OLD | NEW |
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // pp::Instance implementation (see PPP_Instance). | 63 // pp::Instance implementation (see PPP_Instance). |
64 virtual void DidChangeView(const pp::Rect& position, | 64 virtual void DidChangeView(const pp::Rect& position, |
65 const pp::Rect& clip_ignored); | 65 const pp::Rect& clip_ignored); |
66 | 66 |
67 // pp::Graphics3DClient implementation. | 67 // pp::Graphics3DClient implementation. |
68 virtual void Graphics3DContextLost() { | 68 virtual void Graphics3DContextLost() { |
69 // TODO(vrk/fischman): Properly reset after a lost graphics context. In | 69 // TODO(vrk/fischman): Properly reset after a lost graphics context. In |
70 // particular need to delete context_ and re-create textures. | 70 // particular need to delete context_ and re-create textures. |
71 // Probably have to recreate the decoder from scratch, because old textures | 71 // Probably have to recreate the decoder from scratch, because old textures |
72 // can still be outstanding in the decoder! | 72 // can still be outstanding in the decoder! |
73 assert(!"Unexpectedly lost graphics context"); | 73 assert(false && "Unexpectedly lost graphics context"); |
74 } | 74 } |
75 | 75 |
76 // pp::VideoDecoderClient_Dev implementation. | 76 // pp::VideoDecoderClient_Dev implementation. |
77 virtual void ProvidePictureBuffers( | 77 virtual void ProvidePictureBuffers( |
78 PP_Resource decoder, | 78 PP_Resource decoder, |
79 uint32_t req_num_of_bufs, | 79 uint32_t req_num_of_bufs, |
80 const PP_Size& dimensions, | 80 const PP_Size& dimensions, |
81 uint32_t texture_target); | 81 uint32_t texture_target); |
82 virtual void DismissPictureBuffer(PP_Resource decoder, | 82 virtual void DismissPictureBuffer(PP_Resource decoder, |
83 int32_t picture_buffer_id); | 83 int32_t picture_buffer_id); |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 pp::CompletionCallback cb = | 454 pp::CompletionCallback cb = |
455 callback_factory_.NewCallback( | 455 callback_factory_.NewCallback( |
456 &VideoDecodeDemoInstance::PaintFinished, decoder, info.buffer.id); | 456 &VideoDecodeDemoInstance::PaintFinished, decoder, info.buffer.id); |
457 last_swap_request_ticks_ = core_if_->GetTimeTicks(); | 457 last_swap_request_ticks_ = core_if_->GetTimeTicks(); |
458 assert(context_->SwapBuffers(cb) == PP_OK_COMPLETIONPENDING); | 458 assert(context_->SwapBuffers(cb) == PP_OK_COMPLETIONPENDING); |
459 } | 459 } |
460 | 460 |
461 void VideoDecodeDemoInstance::NotifyError(PP_Resource decoder, | 461 void VideoDecodeDemoInstance::NotifyError(PP_Resource decoder, |
462 PP_VideoDecodeError_Dev error) { | 462 PP_VideoDecodeError_Dev error) { |
463 LogError(this).s() << "Received error: " << error; | 463 LogError(this).s() << "Received error: " << error; |
464 assert(!"Unexpected error; see stderr for details"); | 464 assert(false && "Unexpected error; see stderr for details"); |
465 } | 465 } |
466 | 466 |
467 // This object is the global object representing this plugin library as long | 467 // This object is the global object representing this plugin library as long |
468 // as it is loaded. | 468 // as it is loaded. |
469 class VideoDecodeDemoModule : public pp::Module { | 469 class VideoDecodeDemoModule : public pp::Module { |
470 public: | 470 public: |
471 VideoDecodeDemoModule() : pp::Module() {} | 471 VideoDecodeDemoModule() : pp::Module() {} |
472 virtual ~VideoDecodeDemoModule() {} | 472 virtual ~VideoDecodeDemoModule() {} |
473 | 473 |
474 virtual pp::Instance* CreateInstance(PP_Instance instance) { | 474 virtual pp::Instance* CreateInstance(PP_Instance instance) { |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 gles2_if_->DeleteShader(context_->pp_resource(), shader); | 675 gles2_if_->DeleteShader(context_->pp_resource(), shader); |
676 } | 676 } |
677 } // anonymous namespace | 677 } // anonymous namespace |
678 | 678 |
679 namespace pp { | 679 namespace pp { |
680 // Factory function for your specialization of the Module object. | 680 // Factory function for your specialization of the Module object. |
681 Module* CreateModule() { | 681 Module* CreateModule() { |
682 return new VideoDecodeDemoModule(); | 682 return new VideoDecodeDemoModule(); |
683 } | 683 } |
684 } // namespace pp | 684 } // namespace pp |
OLD | NEW |