| 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 <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 Loading... |
| 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[] = { | |
| 239 PP_VIDEOATTR_BITSTREAMFORMATKEY_H264_PROFILE, | |
| 240 PP_H264PROFILE_BASELINE, | |
| 241 PP_VIDEOATTR_DICTIONARY_TERMINATOR, | |
| 242 }; | |
| 243 | |
| 244 assert(video_decoders_.empty()); | 238 assert(video_decoders_.empty()); |
| 245 for (int i = 0; i < kNumDecoders; ++i) { | 239 for (int i = 0; i < kNumDecoders; ++i) { |
| 246 DecoderClient* client = new DecoderClient( | 240 DecoderClient* client = new DecoderClient( |
| 247 this, new pp::VideoDecoder_Dev(*this, *context_, configs)); | 241 this, new pp::VideoDecoder_Dev( |
| 242 this, *context_, PP_VIDEODECODER_H264PROFILE_BASELINE)); |
| 248 assert(!client->decoder()->is_null()); | 243 assert(!client->decoder()->is_null()); |
| 249 assert(video_decoders_.insert(std::make_pair( | 244 assert(video_decoders_.insert(std::make_pair( |
| 250 client->decoder()->pp_resource(), client)).second); | 245 client->decoder()->pp_resource(), client)).second); |
| 251 client->DecodeNextNALUs(); | 246 client->DecodeNextNALUs(); |
| 252 } | 247 } |
| 253 } | 248 } |
| 254 | 249 |
| 255 void GLES2DemoInstance::DecoderClient::DecoderBitstreamDone( | 250 void GLES2DemoInstance::DecoderClient::DecoderBitstreamDone( |
| 256 int32_t result, int bitstream_buffer_id) { | 251 int32_t result, int bitstream_buffer_id) { |
| 257 assert(bitstream_ids_at_decoder_.erase(bitstream_buffer_id) == 1); | 252 assert(bitstream_ids_at_decoder_.erase(bitstream_buffer_id) == 1); |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 gles2_if_->DeleteShader(context_->pp_resource(), shader); | 578 gles2_if_->DeleteShader(context_->pp_resource(), shader); |
| 584 } | 579 } |
| 585 } // anonymous namespace | 580 } // anonymous namespace |
| 586 | 581 |
| 587 namespace pp { | 582 namespace pp { |
| 588 // Factory function for your specialization of the Module object. | 583 // Factory function for your specialization of the Module object. |
| 589 Module* CreateModule() { | 584 Module* CreateModule() { |
| 590 return new GLES2DemoModule(); | 585 return new GLES2DemoModule(); |
| 591 } | 586 } |
| 592 } // namespace pp | 587 } // namespace pp |
| OLD | NEW |