Commit d27c2c15 authored by Miguel Casas's avatar Miguel Casas Committed by Commit Bot

media/gpu/cros: remove unused gpu::GpuMemoryBufferFactory*

Remove unused gpu::GpuMemoryBufferFactory* from VideoDecoderPipeline

Bug: 1040291
Change-Id: I122f5141d0892aa31ed84d78a74ce4c65edc76e5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2254445
Commit-Queue: Miguel Casas <mcasas@chromium.org>
Commit-Queue: Dan Sanders <sandersd@chromium.org>
Reviewed-by: default avatarDan Sanders <sandersd@chromium.org>
Reviewed-by: default avatarAndres Calderon Jaramillo <andrescj@chromium.org>
Auto-Submit: Miguel Casas <mcasas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#780420}
parent 937e64da
......@@ -73,12 +73,10 @@ ChromeosVideoDecoderFactory::GetSupportedConfigs() {
std::unique_ptr<VideoDecoder> ChromeosVideoDecoderFactory::Create(
scoped_refptr<base::SequencedTaskRunner> client_task_runner,
std::unique_ptr<DmabufVideoFramePool> frame_pool,
std::unique_ptr<VideoFrameConverter> frame_converter,
gpu::GpuMemoryBufferFactory* const gpu_memory_buffer_factory) {
std::unique_ptr<VideoFrameConverter> frame_converter) {
return VideoDecoderPipeline::Create(
std::move(client_task_runner), std::move(frame_pool),
std::move(frame_converter), gpu_memory_buffer_factory,
base::BindRepeating(&GetCreateVDFunctions));
std::move(frame_converter), base::BindRepeating(&GetCreateVDFunctions));
}
} // namespace media
......@@ -15,10 +15,6 @@ namespace base {
class SequencedTaskRunner;
} // namespace base
namespace gpu {
class GpuMemoryBufferFactory;
} // namespace gpu
namespace media {
class DmabufVideoFramePool;
......@@ -31,13 +27,10 @@ class MEDIA_GPU_EXPORT ChromeosVideoDecoderFactory {
// Create VideoDecoder instance that allocates VideoFrame from |frame_pool|
// and converts the output VideoFrame |frame_converter|.
// Note the caller is responsible for keeping |gpu_memory_buffer_factory|
// alive during the returned VideoDecoder lifetime.
static std::unique_ptr<VideoDecoder> Create(
scoped_refptr<base::SequencedTaskRunner> client_task_runner,
std::unique_ptr<DmabufVideoFramePool> frame_pool,
std::unique_ptr<VideoFrameConverter> frame_converter,
gpu::GpuMemoryBufferFactory* const gpu_memory_buffer_factory);
std::unique_ptr<VideoFrameConverter> frame_converter);
};
} // namespace media
......
......@@ -136,8 +136,7 @@ bool VdVideoDecodeAccelerator::Initialize(const Config& config,
std::unique_ptr<VdaVideoFramePool> frame_pool =
std::make_unique<VdaVideoFramePool>(weak_this_, client_task_runner_);
vd_ = create_vd_cb_.Run(client_task_runner_, std::move(frame_pool),
std::make_unique<VideoFrameConverter>(),
nullptr /* gpu_memory_buffer_factory */);
std::make_unique<VideoFrameConverter>());
if (!vd_)
return false;
......
......@@ -24,10 +24,6 @@
#include "media/gpu/media_gpu_export.h"
#include "media/video/video_decode_accelerator.h"
namespace gpu {
class GpuMemoryBufferFactory;
} // namespace gpu
namespace media {
class VideoFrame;
......@@ -51,8 +47,7 @@ class MEDIA_GPU_EXPORT VdVideoDecodeAccelerator
base::RepeatingCallback<std::unique_ptr<VideoDecoder>(
scoped_refptr<base::SequencedTaskRunner>,
std::unique_ptr<DmabufVideoFramePool>,
std::unique_ptr<VideoFrameConverter>,
gpu::GpuMemoryBufferFactory* const)>;
std::unique_ptr<VideoFrameConverter>)>;
// Create VdVideoDecodeAccelerator instance, and call Initialize().
// Return nullptr if Initialize() failed.
......
......@@ -68,7 +68,6 @@ std::unique_ptr<VideoDecoder> VideoDecoderPipeline::Create(
scoped_refptr<base::SequencedTaskRunner> client_task_runner,
std::unique_ptr<DmabufVideoFramePool> frame_pool,
std::unique_ptr<VideoFrameConverter> frame_converter,
gpu::GpuMemoryBufferFactory* const gpu_memory_buffer_factory,
GetCreateVDFunctionsCB get_create_vd_functions_cb) {
if (!client_task_runner || !frame_pool || !frame_converter) {
VLOGF(1) << "One of arguments is nullptr.";
......@@ -82,22 +81,19 @@ std::unique_ptr<VideoDecoder> VideoDecoderPipeline::Create(
return base::WrapUnique<VideoDecoder>(new VideoDecoderPipeline(
std::move(client_task_runner), std::move(frame_pool),
std::move(frame_converter), gpu_memory_buffer_factory,
std::move(get_create_vd_functions_cb)));
std::move(frame_converter), std::move(get_create_vd_functions_cb)));
}
VideoDecoderPipeline::VideoDecoderPipeline(
scoped_refptr<base::SequencedTaskRunner> client_task_runner,
std::unique_ptr<DmabufVideoFramePool> frame_pool,
std::unique_ptr<VideoFrameConverter> frame_converter,
gpu::GpuMemoryBufferFactory* const gpu_memory_buffer_factory,
GetCreateVDFunctionsCB get_create_vd_functions_cb)
: client_task_runner_(std::move(client_task_runner)),
decoder_task_runner_(base::ThreadPool::CreateSingleThreadTaskRunner(
{base::WithBaseSyncPrimitives(), base::TaskPriority::USER_VISIBLE},
base::SingleThreadTaskRunnerThreadMode::DEDICATED)),
main_frame_pool_(std::move(frame_pool)),
gpu_memory_buffer_factory_(gpu_memory_buffer_factory),
frame_converter_(std::move(frame_converter)),
get_create_vd_functions_cb_(std::move(get_create_vd_functions_cb)) {
DCHECK_CALLED_ON_VALID_SEQUENCE(client_sequence_checker_);
......
......@@ -24,10 +24,6 @@ namespace base {
class SequencedTaskRunner;
}
namespace gpu {
class GpuMemoryBufferFactory;
} // namespace gpu
namespace media {
class DmabufVideoFramePool;
......@@ -141,7 +137,6 @@ class MEDIA_GPU_EXPORT VideoDecoderPipeline : public VideoDecoder,
scoped_refptr<base::SequencedTaskRunner> client_task_runner,
std::unique_ptr<DmabufVideoFramePool> frame_pool,
std::unique_ptr<VideoFrameConverter> frame_converter,
gpu::GpuMemoryBufferFactory* const gpu_memory_buffer_factory,
GetCreateVDFunctionsCB get_create_vd_functions_cb);
~VideoDecoderPipeline() override;
......@@ -182,7 +177,6 @@ class MEDIA_GPU_EXPORT VideoDecoderPipeline : public VideoDecoder,
scoped_refptr<base::SequencedTaskRunner> client_task_runner,
std::unique_ptr<DmabufVideoFramePool> frame_pool,
std::unique_ptr<VideoFrameConverter> frame_converter,
gpu::GpuMemoryBufferFactory* const gpu_memory_buffer_factory,
GetCreateVDFunctionsCB get_create_vd_functions_cb);
void Destroy() override;
void DestroyTask();
......@@ -241,10 +235,6 @@ class MEDIA_GPU_EXPORT VideoDecoderPipeline : public VideoDecoder,
// the client should be created using this pool.
// Used on |decoder_task_runner_|.
std::unique_ptr<DmabufVideoFramePool> main_frame_pool_;
// Used to generate additional frame pools for intermediate results if
// required. The instance is indirectly owned by GpuChildThread, therefore
// alive as long as the GPU process is.
gpu::GpuMemoryBufferFactory* const gpu_memory_buffer_factory_;
// The image processor is only created when the decoder cannot output frames
// with renderable format.
......
......@@ -189,8 +189,7 @@ void VideoDecoderClient::CreateDecoderTask(bool* success,
base::ThreadTaskRunnerHandle::Get(),
std::make_unique<PlatformVideoFramePool>(
gpu_memory_buffer_factory_),
std::make_unique<VideoFrameConverter>(),
gpu_memory_buffer_factory_);
std::make_unique<VideoFrameConverter>());
} else {
LOG(ERROR) << "VD-based video decoders only support import mode";
}
......
......@@ -268,8 +268,7 @@ std::unique_ptr<VideoDecoder> GpuMojoMediaClient::CreateVideoDecoder(
command_buffer_id->channel_token,
command_buffer_id->route_id));
video_decoder = ChromeosVideoDecoderFactory::Create(
task_runner, std::move(frame_pool), std::move(frame_converter),
gpu_memory_buffer_factory_);
task_runner, std::move(frame_pool), std::move(frame_converter));
} else {
video_decoder = VdaVideoDecoder::Create(
task_runner, gpu_task_runner_, media_log->Clone(),
......
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