OLD | NEW |
1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2011 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_C_DEV_PPP_VIDEO_DECODER_DEV_H_ | 5 #ifndef PPAPI_C_DEV_PPP_VIDEO_DECODER_DEV_H_ |
6 #define PPAPI_C_DEV_PPP_VIDEO_DECODER_DEV_H_ | 6 #define PPAPI_C_DEV_PPP_VIDEO_DECODER_DEV_H_ |
7 | 7 |
8 #include "ppapi/c/pp_instance.h" | 8 #include "ppapi/c/pp_instance.h" |
9 #include "ppapi/c/pp_resource.h" | 9 #include "ppapi/c/pp_resource.h" |
10 #include "ppapi/c/dev/pp_video_dev.h" | 10 #include "ppapi/c/dev/pp_video_dev.h" |
11 | 11 |
12 #define PPP_VIDEODECODER_DEV_INTERFACE "PPP_VideoDecoder(Dev);0.4" | 12 #define PPP_VIDEODECODER_DEV_INTERFACE "PPP_VideoDecoder(Dev);0.5" |
13 | 13 |
14 // PPP_VideoDecoder_Dev structure contains the function pointers that the | 14 // PPP_VideoDecoder_Dev structure contains the function pointers that the |
15 // plugin MUST implement to provide services needed by the video decoder | 15 // plugin MUST implement to provide services needed by the video decoder |
16 // implementation. | 16 // implementation. |
17 // See PPB_VideoDecoder_Dev for general usage tips. | 17 // See PPB_VideoDecoder_Dev for general usage tips. |
18 struct PPP_VideoDecoder_Dev { | 18 struct PPP_VideoDecoder_Dev { |
19 // Callback function to provide buffers for the decoded output pictures. If | 19 // Callback function to provide buffers for the decoded output pictures. If |
20 // succeeds plugin must provide buffers through AssignPictureBuffers function | 20 // succeeds plugin must provide buffers through AssignPictureBuffers function |
21 // to the API. If |req_num_of_bufs| matching exactly the specification | 21 // to the API. If |req_num_of_bufs| matching exactly the specification |
22 // given in the parameters cannot be allocated decoder should be destroyed. | 22 // given in the parameters cannot be allocated decoder should be destroyed. |
23 // | 23 // |
24 // Decoding will not proceed until buffers have been provided. | 24 // Decoding will not proceed until buffers have been provided. |
25 // | 25 // |
26 // Parameters: | 26 // Parameters: |
27 // |instance| the plugin instance to which the callback is responding. | 27 // |instance| the plugin instance to which the callback is responding. |
28 // |decoder| is pointer to the Pepper Video Decoder resource. | |
29 // |req_num_of_bufs| tells how many buffers are needed by the decoder. | 28 // |req_num_of_bufs| tells how many buffers are needed by the decoder. |
30 // |dimensions| tells the dimensions of the buffer to allocate. | 29 // |dimensions| tells the dimensions of the buffer to allocate. |
31 // |type| specifies whether the buffer lives in system memory or GL texture. | 30 // |type| specifies whether the buffer lives in system memory or GL texture. |
32 void (*ProvidePictureBuffers)( | 31 void (*ProvidePictureBuffers)( |
33 PP_Instance instance, | 32 PP_Instance instance, |
34 PP_Resource decoder, | |
35 uint32_t req_num_of_bufs, | 33 uint32_t req_num_of_bufs, |
36 struct PP_Size dimensions, | 34 struct PP_Size dimensions, |
37 enum PP_PictureBufferType_Dev type); | 35 enum PP_PictureBufferType_Dev type); |
38 | 36 |
39 // Callback function for decoder to deliver unneeded picture buffers back to | 37 // Callback function for decoder to deliver unneeded picture buffers back to |
40 // the plugin. | 38 // the plugin. |
41 // | 39 // |
42 // Parameters: | 40 // Parameters: |
43 // |instance| the plugin instance to which the callback is responding. | 41 // |instance| the plugin instance to which the callback is responding. |
44 // |decoder| is pointer to the Pepper Video Decoder resource. | |
45 // |picture_buffer| points to the picture buffer that is no longer needed. | 42 // |picture_buffer| points to the picture buffer that is no longer needed. |
46 void (*DismissPictureBuffer)(PP_Instance instance, | 43 void (*DismissPictureBuffer)(PP_Instance instance, int32_t picture_buffer_id); |
47 PP_Resource decoder, | |
48 int32_t picture_buffer_id); | |
49 | 44 |
50 // Callback function for decoder to deliver decoded pictures ready to be | 45 // Callback function for decoder to deliver decoded pictures ready to be |
51 // displayed. Decoder expects the plugin to return the buffer back to the | 46 // displayed. Decoder expects the plugin to return the buffer back to the |
52 // decoder through ReusePictureBuffer function in PPB Video Decoder API. | 47 // decoder through ReusePictureBuffer function in PPB Video Decoder API. |
53 // | 48 // |
54 // Parameters: | 49 // Parameters: |
55 // |instance| the plugin instance to which the callback is responding. | 50 // |instance| the plugin instance to which the callback is responding. |
56 // |decoder| is pointer to the Pepper Video Decoder resource. | |
57 // |picture| is the picture that is ready. | 51 // |picture| is the picture that is ready. |
58 void (*PictureReady)(PP_Instance instance, | 52 void (*PictureReady)(PP_Instance instance, struct PP_Picture_Dev picture); |
59 PP_Resource decoder, | |
60 struct PP_Picture_Dev picture); | |
61 | 53 |
62 // Callback function to tell the plugin that decoder has decoded end of stream | 54 // Callback function to tell the plugin that decoder has decoded end of stream |
63 // marker and output all the pictures that should be displayed from the | 55 // marker and output all the pictures that should be displayed from the |
64 // stream. | 56 // stream. |
65 // | 57 // |
66 // Parameters: | 58 // Parameters: |
67 // |instance| the plugin instance to which the callback is responding. | 59 // |instance| the plugin instance to which the callback is responding. |
68 // |decoder| is pointer to the Pepper Video Decoder resource. | 60 void (*EndOfStream)(PP_Instance instance); |
69 void (*EndOfStream)(PP_Instance instance, PP_Resource decoder); | |
70 | 61 |
71 // Error handler callback for decoder to deliver information about detected | 62 // Error handler callback for decoder to deliver information about detected |
72 // errors to the plugin. | 63 // errors to the plugin. |
73 // | 64 // |
74 // TODO(vmr): Fill out error result codes and corresponding actions. | 65 // TODO(vmr): Fill out error result codes and corresponding actions. |
75 // | 66 // |
76 // Parameters: | 67 // Parameters: |
77 // |instance| the plugin instance to which the callback is responding. | 68 // |instance| the plugin instance to which the callback is responding. |
78 // |decoder| is pointer to the Pepper Video Decoder resource. | |
79 // |error| error is the enumeration specifying the error. | 69 // |error| error is the enumeration specifying the error. |
80 void (*NotifyError)(PP_Instance instance, | 70 void (*NotifyError)(PP_Instance instance, enum PP_VideoDecodeError_Dev error); |
81 PP_Resource decoder, | |
82 enum PP_VideoDecodeError_Dev error); | |
83 }; | 71 }; |
84 | 72 |
85 #endif /* PPAPI_C_DEV_PPP_VIDEO_DECODER_DEV_H_ */ | 73 #endif /* PPAPI_C_DEV_PPP_VIDEO_DECODER_DEV_H_ */ |
OLD | NEW |