X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fwriter.h;h=1ae761dea83656073d4d03abb45c1ef6b8a9e5f7;hb=5a820bb8fae34591be5ac6d19a73461b9dab532a;hp=14d4b7faa323b7483e3eec29e70d527a93f55e1b;hpb=33e13c4053138930f4b2f59349e441c76111059d;p=dcpomatic.git diff --git a/src/lib/writer.h b/src/lib/writer.h index 14d4b7faa..1ae761dea 100644 --- a/src/lib/writer.h +++ b/src/lib/writer.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2020 Carl Hetherington + Copyright (C) 2012-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -25,10 +25,12 @@ #include "atmos_metadata.h" -#include "types.h" -#include "player_text.h" -#include "exception_store.h" #include "dcp_text_track.h" +#include "dcpomatic_time.h" +#include "exception_store.h" +#include "font_id_map.h" +#include "player_text.h" +#include "types.h" #include "weak_film.h" #include #include @@ -40,15 +42,14 @@ namespace dcp { class Data; } -namespace dcpomatic { - class FontData; -} - -class Film; class AudioBuffers; +class Film; class Job; -class ReferencedReelAsset; class ReelWriter; +class ReferencedReelAsset; +struct writer_disambiguate_font_ids1; +struct writer_disambiguate_font_ids2; +struct writer_disambiguate_font_ids3; struct QueueItem @@ -114,7 +115,7 @@ public: void repeat (Frame, Eyes); void write (std::shared_ptr, dcpomatic::DCPTime time); void write (PlayerText text, TextType type, boost::optional, dcpomatic::DCPTimePeriod period); - void write (std::vector fonts); + void write (std::vector> fonts); void write (ReferencedReelAsset asset); void write (std::shared_ptr atmos, dcpomatic::DCPTime time, AtmosMetadata metadata); void finish (boost::filesystem::path output_dcp); @@ -122,13 +123,19 @@ public: void set_encoder_threads (int threads); private: + friend struct ::writer_disambiguate_font_ids1; + friend struct ::writer_disambiguate_font_ids2; + friend struct ::writer_disambiguate_font_ids3; + void thread (); void terminate_thread (bool); bool have_sequenced_image_at_queue_head (); size_t video_reel (int frame) const; void set_digest_progress (Job* job, float progress); void write_cover_sheet (boost::filesystem::path output_dcp); - void calculate_referenced_digests (boost::function set_progress); + void calculate_referenced_digests (std::function set_progress); + void write_hanging_text (ReelWriter& reel); + void calculate_digests (); std::weak_ptr _job; std::vector _reels; @@ -198,10 +205,23 @@ private: std::list _reel_assets; - std::vector _fonts; + FontIdMap _fonts; + /** If we are given many fonts, but we're making an Interop DCP, we'll choose a single + * one that we'll use everywher. This is that chosen font. + */ + std::shared_ptr _chosen_interop_font; /** true if any reel has any subtitles */ bool _have_subtitles = false; /** all closed caption tracks that we have on any reel */ std::set _have_closed_captions; + + struct HangingText { + PlayerText text; + TextType type; + boost::optional track; + dcpomatic::DCPTimePeriod period; + }; + + std::vector _hanging_texts; };