Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: content/renderer/pepper_platform_video_decoder_impl.cc

Issue 7065010: Add initialization callback support for Video Decoder PPAPI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix CR comments Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 } 129 }
133 130
134 void PlatformVideoDecoderImpl::DismissPictureBuffer(int32 picture_buffer_id) { 131 void PlatformVideoDecoderImpl::DismissPictureBuffer(int32 picture_buffer_id) {
135 client_->DismissPictureBuffer(picture_buffer_id); 132 client_->DismissPictureBuffer(picture_buffer_id);
136 } 133 }
137 134
138 void PlatformVideoDecoderImpl::PictureReady(const media::Picture& picture) { 135 void PlatformVideoDecoderImpl::PictureReady(const media::Picture& picture) {
139 client_->PictureReady(picture); 136 client_->PictureReady(picture);
140 } 137 }
141 138
139 void PlatformVideoDecoderImpl::NotifyInitializeDone() {
140 client_->NotifyInitializeDone();
141 }
142
142 void PlatformVideoDecoderImpl::NotifyEndOfBitstreamBuffer( 143 void PlatformVideoDecoderImpl::NotifyEndOfBitstreamBuffer(
143 int32 bitstream_buffer_id) { 144 int32 bitstream_buffer_id) {
144 client_->NotifyEndOfBitstreamBuffer(bitstream_buffer_id); 145 client_->NotifyEndOfBitstreamBuffer(bitstream_buffer_id);
145 } 146 }
146 147
147 void PlatformVideoDecoderImpl::NotifyFlushDone() { 148 void PlatformVideoDecoderImpl::NotifyFlushDone() {
148 client_->NotifyFlushDone(); 149 client_->NotifyFlushDone();
149 } 150 }
150 151
151 void PlatformVideoDecoderImpl::NotifyAbortDone() { 152 void PlatformVideoDecoderImpl::NotifyAbortDone() {
152 client_->NotifyAbortDone(); 153 client_->NotifyAbortDone();
153 } 154 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698