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 "content/common/gpu/media/gpu_video_decode_accelerator.h" | 5 #include "content/common/gpu/media/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/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 // So we have to wait for the RemoveFilter callback here instead and remove | 452 // So we have to wait for the RemoveFilter callback here instead and remove |
453 // the VDA after it arrives and before returning. | 453 // the VDA after it arrives and before returning. |
454 if (filter_.get()) { | 454 if (filter_.get()) { |
455 stub_->channel()->RemoveFilter(filter_.get()); | 455 stub_->channel()->RemoveFilter(filter_.get()); |
456 filter_removed_.Wait(); | 456 filter_removed_.Wait(); |
457 } | 457 } |
458 | 458 |
459 stub_->channel()->RemoveRoute(host_route_id_); | 459 stub_->channel()->RemoveRoute(host_route_id_); |
460 stub_->RemoveDestructionObserver(this); | 460 stub_->RemoveDestructionObserver(this); |
461 | 461 |
462 if (video_decode_accelerator_) | |
463 video_decode_accelerator_.release()->Destroy(); | |
464 | |
465 delete this; | 462 delete this; |
466 } | 463 } |
467 | 464 |
468 void GpuVideoDecodeAccelerator::SetTextureCleared( | 465 void GpuVideoDecodeAccelerator::SetTextureCleared( |
469 const media::Picture& picture) { | 466 const media::Picture& picture) { |
470 DCHECK(child_message_loop_->BelongsToCurrentThread()); | 467 DCHECK(child_message_loop_->BelongsToCurrentThread()); |
471 DebugAutoLock auto_lock(debug_uncleared_textures_lock_); | 468 DebugAutoLock auto_lock(debug_uncleared_textures_lock_); |
472 std::map<int32, scoped_refptr<gpu::gles2::TextureRef> >::iterator it; | 469 std::map<int32, scoped_refptr<gpu::gles2::TextureRef> >::iterator it; |
473 it = uncleared_textures_.find(picture.picture_buffer_id()); | 470 it = uncleared_textures_.find(picture.picture_buffer_id()); |
474 if (it == uncleared_textures_.end()) | 471 if (it == uncleared_textures_.end()) |
(...skipping 15 matching lines...) Expand all Loading... |
490 return stub_->channel()->Send(message); | 487 return stub_->channel()->Send(message); |
491 } | 488 } |
492 | 489 |
493 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, | 490 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, |
494 bool succeeded) { | 491 bool succeeded) { |
495 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); | 492 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); |
496 Send(message); | 493 Send(message); |
497 } | 494 } |
498 | 495 |
499 } // namespace content | 496 } // namespace content |
OLD | NEW |