Add video_{range,frame_type}.{cc,h} and remove some types.h includes.
authorCarl Hetherington <cth@carlh.net>
Tue, 13 Dec 2022 00:04:07 +0000 (01:04 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 13 Dec 2022 00:11:42 +0000 (01:11 +0100)
29 files changed:
src/lib/analyse_audio_job.h
src/lib/audio_analyser.cc
src/lib/audio_analysis.cc
src/lib/content.h
src/lib/create_cli.h
src/lib/decoder.h
src/lib/hints.cc
src/lib/image.h
src/lib/overlaps.cc
src/lib/piece.h
src/lib/reel_writer.h
src/lib/render_text.cc
src/lib/text_decoder.h
src/lib/types.cc
src/lib/types.h
src/lib/video_content.h
src/lib/video_frame_type.cc [new file with mode: 0644]
src/lib/video_frame_type.h [new file with mode: 0644]
src/lib/video_range.cc [new file with mode: 0644]
src/lib/video_range.h [new file with mode: 0644]
src/lib/wscript
src/wx/auto_crop_dialog.cc
src/wx/content_panel.h
src/wx/controls.h
src/wx/kdm_cpl_panel.h
src/wx/timeline_content_view.h
src/wx/video_panel.h
test/guess_crop_test.cc
test/test.h

index f8311da4724c2b3304be13a9bcc4dd3792a0421b..2b749da6ba4b805a1ec3de988ca184e1a046d092 100644 (file)
 
 
 #include "audio_analyser.h"
-#include "job.h"
 #include "audio_point.h"
-#include "types.h"
 #include "dcpomatic_time.h"
+#include "job.h"
 #include <leqm_nrt.h>
 #include <boost/scoped_ptr.hpp>
 
index 1556f921de634b27103ec2276d9013c9bd22d9cd..687da9cef1741d8b26648264d067a5362cae5d60 100644 (file)
@@ -30,7 +30,6 @@
 #include "film.h"
 #include "filter.h"
 #include "playlist.h"
-#include "types.h"
 #include <dcp/warnings.h>
 extern "C" {
 #include <leqm_nrt.h>
index 721ffed07c6e28464ddb159877527c39c8d712db..6f1bb2375613f851116eb66d096c9fc147296d99 100644 (file)
 
 
 #include "audio_analysis.h"
+#include "audio_content.h"
 #include "cross.h"
-#include "util.h"
 #include "playlist.h"
-#include "audio_content.h"
+#include "util.h"
 #include <dcp/raw_convert.h>
 #include <dcp/warnings.h>
 LIBDCP_DISABLE_WARNINGS
index 5b804b3318aabde130272ebeb55afaeb66cd948e..ce6eaa83be63a1eceef990688e9bd328e2915961 100644 (file)
@@ -50,6 +50,9 @@ namespace cxml {
 class Job;
 class Film;
 class AtmosContent;
+class AudioContent;
+class TextContent;
+class VideoContent;
 
 class ContentProperty
 {
index a5e0c394130e2bd476df1652243012c2e4d737f9..e473be1f2844a84c64d215f82376f70ee307ba23 100644 (file)
@@ -19,7 +19,7 @@
 */
 
 
-#include "types.h"
+#include "video_frame_type.h"
 #include <dcp/types.h>
 #include <boost/optional.hpp>
 #include <boost/filesystem.hpp>
index 0324075a36d98a252013e29dad8df9a8cf6e0392..34153eafc949f09ee2fcbe7629ec557df111e4b0 100644 (file)
@@ -30,7 +30,6 @@
 
 #include "dcpomatic_time.h"
 #include "film.h"
-#include "types.h"
 #include "weak_film.h"
 #include <boost/utility.hpp>
 
index 8db0099c18f23152274989368790c5094fbab409..b628efc31534fd53be7c7c8d29350ceab88363c3 100644 (file)
@@ -35,7 +35,6 @@
 #include "player.h"
 #include "ratio.h"
 #include "text_content.h"
-#include "types.h"
 #include "video_content.h"
 #include "writer.h"
 #include <dcp/cpl.h>
index 60e65c20a9c2737f990644488bc62d3098e8187c..0237b3d1b8fc259c793a695694e9c8a3a75ebdee 100644 (file)
@@ -29,7 +29,7 @@
 #include "crop.h"
 #include "position.h"
 #include "position_image.h"
-#include "types.h"
+#include "video_range.h"
 extern "C" {
 #include <libavutil/pixfmt.h>
 }
index 7a541a7c292ec6b8c271b5f7604826de03b66365..770882cd5c6ddd3dbeb6d5a46ca790a2fd5a82a2 100644 (file)
@@ -21,7 +21,6 @@
 
 #include "content.h"
 #include "overlaps.h"
-#include "types.h"
 
 
 using std::function;
index 688242c064d5b54013217fb6c98a942540445817..c617de544cd5214e5f7c40d1e2165a12240a1cf9 100644 (file)
@@ -25,7 +25,6 @@
 
 #include "dcpomatic_time.h"
 #include "frame_rate_change.h"
-#include "types.h"
 
 
 class Content;
index d5b531f410ed9b6793237305296fbf43c83e66d9..8ceef9f516eb46fc2866c358e72c8993eb581c29 100644 (file)
@@ -27,7 +27,6 @@
 #include "player_text.h"
 #include "referenced_reel_asset.h"
 #include "render_text.h"
-#include "types.h"
 #include "weak_film.h"
 #include <dcp/atmos_asset_writer.h>
 #include <dcp/file.h>
index 2338bde97abe449adf0170bcccb79014181f3565..702f848ac261d5d6730e319c72850313ec6aae4d 100644 (file)
@@ -25,7 +25,6 @@
 #include "font_config.h"
 #include "image.h"
 #include "render_text.h"
-#include "types.h"
 #include "util.h"
 #include <dcp/raw_convert.h>
 #include <dcp/warnings.h>
index 9b3050f718b56ad8f4fd65e1397d01a3fe2ee850..5362540c2ed6a78a598dac2693d86ddb11e8ac6a 100644 (file)
@@ -25,7 +25,6 @@
 
 #include "decoder.h"
 #include "rect.h"
-#include "types.h"
 #include "content_text.h"
 #include "decoder_part.h"
 #include <dcp/subtitle_string.h>
index 69d27a1ce2776bea1bbabf9ea592fedcfd78becb..fd4b8906ce19e5c67e2c8e349028369a277e3f27 100644 (file)
@@ -87,53 +87,6 @@ text_type_to_name (TextType t)
        }
 }
 
-string
-video_frame_type_to_string (VideoFrameType t)
-{
-       switch (t) {
-       case VideoFrameType::TWO_D:
-               return "2d";
-       case VideoFrameType::THREE_D:
-               return "3d";
-       case VideoFrameType::THREE_D_LEFT_RIGHT:
-               return "3d-left-right";
-       case VideoFrameType::THREE_D_TOP_BOTTOM:
-               return "3d-top-bottom";
-       case VideoFrameType::THREE_D_ALTERNATE:
-               return "3d-alternate";
-       case VideoFrameType::THREE_D_LEFT:
-               return "3d-left";
-       case VideoFrameType::THREE_D_RIGHT:
-               return "3d-right";
-       default:
-               DCPOMATIC_ASSERT (false);
-       }
-
-       DCPOMATIC_ASSERT (false);
-}
-
-VideoFrameType
-string_to_video_frame_type (string s)
-{
-       if (s == "2d") {
-               return VideoFrameType::TWO_D;
-       } else if (s == "3d") {
-               return VideoFrameType::THREE_D;
-       } else if (s == "3d-left-right") {
-               return VideoFrameType::THREE_D_LEFT_RIGHT;
-       } else if (s == "3d-top-bottom") {
-               return VideoFrameType::THREE_D_TOP_BOTTOM;
-       } else if (s == "3d-alternate") {
-               return VideoFrameType::THREE_D_ALTERNATE;
-       } else if (s == "3d-left") {
-               return VideoFrameType::THREE_D_LEFT;
-       } else if (s == "3d-right") {
-               return VideoFrameType::THREE_D_RIGHT;
-       }
-
-       DCPOMATIC_ASSERT (false);
-}
-
 CPLSummary::CPLSummary (boost::filesystem::path p)
        : dcp_directory (p.leaf().string())
 {
@@ -167,30 +120,3 @@ CPLSummary::CPLSummary (boost::filesystem::path p)
 }
 
 
-string
-video_range_to_string (VideoRange r)
-{
-       switch (r) {
-       case VideoRange::FULL:
-               return "full";
-       case VideoRange::VIDEO:
-               return "video";
-       default:
-               DCPOMATIC_ASSERT (false);
-       }
-}
-
-
-VideoRange
-string_to_video_range (string s)
-{
-       if (s == "full") {
-               return VideoRange::FULL;
-       } else if (s == "video") {
-               return VideoRange::VIDEO;
-       }
-
-       DCPOMATIC_ASSERT (false);
-       return VideoRange::FULL;
-}
-
index 9bf4c80b1b732560d133114f932ab2ff27344731..9801ef5578c3efc5a105bc925b583333d9602ef0 100644 (file)
@@ -86,23 +86,6 @@ typedef std::vector<std::shared_ptr<FFmpegContent>> FFmpegContentList;
 
 typedef int64_t Frame;
 
-enum class VideoFrameType
-{
-       TWO_D,
-       /** `True' 3D content, e.g. 3D DCPs */
-       THREE_D,
-       THREE_D_LEFT_RIGHT,
-       THREE_D_TOP_BOTTOM,
-       THREE_D_ALTERNATE,
-       /** This content is all the left frames of some 3D */
-       THREE_D_LEFT,
-       /** This content is all the right frames of some 3D */
-       THREE_D_RIGHT
-};
-
-std::string video_frame_type_to_string (VideoFrameType);
-VideoFrameType string_to_video_frame_type (std::string);
-
 enum class Eyes
 {
        BOTH,
@@ -128,16 +111,6 @@ enum class ReelType
 };
 
 
-enum class VideoRange
-{
-       FULL, ///< full,  or "JPEG" (0-255 for 8-bit)
-       VIDEO ///< video, or "MPEG" (16-235 for 8-bit)
-};
-
-extern std::string video_range_to_string (VideoRange r);
-extern VideoRange string_to_video_range (std::string s);
-
-
 /** Type of captions.
  *
  *  The generally accepted definitions seem to be:
index 087a922452ab85bc870fc5056c2aea0e1cd0ff25..3ef8b277592eaf7f04944ef08cdfe4b294c11c9e 100644 (file)
@@ -29,6 +29,8 @@
 #include "dcpomatic_time.h"
 #include "pixel_quanta.h"
 #include "user_property.h"
+#include "video_frame_type.h"
+#include "video_range.h"
 #include <dcp/language_tag.h>
 #include <boost/thread/mutex.hpp>
 
diff --git a/src/lib/video_frame_type.cc b/src/lib/video_frame_type.cc
new file mode 100644 (file)
index 0000000..5882fb1
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+    Copyright (C) 2013-2021 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/>.
+
+*/
+
+
+#include "dcpomatic_assert.h"
+#include "video_frame_type.h"
+
+
+using std::string;
+
+
+string
+video_frame_type_to_string(VideoFrameType t)
+{
+       switch (t) {
+       case VideoFrameType::TWO_D:
+               return "2d";
+       case VideoFrameType::THREE_D:
+               return "3d";
+       case VideoFrameType::THREE_D_LEFT_RIGHT:
+               return "3d-left-right";
+       case VideoFrameType::THREE_D_TOP_BOTTOM:
+               return "3d-top-bottom";
+       case VideoFrameType::THREE_D_ALTERNATE:
+               return "3d-alternate";
+       case VideoFrameType::THREE_D_LEFT:
+               return "3d-left";
+       case VideoFrameType::THREE_D_RIGHT:
+               return "3d-right";
+       default:
+               DCPOMATIC_ASSERT (false);
+       }
+
+       DCPOMATIC_ASSERT (false);
+}
+
+VideoFrameType
+string_to_video_frame_type(string s)
+{
+       if (s == "2d") {
+               return VideoFrameType::TWO_D;
+       } else if (s == "3d") {
+               return VideoFrameType::THREE_D;
+       } else if (s == "3d-left-right") {
+               return VideoFrameType::THREE_D_LEFT_RIGHT;
+       } else if (s == "3d-top-bottom") {
+               return VideoFrameType::THREE_D_TOP_BOTTOM;
+       } else if (s == "3d-alternate") {
+               return VideoFrameType::THREE_D_ALTERNATE;
+       } else if (s == "3d-left") {
+               return VideoFrameType::THREE_D_LEFT;
+       } else if (s == "3d-right") {
+               return VideoFrameType::THREE_D_RIGHT;
+       }
+
+       DCPOMATIC_ASSERT(false);
+}
+
diff --git a/src/lib/video_frame_type.h b/src/lib/video_frame_type.h
new file mode 100644 (file)
index 0000000..a5da7ca
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+    Copyright (C) 2013-2021 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_VIDEO_FRAME_TYPE_H
+#define DCPOMATIC_VIDEO_FRAME_TYPE_H
+
+
+#include <string>
+
+
+enum class VideoFrameType
+{
+       TWO_D,
+       /** `True' 3D content, e.g. 3D DCPs */
+       THREE_D,
+       THREE_D_LEFT_RIGHT,
+       THREE_D_TOP_BOTTOM,
+       THREE_D_ALTERNATE,
+       /** This content is all the left frames of some 3D */
+       THREE_D_LEFT,
+       /** This content is all the right frames of some 3D */
+       THREE_D_RIGHT
+};
+
+
+std::string video_frame_type_to_string(VideoFrameType);
+VideoFrameType string_to_video_frame_type(std::string);
+
+
+#endif
diff --git a/src/lib/video_range.cc b/src/lib/video_range.cc
new file mode 100644 (file)
index 0000000..b9cfef6
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+    Copyright (C) 2013-2021 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/>.
+
+*/
+
+
+#include "dcpomatic_assert.h"
+#include "video_range.h"
+
+
+using std::string;
+
+
+string
+video_range_to_string(VideoRange r)
+{
+       switch (r) {
+       case VideoRange::FULL:
+               return "full";
+       case VideoRange::VIDEO:
+               return "video";
+       default:
+               DCPOMATIC_ASSERT (false);
+       }
+}
+
+
+VideoRange
+string_to_video_range(string s)
+{
+       if (s == "full") {
+               return VideoRange::FULL;
+       } else if (s == "video") {
+               return VideoRange::VIDEO;
+       }
+
+       DCPOMATIC_ASSERT (false);
+       return VideoRange::FULL;
+}
+
+
diff --git a/src/lib/video_range.h b/src/lib/video_range.h
new file mode 100644 (file)
index 0000000..0cd3618
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+    Copyright (C) 2013-2021 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_VIDEO_RANGE_H
+#define DCPOMATIC_VIDEO_RANGE_H
+
+
+#include <string>
+
+
+enum class VideoRange
+{
+       FULL, ///< full,  or "JPEG" (0-255 for 8-bit)
+       VIDEO ///< video, or "MPEG" (16-235 for 8-bit)
+};
+
+
+extern std::string video_range_to_string(VideoRange r);
+extern VideoRange string_to_video_range(std::string s);
+
+
+#endif
+
+
index f3e16fad871a6819e1c469872a0bcb7af5429379..cdf864cfc5b9c396cce836ae74b3abf31bc70d05 100644 (file)
@@ -200,9 +200,11 @@ sources = """
           video_decoder.cc
           video_filter_graph.cc
           video_filter_graph_set.cc
+          video_frame_type.cc
           video_mxf_content.cc
           video_mxf_decoder.cc
           video_mxf_examiner.cc
+          video_range.cc
           video_ring_buffers.cc
           writer.cc
           zipper.cc
index bfc08beb3881f693fe5b9af8a3ccb24b287ab240..7e1f73653834f01645c3da8bfcbc333ee46d2c53 100644 (file)
@@ -23,7 +23,6 @@
 #include "dcpomatic_spin_ctrl.h"
 #include "wx_util.h"
 #include "lib/config.h"
-#include "lib/types.h"
 
 
 AutoCropDialog::AutoCropDialog (wxWindow* parent, Crop crop)
index 4ce68aea55a05da8791c51f47f8eefa6515efc5e..a493ea80d91b67b7a6ae67a304c49be1d054383a 100644 (file)
@@ -22,7 +22,6 @@
 #include "content_menu.h"
 #include "lib/enum_indexed_vector.h"
 #include "lib/film.h"
-#include "lib/types.h"
 #include <dcp/warnings.h>
 LIBDCP_DISABLE_WARNINGS
 #include <wx/splitter.h>
index df33005ff11a39a12b831ba6c19f9b6f29326d68..f04f3aab6c60cc27bb4a02d7858131930b16fdb5 100644 (file)
@@ -25,7 +25,6 @@
 
 #include "lib/dcpomatic_time.h"
 #include "lib/film.h"
-#include "lib/types.h"
 #include <dcp/warnings.h>
 LIBDCP_DISABLE_WARNINGS
 #include <wx/wx.h>
index 720a1efe85007d1779f80de170959db4ba0cba81..9ce90217e8ac3a50a1b5d18ec08753fe8940c59b 100644 (file)
@@ -18,6 +18,7 @@
 
 */
 
+
 #include "lib/types.h"
 #include <dcp/warnings.h>
 LIBDCP_DISABLE_WARNINGS
@@ -25,6 +26,7 @@ LIBDCP_DISABLE_WARNINGS
 LIBDCP_ENABLE_WARNINGS
 #include <boost/filesystem.hpp>
 
+
 class KDMCPLPanel : public wxPanel
 {
 public:
index aa9832e5db14453accce3c2ae88fa17587d261e8..7794120cdc96762880e944bb14baf1b58b12503e 100644 (file)
@@ -25,7 +25,6 @@
 
 #include "timeline_view.h"
 #include "lib/change_signaller.h"
-#include "lib/types.h"
 #include <dcp/warnings.h>
 LIBDCP_DISABLE_WARNINGS
 #include <wx/wx.h>
index 752e37765fcc9a3f16a99b561f85d19660a89fcd..81e65d820e68b5e703320122422723b896af97c0 100644 (file)
@@ -28,6 +28,7 @@
 #include "content_widget.h"
 #include "timecode.h"
 #include "lib/film.h"
+#include "lib/video_frame_type.h"
 
 
 class CheckBox;
index ed273254c87c32c06e5b3718ffe9570554772640..ccced0b3ef495435115ffabd043e1af8f494b164 100644 (file)
@@ -22,7 +22,6 @@
 #include "lib/content.h"
 #include "lib/content_factory.h"
 #include "lib/guess_crop.h"
-#include "lib/types.h"
 #include "lib/video_content.h"
 #include "test.h"
 #include <boost/test/unit_test.hpp>
index 8bcef0604c9b3a080a839735b4e034dc0bc45900..8399abf9a3656687b83f90ba2cc295f68615344f 100644 (file)
 */
 
 
-#include "lib/types.h"
+#include "lib/video_frame_type.h"
+#include <dcp/types.h>
 #include <dcp/verify.h>
 #include <boost/filesystem.hpp>
 #include <vector>
 
 
+class Content;
 class Film;
 class Image;
 class Log;