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