Commit 0e776838 authored by Hirokazu Honda's avatar Hirokazu Honda Committed by Commit Bot

video_decode_accelerator.mojom: Remove ProvidePictureBuffersDeprecated

Bug: 949898
Test: Play videos with YouTube app
Change-Id: I737bfd232cefc3a4db379bdbc9f1eb1dc62c7c54
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1621804Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664686}
parent 7c16850e
......@@ -131,14 +131,10 @@ interface VideoDecodeAccelerator {
Flush@6() => (Result result);
};
// Deprecated method IDs: 0
// Deprecated method IDs: 0, 4
// Next method ID: 6
interface VideoDecodeClient {
// Callback to tell client how many and what size of buffers to provide.
[MinVersion=1]
ProvidePictureBuffersDeprecated@4(PictureBufferFormat format);
// Called to notify the client that |picture| is ready to be displayed.
// The calls to PictureReady() are in display order and Picture should
// be displayed in that order.
......
......@@ -115,8 +115,7 @@ GpuArcVideoDecodeAccelerator::GpuArcVideoDecodeAccelerator(
const gpu::GpuPreferences& gpu_preferences,
scoped_refptr<ProtectedBufferManager> protected_buffer_manager)
: gpu_preferences_(gpu_preferences),
protected_buffer_manager_(std::move(protected_buffer_manager)),
weak_this_factory_(this) {}
protected_buffer_manager_(std::move(protected_buffer_manager)) {}
GpuArcVideoDecodeAccelerator::~GpuArcVideoDecodeAccelerator() {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
......@@ -124,15 +123,6 @@ GpuArcVideoDecodeAccelerator::~GpuArcVideoDecodeAccelerator() {
client_count_--;
}
// TODO(crbug.com/949898): Remove if all clients support a newer
// ProvidePictureBuffers().
void GpuArcVideoDecodeAccelerator::GetClientVersion(base::OnceClosure callback,
uint32_t version) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
client_version_ = version;
std::move(callback).Run();
}
void GpuArcVideoDecodeAccelerator::ProvidePictureBuffers(
uint32_t requested_num_of_buffers,
media::VideoPixelFormat format,
......@@ -159,28 +149,7 @@ void GpuArcVideoDecodeAccelerator::ProvidePictureBuffersWithVisibleRect(
auto pbf = mojom::PictureBufferFormat::New();
pbf->min_num_buffers = requested_num_of_buffers;
pbf->coded_size = dimensions;
// TODO(crbug.com/949898): Remove if all clients support a newer
// ProvidePictureBuffers().
if (client_version_ == std::numeric_limits<uint32_t>::max()) {
// Base::Unretained(this) is safe here. |this| is ensured to be valid when
// GetClientVersion is called.
auto callback = base::BindOnce(
&GpuArcVideoDecodeAccelerator::ProvidePictureBuffersWithVisibleRect,
base::Unretained(this), requested_num_of_buffers, format,
textures_per_buffer, dimensions, visible_rect, texture_target);
client_.QueryVersion(base::BindRepeating(
&GpuArcVideoDecodeAccelerator::GetClientVersion,
weak_this_factory_.GetWeakPtr(), base::Passed(std::move(callback))));
return;
}
if (client_version_ >=
::arc::mojom::VideoDecodeClient::kProvidePictureBuffersMinVersion) {
client_->ProvidePictureBuffers(std::move(pbf), visible_rect);
} else {
client_->ProvidePictureBuffersDeprecated(std::move(pbf));
}
client_->ProvidePictureBuffers(std::move(pbf), visible_rect);
}
void GpuArcVideoDecodeAccelerator::DismissPictureBuffer(
......
......@@ -108,10 +108,6 @@ class GpuArcVideoDecodeAccelerator
PendingCallback cb,
media::VideoDecodeAccelerator* vda);
// TODO(crbug.com/949898): Remove if all clients support a newer
// ProvidePictureBuffers().
void GetClientVersion(base::OnceClosure callback, uint32_t version);
// Global counter that keeps track of the number of active clients (i.e., how
// many VDAs in use by this class).
// Since this class only works on the same thread, it's safe to access
......@@ -156,12 +152,7 @@ class GpuArcVideoDecodeAccelerator
bool secure_mode_ = false;
size_t output_buffer_count_ = 0;
uint32_t client_version_ = std::numeric_limits<uint32_t>::max();
THREAD_CHECKER(thread_checker_);
base::WeakPtrFactory<GpuArcVideoDecodeAccelerator> weak_this_factory_;
DISALLOW_COPY_AND_ASSIGN(GpuArcVideoDecodeAccelerator);
};
......
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