Make terminate_threads() less likely to leave _threads containing invalid pointers.
[dcpomatic.git] / src / lib / ffmpeg_content.h
index d9020ac018dcce2ab2bcda5df638d74d1cc9653f..4c612cd3ee00eb62720fc35fe1759f5fd2cf1451 100644 (file)
@@ -46,20 +46,25 @@ public:
 class FFmpegContent : public Content
 {
 public:
-       FFmpegContent (boost::shared_ptr<const Film>, boost::filesystem::path);
-       FFmpegContent (boost::shared_ptr<const Film>, cxml::ConstNodePtr, int version, std::list<std::string> &);
-       FFmpegContent (boost::shared_ptr<const Film>, std::vector<boost::shared_ptr<Content> >);
+       FFmpegContent (boost::filesystem::path);
+       FFmpegContent (cxml::ConstNodePtr, int version, std::list<std::string> &);
+       FFmpegContent (std::vector<boost::shared_ptr<Content> >);
 
        boost::shared_ptr<FFmpegContent> shared_from_this () {
                return boost::dynamic_pointer_cast<FFmpegContent> (Content::shared_from_this ());
        }
 
-       void examine (boost::shared_ptr<Job>);
+       boost::shared_ptr<const FFmpegContent> shared_from_this () const {
+               return boost::dynamic_pointer_cast<const FFmpegContent> (Content::shared_from_this ());
+       }
+
+       void examine (boost::shared_ptr<const Film> film, boost::shared_ptr<Job>);
        void take_settings_from (boost::shared_ptr<const Content> c);
        std::string summary () const;
        std::string technical_summary () const;
        void as_xml (xmlpp::Node *, bool with_paths) const;
-       DCPTime full_length () const;
+       DCPTime full_length (boost::shared_ptr<const Film> film) const;
+       DCPTime approximate_length () const;
 
        std::string identifier () const;
 
@@ -93,8 +98,18 @@ public:
 
        void signal_subtitle_stream_changed ();
 
+       boost::optional<std::string> decryption_key () const {
+               boost::mutex::scoped_lock lm (_mutex);
+               return _decryption_key;
+       }
+
+       bool encrypted () const {
+               boost::mutex::scoped_lock lm (_mutex);
+               return _encrypted;
+       }
+
 private:
-       void add_properties (std::list<UserProperty> &) const;
+       void add_properties (boost::shared_ptr<const Film> film, std::list<UserProperty> &) const;
 
        friend struct ffmpeg_pts_offset_test;
        friend struct audio_sampling_rate_test;
@@ -105,11 +120,13 @@ private:
        /** Video filters that should be used when generating DCPs */
        std::vector<Filter const *> _filters;
 
-       AVColorRange _color_range;
-       AVColorPrimaries _color_primaries;
-       AVColorTransferCharacteristic _color_trc;
-       AVColorSpace _colorspace;
+       boost::optional<AVColorRange> _color_range;
+       boost::optional<AVColorPrimaries> _color_primaries;
+       boost::optional<AVColorTransferCharacteristic> _color_trc;
+       boost::optional<AVColorSpace> _colorspace;
        boost::optional<int> _bits_per_pixel;
+       boost::optional<std::string> _decryption_key;
+       bool _encrypted;
 };
 
 #endif