]> git.sesse.net Git - casparcg/blobdiff - core/frame/frame.h
[general] Abstracted the concept of a key only frame so that readers of const_frame...
[casparcg] / core / frame / frame.h
index 6ae3d0a044c6490af1d3f7a035b6bee9a6ee8a2f..fff5382c845a715e34cecb93380e2dd107852be5 100644 (file)
@@ -18,7 +18,7 @@
 FORWARD1(boost, template<typename> class shared_future);
 
 namespace caspar { namespace core {
-       
+
 typedef caspar::array<const int32_t> audio_buffer;
 typedef cache_aligned_vector<int32_t> mutable_audio_buffer;
 class frame_geometry;
@@ -27,15 +27,15 @@ 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<array<std::uint8_t>> image_buffers, 
+       explicit mutable_frame(std::vector<array<std::uint8_t>> image_buffers,
                                                mutable_audio_buffer audio_data,
-                                               const void* tag, 
+                                               const void* tag,
                                                const pixel_format_desc& desc,
                                                const audio_channel_layout& channel_layout);
        ~mutable_frame();
@@ -46,9 +46,9 @@ public:
        mutable_frame& operator=(mutable_frame&& other);
 
        void swap(mutable_frame& other);
-                       
+
        // Properties
-                       
+
        const core::pixel_format_desc& pixel_format_desc() const;
        const core::audio_channel_layout& audio_channel_layout() const;
 
@@ -57,17 +57,17 @@ public:
 
        array<std::uint8_t>& image_data(std::size_t index = 0);
        core::mutable_audio_buffer& audio_data();
-       
+
        std::size_t width() const;
        std::size_t height() const;
-                                                               
+
        const void* stream_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> impl_;
@@ -75,7 +75,7 @@ private:
 
 class const_frame final
 {
-public:        
+public:
 
        // Static Members
 
@@ -84,9 +84,9 @@ public:
        // Constructors
 
        explicit const_frame(const void* tag = nullptr);
-       explicit const_frame(std::shared_future<array<const std::uint8_t>> image, 
-                                               audio_buffer audio_data, 
-                                               const void* tag, 
+       explicit const_frame(std::shared_future<array<const std::uint8_t>> image,
+                                               audio_buffer audio_data,
+                                               const void* tag,
                                                const pixel_format_desc& desc,
                                                const audio_channel_layout& channel_layout);
        const_frame(mutable_frame&& other);
@@ -98,19 +98,21 @@ public:
        const_frame& operator=(const_frame&& other);
        const_frame(const const_frame&);
        const_frame& operator=(const const_frame& other);
-                               
+
+       const_frame key_only() const;
+
        // Properties
-                               
+
        const core::pixel_format_desc& pixel_format_desc() const;
        const core::audio_channel_layout& audio_channel_layout() const;
 
        array<const std::uint8_t> 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 core::frame_geometry& geometry() const;
@@ -121,7 +123,7 @@ public:
        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> impl_;