| 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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 assert(!video_decoder_); | 216 assert(!video_decoder_); |
| 217 video_decoder_ = new pp::VideoDecoder_Dev(*this); | 217 video_decoder_ = new pp::VideoDecoder_Dev(*this); |
| 218 | 218 |
| 219 PP_VideoConfigElement configs = PP_VIDEOATTR_DICTIONARY_TERMINATOR; | 219 PP_VideoConfigElement configs = PP_VIDEOATTR_DICTIONARY_TERMINATOR; |
| 220 pp::CompletionCallback cb = | 220 assert(video_decoder_->Initialize(&configs, *context_) == PP_OK); |
| 221 callback_factory_.NewCallback(&GLES2DemoInstance::DecoderInitDone); | |
| 222 video_decoder_->Initialize(&configs, *context_, cb); | |
| 223 } | |
| 224 | |
| 225 void GLES2DemoInstance::DecoderInitDone(int32_t result) { | |
| 226 DecodeNextNALUs(); | 221 DecodeNextNALUs(); |
| 227 } | 222 } |
| 228 | 223 |
| 229 void GLES2DemoInstance::DecoderBitstreamDone( | 224 void GLES2DemoInstance::DecoderBitstreamDone( |
| 230 int32_t result, int bitstream_buffer_id) { | 225 int32_t result, int bitstream_buffer_id) { |
| 231 assert(bitstream_ids_at_decoder_.erase(bitstream_buffer_id) == 1); | 226 assert(bitstream_ids_at_decoder_.erase(bitstream_buffer_id) == 1); |
| 232 BitstreamBufferMap::iterator it = | 227 BitstreamBufferMap::iterator it = |
| 233 bitstream_buffers_by_id_.find(bitstream_buffer_id); | 228 bitstream_buffers_by_id_.find(bitstream_buffer_id); |
| 234 assert(it != bitstream_buffers_by_id_.end()); | 229 assert(it != bitstream_buffers_by_id_.end()); |
| 235 delete it->second; | 230 delete it->second; |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 gles2_if_->DeleteShader(context_->pp_resource(), shader); | 522 gles2_if_->DeleteShader(context_->pp_resource(), shader); |
| 528 } | 523 } |
| 529 } // anonymous namespace | 524 } // anonymous namespace |
| 530 | 525 |
| 531 namespace pp { | 526 namespace pp { |
| 532 // Factory function for your specialization of the Module object. | 527 // Factory function for your specialization of the Module object. |
| 533 Module* CreateModule() { | 528 Module* CreateModule() { |
| 534 return new GLES2DemoModule(); | 529 return new GLES2DemoModule(); |
| 535 } | 530 } |
| 536 } // namespace pp | 531 } // namespace pp |
| OLD | NEW |