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/* From dev/ppp_video_decoder_dev.idl modified Fri Dec 13 15:21:30 2013. */
7
8#ifndef PPAPI_C_DEV_PPP_VIDEO_DECODER_DEV_H_
9#define PPAPI_C_DEV_PPP_VIDEO_DECODER_DEV_H_
10
11#include "ppapi/c/dev/pp_video_dev.h"
12#include "ppapi/c/pp_instance.h"
13#include "ppapi/c/pp_macros.h"
14#include "ppapi/c/pp_resource.h"
15#include "ppapi/c/pp_size.h"
16#include "ppapi/c/pp_stdint.h"
17
18#define PPP_VIDEODECODER_DEV_INTERFACE_0_11 "PPP_VideoDecoder(Dev);0.11"
19#define PPP_VIDEODECODER_DEV_INTERFACE PPP_VIDEODECODER_DEV_INTERFACE_0_11
20
21/**
22 * @file
23 * This file defines the <code>PPP_VideoDecoder_Dev</code> interface.
24 */
25
26
27/**
28 * @addtogroup Interfaces
29 * @{
30 */
31/**
32 * PPP_VideoDecoder_Dev structure contains the function pointers that the
33 * plugin MUST implement to provide services needed by the video decoder
34 * implementation.
35 *
36 * See PPB_VideoDecoder_Dev for general usage tips.
37 */
38struct PPP_VideoDecoder_Dev_0_11 {
39  /**
40   * Callback function to provide buffers for the decoded output pictures. If
41   * succeeds plugin must provide buffers through AssignPictureBuffers function
42   * to the API. If |req_num_of_bufs| matching exactly the specification
43   * given in the parameters cannot be allocated decoder should be destroyed.
44   *
45   * Decoding will not proceed until buffers have been provided.
46   *
47   * Parameters:
48   *  |instance| the plugin instance to which the callback is responding.
49   *  |decoder| the PPB_VideoDecoder_Dev resource.
50   *  |req_num_of_bufs| tells how many buffers are needed by the decoder.
51   *  |dimensions| tells the dimensions of the buffer to allocate.
52   *  |texture_target| the type of texture used. Sample targets in use are
53   *      TEXTURE_2D (most platforms) and TEXTURE_EXTERNAL_OES (on ARM).
54   */
55  void (*ProvidePictureBuffers)(PP_Instance instance,
56                                PP_Resource decoder,
57                                uint32_t req_num_of_bufs,
58                                const struct PP_Size* dimensions,
59                                uint32_t texture_target);
60  /**
61   * Callback function for decoder to deliver unneeded picture buffers back to
62   * the plugin.
63   *
64   * Parameters:
65   *  |instance| the plugin instance to which the callback is responding.
66   *  |decoder| the PPB_VideoDecoder_Dev resource.
67   *  |picture_buffer| points to the picture buffer that is no longer needed.
68   */
69  void (*DismissPictureBuffer)(PP_Instance instance,
70                               PP_Resource decoder,
71                               int32_t picture_buffer_id);
72  /**
73   * Callback function for decoder to deliver decoded pictures ready to be
74   * displayed. Decoder expects the plugin to return the buffer back to the
75   * decoder through ReusePictureBuffer function in PPB Video Decoder API.
76   *
77   * Parameters:
78   *  |instance| the plugin instance to which the callback is responding.
79   *  |decoder| the PPB_VideoDecoder_Dev resource.
80   *  |picture| is the picture that is ready.
81   */
82  void (*PictureReady)(PP_Instance instance,
83                       PP_Resource decoder,
84                       const struct PP_Picture_Dev* picture);
85  /**
86   * Error handler callback for decoder to deliver information about detected
87   * errors to the plugin.
88   *
89   * Parameters:
90   *  |instance| the plugin instance to which the callback is responding.
91   *  |decoder| the PPB_VideoDecoder_Dev resource.
92   *  |error| error is the enumeration specifying the error.
93   */
94  void (*NotifyError)(PP_Instance instance,
95                      PP_Resource decoder,
96                      PP_VideoDecodeError_Dev error);
97};
98
99typedef struct PPP_VideoDecoder_Dev_0_11 PPP_VideoDecoder_Dev;
100/**
101 * @}
102 */
103
104#endif  /* PPAPI_C_DEV_PPP_VIDEO_DECODER_DEV_H_ */
105
106