X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2Fplayer.h;h=5950b95a39d03ca5b96a1e2b037f150135e0403c;hb=a988cabec09c28ba11a0e46f0acdc564aa04baca;hp=6e83da103df66d8444171025230c8912dc59e702;hpb=053bf81d7ef24843cc2eea62e24c2296fed48950;p=dcpomatic.git diff --git a/src/lib/player.h b/src/lib/player.h index 6e83da103..5950b95a3 100644 --- a/src/lib/player.h +++ b/src/lib/player.h @@ -31,9 +31,10 @@ #include "content_audio.h" #include "content_text.h" #include "content_video.h" +#include "dcp_text_track.h" #include "empty.h" #include "enum_indexed_vector.h" -#include "film.h" +#include "film_property.h" #include "image.h" #include "player_text.h" #include "position_image.h" @@ -49,6 +50,7 @@ namespace dcp { class AtmosContent; class AudioBuffers; class Content; +class Film; class PlayerVideo; class Playlist; class ReferencedReelAsset; @@ -74,14 +76,17 @@ public: /** @class Player * @brief A class which can play a Playlist. */ -class Player : public std::enable_shared_from_this +class Player { public: Player (std::shared_ptr, Image::Alignment subtitle_alignment); Player (std::shared_ptr, std::shared_ptr playlist); - Player (Player const& Player) = delete; - Player& operator= (Player const& Player) = delete; + Player (Player const&) = delete; + Player& operator= (Player const&) = delete; + + Player(Player&& other); + Player& operator=(Player&& other); bool pass (); void seek (dcpomatic::DCPTime time, bool accurate); @@ -137,8 +142,9 @@ private: friend struct overlap_video_test1; void construct (); + void connect(); void setup_pieces (); - void film_change (ChangeType, Film::Property); + void film_change(ChangeType, FilmProperty); void playlist_change (ChangeType); void playlist_content_change (ChangeType, int, bool); Frame dcp_to_content_video (std::shared_ptr piece, dcpomatic::DCPTime t) const; @@ -173,13 +179,13 @@ private: */ mutable boost::mutex _mutex; - std::weak_ptr const _film; + std::weak_ptr _film; /** Playlist, or 0 if we are using the one from the _film */ - std::shared_ptr const _playlist; + std::shared_ptr _playlist; /** > 0 if we are suspended (i.e. pass() and seek() do nothing) */ boost::atomic _suspended; - std::list> _pieces; + std::vector> _pieces; /** Size of the image we are rendering to; this may be the DCP frame size, or * the size of preview in a window. @@ -198,7 +204,7 @@ private: /** true if we should try to be fast rather than high quality */ boost::atomic _fast; /** true if we should keep going in the face of `survivable' errors */ - bool const _tolerant; + bool _tolerant; /** true if we should `play' (i.e output) referenced DCP data (e.g. for preview) */ boost::atomic _play_referenced; @@ -223,13 +229,12 @@ private: public: StreamState () {} - StreamState (std::shared_ptr p, dcpomatic::DCPTime l) + explicit StreamState(std::shared_ptr p) : piece(p) - , last_push_end(l) {} std::shared_ptr piece; - dcpomatic::DCPTime last_push_end; + boost::optional last_push_end; }; std::map _stream_states; @@ -242,7 +247,7 @@ private: boost::atomic _playback_length; /** Alignment for subtitle images that we create */ - Image::Alignment const _subtitle_alignment = Image::Alignment::PADDED; + Image::Alignment _subtitle_alignment = Image::Alignment::PADDED; boost::signals2::scoped_connection _film_changed_connection; boost::signals2::scoped_connection _playlist_change_connection;