X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fdcp_content.h;h=d6fe8c8207a237223a07e8d708d66d68c8613d7a;hb=c008066160d85b9ec9e5485375d7baaa5d27bda2;hp=60b7142de1fe655dc0a6e4826a2841fb3d611334;hpb=40b654453c2ce0b266f43c36f1b9a5d1705f983c;p=dcpomatic.git diff --git a/src/lib/dcp_content.h b/src/lib/dcp_content.h index 60b7142de..d6fe8c820 100644 --- a/src/lib/dcp_content.h +++ b/src/lib/dcp_content.h @@ -17,15 +17,26 @@ */ +#ifndef DCPOMATIC_DCP_CONTENT_H +#define DCPOMATIC_DCP_CONTENT_H + /** @file src/lib/dcp_content.h * @brief DCPContent class. */ #include +#include +#include #include "video_content.h" #include "single_stream_audio_content.h" #include "subtitle_content.h" +class DCPContentProperty +{ +public: + static int const CAN_BE_PLAYED; +}; + /** @class DCPContent * @brief An existing DCP used as input. */ @@ -41,24 +52,47 @@ public: DCPTime full_length () const; - void examine (boost::shared_ptr); + void examine (boost::shared_ptr, bool calculate_digest); std::string summary () const; std::string technical_summary () const; void as_xml (xmlpp::Node *) const; std::string identifier () const; /* SubtitleContent */ - bool has_subtitles () const; + bool has_subtitles () const { + boost::mutex::scoped_lock lm (_mutex); + return _has_subtitles; + } boost::filesystem::path directory () const { boost::mutex::scoped_lock lm (_mutex); return _directory; } + bool encrypted () const { + boost::mutex::scoped_lock lm (_mutex); + return _encrypted; + } + + void add_kdm (dcp::EncryptedKDM); + + boost::optional kdm () const { + return _kdm; + } + + bool can_be_played () const; + private: void read_directory (boost::filesystem::path); std::string _name; bool _has_subtitles; + /** true if our DCP is encrypted */ + bool _encrypted; boost::filesystem::path _directory; + boost::optional _kdm; + /** true if _kdm successfully decrypts the first frame of our DCP */ + bool _kdm_valid; }; + +#endif