Commit b8eef864 authored by Chih-Yu Huang's avatar Chih-Yu Huang Committed by Commit Bot

media/gpu/linux: Remove UnwrapFrame() in DmabufVideoFramePool interface.

The UnwrapFrame() method is only used between PlatformVideoFramePool
and MailboxVideoFrameConverter implementation. It is not a general
method.

This CL moves the method from DmabufVideoFramePool interface to
PlatformVideoFramePool implementation.

BUG=b:136716638
TEST=run video_decode_accelerator_tests on kevin

Change-Id: Icfd5d99fb2319ec904e0d8c298572cb0af1031b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1824500
Auto-Submit: Chih-Yu Huang <akahuang@chromium.org>
Reviewed-by: default avatarDan Sanders <sandersd@chromium.org>
Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Commit-Queue: Chih-Yu Huang <akahuang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#700068}
parent c32ca8fc
...@@ -60,12 +60,6 @@ class MEDIA_GPU_EXPORT DmabufVideoFramePool { ...@@ -60,12 +60,6 @@ class MEDIA_GPU_EXPORT DmabufVideoFramePool {
// would be dropped immediately. // would be dropped immediately.
virtual void NotifyWhenFrameAvailable(base::OnceClosure cb) = 0; virtual void NotifyWhenFrameAvailable(base::OnceClosure cb) = 0;
// Returns the original frame of a wrapped frame. We need this method to
// determine whether the frame returned by GetFrame() is the same one after
// recycling, and bind destruction callback at original frames.
// TODO(akahuang): Find a way to avoid this method.
virtual VideoFrame* UnwrapFrame(const VideoFrame& wrapped_frame) = 0;
protected: protected:
scoped_refptr<base::SequencedTaskRunner> parent_task_runner_; scoped_refptr<base::SequencedTaskRunner> parent_task_runner_;
}; };
......
...@@ -47,9 +47,13 @@ class MEDIA_GPU_EXPORT PlatformVideoFramePool : public DmabufVideoFramePool { ...@@ -47,9 +47,13 @@ class MEDIA_GPU_EXPORT PlatformVideoFramePool : public DmabufVideoFramePool {
const gfx::Size& natural_size) override; const gfx::Size& natural_size) override;
scoped_refptr<VideoFrame> GetFrame() override; scoped_refptr<VideoFrame> GetFrame() override;
bool IsExhausted() override; bool IsExhausted() override;
VideoFrame* UnwrapFrame(const VideoFrame& wrapped_frame) override;
void NotifyWhenFrameAvailable(base::OnceClosure cb) override; void NotifyWhenFrameAvailable(base::OnceClosure cb) override;
// Returns the original frame of a wrapped frame. We need this method to
// determine whether the frame returned by GetFrame() is the same one after
// recycling, and bind destruction callback at original frames.
VideoFrame* UnwrapFrame(const VideoFrame& wrapped_frame);
private: private:
friend class PlatformVideoFramePoolTest; friend class PlatformVideoFramePoolTest;
......
...@@ -240,7 +240,7 @@ std::unique_ptr<VideoDecoder> GpuMojoMediaClient::CreateVideoDecoder( ...@@ -240,7 +240,7 @@ std::unique_ptr<VideoDecoder> GpuMojoMediaClient::CreateVideoDecoder(
#if BUILDFLAG(USE_V4L2_CODEC) || BUILDFLAG(USE_VAAPI) #if BUILDFLAG(USE_V4L2_CODEC) || BUILDFLAG(USE_VAAPI)
auto frame_pool = std::make_unique<PlatformVideoFramePool>(); auto frame_pool = std::make_unique<PlatformVideoFramePool>();
auto frame_converter = MailboxVideoFrameConverter::Create( auto frame_converter = MailboxVideoFrameConverter::Create(
base::BindRepeating(&DmabufVideoFramePool::UnwrapFrame, base::BindRepeating(&PlatformVideoFramePool::UnwrapFrame,
base::Unretained(frame_pool.get())), base::Unretained(frame_pool.get())),
gpu_task_runner_, gpu_task_runner_,
base::BindRepeating(&GetCommandBufferStub, gpu_task_runner_, base::BindRepeating(&GetCommandBufferStub, gpu_task_runner_,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment