summaryrefslogtreecommitdiff
path: root/chromium/media/gpu/chromeos/dmabuf_video_frame_pool.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2022-02-02 12:21:57 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2022-02-12 08:13:00 +0000
commit606d85f2a5386472314d39923da28c70c60dc8e7 (patch)
treea8f4d7bf997f349f45605e6058259fba0630e4d7 /chromium/media/gpu/chromeos/dmabuf_video_frame_pool.h
parent5786336dda477d04fb98483dca1a5426eebde2d7 (diff)
downloadqtwebengine-chromium-606d85f2a5386472314d39923da28c70c60dc8e7.tar.gz
BASELINE: Update Chromium to 96.0.4664.181
Change-Id: I762cd1da89d73aa6313b4a753fe126c34833f046 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/media/gpu/chromeos/dmabuf_video_frame_pool.h')
-rw-r--r--chromium/media/gpu/chromeos/dmabuf_video_frame_pool.h31
1 files changed, 19 insertions, 12 deletions
diff --git a/chromium/media/gpu/chromeos/dmabuf_video_frame_pool.h b/chromium/media/gpu/chromeos/dmabuf_video_frame_pool.h
index aff3c945182..20e1bbc845c 100644
--- a/chromium/media/gpu/chromeos/dmabuf_video_frame_pool.h
+++ b/chromium/media/gpu/chromeos/dmabuf_video_frame_pool.h
@@ -7,6 +7,7 @@
#include "base/memory/scoped_refptr.h"
#include "base/sequenced_task_runner.h"
+#include "media/base/status.h"
#include "media/base/video_frame.h"
#include "media/gpu/chromeos/fourcc.h"
#include "media/gpu/chromeos/gpu_buffer_layout.h"
@@ -40,19 +41,20 @@ class MEDIA_GPU_EXPORT DmabufVideoFramePool {
scoped_refptr<base::SequencedTaskRunner> parent_task_runner);
// Sets the parameters of allocating frames and the maximum number of frames
- // which can be allocated. Returns a valid GpuBufferLayout if VideoFrame
- // will be created by GetFrame().
- virtual absl::optional<GpuBufferLayout> Initialize(
- const Fourcc& fourcc,
- const gfx::Size& coded_size,
- const gfx::Rect& visible_rect,
- const gfx::Size& natural_size,
- size_t max_num_frames,
- bool use_protected) = 0;
+ // which can be allocated.
+ // Returns a valid GpuBufferLayout if the initialization is successful.
+ // Returns StatusCode::kAborted if the initialization process is aborted.
+ // Returns StatusCode::kInvalidArgument if any other error occurs.
+ virtual StatusOr<GpuBufferLayout> Initialize(const Fourcc& fourcc,
+ const gfx::Size& coded_size,
+ const gfx::Rect& visible_rect,
+ const gfx::Size& natural_size,
+ size_t max_num_frames,
+ bool use_protected) = 0;
- // Returns a frame from the pool with the parameters assigned by
- // SetFrameFormat() and zero timestamp. Returns nullptr if the pool is
- // exhausted.
+ // Returns a frame from the pool with the layout that is returned by the
+ // previous Initialize() method and zero timestamp. Returns nullptr if the
+ // pool is exhausted.
virtual scoped_refptr<VideoFrame> GetFrame() = 0;
// Checks whether the pool is exhausted. This happens when the pool reached
@@ -66,6 +68,11 @@ class MEDIA_GPU_EXPORT DmabufVideoFramePool {
// would be dropped immediately.
virtual void NotifyWhenFrameAvailable(base::OnceClosure cb) = 0;
+ // Invoke to cause the pool to release all the frames it has allocated before
+ // which will cause new ones to be allocated. This method must be called on
+ // |parent_task_runner_| because it may invalidate weak ptrs.
+ virtual void ReleaseAllFrames() = 0;
+
protected:
scoped_refptr<base::SequencedTaskRunner> parent_task_runner_;
};