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

Side by Side Diff: content/common/gpu/client/gpu_video_decode_accelerator_host.cc

Issue 1816203003: Add an additional VDA::Flush() mode to return all allocated buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
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 "content/common/gpu/client/gpu_video_decode_accelerator_host.h" 5 #include "content/common/gpu/client/gpu_video_decode_accelerator_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 154
155 void GpuVideoDecodeAcceleratorHost::ReusePictureBuffer( 155 void GpuVideoDecodeAcceleratorHost::ReusePictureBuffer(
156 int32_t picture_buffer_id) { 156 int32_t picture_buffer_id) {
157 DCHECK(CalledOnValidThread()); 157 DCHECK(CalledOnValidThread());
158 if (!channel_) 158 if (!channel_)
159 return; 159 return;
160 Send(new AcceleratedVideoDecoderMsg_ReusePictureBuffer( 160 Send(new AcceleratedVideoDecoderMsg_ReusePictureBuffer(
161 decoder_route_id_, picture_buffer_id)); 161 decoder_route_id_, picture_buffer_id));
162 } 162 }
163 163
164 void GpuVideoDecodeAcceleratorHost::Flush() { 164 void GpuVideoDecodeAcceleratorHost::Flush(bool return_buffers) {
165 DCHECK(CalledOnValidThread()); 165 DCHECK(CalledOnValidThread());
166 if (!channel_) 166 if (!channel_)
167 return; 167 return;
168 Send(new AcceleratedVideoDecoderMsg_Flush(decoder_route_id_)); 168 Send(new AcceleratedVideoDecoderMsg_Flush(decoder_route_id_, return_buffers));
169 } 169 }
170 170
171 void GpuVideoDecodeAcceleratorHost::Reset() { 171 void GpuVideoDecodeAcceleratorHost::Reset() {
172 DCHECK(CalledOnValidThread()); 172 DCHECK(CalledOnValidThread());
173 if (!channel_) 173 if (!channel_)
174 return; 174 return;
175 Send(new AcceleratedVideoDecoderMsg_Reset(decoder_route_id_)); 175 Send(new AcceleratedVideoDecoderMsg_Reset(decoder_route_id_));
176 } 176 }
177 177
178 void GpuVideoDecodeAcceleratorHost::Destroy() { 178 void GpuVideoDecodeAcceleratorHost::Destroy() {
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 weak_this_factory_.InvalidateWeakPtrs(); 274 weak_this_factory_.InvalidateWeakPtrs();
275 275
276 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the 276 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the
277 // last thing done on this stack! 277 // last thing done on this stack!
278 media::VideoDecodeAccelerator::Client* client = NULL; 278 media::VideoDecodeAccelerator::Client* client = NULL;
279 std::swap(client, client_); 279 std::swap(client, client_);
280 client->NotifyError(static_cast<media::VideoDecodeAccelerator::Error>(error)); 280 client->NotifyError(static_cast<media::VideoDecodeAccelerator::Error>(error));
281 } 281 }
282 282
283 } // namespace content 283 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698