| 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/renderer/media/pepper_platform_video_decoder.h" | 5 #include "content/renderer/media/pepper_platform_video_decoder.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 "content/child/child_process.h" | 9 #include "content/child/child_process.h" |
| 10 #include "content/common/gpu/client/gpu_channel_host.h" | 10 #include "content/common/gpu/client/gpu_channel_host.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 // This is not synchronous, but subsequent IPC messages will be buffered, so | 33 // This is not synchronous, but subsequent IPC messages will be buffered, so |
| 34 // it is okay to immediately send IPC messages through the returned channel. | 34 // it is okay to immediately send IPC messages through the returned channel. |
| 35 GpuChannelHost* channel = | 35 GpuChannelHost* channel = |
| 36 render_thread->EstablishGpuChannelSync( | 36 render_thread->EstablishGpuChannelSync( |
| 37 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); | 37 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); |
| 38 | 38 |
| 39 if (!channel) | 39 if (!channel) |
| 40 return false; | 40 return false; |
| 41 | 41 |
| 42 // Send IPC message to initialize decoder in GPU process. | 42 // Send IPC message to initialize decoder in GPU process. |
| 43 decoder_ = channel->CreateVideoDecoder(command_buffer_route_id_, profile); | 43 decoder_ = channel->CreateVideoDecoder(command_buffer_route_id_); |
| 44 return (decoder_ && decoder_->Initialize(profile, this)); | 44 return (decoder_ && decoder_->Initialize(profile, this)); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void PlatformVideoDecoder::Decode(const BitstreamBuffer& bitstream_buffer) { | 47 void PlatformVideoDecoder::Decode(const BitstreamBuffer& bitstream_buffer) { |
| 48 DCHECK(decoder_.get()); | 48 DCHECK(decoder_.get()); |
| 49 decoder_->Decode(bitstream_buffer); | 49 decoder_->Decode(bitstream_buffer); |
| 50 } | 50 } |
| 51 | 51 |
| 52 void PlatformVideoDecoder::AssignPictureBuffers( | 52 void PlatformVideoDecoder::AssignPictureBuffers( |
| 53 const std::vector<media::PictureBuffer>& buffers) { | 53 const std::vector<media::PictureBuffer>& buffers) { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 void PlatformVideoDecoder::DismissPictureBuffer(int32 picture_buffer_id) { | 95 void PlatformVideoDecoder::DismissPictureBuffer(int32 picture_buffer_id) { |
| 96 DCHECK(RenderThreadImpl::current()); | 96 DCHECK(RenderThreadImpl::current()); |
| 97 client_->DismissPictureBuffer(picture_buffer_id); | 97 client_->DismissPictureBuffer(picture_buffer_id); |
| 98 } | 98 } |
| 99 | 99 |
| 100 void PlatformVideoDecoder::PictureReady(const media::Picture& picture) { | 100 void PlatformVideoDecoder::PictureReady(const media::Picture& picture) { |
| 101 DCHECK(RenderThreadImpl::current()); | 101 DCHECK(RenderThreadImpl::current()); |
| 102 client_->PictureReady(picture); | 102 client_->PictureReady(picture); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void PlatformVideoDecoder::NotifyInitializeDone() { | |
| 106 NOTREACHED() << "GpuVideoDecodeAcceleratorHost::Initialize is synchronous!"; | |
| 107 } | |
| 108 | |
| 109 void PlatformVideoDecoder::NotifyEndOfBitstreamBuffer( | 105 void PlatformVideoDecoder::NotifyEndOfBitstreamBuffer( |
| 110 int32 bitstream_buffer_id) { | 106 int32 bitstream_buffer_id) { |
| 111 DCHECK(RenderThreadImpl::current()); | 107 DCHECK(RenderThreadImpl::current()); |
| 112 client_->NotifyEndOfBitstreamBuffer(bitstream_buffer_id); | 108 client_->NotifyEndOfBitstreamBuffer(bitstream_buffer_id); |
| 113 } | 109 } |
| 114 | 110 |
| 115 void PlatformVideoDecoder::NotifyFlushDone() { | 111 void PlatformVideoDecoder::NotifyFlushDone() { |
| 116 DCHECK(RenderThreadImpl::current()); | 112 DCHECK(RenderThreadImpl::current()); |
| 117 client_->NotifyFlushDone(); | 113 client_->NotifyFlushDone(); |
| 118 } | 114 } |
| 119 | 115 |
| 120 void PlatformVideoDecoder::NotifyResetDone() { | 116 void PlatformVideoDecoder::NotifyResetDone() { |
| 121 DCHECK(RenderThreadImpl::current()); | 117 DCHECK(RenderThreadImpl::current()); |
| 122 client_->NotifyResetDone(); | 118 client_->NotifyResetDone(); |
| 123 } | 119 } |
| 124 | 120 |
| 125 } // namespace content | 121 } // namespace content |
| OLD | NEW |