- add sources.
[platform/framework/web/crosswalk.git] / src / ppapi / c / dev / ppp_video_decoder_dev.h
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
3  * found in the LICENSE file.
4  */
5
6 /* From dev/ppp_video_decoder_dev.idl modified Tue May 29 10:59:23 2012. */
7
8 #ifndef PPAPI_C_DEV_PPP_VIDEO_DECODER_DEV_H_
9 #define PPAPI_C_DEV_PPP_VIDEO_DECODER_DEV_H_
10
11 #include "ppapi/c/dev/pp_video_dev.h"
12 #include "ppapi/c/pp_instance.h"
13 #include "ppapi/c/pp_macros.h"
14 #include "ppapi/c/pp_resource.h"
15 #include "ppapi/c/pp_size.h"
16 #include "ppapi/c/pp_stdint.h"
17
18 #define PPP_VIDEODECODER_DEV_INTERFACE_0_9 "PPP_VideoDecoder(Dev);0.9"
19 #define PPP_VIDEODECODER_DEV_INTERFACE_0_10 "PPP_VideoDecoder(Dev);0.10"
20 #define PPP_VIDEODECODER_DEV_INTERFACE_0_11 "PPP_VideoDecoder(Dev);0.11"
21 #define PPP_VIDEODECODER_DEV_INTERFACE PPP_VIDEODECODER_DEV_INTERFACE_0_11
22
23 /**
24  * @file
25  * This file defines the <code>PPP_VideoDecoder_Dev</code> interface.
26  */
27
28
29 /**
30  * @addtogroup Interfaces
31  * @{
32  */
33 /**
34  * PPP_VideoDecoder_Dev structure contains the function pointers that the
35  * plugin MUST implement to provide services needed by the video decoder
36  * implementation.
37  *
38  * See PPB_VideoDecoder_Dev for general usage tips.
39  */
40 struct PPP_VideoDecoder_Dev_0_11 {
41   /**
42    * Callback function to provide buffers for the decoded output pictures. If
43    * succeeds plugin must provide buffers through AssignPictureBuffers function
44    * to the API. If |req_num_of_bufs| matching exactly the specification
45    * given in the parameters cannot be allocated decoder should be destroyed.
46    *
47    * Decoding will not proceed until buffers have been provided.
48    *
49    * Parameters:
50    *  |instance| the plugin instance to which the callback is responding.
51    *  |decoder| the PPB_VideoDecoder_Dev resource.
52    *  |req_num_of_bufs| tells how many buffers are needed by the decoder.
53    *  |dimensions| tells the dimensions of the buffer to allocate.
54    *  |texture_target| the type of texture used.
55    */
56   void (*ProvidePictureBuffers)(PP_Instance instance,
57                                 PP_Resource decoder,
58                                 uint32_t req_num_of_bufs,
59                                 const struct PP_Size* dimensions,
60                                 uint32_t texture_target);
61   /**
62    * Callback function for decoder to deliver unneeded picture buffers back to
63    * the plugin.
64    *
65    * Parameters:
66    *  |instance| the plugin instance to which the callback is responding.
67    *  |decoder| the PPB_VideoDecoder_Dev resource.
68    *  |picture_buffer| points to the picture buffer that is no longer needed.
69    */
70   void (*DismissPictureBuffer)(PP_Instance instance,
71                                PP_Resource decoder,
72                                int32_t picture_buffer_id);
73   /**
74    * Callback function for decoder to deliver decoded pictures ready to be
75    * displayed. Decoder expects the plugin to return the buffer back to the
76    * decoder through ReusePictureBuffer function in PPB Video Decoder API.
77    *
78    * Parameters:
79    *  |instance| the plugin instance to which the callback is responding.
80    *  |decoder| the PPB_VideoDecoder_Dev resource.
81    *  |picture| is the picture that is ready.
82    */
83   void (*PictureReady)(PP_Instance instance,
84                        PP_Resource decoder,
85                        const struct PP_Picture_Dev* picture);
86   /**
87    * Error handler callback for decoder to deliver information about detected
88    * errors to the plugin.
89    *
90    * Parameters:
91    *  |instance| the plugin instance to which the callback is responding.
92    *  |decoder| the PPB_VideoDecoder_Dev resource.
93    *  |error| error is the enumeration specifying the error.
94    */
95   void (*NotifyError)(PP_Instance instance,
96                       PP_Resource decoder,
97                       PP_VideoDecodeError_Dev error);
98 };
99
100 typedef struct PPP_VideoDecoder_Dev_0_11 PPP_VideoDecoder_Dev;
101
102 struct PPP_VideoDecoder_Dev_0_9 {
103   void (*ProvidePictureBuffers)(PP_Instance instance,
104                                 PP_Resource decoder,
105                                 uint32_t req_num_of_bufs,
106                                 const struct PP_Size* dimensions);
107   void (*DismissPictureBuffer)(PP_Instance instance,
108                                PP_Resource decoder,
109                                int32_t picture_buffer_id);
110   void (*PictureReady)(PP_Instance instance,
111                        PP_Resource decoder,
112                        const struct PP_Picture_Dev* picture);
113   void (*EndOfStream)(PP_Instance instance, PP_Resource decoder);
114   void (*NotifyError)(PP_Instance instance,
115                       PP_Resource decoder,
116                       PP_VideoDecodeError_Dev error);
117 };
118
119 struct PPP_VideoDecoder_Dev_0_10 {
120   void (*ProvidePictureBuffers)(PP_Instance instance,
121                                 PP_Resource decoder,
122                                 uint32_t req_num_of_bufs,
123                                 const struct PP_Size* dimensions);
124   void (*DismissPictureBuffer)(PP_Instance instance,
125                                PP_Resource decoder,
126                                int32_t picture_buffer_id);
127   void (*PictureReady)(PP_Instance instance,
128                        PP_Resource decoder,
129                        const struct PP_Picture_Dev* picture);
130   void (*NotifyError)(PP_Instance instance,
131                       PP_Resource decoder,
132                       PP_VideoDecodeError_Dev error);
133 };
134 /**
135  * @}
136  */
137
138 #endif  /* PPAPI_C_DEV_PPP_VIDEO_DECODER_DEV_H_ */
139