| 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 #ifndef PPAPI_CPP_DEV_VIDEO_DECODER_CLIENT_DEV_H_ | 5 #ifndef PPAPI_CPP_DEV_VIDEO_DECODER_CLIENT_DEV_H_ |
| 6 #define PPAPI_CPP_DEV_VIDEO_DECODER_CLIENT_DEV_H_ | 6 #define PPAPI_CPP_DEV_VIDEO_DECODER_CLIENT_DEV_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/pp_stdint.h" | 8 #include "ppapi/c/pp_stdint.h" |
| 9 #include "ppapi/c/dev/pp_video_dev.h" | 9 #include "ppapi/c/dev/pp_video_dev.h" |
| 10 #include "ppapi/cpp/instance_handle.h" |
| 10 | 11 |
| 11 namespace pp { | 12 namespace pp { |
| 12 | 13 |
| 13 class Instance; | |
| 14 class VideoDecoder_Dev; | 14 class VideoDecoder_Dev; |
| 15 | 15 |
| 16 // This class provides a C++ interface for callbacks related to video decoding. | 16 // This class provides a C++ interface for callbacks related to video decoding. |
| 17 // It is the C++ counterpart to PPP_VideoDecoder_Dev. | 17 // It is the C++ counterpart to PPP_VideoDecoder_Dev. |
| 18 // You would normally use multiple inheritance to derive from this class in your | 18 // You would normally use multiple inheritance to derive from this class in your |
| 19 // instance. | 19 // instance. |
| 20 class VideoDecoderClient_Dev { | 20 class VideoDecoderClient_Dev { |
| 21 public: | 21 public: |
| 22 VideoDecoderClient_Dev(Instance* instance); | 22 VideoDecoderClient_Dev(const InstanceHandle& instance); |
| 23 virtual ~VideoDecoderClient_Dev(); | 23 virtual ~VideoDecoderClient_Dev(); |
| 24 | 24 |
| 25 // Callback to provide buffers for the decoded output pictures. | 25 // Callback to provide buffers for the decoded output pictures. |
| 26 virtual void ProvidePictureBuffers(PP_Resource decoder, | 26 virtual void ProvidePictureBuffers(PP_Resource decoder, |
| 27 uint32_t req_num_of_bufs, | 27 uint32_t req_num_of_bufs, |
| 28 const PP_Size& dimensions) = 0; | 28 const PP_Size& dimensions) = 0; |
| 29 | 29 |
| 30 // Callback for decoder to deliver unneeded picture buffers back to the | 30 // Callback for decoder to deliver unneeded picture buffers back to the |
| 31 // plugin. | 31 // plugin. |
| 32 virtual void DismissPictureBuffer(PP_Resource decoder, | 32 virtual void DismissPictureBuffer(PP_Resource decoder, |
| 33 int32_t picture_buffer_id) = 0; | 33 int32_t picture_buffer_id) = 0; |
| 34 | 34 |
| 35 // Callback to deliver decoded pictures ready to be displayed. | 35 // Callback to deliver decoded pictures ready to be displayed. |
| 36 virtual void PictureReady(PP_Resource decoder, | 36 virtual void PictureReady(PP_Resource decoder, |
| 37 const PP_Picture_Dev& picture) = 0; | 37 const PP_Picture_Dev& picture) = 0; |
| 38 | 38 |
| 39 // Callback to notify about decoding errors. | 39 // Callback to notify about decoding errors. |
| 40 virtual void NotifyError(PP_Resource decoder, | 40 virtual void NotifyError(PP_Resource decoder, |
| 41 PP_VideoDecodeError_Dev error) = 0; | 41 PP_VideoDecodeError_Dev error) = 0; |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 Instance* associated_instance_; | 44 InstanceHandle associated_instance_; |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 } // namespace pp | 47 } // namespace pp |
| 48 | 48 |
| 49 #endif // PPAPI_CPP_DEV_VIDEO_DECODER_CLIENT_DEV_H_ | 49 #endif // PPAPI_CPP_DEV_VIDEO_DECODER_CLIENT_DEV_H_ |
| OLD | NEW |