19b49e926c581168eec493529b91cff94bce5a97
[dcpomatic.git] / src / lib / video_content.h
1 #ifndef DVDOMATIC_VIDEO_CONTENT_H
2 #define DVDOMATIC_VIDEO_CONTENT_H
3
4 #include "content.h"
5 #include "util.h"
6
7 class VideoDecoder;
8
9 class VideoContentProperty
10 {
11 public:
12         static int const VIDEO_LENGTH;
13         static int const VIDEO_SIZE;
14         static int const VIDEO_FRAME_RATE;
15 };
16
17 class VideoContent : public virtual Content
18 {
19 public:
20         VideoContent (boost::filesystem::path);
21         VideoContent (boost::shared_ptr<const cxml::Node>);
22         VideoContent (VideoContent const &);
23
24         void as_xml (xmlpp::Node *) const;
25         virtual std::string information () const;
26
27         ContentVideoFrame video_length () const {
28                 boost::mutex::scoped_lock lm (_mutex);
29                 return _video_length;
30         }
31
32         libdcp::Size video_size () const {
33                 boost::mutex::scoped_lock lm (_mutex);
34                 return _video_size;
35         }
36         
37         float video_frame_rate () const {
38                 boost::mutex::scoped_lock lm (_mutex);
39                 return _video_frame_rate;
40         }
41
42 protected:
43         void take_from_video_decoder (boost::shared_ptr<VideoDecoder>);
44
45         ContentVideoFrame _video_length;
46
47 private:
48         libdcp::Size _video_size;
49         float _video_frame_rate;
50 };
51
52 #endif