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 Fri Dec 13 15:21:30 2013. */
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_11 "PPP_VideoDecoder(Dev);0.11"
19 #define PPP_VIDEODECODER_DEV_INTERFACE PPP_VIDEODECODER_DEV_INTERFACE_0_11
23 * This file defines the <code>PPP_VideoDecoder_Dev</code> interface.
28 * @addtogroup Interfaces
32 * PPP_VideoDecoder_Dev structure contains the function pointers that the
33 * plugin MUST implement to provide services needed by the video decoder
36 * See PPB_VideoDecoder_Dev for general usage tips.
38 struct PPP_VideoDecoder_Dev_0_11
{
40 * Callback function to provide buffers for the decoded output pictures. If
41 * succeeds plugin must provide buffers through AssignPictureBuffers function
42 * to the API. If |req_num_of_bufs| matching exactly the specification
43 * given in the parameters cannot be allocated decoder should be destroyed.
45 * Decoding will not proceed until buffers have been provided.
48 * |instance| the plugin instance to which the callback is responding.
49 * |decoder| the PPB_VideoDecoder_Dev resource.
50 * |req_num_of_bufs| tells how many buffers are needed by the decoder.
51 * |dimensions| tells the dimensions of the buffer to allocate.
52 * |texture_target| the type of texture used. Sample targets in use are
53 * TEXTURE_2D (most platforms) and TEXTURE_EXTERNAL_OES (on ARM).
55 void (*ProvidePictureBuffers
)(PP_Instance instance
,
57 uint32_t req_num_of_bufs
,
58 const struct PP_Size
* dimensions
,
59 uint32_t texture_target
);
61 * Callback function for decoder to deliver unneeded picture buffers back to
65 * |instance| the plugin instance to which the callback is responding.
66 * |decoder| the PPB_VideoDecoder_Dev resource.
67 * |picture_buffer| points to the picture buffer that is no longer needed.
69 void (*DismissPictureBuffer
)(PP_Instance instance
,
71 int32_t picture_buffer_id
);
73 * Callback function for decoder to deliver decoded pictures ready to be
74 * displayed. Decoder expects the plugin to return the buffer back to the
75 * decoder through ReusePictureBuffer function in PPB Video Decoder API.
78 * |instance| the plugin instance to which the callback is responding.
79 * |decoder| the PPB_VideoDecoder_Dev resource.
80 * |picture| is the picture that is ready.
82 void (*PictureReady
)(PP_Instance instance
,
84 const struct PP_Picture_Dev
* picture
);
86 * Error handler callback for decoder to deliver information about detected
87 * errors to the plugin.
90 * |instance| the plugin instance to which the callback is responding.
91 * |decoder| the PPB_VideoDecoder_Dev resource.
92 * |error| error is the enumeration specifying the error.
94 void (*NotifyError
)(PP_Instance instance
,
96 PP_VideoDecodeError_Dev error
);
99 typedef struct PPP_VideoDecoder_Dev_0_11 PPP_VideoDecoder_Dev
;
104 #endif /* PPAPI_C_DEV_PPP_VIDEO_DECODER_DEV_H_ */