Chromium Code Reviews| 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/dev/pp_video_dev.h" | 8 #include "ppapi/c/dev/pp_video_dev.h" |
| 9 | 9 |
| 10 #define PPP_VIDEODECODER_DEV_INTERFACE "PPP_VideoDecoder(Dev);0.1" | 10 #define PPP_VIDEODECODER_DEV_INTERFACE "PPP_VideoDecoder(Dev);0.2" |
| 11 | 11 |
| 12 // PPP_VideoDecoder_Dev structure contains the function pointers that the | 12 // PPP_VideoDecoder_Dev structure contains the function pointers that the |
| 13 // plugin MUST implement to provide services needed by the video decoder | 13 // plugin MUST implement to provide services needed by the video decoder |
| 14 // implementation. | 14 // implementation. |
| 15 struct PPP_VideoDecoder_Dev { | 15 struct PPP_VideoDecoder_Dev { |
| 16 // Callback function to provide buffers for the decoded output pictures. If | 16 // Callback function to provide buffers for the decoded output pictures. If |
| 17 // succeeds plugin must provide buffers through AssignPictureBuffers function | 17 // succeeds plugin must provide buffers through AssignPictureBuffers function |
| 18 // to the API. If |req_num_of_bufs| matching exactly the specification | 18 // to the API. If |req_num_of_bufs| matching exactly the specification |
| 19 // given in |props| cannot be allocated decoder should be destroyed. | 19 // given in the parameters cannot be allocated decoder should be destroyed. |
| 20 // | 20 // |
| 21 // Decoding will not proceed until buffers have been provided. | 21 // Decoding will not proceed until buffers have been provided. |
| 22 // | 22 // |
| 23 // Parameters: | 23 // Parameters: |
| 24 // |decoder| is pointer to the Pepper Video Decoder instance. | 24 // |decoder| is pointer to the Pepper Video Decoder instance. |
| 25 // |req_num_of_bufs| tells how many buffers are needed by the decoder. | 25 // |req_num_of_bufs| tells how many buffers are needed by the decoder. |
| 26 // |props| tells the properties that are required from the textures. | 26 // |dimensions| tells the dimensions of the buffer to allocate. |
| 27 // |type| specifies whether the buffer lives in system memory or GL texture. | |
| 27 void (*ProvidePictureBuffers)( | 28 void (*ProvidePictureBuffers)( |
| 28 PP_Resource decoder, | 29 PP_Resource decoder, |
| 29 uint32_t req_num_of_bufs, | 30 uint32_t req_num_of_bufs, |
| 30 const struct PP_PictureBufferProperties_Dev* props); | 31 struct PP_Size dimensions, |
|
Ami GONE FROM CHROMIUM
2011/04/29 18:40:34
s/dimensions/size/ ?
(singular to emph that this i
vrk (LEFT CHROMIUM)
2011/05/03 18:19:58
Done.
| |
| 32 enum PP_PictureBufferType_Dev type); | |
| 31 | 33 |
| 32 // Callback function for decoder to deliver unneeded picture buffers back to | 34 // Callback function for decoder to deliver unneeded picture buffers back to |
| 33 // the plugin. | 35 // the plugin. |
| 34 // | 36 // |
| 35 // Parameters: | 37 // Parameters: |
| 36 // |decoder| is pointer to the Pepper Video Decoder instance. | 38 // |decoder| is pointer to the Pepper Video Decoder instance. |
| 37 // |picture_buffer| points to the picture buffer that is no longer needed. | 39 // |picture_buffer| points to the picture buffer that is no longer needed. |
| 38 void (*DismissPictureBuffer)(PP_Resource decoder, | 40 void (*DismissPictureBuffer)(PP_Resource decoder, |
| 39 union PP_PictureData_Dev* picture_buffer); | 41 int32_t picture_buffer_id); |
| 40 | 42 |
| 41 // Callback function for decoder to deliver decoded pictures ready to be | 43 // Callback function for decoder to deliver decoded pictures ready to be |
| 42 // displayed. Decoder expects the plugin to return the buffer back to the | 44 // displayed. Decoder expects the plugin to return the buffer back to the |
| 43 // decoder through ReusePictureBuffer function in PPB Video Decoder API. | 45 // decoder through ReusePictureBuffer function in PPB Video Decoder API. |
| 44 // | 46 // |
| 45 // Parameters: | 47 // Parameters: |
| 46 // |decoder| is pointer to the Pepper Video Decoder instance. | 48 // |decoder| is pointer to the Pepper Video Decoder instance. |
| 47 // |picture| is the picture that is ready. | 49 // |picture| is the picture that is ready. |
| 48 void (*PictureReady)(PP_Resource decoder, | 50 void (*PictureReady)(PP_Resource decoder, |
| 49 struct PP_Picture_Dev* picture); | 51 struct PP_Picture_Dev picture); |
|
Ami GONE FROM CHROMIUM
2011/04/29 18:40:34
const&?
vrk (LEFT CHROMIUM)
2011/05/03 18:19:58
C API, can't use &.
| |
| 50 | 52 |
| 51 // Callback function to tell the plugin that decoder has decoded end of stream | 53 // Callback function to tell the plugin that decoder has decoded end of stream |
| 52 // marker and output all the pictures that should be displayed from the | 54 // marker and output all the pictures that should be displayed from the |
| 53 // stream. | 55 // stream. |
| 54 // | 56 // |
| 55 // Parameters: | 57 // Parameters: |
| 56 // |decoder| is pointer to the Pepper Video Decoder instance. | 58 // |decoder| is pointer to the Pepper Video Decoder instance. |
| 57 void (*EndOfStream)(PP_Resource decoder); | 59 void (*EndOfStream)(PP_Resource decoder); |
| 58 | 60 |
| 59 // Error handler callback for decoder to deliver information about detected | 61 // Error handler callback for decoder to deliver information about detected |
| 60 // errors to the plugin. | 62 // errors to the plugin. |
| 61 // | 63 // |
| 62 // TODO(vmr): Fill out error result codes and corresponding actions. | 64 // TODO(vmr): Fill out error result codes and corresponding actions. |
| 63 // | 65 // |
| 64 // Parameters: | 66 // Parameters: |
| 65 // |decoder| is pointer to the Pepper Video Decoder instance. | 67 // |decoder| is pointer to the Pepper Video Decoder instance. |
| 66 // |error| error is the enumeration specifying the error. | 68 // |error| error is the enumeration specifying the error. |
| 67 void (*NotifyError)(PP_Resource decoder, enum PP_VideoDecodeError_Dev error); | 69 void (*NotifyError)(PP_Resource decoder, enum PP_VideoDecodeError_Dev error); |
| 68 }; | 70 }; |
| 69 | 71 |
| 70 #endif /* PPAPI_C_DEV_PPP_VIDEO_DECODER_DEV_H_ */ | 72 #endif /* PPAPI_C_DEV_PPP_VIDEO_DECODER_DEV_H_ */ |
| OLD | NEW |