summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-12-10 00:47:30 +0100
committerCarl Hetherington <cth@carlh.net>2022-12-10 00:47:30 +0100
commitda38c8a0156808595be0aae1b1490069a663fb78 (patch)
tree27503d03848a16b4a437cacdad03e6872cd726f5 /src/lib
parentd27598b1dcddd84fc0063dd1b67deabe164dc310 (diff)
Extract constants.h
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/audio_content.cc1
-rw-r--r--src/lib/audio_filter_graph.cc2
-rw-r--r--src/lib/audio_mapping.cc3
-rw-r--r--src/lib/audio_stream.cc2
-rw-r--r--src/lib/config.cc2
-rw-r--r--src/lib/constants.h53
-rw-r--r--src/lib/dcp_subtitle_decoder.cc1
-rw-r--r--src/lib/encode_server.cc16
-rw-r--r--src/lib/encode_server_finder.cc8
-rw-r--r--src/lib/ffmpeg_content.cc20
-rw-r--r--src/lib/ffmpeg_decoder.h1
-rw-r--r--src/lib/film.cc2
-rw-r--r--src/lib/film.h2
-rw-r--r--src/lib/filter_graph.h3
-rw-r--r--src/lib/hints.cc1
-rw-r--r--src/lib/image_content.cc1
-rw-r--r--src/lib/image_decoder.cc1
-rw-r--r--src/lib/j2k_encoder.h1
-rw-r--r--src/lib/job.cc1
-rw-r--r--src/lib/job_manager.cc1
-rw-r--r--src/lib/playlist.h3
-rw-r--r--src/lib/util.cc1
-rw-r--r--src/lib/util.h25
-rw-r--r--src/lib/video_decoder.h5
-rw-r--r--src/lib/video_filter_graph.cc2
25 files changed, 99 insertions, 59 deletions
diff --git a/src/lib/audio_content.cc b/src/lib/audio_content.cc
index acd3b81b4..1fcd33583 100644
--- a/src/lib/audio_content.cc
+++ b/src/lib/audio_content.cc
@@ -22,6 +22,7 @@
#include "audio_content.h"
#include "compose.hpp"
#include "config.h"
+#include "constants.h"
#include "exceptions.h"
#include "film.h"
#include "frame_rate_change.h"
diff --git a/src/lib/audio_filter_graph.cc b/src/lib/audio_filter_graph.cc
index 73c3aa6f7..4e3052d57 100644
--- a/src/lib/audio_filter_graph.cc
+++ b/src/lib/audio_filter_graph.cc
@@ -22,6 +22,8 @@
#include "audio_buffers.h"
#include "audio_filter_graph.h"
#include "compose.hpp"
+#include "dcpomatic_assert.h"
+#include "exceptions.h"
extern "C" {
#include <libavfilter/buffersink.h>
#include <libavfilter/buffersrc.h>
diff --git a/src/lib/audio_mapping.cc b/src/lib/audio_mapping.cc
index 5e8bf4d04..cd5c1fc7e 100644
--- a/src/lib/audio_mapping.cc
+++ b/src/lib/audio_mapping.cc
@@ -21,8 +21,9 @@
#include "audio_mapping.h"
#include "audio_processor.h"
+#include "constants.h"
+#include "dcpomatic_assert.h"
#include "digester.h"
-#include "util.h"
#include <dcp/raw_convert.h>
#include <dcp/warnings.h>
#include <libcxml/cxml.h>
diff --git a/src/lib/audio_stream.cc b/src/lib/audio_stream.cc
index 43e4c5ec1..bd53c9b26 100644
--- a/src/lib/audio_stream.cc
+++ b/src/lib/audio_stream.cc
@@ -21,7 +21,7 @@
#include "audio_stream.h"
#include "audio_mapping.h"
-#include "util.h"
+#include "constants.h"
AudioStream::AudioStream (int frame_rate, Frame length, int channels)
diff --git a/src/lib/config.cc b/src/lib/config.cc
index 4bc4f60f2..81d4ab160 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -23,6 +23,7 @@
#include "colour_conversion.h"
#include "compose.hpp"
#include "config.h"
+#include "constants.h"
#include "cross.h"
#include "crypto.h"
#include "dcp_content_type.h"
@@ -33,7 +34,6 @@
#include "log.h"
#include "ratio.h"
#include "types.h"
-#include "util.h"
#include "zipper.h"
#include <dcp/certificate_chain.h>
#include <dcp/name_format.h>
diff --git a/src/lib/constants.h b/src/lib/constants.h
new file mode 100644
index 000000000..3b1871554
--- /dev/null
+++ b/src/lib/constants.h
@@ -0,0 +1,53 @@
+/*
+ Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
+
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ DCP-o-matic is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+
+#ifndef DCPOMATIC_CONSTANTS_H
+#define DCPOMATIC_CONSTANTS_H
+
+
+/** The maximum number of audio channels that we can have in a DCP */
+#define MAX_DCP_AUDIO_CHANNELS 16
+/** Message broadcast to find possible encoding servers */
+#define DCPOMATIC_HELLO "I mean really, Ray, it's used."
+/** Number of films to keep in history */
+#define HISTORY_SIZE 10
+#define REPORT_PROBLEM _("Please report this problem by using Help -> Report a problem or via email to carl@dcpomatic.com")
+#define TEXT_FONT_ID "font"
+/** Largest KDM size (in bytes) that will be accepted */
+#define MAX_KDM_SIZE (256 * 1024)
+/** Number of lines that closed caption viewers will display */
+#define MAX_CLOSED_CAPTION_LINES 3
+/** Maximum line length of closed caption viewers, according to SMPTE Bv2.1 */
+#define MAX_CLOSED_CAPTION_LENGTH 32
+/** Maximum size of a subtitle / closed caption MXF in bytes, according to SMPTE Bv2.1 */
+#define MAX_TEXT_MXF_SIZE (115 * 1024 * 1024)
+#define MAX_TEXT_MXF_SIZE_TEXT "115MB"
+/** Maximum size of a font file, in bytes */
+#define MAX_FONT_FILE_SIZE (640 * 1024)
+#define MAX_FONT_FILE_SIZE_TEXT "640KB"
+/** Maximum size of the XML part of a closed caption file, according to SMPTE Bv2.1 */
+#define MAX_CLOSED_CAPTION_XML_SIZE (256 * 1024)
+#define MAX_CLOSED_CAPTION_XML_SIZE_TEXT "256KB"
+#define CERTIFICATE_VALIDITY_PERIOD (10 * 365)
+
+
+#endif
+
diff --git a/src/lib/dcp_subtitle_decoder.cc b/src/lib/dcp_subtitle_decoder.cc
index cbfe6fdbe..617f7ec53 100644
--- a/src/lib/dcp_subtitle_decoder.cc
+++ b/src/lib/dcp_subtitle_decoder.cc
@@ -23,6 +23,7 @@
#include "dcp_subtitle_decoder.h"
#include "font.h"
#include "text_content.h"
+#include "util.h"
#include <dcp/interop_subtitle_asset.h>
#include <dcp/load_font_node.h>
diff --git a/src/lib/encode_server.cc b/src/lib/encode_server.cc
index d326c767b..6501dcde1 100644
--- a/src/lib/encode_server.cc
+++ b/src/lib/encode_server.cc
@@ -25,18 +25,18 @@
*/
-#include "encode_server.h"
-#include "util.h"
-#include "dcpomatic_socket.h"
-#include "image.h"
-#include "dcp_video.h"
+#include "compose.hpp"
#include "config.h"
+#include "constants.h"
#include "cross.h"
-#include "player_video.h"
-#include "compose.hpp"
-#include "log.h"
+#include "dcp_video.h"
#include "dcpomatic_log.h"
+#include "dcpomatic_socket.h"
+#include "encode_server.h"
#include "encoded_log_entry.h"
+#include "image.h"
+#include "log.h"
+#include "player_video.h"
#include "version.h"
#include <dcp/raw_convert.h>
#include <dcp/warnings.h>
diff --git a/src/lib/encode_server_finder.cc b/src/lib/encode_server_finder.cc
index e01019a8c..3f5cb74f0 100644
--- a/src/lib/encode_server_finder.cc
+++ b/src/lib/encode_server_finder.cc
@@ -19,13 +19,13 @@
*/
-#include "encode_server_finder.h"
-#include "exceptions.h"
-#include "util.h"
#include "config.h"
+#include "constants.h"
#include "cross.h"
-#include "encode_server_description.h"
#include "dcpomatic_socket.h"
+#include "encode_server_description.h"
+#include "encode_server_finder.h"
+#include "exceptions.h"
#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
#include <boost/bind/placeholders.hpp>
diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc
index 515b58cd0..6681a4f0a 100644
--- a/src/lib/ffmpeg_content.cc
+++ b/src/lib/ffmpeg_content.cc
@@ -19,22 +19,22 @@
*/
-#include "ffmpeg_content.h"
-#include "video_content.h"
#include "audio_content.h"
-#include "ffmpeg_examiner.h"
-#include "ffmpeg_subtitle_stream.h"
-#include "ffmpeg_audio_stream.h"
#include "compose.hpp"
-#include "job.h"
-#include "util.h"
-#include "filter.h"
-#include "film.h"
-#include "log.h"
#include "config.h"
+#include "constants.h"
#include "exceptions.h"
+#include "ffmpeg_audio_stream.h"
+#include "ffmpeg_content.h"
+#include "ffmpeg_examiner.h"
+#include "ffmpeg_subtitle_stream.h"
+#include "film.h"
+#include "filter.h"
#include "frame_rate_change.h"
+#include "job.h"
+#include "log.h"
#include "text_content.h"
+#include "video_content.h"
#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
extern "C" {
diff --git a/src/lib/ffmpeg_decoder.h b/src/lib/ffmpeg_decoder.h
index 1e47e2fca..bd4b74f88 100644
--- a/src/lib/ffmpeg_decoder.h
+++ b/src/lib/ffmpeg_decoder.h
@@ -28,7 +28,6 @@
#include "decoder.h"
#include "ffmpeg.h"
#include "video_filter_graph_set.h"
-#include "util.h"
extern "C" {
#include <libavcodec/avcodec.h>
}
diff --git a/src/lib/film.cc b/src/lib/film.cc
index 29952d0f2..5543a0d01 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -32,6 +32,7 @@
#include "cinema.h"
#include "compose.hpp"
#include "config.h"
+#include "constants.h"
#include "cross.h"
#include "dcp_content.h"
#include "dcp_content_type.h"
@@ -56,7 +57,6 @@
#include "text_content.h"
#include "transcode_job.h"
#include "upload_job.h"
-#include "util.h"
#include "video_content.h"
#include "version.h"
#include <libcxml/cxml.h>
diff --git a/src/lib/film.h b/src/lib/film.h
index 72d6d5e8d..b1451c212 100644
--- a/src/lib/film.h
+++ b/src/lib/film.h
@@ -31,11 +31,11 @@
#include "change_signaller.h"
#include "dcp_text_track.h"
+#include "dcpomatic_time.h"
#include "frame_rate_change.h"
#include "signaller.h"
#include "transcode_job.h"
#include "types.h"
-#include "util.h"
#include <dcp/encrypted_kdm.h>
#include <dcp/file.h>
#include <dcp/key.h>
diff --git a/src/lib/filter_graph.h b/src/lib/filter_graph.h
index 4019b5863..d56f15296 100644
--- a/src/lib/filter_graph.h
+++ b/src/lib/filter_graph.h
@@ -28,13 +28,14 @@
#define DCPOMATIC_FILTER_GRAPH_H
-#include "util.h"
#include <dcp/warnings.h>
LIBDCP_DISABLE_WARNINGS
extern "C" {
#include <libavfilter/buffersink.h>
}
LIBDCP_ENABLE_WARNINGS
+#include <string>
+#include <vector>
struct AVFilterContext;
diff --git a/src/lib/hints.cc b/src/lib/hints.cc
index 46296351b..8db0099c1 100644
--- a/src/lib/hints.cc
+++ b/src/lib/hints.cc
@@ -24,6 +24,7 @@
#include "audio_processor.h"
#include "compose.hpp"
#include "config.h"
+#include "constants.h"
#include "content.h"
#include "cross.h"
#include "dcp_content_type.h"
diff --git a/src/lib/image_content.cc b/src/lib/image_content.cc
index 1415fef24..bb2de9307 100644
--- a/src/lib/image_content.cc
+++ b/src/lib/image_content.cc
@@ -27,6 +27,7 @@
#include "image_examiner.h"
#include "image_filename_sorter.h"
#include "job.h"
+#include "util.h"
#include "video_content.h"
#include <libcxml/cxml.h>
#include <libxml++/libxml++.h>
diff --git a/src/lib/image_decoder.cc b/src/lib/image_decoder.cc
index 59dc4e873..26a9ad624 100644
--- a/src/lib/image_decoder.cc
+++ b/src/lib/image_decoder.cc
@@ -27,6 +27,7 @@
#include "image_content.h"
#include "image_decoder.h"
#include "j2k_image_proxy.h"
+#include "util.h"
#include "video_content.h"
#include "video_decoder.h"
#include <boost/filesystem.hpp>
diff --git a/src/lib/j2k_encoder.h b/src/lib/j2k_encoder.h
index ef925b8de..63228a6b8 100644
--- a/src/lib/j2k_encoder.h
+++ b/src/lib/j2k_encoder.h
@@ -32,7 +32,6 @@
#include "enum_indexed_vector.h"
#include "event_history.h"
#include "exception_store.h"
-#include "util.h"
#include "writer.h"
#include <boost/optional.hpp>
#include <boost/signals2.hpp>
diff --git a/src/lib/job.cc b/src/lib/job.cc
index 8ce63ced0..12bcff415 100644
--- a/src/lib/job.cc
+++ b/src/lib/job.cc
@@ -25,6 +25,7 @@
#include "compose.hpp"
+#include "constants.h"
#include "cross.h"
#include "dcpomatic_log.h"
#include "exceptions.h"
diff --git a/src/lib/job_manager.cc b/src/lib/job_manager.cc
index 608df7ef0..e17b12853 100644
--- a/src/lib/job_manager.cc
+++ b/src/lib/job_manager.cc
@@ -30,6 +30,7 @@
#include "film.h"
#include "job.h"
#include "job_manager.h"
+#include "util.h"
#include <boost/thread.hpp>
diff --git a/src/lib/playlist.h b/src/lib/playlist.h
index 921637bc3..89f36f895 100644
--- a/src/lib/playlist.h
+++ b/src/lib/playlist.h
@@ -24,8 +24,9 @@
#include "change_signaller.h"
+#include "dcpomatic_time.h"
#include "frame_rate_change.h"
-#include "util.h"
+#include "types.h"
#include <libcxml/cxml.h>
#include <boost/signals2.hpp>
#include <boost/thread.hpp>
diff --git a/src/lib/util.cc b/src/lib/util.cc
index 829e6de97..7680f2632 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -31,6 +31,7 @@
#include "cinema_sound_processor.h"
#include "compose.hpp"
#include "config.h"
+#include "constants.h"
#include "cross.h"
#include "crypto.h"
#include "dcp_content_type.h"
diff --git a/src/lib/util.h b/src/lib/util.h
index acdc861ae..38accb4e3 100644
--- a/src/lib/util.h
+++ b/src/lib/util.h
@@ -52,31 +52,6 @@ namespace dcp {
class SubtitleAsset;
}
-/** The maximum number of audio channels that we can have in a DCP */
-#define MAX_DCP_AUDIO_CHANNELS 16
-/** Message broadcast to find possible encoding servers */
-#define DCPOMATIC_HELLO "I mean really, Ray, it's used."
-/** Number of films to keep in history */
-#define HISTORY_SIZE 10
-#define REPORT_PROBLEM _("Please report this problem by using Help -> Report a problem or via email to carl@dcpomatic.com")
-#define TEXT_FONT_ID "font"
-/** Largest KDM size (in bytes) that will be accepted */
-#define MAX_KDM_SIZE (256 * 1024)
-/** Number of lines that closed caption viewers will display */
-#define MAX_CLOSED_CAPTION_LINES 3
-/** Maximum line length of closed caption viewers, according to SMPTE Bv2.1 */
-#define MAX_CLOSED_CAPTION_LENGTH 32
-/** Maximum size of a subtitle / closed caption MXF in bytes, according to SMPTE Bv2.1 */
-#define MAX_TEXT_MXF_SIZE (115 * 1024 * 1024)
-#define MAX_TEXT_MXF_SIZE_TEXT "115MB"
-/** Maximum size of a font file, in bytes */
-#define MAX_FONT_FILE_SIZE (640 * 1024)
-#define MAX_FONT_FILE_SIZE_TEXT "640KB"
-/** Maximum size of the XML part of a closed caption file, according to SMPTE Bv2.1 */
-#define MAX_CLOSED_CAPTION_XML_SIZE (256 * 1024)
-#define MAX_CLOSED_CAPTION_XML_SIZE_TEXT "256KB"
-#define CERTIFICATE_VALIDITY_PERIOD (10 * 365)
-
extern std::string program_name;
extern bool is_batch_converter;
diff --git a/src/lib/video_decoder.h b/src/lib/video_decoder.h
index 828ac66a2..f6ee17425 100644
--- a/src/lib/video_decoder.h
+++ b/src/lib/video_decoder.h
@@ -28,11 +28,10 @@
#define DCPOMATIC_VIDEO_DECODER_H
-#include "decoder.h"
-#include "video_content.h"
-#include "util.h"
#include "content_video.h"
+#include "decoder.h"
#include "decoder_part.h"
+#include "video_content.h"
#include <boost/signals2.hpp>
diff --git a/src/lib/video_filter_graph.cc b/src/lib/video_filter_graph.cc
index 26f858437..89467ae94 100644
--- a/src/lib/video_filter_graph.cc
+++ b/src/lib/video_filter_graph.cc
@@ -20,6 +20,8 @@
#include "compose.hpp"
+#include "dcpomatic_assert.h"
+#include "exceptions.h"
#include "image.h"
#include "scope_guard.h"
#include "video_filter_graph.h"