OLD | NEW |
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 "media/gpu/ipc/client/gpu_video_decode_accelerator_host.h" | 5 #include "media/gpu/ipc/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/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 std::vector<PictureBuffer::TextureIds> texture_ids; | 126 std::vector<PictureBuffer::TextureIds> texture_ids; |
127 for (uint32_t i = 0; i < buffers.size(); i++) { | 127 for (uint32_t i = 0; i < buffers.size(); i++) { |
128 const PictureBuffer& buffer = buffers[i]; | 128 const PictureBuffer& buffer = buffers[i]; |
129 if (buffer.size() != picture_buffer_dimensions_) { | 129 if (buffer.size() != picture_buffer_dimensions_) { |
130 DLOG(ERROR) << "buffer.size() invalid: expected " | 130 DLOG(ERROR) << "buffer.size() invalid: expected " |
131 << picture_buffer_dimensions_.ToString() << ", got " | 131 << picture_buffer_dimensions_.ToString() << ", got " |
132 << buffer.size().ToString(); | 132 << buffer.size().ToString(); |
133 PostNotifyError(INVALID_ARGUMENT); | 133 PostNotifyError(INVALID_ARGUMENT); |
134 return; | 134 return; |
135 } | 135 } |
136 texture_ids.push_back(buffer.texture_ids()); | 136 texture_ids.push_back(buffer.client_texture_ids()); |
137 buffer_ids.push_back(buffer.id()); | 137 buffer_ids.push_back(buffer.id()); |
138 } | 138 } |
139 Send(new AcceleratedVideoDecoderMsg_AssignPictureBuffers( | 139 Send(new AcceleratedVideoDecoderMsg_AssignPictureBuffers( |
140 decoder_route_id_, buffer_ids, texture_ids)); | 140 decoder_route_id_, buffer_ids, texture_ids)); |
141 } | 141 } |
142 | 142 |
143 void GpuVideoDecodeAcceleratorHost::ReusePictureBuffer( | 143 void GpuVideoDecodeAcceleratorHost::ReusePictureBuffer( |
144 int32_t picture_buffer_id) { | 144 int32_t picture_buffer_id) { |
145 DCHECK(CalledOnValidThread()); | 145 DCHECK(CalledOnValidThread()); |
146 if (!channel_) | 146 if (!channel_) |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 weak_this_factory_.InvalidateWeakPtrs(); | 272 weak_this_factory_.InvalidateWeakPtrs(); |
273 | 273 |
274 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the | 274 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the |
275 // last thing done on this stack! | 275 // last thing done on this stack! |
276 VideoDecodeAccelerator::Client* client = NULL; | 276 VideoDecodeAccelerator::Client* client = NULL; |
277 std::swap(client, client_); | 277 std::swap(client, client_); |
278 client->NotifyError(static_cast<VideoDecodeAccelerator::Error>(error)); | 278 client->NotifyError(static_cast<VideoDecodeAccelerator::Error>(error)); |
279 } | 279 } |
280 | 280 |
281 } // namespace media | 281 } // namespace media |
OLD | NEW |