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.
7 * This file defines the <code>PPP_VideoDecoder_Dev</code> interface.
16 * PPP_VideoDecoder_Dev structure contains the function pointers that the
17 * plugin MUST implement to provide services needed by the video decoder
20 * See PPB_VideoDecoder_Dev for general usage tips.
22 interface PPP_VideoDecoder_Dev
{
24 * Callback function to provide buffers for the decoded output pictures. If
25 * succeeds plugin must provide buffers through AssignPictureBuffers function
26 * to the API. If |req_num_of_bufs| matching exactly the specification
27 * given in the parameters cannot be allocated decoder should be destroyed.
29 * Decoding will not proceed until buffers have been provided.
32 * |instance| the plugin instance to which the callback is responding.
33 * |decoder| the PPB_VideoDecoder_Dev resource.
34 * |req_num_of_bufs| tells how many buffers are needed by the decoder.
35 * |dimensions| tells the dimensions of the buffer to allocate.
38 void ProvidePictureBuffers
(
39 [in] PP_Instance instance
,
40 [in] PP_Resource decoder
,
41 [in] uint32_t req_num_of_bufs
,
42 [in] PP_Size dimensions
);
45 * Callback function to provide buffers for the decoded output pictures. If
46 * succeeds plugin must provide buffers through AssignPictureBuffers function
47 * to the API. If |req_num_of_bufs| matching exactly the specification
48 * given in the parameters cannot be allocated decoder should be destroyed.
50 * Decoding will not proceed until buffers have been provided.
53 * |instance| the plugin instance to which the callback is responding.
54 * |decoder| the PPB_VideoDecoder_Dev resource.
55 * |req_num_of_bufs| tells how many buffers are needed by the decoder.
56 * |dimensions| tells the dimensions of the buffer to allocate.
57 * |texture_target| the type of texture used.
60 void ProvidePictureBuffers
(
61 [in] PP_Instance instance
,
62 [in] PP_Resource decoder
,
63 [in] uint32_t req_num_of_bufs
,
64 [in] PP_Size dimensions
,
65 [in] uint32_t texture_target
);
68 * Callback function for decoder to deliver unneeded picture buffers back to
72 * |instance| the plugin instance to which the callback is responding.
73 * |decoder| the PPB_VideoDecoder_Dev resource.
74 * |picture_buffer| points to the picture buffer that is no longer needed.
76 void DismissPictureBuffer
(
77 [in] PP_Instance instance
,
78 [in] PP_Resource decoder
,
79 [in] int32_t picture_buffer_id
);
82 * Callback function for decoder to deliver decoded pictures ready to be
83 * displayed. Decoder expects the plugin to return the buffer back to the
84 * decoder through ReusePictureBuffer function in PPB Video Decoder API.
87 * |instance| the plugin instance to which the callback is responding.
88 * |decoder| the PPB_VideoDecoder_Dev resource.
89 * |picture| is the picture that is ready.
92 [in] PP_Instance instance
,
93 [in] PP_Resource decoder
,
94 [in] PP_Picture_Dev picture
);
97 * Callback function to tell the plugin that decoder has decoded end of stream
98 * marker and output all the pictures that should be displayed from the
102 * |instance| the plugin instance to which the callback is responding.
103 * |decoder| the PPB_VideoDecoder_Dev resource.
107 [in] PP_Instance instance
,
108 [in] PP_Resource decoder
);
111 * Error handler callback for decoder to deliver information about detected
112 * errors to the plugin.
115 * |instance| the plugin instance to which the callback is responding.
116 * |decoder| the PPB_VideoDecoder_Dev resource.
117 * |error| error is the enumeration specifying the error.
120 [in] PP_Instance instance
,
121 [in] PP_Resource decoder
,
122 [in] PP_VideoDecodeError_Dev error
);