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

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

Issue 7474006: PPB_VideoDecoder_Dev::Initialize is now synchronous! (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: vrk CR update. Created 9 years, 4 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 28 matching lines...) Expand all
39 content::CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); 39 content::CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE);
40 40
41 if (!channel) 41 if (!channel)
42 return false; 42 return false;
43 43
44 DCHECK_EQ(channel->state(), GpuChannelHost::kConnected); 44 DCHECK_EQ(channel->state(), GpuChannelHost::kConnected);
45 45
46 // Send IPC message to initialize decoder in GPU process. 46 // Send IPC message to initialize decoder in GPU process.
47 decoder_ = channel->CreateVideoDecoder( 47 decoder_ = channel->CreateVideoDecoder(
48 command_buffer_route_id_, configs, this); 48 command_buffer_route_id_, configs, this);
49 return true; 49 return decoder_.get() != NULL;
50 } 50 }
51 51
52 void PlatformVideoDecoderImpl::Decode(const BitstreamBuffer& bitstream_buffer) { 52 void PlatformVideoDecoderImpl::Decode(const BitstreamBuffer& bitstream_buffer) {
53 DCHECK(decoder_); 53 DCHECK(decoder_);
54 decoder_->Decode(bitstream_buffer); 54 decoder_->Decode(bitstream_buffer);
55 } 55 }
56 56
57 void PlatformVideoDecoderImpl::AssignPictureBuffers( 57 void PlatformVideoDecoderImpl::AssignPictureBuffers(
58 const std::vector<media::PictureBuffer>& buffers) { 58 const std::vector<media::PictureBuffer>& buffers) {
59 DCHECK(decoder_); 59 DCHECK(decoder_);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 DCHECK_EQ(RenderThread::current()->message_loop(), MessageLoop::current()); 105 DCHECK_EQ(RenderThread::current()->message_loop(), MessageLoop::current());
106 client_->DismissPictureBuffer(picture_buffer_id); 106 client_->DismissPictureBuffer(picture_buffer_id);
107 } 107 }
108 108
109 void PlatformVideoDecoderImpl::PictureReady(const media::Picture& picture) { 109 void PlatformVideoDecoderImpl::PictureReady(const media::Picture& picture) {
110 DCHECK_EQ(RenderThread::current()->message_loop(), MessageLoop::current()); 110 DCHECK_EQ(RenderThread::current()->message_loop(), MessageLoop::current());
111 client_->PictureReady(picture); 111 client_->PictureReady(picture);
112 } 112 }
113 113
114 void PlatformVideoDecoderImpl::NotifyInitializeDone() { 114 void PlatformVideoDecoderImpl::NotifyInitializeDone() {
115 DCHECK_EQ(RenderThread::current()->message_loop(), MessageLoop::current()); 115 NOTREACHED() << "GpuVideoDecodeAcceleratorHost::Initialize is synchronous!";
116 client_->NotifyInitializeDone();
117 } 116 }
118 117
119 void PlatformVideoDecoderImpl::NotifyEndOfBitstreamBuffer( 118 void PlatformVideoDecoderImpl::NotifyEndOfBitstreamBuffer(
120 int32 bitstream_buffer_id) { 119 int32 bitstream_buffer_id) {
121 DCHECK_EQ(RenderThread::current()->message_loop(), MessageLoop::current()); 120 DCHECK_EQ(RenderThread::current()->message_loop(), MessageLoop::current());
122 client_->NotifyEndOfBitstreamBuffer(bitstream_buffer_id); 121 client_->NotifyEndOfBitstreamBuffer(bitstream_buffer_id);
123 } 122 }
124 123
125 void PlatformVideoDecoderImpl::NotifyFlushDone() { 124 void PlatformVideoDecoderImpl::NotifyFlushDone() {
126 DCHECK_EQ(RenderThread::current()->message_loop(), MessageLoop::current()); 125 DCHECK_EQ(RenderThread::current()->message_loop(), MessageLoop::current());
127 client_->NotifyFlushDone(); 126 client_->NotifyFlushDone();
128 } 127 }
129 128
130 void PlatformVideoDecoderImpl::NotifyResetDone() { 129 void PlatformVideoDecoderImpl::NotifyResetDone() {
131 DCHECK_EQ(RenderThread::current()->message_loop(), MessageLoop::current()); 130 DCHECK_EQ(RenderThread::current()->message_loop(), MessageLoop::current());
132 client_->NotifyResetDone(); 131 client_->NotifyResetDone();
133 } 132 }
OLDNEW
« no previous file with comments | « content/renderer/gpu/gpu_video_decode_accelerator_host.cc ('k') | ppapi/c/dev/ppb_video_decoder_dev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698