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

Unified Diff: media/filters/gpu_video_decoder.cc

Issue 2812783002: Always post mailbox release in GpuVideoDecoder; avoids deadlock. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/gpu_video_decoder.cc
diff --git a/media/filters/gpu_video_decoder.cc b/media/filters/gpu_video_decoder.cc
index 2a8a704d7bc70c3b4fcb6025cf4be22477bacfb0..953a41479346873d3f062749af38005d00e13c74 100644
--- a/media/filters/gpu_video_decoder.cc
+++ b/media/filters/gpu_video_decoder.cc
@@ -184,20 +184,6 @@ static void ReportGpuVideoDecoderInitializeStatusToUMAAndRunCB(
cb.Run(success);
}
-// static
-void ReleaseMailboxTrampoline(
- const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
- const VideoFrame::ReleaseMailboxCB& release_mailbox_cb,
- const gpu::SyncToken& release_sync_token) {
- if (task_runner->BelongsToCurrentThread()) {
- release_mailbox_cb.Run(release_sync_token);
- return;
- }
-
- task_runner->PostTask(FROM_HERE,
- base::Bind(release_mailbox_cb, release_sync_token));
-}
-
std::string GpuVideoDecoder::GetDisplayName() const {
return kDecoderName;
}
@@ -673,11 +659,11 @@ void GpuVideoDecoder::PictureReady(const media::Picture& picture) {
scoped_refptr<VideoFrame> frame(VideoFrame::WrapNativeTextures(
pixel_format_, mailbox_holders,
- base::Bind(
- &ReleaseMailboxTrampoline, factories_->GetTaskRunner(),
- base::Bind(&GpuVideoDecoder::ReleaseMailbox,
- weak_factory_.GetWeakPtr(), factories_,
- picture.picture_buffer_id(), pb.client_texture_ids())),
+ // Always post ReleaseMailbox to avoid deadlock with the compositor when
+ // releasing video frames on the media thread; http://crbug.com/710209.
+ BindToCurrentLoop(base::Bind(
+ &GpuVideoDecoder::ReleaseMailbox, weak_factory_.GetWeakPtr(),
+ factories_, picture.picture_buffer_id(), pb.client_texture_ids())),
pb.size(), visible_rect, natural_size, timestamp));
if (!frame) {
DLOG(ERROR) << "Create frame failed for: " << picture.picture_buffer_id();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698