Subtitle "to" times used to be stored against their "from" times.
[dcpomatic.git] / src / lib / ffmpeg_examiner.h
index 7b64b508aff864661aa56b8cea8cd392a9f64c05..e87e11d1c7db29249e360963057a44a90c1aa647 100644 (file)
@@ -21,6 +21,8 @@
 #include "video_examiner.h"
 #include <boost/optional.hpp>
 
+struct AVStream;
+
 class FFmpegAudioStream;
 class FFmpegSubtitleStream;
 
@@ -29,10 +31,11 @@ class FFmpegExaminer : public FFmpeg, public VideoExaminer
 public:
        FFmpegExaminer (boost::shared_ptr<const FFmpegContent>, boost::shared_ptr<Job> job = boost::shared_ptr<Job> ());
 
-       boost::optional<float> video_frame_rate () const;
+       boost::optional<double> video_frame_rate () const;
        dcp::Size video_size () const;
        Frame video_length () const;
-       boost::optional<float> sample_aspect_ratio () const;
+       boost::optional<double> sample_aspect_ratio () const;
+       bool yuv () const;
 
        std::vector<boost::shared_ptr<FFmpegSubtitleStream> > subtitle_streams () const {
                return _subtitle_streams;
@@ -46,6 +49,24 @@ public:
                return _first_video;
        }
 
+       AVColorRange color_range () const {
+               return video_codec_context()->color_range;
+       }
+
+       AVColorPrimaries color_primaries () const {
+               return video_codec_context()->color_primaries;
+       }
+
+       AVColorTransferCharacteristic color_trc () const {
+               return video_codec_context()->color_trc;
+       }
+
+       AVColorSpace colorspace () const {
+               return video_codec_context()->colorspace;
+       }
+
+       int bits_per_pixel () const;
+
 private:
        void video_packet (AVCodecContext *);
        void audio_packet (AVCodecContext *, boost::shared_ptr<FFmpegAudioStream>);
@@ -65,5 +86,17 @@ private:
        Frame _video_length;
        bool _need_video_length;
 
-       boost::optional<ContentTime> _last_subtitle_start;
+       struct SubtitleStart
+       {
+               SubtitleStart (std::string id_, ContentTime time_)
+                       : id (id_)
+                       , time (time_)
+               {}
+
+               std::string id;
+               ContentTime time;
+       };
+
+       typedef std::map<boost::shared_ptr<FFmpegSubtitleStream>, boost::optional<SubtitleStart> > LastSubtitleMap;
+       LastSubtitleMap _last_subtitle_start;
 };