diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-06-01 13:03:38 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-06-07 17:01:06 +0200 |
| commit | 5a820bb8fae34591be5ac6d19a73461b9dab532a (patch) | |
| tree | 098e2dc959b6df0fefa62b2976976afc9f81b96b /src/lib/writer.h | |
| parent | 9a7b67aee32a40539f29bc2d7017edd4a4f65f11 (diff) | |
Rearrange subtitle font management.
With this change each subtitle coming out of the player has a reference
to a dcpomatic::Font that belongs to the TextContent. This hopefully
solves a few problems which all basically stemmed from the fact that
previously the decoders/player were deciding what the font ID in the
output DCP would be - they can't do that properly.
Diffstat (limited to 'src/lib/writer.h')
| -rw-r--r-- | src/lib/writer.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/lib/writer.h b/src/lib/writer.h index 67172b0d4..1ae761dea 100644 --- a/src/lib/writer.h +++ b/src/lib/writer.h @@ -28,6 +28,7 @@ #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" @@ -41,15 +42,14 @@ namespace dcp { class Data; } -namespace dcpomatic { - class FontData; -} - class AudioBuffers; class Film; class Job; class ReelWriter; class ReferencedReelAsset; +struct writer_disambiguate_font_ids1; +struct writer_disambiguate_font_ids2; +struct writer_disambiguate_font_ids3; struct QueueItem @@ -115,7 +115,7 @@ public: void repeat (Frame, Eyes); void write (std::shared_ptr<const AudioBuffers>, dcpomatic::DCPTime time); void write (PlayerText text, TextType type, boost::optional<DCPTextTrack>, dcpomatic::DCPTimePeriod period); - void write (std::vector<dcpomatic::FontData> fonts); + void write (std::vector<std::shared_ptr<dcpomatic::Font>> fonts); void write (ReferencedReelAsset asset); void write (std::shared_ptr<const dcp::AtmosFrame> atmos, dcpomatic::DCPTime time, AtmosMetadata metadata); void finish (boost::filesystem::path output_dcp); @@ -123,6 +123,10 @@ 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 (); @@ -201,7 +205,11 @@ private: std::list<ReferencedReelAsset> _reel_assets; - std::vector<dcpomatic::FontData> _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<dcpomatic::Font> _chosen_interop_font; /** true if any reel has any subtitles */ bool _have_subtitles = false; |
