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

Side by Side Diff: native_client_sdk/src/examples/api/video_decode/video_decode.cc

Issue 390213002: Pepper: Change PPB_VideoDecoder::Reset behavior so plugin always manages textures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « content/renderer/pepper/video_decoder_shim.cc ('k') | ppapi/api/ppb_video_decoder.idl » ('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) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 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 <GLES2/gl2.h> 5 #include <GLES2/gl2.h>
6 #include <GLES2/gl2ext.h> 6 #include <GLES2/gl2ext.h>
7 #include <stdio.h> 7 #include <stdio.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include <iostream> 10 #include <iostream>
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 switch (event.GetType()) { 422 switch (event.GetType()) {
423 case PP_INPUTEVENT_TYPE_MOUSEDOWN: { 423 case PP_INPUTEVENT_TYPE_MOUSEDOWN: {
424 pp::MouseInputEvent mouse_event(event); 424 pp::MouseInputEvent mouse_event(event);
425 // Reset all decoders on mouse down. 425 // Reset all decoders on mouse down.
426 if (mouse_event.GetButton() == PP_INPUTEVENT_MOUSEBUTTON_LEFT) { 426 if (mouse_event.GetButton() == PP_INPUTEVENT_MOUSEBUTTON_LEFT) {
427 // Reset decoders. 427 // Reset decoders.
428 for (size_t i = 0; i < video_decoders_.size(); i++) { 428 for (size_t i = 0; i < video_decoders_.size(); i++) {
429 if (!video_decoders_[i]->resetting()) 429 if (!video_decoders_[i]->resetting())
430 video_decoders_[i]->Reset(); 430 video_decoders_[i]->Reset();
431 } 431 }
432
433 // Clear pending pictures.
434 while (!pending_pictures_.empty())
435 pending_pictures_.pop();
436 } 432 }
437 return true; 433 return true;
438 } 434 }
439 435
440 default: 436 default:
441 return false; 437 return false;
442 } 438 }
443 } 439 }
444 440
445 void MyInstance::InitializeDecoders() { 441 void MyInstance::InitializeDecoders() {
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 }; 726 };
731 727
732 } // anonymous namespace 728 } // anonymous namespace
733 729
734 namespace pp { 730 namespace pp {
735 // Factory function for your specialization of the Module object. 731 // Factory function for your specialization of the Module object.
736 Module* CreateModule() { 732 Module* CreateModule() {
737 return new MyModule(); 733 return new MyModule();
738 } 734 }
739 } // namespace pp 735 } // namespace pp
OLDNEW
« no previous file with comments | « content/renderer/pepper/video_decoder_shim.cc ('k') | ppapi/api/ppb_video_decoder.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698