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

Side by Side Diff: content/common/gpu/media/vaapi_video_decode_accelerator.cc

Issue 11092054: Teach BindToLoop to create callbacks that accept scoped parameters. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: xhwang CR Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/common/gpu/media/vaapi_video_decode_accelerator.h ('k') | media/base/bind_to_loop.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 state_ = kInitialized; 106 state_ = kInitialized;
107 107
108 message_loop_->PostTask(FROM_HERE, base::Bind( 108 message_loop_->PostTask(FROM_HERE, base::Bind(
109 &Client::NotifyInitializeDone, client_)); 109 &Client::NotifyInitializeDone, client_));
110 return true; 110 return true;
111 } 111 }
112 112
113 void VaapiVideoDecodeAccelerator::SubmitDecode( 113 void VaapiVideoDecodeAccelerator::SubmitDecode(
114 int32 output_id, 114 int32 output_id,
115 std::queue<VABufferID>* va_bufs_ptr, 115 scoped_ptr<std::queue<VABufferID> > va_bufs,
116 std::queue<VABufferID>* slice_bufs_ptr) { 116 scoped_ptr<std::queue<VABufferID> > slice_bufs) {
117 DCHECK_EQ(message_loop_, MessageLoop::current()); 117 DCHECK_EQ(message_loop_, MessageLoop::current());
118 118
119 scoped_ptr<std::queue<VABufferID> > va_bufs(va_bufs_ptr);
120 scoped_ptr<std::queue<VABufferID> > slice_bufs(slice_bufs_ptr);
121
122 TRACE_EVENT1("Video Decoder", "VAVDA::Decode", "output_id", output_id); 119 TRACE_EVENT1("Video Decoder", "VAVDA::Decode", "output_id", output_id);
123 120
124 // Handle Destroy() arriving while pictures are queued for output. 121 // Handle Destroy() arriving while pictures are queued for output.
125 if (!client_) 122 if (!client_)
126 return; 123 return;
127 124
128 RETURN_AND_NOTIFY_ON_FAILURE( 125 RETURN_AND_NOTIFY_ON_FAILURE(
129 decoder_.SubmitDecode(output_id, va_bufs.Pass(), slice_bufs.Pass()), 126 decoder_.SubmitDecode(output_id, va_bufs.Pass(), slice_bufs.Pass()),
130 "Failed putting picture to texture", 127 "Failed putting picture to texture",
131 PLATFORM_FAILURE, ); 128 PLATFORM_FAILURE, );
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 void VaapiVideoDecodeAccelerator::PreSandboxInitialization() { 593 void VaapiVideoDecodeAccelerator::PreSandboxInitialization() {
597 VaapiH264Decoder::PreSandboxInitialization(); 594 VaapiH264Decoder::PreSandboxInitialization();
598 } 595 }
599 596
600 // static 597 // static
601 bool VaapiVideoDecodeAccelerator::PostSandboxInitialization() { 598 bool VaapiVideoDecodeAccelerator::PostSandboxInitialization() {
602 return VaapiH264Decoder::PostSandboxInitialization(); 599 return VaapiH264Decoder::PostSandboxInitialization();
603 } 600 }
604 601
605 } // namespace content 602 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/media/vaapi_video_decode_accelerator.h ('k') | media/base/bind_to_loop.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698