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: ppapi/examples/gles2/gles2.cc

Issue 7779001: Replace the use of an int32* with a proper struct for decoder configuration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 9 years, 3 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 <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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 return; 228 return;
229 } 229 }
230 plugin_size_ = position.size(); 230 plugin_size_ = position.size();
231 231
232 // Initialize graphics. 232 // Initialize graphics.
233 InitGL(); 233 InitGL();
234 InitializeDecoders(); 234 InitializeDecoders();
235 } 235 }
236 236
237 void GLES2DemoInstance::InitializeDecoders() { 237 void GLES2DemoInstance::InitializeDecoders() {
238 PP_VideoConfigElement configs[] = { 238 PP_VideoDecoderConfig_Dev config;
239 PP_VIDEOATTR_BITSTREAMFORMATKEY_H264_PROFILE, 239 config.format = PP_VideoDecoderConfig_Dev::H264;
240 PP_H264PROFILE_BASELINE, 240 config.h264_profile = PP_VideoDecoderConfig_Dev::H264PROFILE_BASELINE;
241 PP_VIDEOATTR_DICTIONARY_TERMINATOR,
242 };
243 241
244 assert(video_decoders_.empty()); 242 assert(video_decoders_.empty());
245 for (int i = 0; i < kNumDecoders; ++i) { 243 for (int i = 0; i < kNumDecoders; ++i) {
246 DecoderClient* client = new DecoderClient( 244 DecoderClient* client = new DecoderClient(
247 this, new pp::VideoDecoder_Dev(*this, *context_, configs)); 245 this, new pp::VideoDecoder_Dev(*this, *context_, config));
248 assert(!client->decoder()->is_null()); 246 assert(!client->decoder()->is_null());
249 assert(video_decoders_.insert(std::make_pair( 247 assert(video_decoders_.insert(std::make_pair(
250 client->decoder()->pp_resource(), client)).second); 248 client->decoder()->pp_resource(), client)).second);
251 client->DecodeNextNALUs(); 249 client->DecodeNextNALUs();
252 } 250 }
253 } 251 }
254 252
255 void GLES2DemoInstance::DecoderClient::DecoderBitstreamDone( 253 void GLES2DemoInstance::DecoderClient::DecoderBitstreamDone(
256 int32_t result, int bitstream_buffer_id) { 254 int32_t result, int bitstream_buffer_id) {
257 assert(bitstream_ids_at_decoder_.erase(bitstream_buffer_id) == 1); 255 assert(bitstream_ids_at_decoder_.erase(bitstream_buffer_id) == 1);
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 gles2_if_->DeleteShader(context_->pp_resource(), shader); 581 gles2_if_->DeleteShader(context_->pp_resource(), shader);
584 } 582 }
585 } // anonymous namespace 583 } // anonymous namespace
586 584
587 namespace pp { 585 namespace pp {
588 // Factory function for your specialization of the Module object. 586 // Factory function for your specialization of the Module object.
589 Module* CreateModule() { 587 Module* CreateModule() {
590 return new GLES2DemoModule(); 588 return new GLES2DemoModule();
591 } 589 }
592 } // namespace pp 590 } // namespace pp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698