OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |