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

Side by Side Diff: ppapi/examples/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 | « ppapi/cpp/video_decoder.h ('k') | ppapi/proxy/video_decoder_resource.cc » ('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 <stdio.h> 5 #include <stdio.h>
6 #include <string.h> 6 #include <string.h>
7 7
8 #include <iostream> 8 #include <iostream>
9 #include <queue> 9 #include <queue>
10 #include <sstream> 10 #include <sstream>
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 switch (event.GetType()) { 423 switch (event.GetType()) {
424 case PP_INPUTEVENT_TYPE_MOUSEDOWN: { 424 case PP_INPUTEVENT_TYPE_MOUSEDOWN: {
425 pp::MouseInputEvent mouse_event(event); 425 pp::MouseInputEvent mouse_event(event);
426 // Reset all decoders on mouse down. 426 // Reset all decoders on mouse down.
427 if (mouse_event.GetButton() == PP_INPUTEVENT_MOUSEBUTTON_LEFT) { 427 if (mouse_event.GetButton() == PP_INPUTEVENT_MOUSEBUTTON_LEFT) {
428 // Reset decoders. 428 // Reset decoders.
429 for (size_t i = 0; i < video_decoders_.size(); i++) { 429 for (size_t i = 0; i < video_decoders_.size(); i++) {
430 if (!video_decoders_[i]->resetting()) 430 if (!video_decoders_[i]->resetting())
431 video_decoders_[i]->Reset(); 431 video_decoders_[i]->Reset();
432 } 432 }
433
434 // Clear pending pictures.
435 while (!pending_pictures_.empty())
436 pending_pictures_.pop();
437 } 433 }
438 return true; 434 return true;
439 } 435 }
440 436
441 default: 437 default:
442 return false; 438 return false;
443 } 439 }
444 } 440 }
445 441
446 void MyInstance::InitializeDecoders() { 442 void MyInstance::InitializeDecoders() {
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 }; 727 };
732 728
733 } // anonymous namespace 729 } // anonymous namespace
734 730
735 namespace pp { 731 namespace pp {
736 // Factory function for your specialization of the Module object. 732 // Factory function for your specialization of the Module object.
737 Module* CreateModule() { 733 Module* CreateModule() {
738 return new MyModule(); 734 return new MyModule();
739 } 735 }
740 } // namespace pp 736 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/video_decoder.h ('k') | ppapi/proxy/video_decoder_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698