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_PPB_VIDEO_DECODER_DEV_H_ | 5 #ifndef PPAPI_C_DEV_PPB_VIDEO_DECODER_DEV_H_ |
6 #define PPAPI_C_DEV_PPB_VIDEO_DECODER_DEV_H_ | 6 #define PPAPI_C_DEV_PPB_VIDEO_DECODER_DEV_H_ |
7 | 7 |
8 #include "ppapi/c/dev/pp_video_dev.h" | 8 #include "ppapi/c/dev/pp_video_dev.h" |
9 #include "ppapi/c/pp_completion_callback.h" | 9 #include "ppapi/c/pp_completion_callback.h" |
10 #include "ppapi/c/pp_var.h" | 10 #include "ppapi/c/pp_var.h" |
11 | 11 |
12 #define PPB_VIDEODECODER_DEV_INTERFACE_0_15 "PPB_VideoDecoder(Dev);0.15" | 12 #define PPB_VIDEODECODER_DEV_INTERFACE_0_16 "PPB_VideoDecoder(Dev);0.16" |
13 #define PPB_VIDEODECODER_DEV_INTERFACE PPB_VIDEODECODER_DEV_INTERFACE_0_15 | 13 #define PPB_VIDEODECODER_DEV_INTERFACE PPB_VIDEODECODER_DEV_INTERFACE_0_16 |
14 | 14 |
15 // Video decoder interface. | 15 // Video decoder interface. |
16 // | 16 // |
17 // Typical usage: | 17 // Typical usage: |
18 // - Use Create() to create & configure a new PPB_VideoDecoder_Dev resource. | 18 // - Use Create() to create & configure a new PPB_VideoDecoder_Dev resource. |
19 // - Call Decode() to decode some video data. | 19 // - Call Decode() to decode some video data. |
20 // - Receive ProvidePictureBuffers callback | 20 // - Receive ProvidePictureBuffers callback |
21 // - Supply the decoder with textures using AssignPictureBuffers. | 21 // - Supply the decoder with textures using AssignPictureBuffers. |
22 // - Receive PictureReady callbacks | 22 // - Receive PictureReady callbacks |
23 // - Hand the textures back to the decoder using ReusePictureBuffer. | 23 // - Hand the textures back to the decoder using ReusePictureBuffer. |
24 // - To signal EOS to the decoder: call Flush() and wait for NotifyFlushDone | 24 // - To signal EOS to the decoder: call Flush() and wait for NotifyFlushDone |
25 // callback. | 25 // callback. |
26 // - To reset the decoder (e.g. to implement Seek): call Reset() and wait for | 26 // - To reset the decoder (e.g. to implement Seek): call Reset() and wait for |
27 // NotifyResetDone callback. | 27 // NotifyResetDone callback. |
28 // - To tear down the decoder call Destroy(). | 28 // - To tear down the decoder call Destroy(). |
29 // | 29 // |
30 // See PPP_VideoDecoder_Dev for the notifications the decoder may send the | 30 // See PPP_VideoDecoder_Dev for the notifications the decoder may send the |
31 // plugin. | 31 // plugin. |
32 struct PPB_VideoDecoder_Dev { | 32 struct PPB_VideoDecoder_Dev { |
33 // Creates & initializes a video decoder. | 33 // Creates & initializes a video decoder. |
34 // | 34 // |
35 // Parameters: | 35 // Parameters: |
36 // |instance| pointer to the plugin instance. | 36 // |instance| pointer to the plugin instance. |
37 // |context_3d| a PPB_Context3D_Dev resource in which decoding will happen. | 37 // |context_3d| a PPB_Context3D_Dev resource in which decoding will happen. |
38 // |decoder_config| the configuration to use to initialize the decoder. | 38 // |profile| the video stream's format profile. |
39 // | 39 // |
40 // The created decoder is returned as PP_Resource. 0 means failure. | 40 // The created decoder is returned as PP_Resource. 0 means failure. |
41 // TODO(fischman/vrk): Get rid of silly PP_VideoConfigElement* vector in favor | |
42 // of config struct. | |
43 PP_Resource (*Create)(PP_Instance instance, | 41 PP_Resource (*Create)(PP_Instance instance, |
44 PP_Resource context, | 42 PP_Resource context, |
45 const PP_VideoConfigElement* decoder_config); | 43 enum PP_VideoDecoder_Profile profile); |
46 | 44 |
47 // Tests whether |resource| is a video decoder created through Create | 45 // Tests whether |resource| is a video decoder created through Create |
48 // function of this interface. | 46 // function of this interface. |
49 // | 47 // |
50 // Parameters: | 48 // Parameters: |
51 // |resource| is handle to resource to test. | 49 // |resource| is handle to resource to test. |
52 // | 50 // |
53 // Returns true if is a video decoder, false otherwise. | 51 // Returns true if is a video decoder, false otherwise. |
54 PP_Bool (*IsVideoDecoder)(PP_Resource resource); | 52 PP_Bool (*IsVideoDecoder)(PP_Resource resource); |
55 | 53 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // may be freed asynchronously, after this method returns no more callbacks | 123 // may be freed asynchronously, after this method returns no more callbacks |
126 // will be made on the client. Any resources held by the client at that point | 124 // will be made on the client. Any resources held by the client at that point |
127 // may be freed. | 125 // may be freed. |
128 // | 126 // |
129 // Parameters: | 127 // Parameters: |
130 // |video_decoder| is the previously created handle to the decoder resource. | 128 // |video_decoder| is the previously created handle to the decoder resource. |
131 void (*Destroy)(PP_Resource video_decoder); | 129 void (*Destroy)(PP_Resource video_decoder); |
132 }; | 130 }; |
133 | 131 |
134 #endif /* PPAPI_C_DEV_PPB_VIDEO_DECODER_DEV_H_ */ | 132 #endif /* PPAPI_C_DEV_PPB_VIDEO_DECODER_DEV_H_ */ |
OLD | NEW |