X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fwriter.h;h=486d7d672aa31357b330259cfa89bffc9fbfff0b;hb=43877eccbedc0950ab253e76dd0cea691fd7a4b0;hp=1094dee3cc70505ab3ba982a8e5b07d421b065cf;hpb=a97dffe585e8e185c57a3f1b025cffa6da9525d2;p=dcpomatic.git diff --git a/src/lib/writer.h b/src/lib/writer.h index 1094dee3c..486d7d672 100644 --- a/src/lib/writer.h +++ b/src/lib/writer.h @@ -25,6 +25,7 @@ #include "types.h" #include "player_subtitles.h" #include "data.h" +#include #include #include #include @@ -52,6 +53,10 @@ namespace dcp { struct QueueItem { public: + QueueItem () + : size (0) + {} + enum Type { /** a normal frame with some JPEG200 data */ FULL, @@ -60,6 +65,7 @@ public: state but we use the data that is already on disk. */ FAKE, + REPEAT, } type; /** encoded data for FULL */ @@ -92,13 +98,13 @@ public: ~Writer (); bool can_fake_write (int) const; - + void write (Data, int, Eyes); void fake_write (int, Eyes); + void repeat (int, Eyes); void write (boost::shared_ptr); void write (PlayerSubtitles subs); void write (std::list > fonts); - void repeat (int f, Eyes); void finish (); void set_encoder_threads (int threads); @@ -110,6 +116,9 @@ private: void check_existing_picture_asset (); bool check_existing_picture_asset_frame (FILE *, int, Eyes); bool have_sequenced_image_at_queue_head (); + void write_frame_info (int frame, Eyes eyes, dcp::FrameInfo info) const; + long frame_info_position (int frame, Eyes eyes) const; + dcp::FrameInfo read_frame_info (FILE* file, int frame, Eyes eyes) const; /** our Film */ boost::shared_ptr _film; @@ -140,16 +149,17 @@ private: * ordering */ int _maximum_frames_in_memory; - + /** number of FULL written frames */ int _full_written; /** number of FAKE written frames */ int _fake_written; + int _repeat_written; /** number of frames pushed to disk and then recovered due to the limit of frames to be held in memory. */ int _pushed_to_disk; - + boost::shared_ptr _picture_asset; boost::shared_ptr _picture_asset_writer; boost::shared_ptr _sound_asset;