| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 plugin_size_ = position.size(); | 227 plugin_size_ = position.size(); |
| 228 | 228 |
| 229 // Initialize graphics. | 229 // Initialize graphics. |
| 230 InitGL(); | 230 InitGL(); |
| 231 InitializeDecoders(); | 231 InitializeDecoders(); |
| 232 } | 232 } |
| 233 | 233 |
| 234 void VideoDecodeDemoInstance::InitializeDecoders() { | 234 void VideoDecodeDemoInstance::InitializeDecoders() { |
| 235 assert(video_decoders_.empty()); | 235 assert(video_decoders_.empty()); |
| 236 for (int i = 0; i < kNumDecoders; ++i) { | 236 for (int i = 0; i < kNumDecoders; ++i) { |
| 237 PP_Size frame_size = {0, 0}; |
| 237 DecoderClient* client = new DecoderClient( | 238 DecoderClient* client = new DecoderClient( |
| 238 this, new pp::VideoDecoder_Dev( | 239 this, new pp::VideoDecoder_Dev( |
| 239 this, *context_, PP_VIDEODECODER_H264PROFILE_BASELINE)); | 240 this, *context_, PP_VIDEODECODER_H264PROFILE_BASELINE, frame_size, |
| 241 std::vector<uint8_t>())); |
| 240 assert(!client->decoder()->is_null()); | 242 assert(!client->decoder()->is_null()); |
| 241 assert(video_decoders_.insert(std::make_pair( | 243 assert(video_decoders_.insert(std::make_pair( |
| 242 client->decoder()->pp_resource(), client)).second); | 244 client->decoder()->pp_resource(), client)).second); |
| 243 client->DecodeNextNALUs(); | 245 client->DecodeNextNALUs(); |
| 244 } | 246 } |
| 245 } | 247 } |
| 246 | 248 |
| 247 void VideoDecodeDemoInstance::DecoderClient::DecoderBitstreamDone( | 249 void VideoDecodeDemoInstance::DecoderClient::DecoderBitstreamDone( |
| 248 int32_t result, int bitstream_buffer_id) { | 250 int32_t result, int bitstream_buffer_id) { |
| 249 assert(bitstream_ids_at_decoder_.erase(bitstream_buffer_id) == 1); | 251 assert(bitstream_ids_at_decoder_.erase(bitstream_buffer_id) == 1); |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 gles2_if_->DeleteShader(context_->pp_resource(), shader); | 578 gles2_if_->DeleteShader(context_->pp_resource(), shader); |
| 577 } | 579 } |
| 578 } // anonymous namespace | 580 } // anonymous namespace |
| 579 | 581 |
| 580 namespace pp { | 582 namespace pp { |
| 581 // Factory function for your specialization of the Module object. | 583 // Factory function for your specialization of the Module object. |
| 582 Module* CreateModule() { | 584 Module* CreateModule() { |
| 583 return new VideoDecodeDemoModule(); | 585 return new VideoDecodeDemoModule(); |
| 584 } | 586 } |
| 585 } // namespace pp | 587 } // namespace pp |
| OLD | NEW |