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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 make_context_current_)); | 479 make_context_current_)); |
480 #endif | 480 #endif |
481 return decoder; | 481 return decoder; |
482 } | 482 } |
483 | 483 |
484 void GpuVideoDecodeAccelerator::OnSetCdm(int cdm_id) { | 484 void GpuVideoDecodeAccelerator::OnSetCdm(int cdm_id) { |
485 DCHECK(video_decode_accelerator_); | 485 DCHECK(video_decode_accelerator_); |
486 video_decode_accelerator_->SetCdm(cdm_id); | 486 video_decode_accelerator_->SetCdm(cdm_id); |
487 } | 487 } |
488 | 488 |
| 489 void GpuVideoDecodeAccelerator::CallOrPostNotifyError( |
| 490 media::VideoDecodeAccelerator::Error error) { |
| 491 if (child_task_runner_->BelongsToCurrentThread()) { |
| 492 NotifyError(error); |
| 493 } else { |
| 494 child_task_runner_->PostTask( |
| 495 FROM_HERE, base::Bind(&GpuVideoDecodeAccelerator::NotifyError, |
| 496 base::Unretained(this), error)); |
| 497 } |
| 498 } |
| 499 |
489 // Runs on IO thread if video_decode_accelerator_->CanDecodeOnIOThread() is | 500 // Runs on IO thread if video_decode_accelerator_->CanDecodeOnIOThread() is |
490 // true, otherwise on the main thread. | 501 // true, otherwise on the main thread. |
491 void GpuVideoDecodeAccelerator::OnDecode( | 502 void GpuVideoDecodeAccelerator::OnDecode( |
492 const media::BitstreamBuffer& bitstream_buffer) { | 503 const media::BitstreamBuffer& bitstream_buffer) { |
493 DCHECK(video_decode_accelerator_); | 504 DCHECK(video_decode_accelerator_); |
494 video_decode_accelerator_->Decode(bitstream_buffer); | 505 video_decode_accelerator_->Decode(bitstream_buffer); |
495 } | 506 } |
496 | 507 |
497 void GpuVideoDecodeAccelerator::OnAssignPictureBuffers( | 508 void GpuVideoDecodeAccelerator::OnAssignPictureBuffers( |
498 const std::vector<int32_t>& buffer_ids, | 509 const std::vector<int32_t>& buffer_ids, |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 scoped_refptr<gpu::gles2::TextureRef> texture_ref = it->second; | 616 scoped_refptr<gpu::gles2::TextureRef> texture_ref = it->second; |
606 GLenum target = texture_ref->texture()->target(); | 617 GLenum target = texture_ref->texture()->target(); |
607 gpu::gles2::TextureManager* texture_manager = | 618 gpu::gles2::TextureManager* texture_manager = |
608 stub_->decoder()->GetContextGroup()->texture_manager(); | 619 stub_->decoder()->GetContextGroup()->texture_manager(); |
609 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); | 620 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); |
610 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true); | 621 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true); |
611 uncleared_textures_.erase(it); | 622 uncleared_textures_.erase(it); |
612 } | 623 } |
613 | 624 |
614 } // namespace content | 625 } // namespace content |
OLD | NEW |