Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(614)

Unified Diff: media/filters/gpu_video_decoder.cc

Issue 175223003: HW Video: Make media::VideoFrame handle the sync point of the compositor as well as webgl (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: previous patchset has unrelated code by mistake. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/filters/gpu_video_decoder.cc
diff --git a/media/filters/gpu_video_decoder.cc b/media/filters/gpu_video_decoder.cc
index 54845214bb138195a69ba075b5582318230d2f2f..95484e280dae7e6981c13622da357835f9ff1411 100644
--- a/media/filters/gpu_video_decoder.cc
+++ b/media/filters/gpu_video_decoder.cc
@@ -425,24 +425,24 @@ void GpuVideoDecoder::DismissPictureBuffer(int32 id) {
static void ReadPixelsSyncInner(
const scoped_refptr<media::GpuVideoAcceleratorFactories>& factories,
uint32 texture_id,
- const gfx::Rect& visible_rect,
+ const scoped_refptr<VideoFrame>& frame,
const SkBitmap& pixels,
base::WaitableEvent* event) {
- factories->ReadPixels(texture_id, visible_rect, pixels);
+ factories->ReadPixels(texture_id, frame, pixels);
event->Signal();
}
static void ReadPixelsSync(
const scoped_refptr<media::GpuVideoAcceleratorFactories>& factories,
uint32 texture_id,
- const gfx::Rect& visible_rect,
+ const scoped_refptr<VideoFrame>& frame,
const SkBitmap& pixels) {
base::WaitableEvent event(true, false);
if (!factories->GetTaskRunner()->PostTask(FROM_HERE,
base::Bind(&ReadPixelsSyncInner,
factories,
texture_id,
- visible_rect,
+ frame,
pixels,
&event)))
return;
@@ -480,7 +480,7 @@ void GpuVideoDecoder::PictureReady(const media::Picture& picture) {
visible_rect,
natural_size,
timestamp,
- base::Bind(&ReadPixelsSync, factories_, pb.texture_id(), visible_rect)));
+ base::Bind(&ReadPixelsSync, factories_, pb.texture_id())));
CHECK_GT(available_pictures_, 0);
--available_pictures_;
bool inserted =
@@ -514,7 +514,8 @@ void GpuVideoDecoder::EnqueueFrameAndTriggerFrameDelivery(
void GpuVideoDecoder::ReusePictureBuffer(
int64 picture_buffer_id,
- scoped_ptr<gpu::MailboxHolder> mailbox_holder) {
+ scoped_ptr<gpu::MailboxHolder> mailbox_holder,
+ const std::vector<uint32>& release_sync_points) {
DVLOG(3) << "ReusePictureBuffer(" << picture_buffer_id << ")";
DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent();
@@ -538,7 +539,9 @@ void GpuVideoDecoder::ReusePictureBuffer(
return;
}
- factories_->WaitSyncPoint(mailbox_holder->sync_point);
+ for (size_t i = 0; i < release_sync_points.size(); i++)
+ factories_->WaitSyncPoint(release_sync_points[i]);
+
++available_pictures_;
vda_->ReusePictureBuffer(picture_buffer_id);

Powered by Google App Engine
This is Rietveld 408576698