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. 4 */ 5 6 /** 7 * This file defines the <code>PPP_VideoDecoder_Dev</code> interface. 8 */ 9 label Chrome { 10 M14 = 0.9, 11 M18 = 0.10, 12 M21 = 0.11 13 }; 14 15 /** 16 * PPP_VideoDecoder_Dev structure contains the function pointers that the 17 * plugin MUST implement to provide services needed by the video decoder 18 * implementation. 19 * 20 * See PPB_VideoDecoder_Dev for general usage tips. 21 */ 22 interface PPP_VideoDecoder_Dev { 23 /** 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. 28 * 29 * Decoding will not proceed until buffers have been provided. 30 * 31 * Parameters: 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. 36 */ 37 [deprecate=0.11] 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); 43 44 /** 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. 49 * 50 * Decoding will not proceed until buffers have been provided. 51 * 52 * Parameters: 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. 58 */ 59 [version=0.11] 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); 66 67 /** 68 * Callback function for decoder to deliver unneeded picture buffers back to 69 * the plugin. 70 * 71 * Parameters: 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. 75 */ 76 void DismissPictureBuffer( 77 [in] PP_Instance instance, 78 [in] PP_Resource decoder, 79 [in] int32_t picture_buffer_id); 80 81 /** 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. 85 * 86 * Parameters: 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. 90 */ 91 void PictureReady( 92 [in] PP_Instance instance, 93 [in] PP_Resource decoder, 94 [in] PP_Picture_Dev picture); 95 96 /** 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 99 * stream. 100 * 101 * Parameters: 102 * |instance| the plugin instance to which the callback is responding. 103 * |decoder| the PPB_VideoDecoder_Dev resource. 104 */ 105 [deprecate=0.10] 106 void EndOfStream( 107 [in] PP_Instance instance, 108 [in] PP_Resource decoder); 109 110 /** 111 * Error handler callback for decoder to deliver information about detected 112 * errors to the plugin. 113 * 114 * Parameters: 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. 118 */ 119 void NotifyError( 120 [in] PP_Instance instance, 121 [in] PP_Resource decoder, 122 [in] PP_VideoDecodeError_Dev error); 123 }; 124