Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: ppapi/examples/video_decode/video_decode.cc

Issue 10408003: Plumb extra_data() to VideoDecodeAccelerator (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rev interface versino Created 8 years, 7 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
« no previous file with comments | « ppapi/cpp/dev/video_decoder_dev.cc ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ppapi/cpp/dev/video_decoder_dev.cc ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698