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

Side by Side Diff: ppapi/examples/gles2/gles2.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
« no previous file with comments | « ppapi/cpp/dev/video_decoder_dev.cc ('k') | ppapi/proxy/resource_creation_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <string.h> 5 #include <string.h>
6 6
7 #include <iostream> 7 #include <iostream>
8 #include <sstream> 8 #include <sstream>
9 #include <list> 9 #include <list>
10 #include <map> 10 #include <map>
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 return; 206 return;
207 } 207 }
208 position_size_ = position.size(); 208 position_size_ = position.size();
209 209
210 // Initialize graphics. 210 // Initialize graphics.
211 InitGL(); 211 InitGL();
212 InitializeDecoder(); 212 InitializeDecoder();
213 } 213 }
214 214
215 void GLES2DemoInstance::InitializeDecoder() { 215 void GLES2DemoInstance::InitializeDecoder() {
216 PP_VideoConfigElement configs = PP_VIDEOATTR_DICTIONARY_TERMINATOR;
217
216 assert(!video_decoder_); 218 assert(!video_decoder_);
217 video_decoder_ = new pp::VideoDecoder_Dev(*this); 219 video_decoder_ = new pp::VideoDecoder_Dev(*this, *context_, &configs);
220 assert(!video_decoder_->is_null());
218 221
219 PP_VideoConfigElement configs = PP_VIDEOATTR_DICTIONARY_TERMINATOR;
220 pp::CompletionCallback cb =
221 callback_factory_.NewCallback(&GLES2DemoInstance::DecoderInitDone);
222 video_decoder_->Initialize(&configs, *context_, cb);
223 }
224
225 void GLES2DemoInstance::DecoderInitDone(int32_t result) {
226 DecodeNextNALUs(); 222 DecodeNextNALUs();
227 } 223 }
228 224
229 void GLES2DemoInstance::DecoderBitstreamDone( 225 void GLES2DemoInstance::DecoderBitstreamDone(
230 int32_t result, int bitstream_buffer_id) { 226 int32_t result, int bitstream_buffer_id) {
231 assert(bitstream_ids_at_decoder_.erase(bitstream_buffer_id) == 1); 227 assert(bitstream_ids_at_decoder_.erase(bitstream_buffer_id) == 1);
232 BitstreamBufferMap::iterator it = 228 BitstreamBufferMap::iterator it =
233 bitstream_buffers_by_id_.find(bitstream_buffer_id); 229 bitstream_buffers_by_id_.find(bitstream_buffer_id);
234 assert(it != bitstream_buffers_by_id_.end()); 230 assert(it != bitstream_buffers_by_id_.end());
235 delete it->second; 231 delete it->second;
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 gles2_if_->DeleteShader(context_->pp_resource(), shader); 523 gles2_if_->DeleteShader(context_->pp_resource(), shader);
528 } 524 }
529 } // anonymous namespace 525 } // anonymous namespace
530 526
531 namespace pp { 527 namespace pp {
532 // Factory function for your specialization of the Module object. 528 // Factory function for your specialization of the Module object.
533 Module* CreateModule() { 529 Module* CreateModule() {
534 return new GLES2DemoModule(); 530 return new GLES2DemoModule();
535 } 531 }
536 } // namespace pp 532 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/dev/video_decoder_dev.cc ('k') | ppapi/proxy/resource_creation_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698