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

Side by Side Diff: content/common/gpu/gpu_video_decode_accelerator.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: cleanup Created 9 years, 7 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/common/gpu/gpu_video_decode_accelerator.h" 5 #include "content/common/gpu/gpu_video_decode_accelerator.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 void GpuVideoDecodeAccelerator::OnChannelConnected(int32 peer_pid) { 46 void GpuVideoDecodeAccelerator::OnChannelConnected(int32 peer_pid) {
47 // TODO(vmr): Do we have to react on channel connections? 47 // TODO(vmr): Do we have to react on channel connections?
48 } 48 }
49 49
50 void GpuVideoDecodeAccelerator::OnChannelError() { 50 void GpuVideoDecodeAccelerator::OnChannelError() {
51 // TODO(vmr): Do we have to react on channel errors? 51 // TODO(vmr): Do we have to react on channel errors?
52 } 52 }
53 53
54 void GpuVideoDecodeAccelerator::ProvidePictureBuffers( 54 void GpuVideoDecodeAccelerator::ProvidePictureBuffers(
55 uint32 requested_num_of_buffers, 55 uint32 requested_num_of_buffers, const gfx::Size& dimensions) {
56 const gfx::Size& dimensions,
57 media::VideoDecodeAccelerator::MemoryType type) {
58 if (!Send(new AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers( 56 if (!Send(new AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers(
59 route_id_, requested_num_of_buffers, dimensions, type))) { 57 route_id_, requested_num_of_buffers, dimensions))) {
60 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers) " 58 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers) "
61 << "failed"; 59 << "failed";
62 } 60 }
63 } 61 }
64 62
65 void GpuVideoDecodeAccelerator::DismissPictureBuffer( 63 void GpuVideoDecodeAccelerator::DismissPictureBuffer(
66 int32 picture_buffer_id) { 64 int32 picture_buffer_id) {
67 // TODO(vrk): Unmap picture buffer. 65 // TODO(vrk): Unmap picture buffer.
68 NOTIMPLEMENTED(); 66 NOTIMPLEMENTED();
69 67
70 // Notify client that picture buffer is now unused. 68 // Notify client that picture buffer is now unused.
71 if (!Send(new AcceleratedVideoDecoderHostMsg_DismissPictureBuffer( 69 if (!Send(new AcceleratedVideoDecoderHostMsg_DismissPictureBuffer(
72 route_id_, picture_buffer_id))) { 70 route_id_, picture_buffer_id))) {
73 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_DismissPictureBuffer) " 71 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_DismissPictureBuffer) "
74 << "failed"; 72 << "failed";
75 } 73 }
76 } 74 }
77 75
78 void GpuVideoDecodeAccelerator::PictureReady( 76 void GpuVideoDecodeAccelerator::PictureReady(
79 const media::Picture& picture) { 77 const media::Picture& picture) {
80 if (!Send(new AcceleratedVideoDecoderHostMsg_PictureReady( 78 if (!Send(new AcceleratedVideoDecoderHostMsg_PictureReady(
81 route_id_, 79 route_id_,
82 picture.picture_buffer_id(), 80 picture.picture_buffer_id(),
83 picture.bitstream_buffer_id(), 81 picture.bitstream_buffer_id()))) {
84 picture.visible_size(),
85 picture.decoded_size()))) {
86 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_PictureReady) failed"; 82 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_PictureReady) failed";
87 } 83 }
88 } 84 }
89 85
90 void GpuVideoDecodeAccelerator::NotifyEndOfStream() { 86 void GpuVideoDecodeAccelerator::NotifyEndOfStream() {
91 Send(new AcceleratedVideoDecoderHostMsg_EndOfStream(route_id_)); 87 Send(new AcceleratedVideoDecoderHostMsg_EndOfStream(route_id_));
92 } 88 }
93 89
94 void GpuVideoDecodeAccelerator::NotifyError( 90 void GpuVideoDecodeAccelerator::NotifyError(
95 media::VideoDecodeAccelerator::Error error) { 91 media::VideoDecodeAccelerator::Error error) {
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 171
176 void GpuVideoDecodeAccelerator::NotifyAbortDone() { 172 void GpuVideoDecodeAccelerator::NotifyAbortDone() {
177 if (!Send(new AcceleratedVideoDecoderHostMsg_AbortDone(route_id_))) 173 if (!Send(new AcceleratedVideoDecoderHostMsg_AbortDone(route_id_)))
178 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_AbortDone) failed"; 174 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_AbortDone) failed";
179 } 175 }
180 176
181 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { 177 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) {
182 DCHECK(sender_); 178 DCHECK(sender_);
183 return sender_->Send(message); 179 return sender_->Send(message);
184 } 180 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698