X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=core%2Fframe%2Fframe.h;h=640a6589e3027cea195813d7da3f95e792816026;hb=1678432d8cabef093a58e27791f68499c031dba9;hp=4667c0a2a1402470ef5138e3502fc8f9e189e713;hpb=40ee6eeb1cc1486ba665c05ec256b8196952c73e;p=casparcg diff --git a/core/frame/frame.h b/core/frame/frame.h index 4667c0a2a..640a6589e 100644 --- a/core/frame/frame.h +++ b/core/frame/frame.h @@ -3,13 +3,14 @@ #undef BOOST_PARAMETER_MAX_ARITY #define BOOST_PARAMETER_MAX_ARITY 7 -#include "../video_format.h" +#include "../fwd.h" #include #include #include #include #include +#include #include #include @@ -17,24 +18,26 @@ FORWARD1(boost, template class shared_future); namespace caspar { namespace core { - -typedef cache_aligned_vector audio_buffer; + +typedef caspar::array audio_buffer; +typedef cache_aligned_vector mutable_audio_buffer; class frame_geometry; class mutable_frame final { mutable_frame(const mutable_frame&); mutable_frame& operator=(const mutable_frame&); -public: +public: // Static Members // Constructors - explicit mutable_frame(std::vector> image_buffers, - audio_buffer audio_buffer, - const void* tag, - const struct pixel_format_desc& desc); + explicit mutable_frame(std::vector> image_buffers, + mutable_audio_buffer audio_data, + const void* tag, + const pixel_format_desc& desc, + const audio_channel_layout& channel_layout); ~mutable_frame(); // Methods @@ -43,26 +46,28 @@ public: mutable_frame& operator=(mutable_frame&& other); void swap(mutable_frame& other); - + // Properties - - const struct pixel_format_desc& pixel_format_desc() const; + + const core::pixel_format_desc& pixel_format_desc() const; + const core::audio_channel_layout& audio_channel_layout() const; const array& image_data(std::size_t index = 0) const; - const core::audio_buffer& audio_data() const; + const core::mutable_audio_buffer& audio_data() const; array& image_data(std::size_t index = 0); - core::audio_buffer& audio_data(); - + core::mutable_audio_buffer& audio_data(); + std::size_t width() const; std::size_t height() const; - + const void* stream_tag() const; - const void* data_tag() const; const core::frame_geometry& geometry() const; void set_geometry(const frame_geometry& g); - + + caspar::timer since_created() const; + private: struct impl; spl::unique_ptr impl_; @@ -70,7 +75,8 @@ private: class const_frame final { -public: + struct impl; +public: // Static Members @@ -79,10 +85,11 @@ public: // Constructors explicit const_frame(const void* tag = nullptr); - explicit const_frame(std::shared_future> image, - audio_buffer audio_buffer, - const void* tag, - const struct pixel_format_desc& desc); + explicit const_frame(std::shared_future> image, + audio_buffer audio_data, + const void* tag, + const pixel_format_desc& desc, + const audio_channel_layout& channel_layout); const_frame(mutable_frame&& other); ~const_frame(); @@ -91,33 +98,36 @@ public: const_frame(const_frame&& other); const_frame& operator=(const_frame&& other); const_frame(const const_frame&); + const_frame(const const_frame::impl&); const_frame& operator=(const const_frame& other); - + + const_frame key_only() const; + // Properties - - const struct pixel_format_desc& pixel_format_desc() const; + + const core::pixel_format_desc& pixel_format_desc() const; + const core::audio_channel_layout& audio_channel_layout() const; array image_data(int index = 0) const; const core::audio_buffer& audio_data() const; - + std::size_t width() const; std::size_t height() const; std::size_t size() const; - + const void* stream_tag() const; - const void* data_tag() const; const core::frame_geometry& geometry() const; - void set_geometry(const frame_geometry& g); + const_frame with_geometry(const frame_geometry& g) const; + int64_t get_age_millis() const; bool operator==(const const_frame& other); bool operator!=(const const_frame& other); bool operator<(const const_frame& other); bool operator>(const const_frame& other); - + private: - struct impl; spl::shared_ptr impl_; }; -}} \ No newline at end of file +}}