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.
6 /* From dev/ppp_video_decoder_dev.idl modified Tue May 29 10:59:23 2012. */
8 #ifndef PPAPI_C_DEV_PPP_VIDEO_DECODER_DEV_H_
9 #define PPAPI_C_DEV_PPP_VIDEO_DECODER_DEV_H_
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"
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
25 * This file defines the <code>PPP_VideoDecoder_Dev</code> interface.
30 * @addtogroup Interfaces
34 * PPP_VideoDecoder_Dev structure contains the function pointers that the
35 * plugin MUST implement to provide services needed by the video decoder
38 * See PPB_VideoDecoder_Dev for general usage tips.
40 struct PPP_VideoDecoder_Dev_0_11 {
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.
47 * Decoding will not proceed until buffers have been provided.
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.
56 void (*ProvidePictureBuffers)(PP_Instance instance,
58 uint32_t req_num_of_bufs,
59 const struct PP_Size* dimensions,
60 uint32_t texture_target);
62 * Callback function for decoder to deliver unneeded picture buffers back to
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.
70 void (*DismissPictureBuffer)(PP_Instance instance,
72 int32_t picture_buffer_id);
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.
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.
83 void (*PictureReady)(PP_Instance instance,
85 const struct PP_Picture_Dev* picture);
87 * Error handler callback for decoder to deliver information about detected
88 * errors to the plugin.
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.
95 void (*NotifyError)(PP_Instance instance,
97 PP_VideoDecodeError_Dev error);
100 typedef struct PPP_VideoDecoder_Dev_0_11 PPP_VideoDecoder_Dev;
102 struct PPP_VideoDecoder_Dev_0_9 {
103 void (*ProvidePictureBuffers)(PP_Instance instance,
105 uint32_t req_num_of_bufs,
106 const struct PP_Size* dimensions);
107 void (*DismissPictureBuffer)(PP_Instance instance,
109 int32_t picture_buffer_id);
110 void (*PictureReady)(PP_Instance instance,
112 const struct PP_Picture_Dev* picture);
113 void (*EndOfStream)(PP_Instance instance, PP_Resource decoder);
114 void (*NotifyError)(PP_Instance instance,
116 PP_VideoDecodeError_Dev error);
119 struct PPP_VideoDecoder_Dev_0_10 {
120 void (*ProvidePictureBuffers)(PP_Instance instance,
122 uint32_t req_num_of_bufs,
123 const struct PP_Size* dimensions);
124 void (*DismissPictureBuffer)(PP_Instance instance,
126 int32_t picture_buffer_id);
127 void (*PictureReady)(PP_Instance instance,
129 const struct PP_Picture_Dev* picture);
130 void (*NotifyError)(PP_Instance instance,
132 PP_VideoDecodeError_Dev error);
138 #endif /* PPAPI_C_DEV_PPP_VIDEO_DECODER_DEV_H_ */