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