Home | History | Annotate | Download | only in dev
      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   M21 = 0.11
     11 };
     12 
     13 /**
     14  * PPP_VideoDecoder_Dev structure contains the function pointers that the
     15  * plugin MUST implement to provide services needed by the video decoder
     16  * implementation.
     17  *
     18  * See PPB_VideoDecoder_Dev for general usage tips.
     19  */
     20 interface PPP_VideoDecoder_Dev {
     21   /**
     22    * Callback function to provide buffers for the decoded output pictures. If
     23    * succeeds plugin must provide buffers through AssignPictureBuffers function
     24    * to the API. If |req_num_of_bufs| matching exactly the specification
     25    * given in the parameters cannot be allocated decoder should be destroyed.
     26    *
     27    * Decoding will not proceed until buffers have been provided.
     28    *
     29    * Parameters:
     30    *  |instance| the plugin instance to which the callback is responding.
     31    *  |decoder| the PPB_VideoDecoder_Dev resource.
     32    *  |req_num_of_bufs| tells how many buffers are needed by the decoder.
     33    *  |dimensions| tells the dimensions of the buffer to allocate.
     34    *  |texture_target| the type of texture used. Sample targets in use are
     35    *      TEXTURE_2D (most platforms) and TEXTURE_EXTERNAL_OES (on ARM).
     36    */
     37   [version=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       [in] uint32_t texture_target);
     44 
     45   /**
     46    * Callback function for decoder to deliver unneeded picture buffers back to
     47    * the plugin.
     48    *
     49    * Parameters:
     50    *  |instance| the plugin instance to which the callback is responding.
     51    *  |decoder| the PPB_VideoDecoder_Dev resource.
     52    *  |picture_buffer| points to the picture buffer that is no longer needed.
     53    */
     54   void DismissPictureBuffer(
     55       [in] PP_Instance instance,
     56       [in] PP_Resource decoder,
     57       [in] int32_t picture_buffer_id);
     58 
     59   /**
     60    * Callback function for decoder to deliver decoded pictures ready to be
     61    * displayed. Decoder expects the plugin to return the buffer back to the
     62    * decoder through ReusePictureBuffer function in PPB Video Decoder API.
     63    *
     64    * Parameters:
     65    *  |instance| the plugin instance to which the callback is responding.
     66    *  |decoder| the PPB_VideoDecoder_Dev resource.
     67    *  |picture| is the picture that is ready.
     68    */
     69   void PictureReady(
     70       [in] PP_Instance instance,
     71       [in] PP_Resource decoder,
     72       [in] PP_Picture_Dev picture);
     73 
     74   /**
     75    * Error handler callback for decoder to deliver information about detected
     76    * errors to the plugin.
     77    *
     78    * Parameters:
     79    *  |instance| the plugin instance to which the callback is responding.
     80    *  |decoder| the PPB_VideoDecoder_Dev resource.
     81    *  |error| error is the enumeration specifying the error.
     82    */
     83   void NotifyError(
     84       [in] PP_Instance instance,
     85       [in] PP_Resource decoder,
     86       [in] PP_VideoDecodeError_Dev error);
     87 };
     88