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

Side by Side Diff: content/renderer/gpu/gpu_video_decode_accelerator_host.cc

Issue 7021020: Clean up video frame sizes, types in Video Decode API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/renderer/gpu/gpu_video_decode_accelerator_host.h" 5 #include "content/renderer/gpu/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.h" 9 #include "base/message_loop.h"
10 #include "base/shared_memory.h" 10 #include "base/shared_memory.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 } 157 }
158 158
159 void GpuVideoDecodeAcceleratorHost::OnBitstreamBufferProcessed( 159 void GpuVideoDecodeAcceleratorHost::OnBitstreamBufferProcessed(
160 int32 bitstream_buffer_id) { 160 int32 bitstream_buffer_id) {
161 DCHECK(CalledOnValidThread()); 161 DCHECK(CalledOnValidThread());
162 client_->NotifyEndOfBitstreamBuffer(bitstream_buffer_id); 162 client_->NotifyEndOfBitstreamBuffer(bitstream_buffer_id);
163 } 163 }
164 164
165 void GpuVideoDecodeAcceleratorHost::OnProvidePictureBuffer( 165 void GpuVideoDecodeAcceleratorHost::OnProvidePictureBuffer(
166 uint32 num_requested_buffers, 166 uint32 num_requested_buffers,
167 const gfx::Size& buffer_size, 167 const gfx::Size& buffer_size) {
168 int32 mem_type) {
169 DCHECK(CalledOnValidThread()); 168 DCHECK(CalledOnValidThread());
170 media::VideoDecodeAccelerator::MemoryType converted_mem_type = 169 client_->ProvidePictureBuffers(num_requested_buffers, buffer_size);
171 static_cast<media::VideoDecodeAccelerator::MemoryType>(mem_type);
172 client_->ProvidePictureBuffers(
173 num_requested_buffers, buffer_size, converted_mem_type);
174 } 170 }
175 171
176 void GpuVideoDecodeAcceleratorHost::OnDismissPictureBuffer( 172 void GpuVideoDecodeAcceleratorHost::OnDismissPictureBuffer(
177 int32 picture_buffer_id) { 173 int32 picture_buffer_id) {
178 DCHECK(CalledOnValidThread()); 174 DCHECK(CalledOnValidThread());
179 client_->DismissPictureBuffer(picture_buffer_id); 175 client_->DismissPictureBuffer(picture_buffer_id);
180 } 176 }
181 177
182 void GpuVideoDecodeAcceleratorHost::OnInitializeDone() { 178 void GpuVideoDecodeAcceleratorHost::OnInitializeDone() {
183 DCHECK(CalledOnValidThread()); 179 DCHECK(CalledOnValidThread());
184 client_->NotifyInitializeDone(); 180 client_->NotifyInitializeDone();
185 } 181 }
186 182
187 void GpuVideoDecodeAcceleratorHost::OnPictureReady( 183 void GpuVideoDecodeAcceleratorHost::OnPictureReady(
188 int32 picture_buffer_id, int32 bitstream_buffer_id, 184 int32 picture_buffer_id, int32 bitstream_buffer_id) {
189 const gfx::Size& visible_size, const gfx::Size& decoded_size) {
190 DCHECK(CalledOnValidThread()); 185 DCHECK(CalledOnValidThread());
191 media::Picture picture( 186 media::Picture picture(picture_buffer_id, bitstream_buffer_id);
192 picture_buffer_id, bitstream_buffer_id, visible_size, decoded_size);
193 client_->PictureReady(picture); 187 client_->PictureReady(picture);
194 } 188 }
195 189
196 void GpuVideoDecodeAcceleratorHost::OnFlushDone() { 190 void GpuVideoDecodeAcceleratorHost::OnFlushDone() {
197 DCHECK(CalledOnValidThread()); 191 DCHECK(CalledOnValidThread());
198 client_->NotifyFlushDone(); 192 client_->NotifyFlushDone();
199 } 193 }
200 194
201 void GpuVideoDecodeAcceleratorHost::OnResetDone() { 195 void GpuVideoDecodeAcceleratorHost::OnResetDone() {
202 DCHECK(CalledOnValidThread()); 196 DCHECK(CalledOnValidThread());
203 client_->NotifyResetDone(); 197 client_->NotifyResetDone();
204 } 198 }
205 199
206 void GpuVideoDecodeAcceleratorHost::OnEndOfStream() { 200 void GpuVideoDecodeAcceleratorHost::OnEndOfStream() {
207 DCHECK(CalledOnValidThread()); 201 DCHECK(CalledOnValidThread());
208 client_->NotifyEndOfStream(); 202 client_->NotifyEndOfStream();
209 } 203 }
210 204
211 void GpuVideoDecodeAcceleratorHost::OnErrorNotification(uint32 error) { 205 void GpuVideoDecodeAcceleratorHost::OnErrorNotification(uint32 error) {
212 DCHECK(CalledOnValidThread()); 206 DCHECK(CalledOnValidThread());
213 client_->NotifyError( 207 client_->NotifyError(
214 static_cast<media::VideoDecodeAccelerator::Error>(error)); 208 static_cast<media::VideoDecodeAccelerator::Error>(error));
215 } 209 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698