| Index: media/mojo/common/mojo_shared_buffer_video_frame.h
|
| diff --git a/media/mojo/common/mojo_shared_buffer_video_frame.h b/media/mojo/common/mojo_shared_buffer_video_frame.h
|
| index 945f43e51f38ec57e6279a8e8e9538d6e7772fd7..028dbf86823f278cf9c19848549a747a9564ad97 100644
|
| --- a/media/mojo/common/mojo_shared_buffer_video_frame.h
|
| +++ b/media/mojo/common/mojo_shared_buffer_video_frame.h
|
| @@ -12,6 +12,7 @@
|
| #include "base/macros.h"
|
| #include "base/memory/ref_counted.h"
|
| #include "media/base/video_frame.h"
|
| +#include "media/base/video_frame_pool.h"
|
| #include "mojo/public/cpp/system/buffer.h"
|
| #include "ui/gfx/geometry/rect.h"
|
| #include "ui/gfx/geometry/size.h"
|
| @@ -29,6 +30,21 @@ namespace mojom {
|
| class VideoFrame;
|
| }
|
|
|
| +class MojoVideoFramePoolDelegate final : public VideoFramePoolDelegate {
|
| + public:
|
| + ~MojoVideoFramePoolDelegate() override;
|
| +
|
| + scoped_refptr<VideoFrame> CreateZeroInitializedFrame(
|
| + VideoPixelFormat format,
|
| + const gfx::Size& coded_size,
|
| + const gfx::Rect& visible_rect,
|
| + const gfx::Size& natural_size,
|
| + base::TimeDelta timestamp) override;
|
| +
|
| + scoped_refptr<VideoFrame> WrapVideoFrame(
|
| + const scoped_refptr<VideoFrame>& frame) override;
|
| +};
|
| +
|
| // A derived class of media::VideoFrame holding a mojo::SharedBufferHandle
|
| // which is mapped on constructor and remains so for the lifetime of the
|
| // object. These frames are ref-counted.
|
| @@ -40,6 +56,15 @@ class MojoSharedBufferVideoFrame : public VideoFrame {
|
| base::Callback<void(mojo::ScopedSharedBufferHandle buffer,
|
| size_t capacity)>;
|
|
|
| + static scoped_refptr<MojoSharedBufferVideoFrame>
|
| + WrapMojoSharedBufferVideoFrame(
|
| + const scoped_refptr<MojoSharedBufferVideoFrame>& frame);
|
| +
|
| + static scoped_refptr<MojoSharedBufferVideoFrame> CreateYUV(
|
| + VideoPixelFormat format,
|
| + const gfx::Size& dimensions,
|
| + base::TimeDelta timestamp);
|
| +
|
| // Creates a new I420 frame in shared memory with provided parameters
|
| // (coded_size() == natural_size() == visible_rect()), or returns nullptr.
|
| // Buffers for the frame are allocated but not initialized. The caller must
|
|
|