Another macOS std::list boost::thread SNAFU.
[dcpomatic.git] / src / lib / ffmpeg_examiner.cc
index b31280cd5b3cac7b093456e2c9cb2c946a71635a..3fb9a53e4618f49e6f4aedb82780e9f10de541b3 100644 (file)
@@ -42,6 +42,7 @@ using std::cout;
 using std::max;
 using boost::shared_ptr;
 using boost::optional;
+using namespace dcpomatic;
 
 /** @param job job that the examiner is operating in, or 0 */
 FFmpegExaminer::FFmpegExaminer (shared_ptr<const FFmpegContent> c, shared_ptr<Job> job)
@@ -165,6 +166,13 @@ FFmpegExaminer::FFmpegExaminer (shared_ptr<const FFmpegContent> c, shared_ptr<Jo
 
                DCPOMATIC_ASSERT (fabs (*_rotation - 90 * round (*_rotation / 90)) < 2);
        }
+
+#ifdef DCPOMATIC_VARIANT_SWAROOP
+       AVDictionaryEntry* e = av_dict_get (_format_context->metadata, SWAROOP_ID_TAG, 0, 0);
+       if (e) {
+               _id = e->value;
+       }
+#endif
 }
 
 void
@@ -380,3 +388,16 @@ FFmpegExaminer::has_video () const
 {
        return static_cast<bool> (_video_stream);
 }
+
+VideoRange
+FFmpegExaminer::range () const
+{
+       switch (color_range()) {
+       case AVCOL_RANGE_MPEG:
+       case AVCOL_RANGE_UNSPECIFIED:
+               return VIDEO_RANGE_VIDEO;
+       case AVCOL_RANGE_JPEG:
+       default:
+               return VIDEO_RANGE_FULL;
+       }
+}