OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/pepper_platform_video_decoder_impl.h" | 5 #include "content/renderer/pepper_platform_video_decoder_impl.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 channel_ = render_thread->EstablishGpuChannelSync( | 44 channel_ = render_thread->EstablishGpuChannelSync( |
45 content::CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); | 45 content::CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); |
46 | 46 |
47 if (!channel_.get()) | 47 if (!channel_.get()) |
48 return false; | 48 return false; |
49 | 49 |
50 DCHECK_EQ(channel_->state(), GpuChannelHost::kConnected); | 50 DCHECK_EQ(channel_->state(), GpuChannelHost::kConnected); |
51 | 51 |
52 // Set a callback to ensure decoder is only initialized after channel is | 52 // Set a callback to ensure decoder is only initialized after channel is |
53 // connected and GpuVidoServiceHost message filter is added to channel. | 53 // connected and GpuVidoServiceHost message filter is added to channel. |
54 // | |
55 // TODO(vrk): Initialize should take a callback to be called (on the | |
56 // renderer's thread) when initialization is completed. | |
57 base::Closure initialize = base::Bind( | 54 base::Closure initialize = base::Bind( |
58 &PlatformVideoDecoderImpl::InitializeDecoder, | 55 &PlatformVideoDecoderImpl::InitializeDecoder, |
59 base::Unretained(this), | 56 base::Unretained(this), |
60 config); | 57 config); |
61 | 58 |
62 GpuVideoServiceHost* video_service = channel_->gpu_video_service_host(); | 59 GpuVideoServiceHost* video_service = channel_->gpu_video_service_host(); |
63 video_service->SetOnInitialized(initialize); | 60 video_service->SetOnInitialized(initialize); |
64 return true; | 61 return true; |
65 } | 62 } |
66 | 63 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 } | 127 } |
131 | 128 |
132 void PlatformVideoDecoderImpl::DismissPictureBuffer(int32 picture_buffer_id) { | 129 void PlatformVideoDecoderImpl::DismissPictureBuffer(int32 picture_buffer_id) { |
133 client_->DismissPictureBuffer(picture_buffer_id); | 130 client_->DismissPictureBuffer(picture_buffer_id); |
134 } | 131 } |
135 | 132 |
136 void PlatformVideoDecoderImpl::PictureReady(const media::Picture& picture) { | 133 void PlatformVideoDecoderImpl::PictureReady(const media::Picture& picture) { |
137 client_->PictureReady(picture); | 134 client_->PictureReady(picture); |
138 } | 135 } |
139 | 136 |
| 137 void PlatformVideoDecoderImpl::NotifyInitializeDone() { |
| 138 client_->NotifyInitializeDone(); |
| 139 } |
| 140 |
140 void PlatformVideoDecoderImpl::NotifyEndOfBitstreamBuffer( | 141 void PlatformVideoDecoderImpl::NotifyEndOfBitstreamBuffer( |
141 int32 bitstream_buffer_id) { | 142 int32 bitstream_buffer_id) { |
142 client_->NotifyEndOfBitstreamBuffer(bitstream_buffer_id); | 143 client_->NotifyEndOfBitstreamBuffer(bitstream_buffer_id); |
143 } | 144 } |
144 | 145 |
145 void PlatformVideoDecoderImpl::NotifyFlushDone() { | 146 void PlatformVideoDecoderImpl::NotifyFlushDone() { |
146 client_->NotifyFlushDone(); | 147 client_->NotifyFlushDone(); |
147 } | 148 } |
148 | 149 |
149 void PlatformVideoDecoderImpl::NotifyAbortDone() { | 150 void PlatformVideoDecoderImpl::NotifyAbortDone() { |
150 client_->NotifyAbortDone(); | 151 client_->NotifyAbortDone(); |
151 } | 152 } |
OLD | NEW |