| 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/service/gpu_video_decode_accelerator.h" | 5 #include "media/gpu/ipc/service/gpu_video_decode_accelerator.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 // the child thread. VDA is responsible to call PictureReady on the child | 257 // the child thread. VDA is responsible to call PictureReady on the child |
| 258 // thread when a picture buffer is delivered the first time. | 258 // thread when a picture buffer is delivered the first time. |
| 259 if (child_task_runner_->BelongsToCurrentThread()) { | 259 if (child_task_runner_->BelongsToCurrentThread()) { |
| 260 SetTextureCleared(picture); | 260 SetTextureCleared(picture); |
| 261 } else { | 261 } else { |
| 262 DCHECK(io_task_runner_->BelongsToCurrentThread()); | 262 DCHECK(io_task_runner_->BelongsToCurrentThread()); |
| 263 DebugAutoLock auto_lock(debug_uncleared_textures_lock_); | 263 DebugAutoLock auto_lock(debug_uncleared_textures_lock_); |
| 264 DCHECK_EQ(0u, uncleared_textures_.count(picture.picture_buffer_id())); | 264 DCHECK_EQ(0u, uncleared_textures_.count(picture.picture_buffer_id())); |
| 265 } | 265 } |
| 266 | 266 |
| 267 AcceleratedVideoDecoderHostMsg_PictureReady_Params params; | 267 if (!Send(new AcceleratedVideoDecoderHostMsg_PictureReady( |
| 268 params.picture_buffer_id = picture.picture_buffer_id(); | 268 host_route_id_, picture.picture_buffer_id(), |
| 269 params.bitstream_buffer_id = picture.bitstream_buffer_id(); | 269 picture.bitstream_buffer_id(), picture.visible_rect(), |
| 270 params.visible_rect = picture.visible_rect(); | 270 picture.allow_overlay(), picture.size_changed()))) { |
| 271 params.color_space = picture.color_space(); | |
| 272 params.allow_overlay = picture.allow_overlay(); | |
| 273 params.size_changed = picture.size_changed(); | |
| 274 if (!Send(new AcceleratedVideoDecoderHostMsg_PictureReady(host_route_id_, | |
| 275 params))) { | |
| 276 DLOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_PictureReady) failed"; | 271 DLOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_PictureReady) failed"; |
| 277 } | 272 } |
| 278 } | 273 } |
| 279 | 274 |
| 280 void GpuVideoDecodeAccelerator::NotifyEndOfBitstreamBuffer( | 275 void GpuVideoDecodeAccelerator::NotifyEndOfBitstreamBuffer( |
| 281 int32_t bitstream_buffer_id) { | 276 int32_t bitstream_buffer_id) { |
| 282 if (!Send(new AcceleratedVideoDecoderHostMsg_BitstreamBufferProcessed( | 277 if (!Send(new AcceleratedVideoDecoderHostMsg_BitstreamBufferProcessed( |
| 283 host_route_id_, bitstream_buffer_id))) { | 278 host_route_id_, bitstream_buffer_id))) { |
| 284 DLOG(ERROR) | 279 DLOG(ERROR) |
| 285 << "Send(AcceleratedVideoDecoderHostMsg_BitstreamBufferProcessed) " | 280 << "Send(AcceleratedVideoDecoderHostMsg_BitstreamBufferProcessed) " |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 GLenum target = texture_ref->texture()->target(); | 514 GLenum target = texture_ref->texture()->target(); |
| 520 gpu::gles2::TextureManager* texture_manager = | 515 gpu::gles2::TextureManager* texture_manager = |
| 521 stub_->decoder()->GetContextGroup()->texture_manager(); | 516 stub_->decoder()->GetContextGroup()->texture_manager(); |
| 522 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); | 517 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); |
| 523 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true); | 518 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true); |
| 524 } | 519 } |
| 525 uncleared_textures_.erase(it); | 520 uncleared_textures_.erase(it); |
| 526 } | 521 } |
| 527 | 522 |
| 528 } // namespace media | 523 } // namespace media |
| OLD | NEW |