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/pp_video_dev.idl modified Tue Apr 30 14:58:38 2013. */
7
8#ifndef PPAPI_C_DEV_PP_VIDEO_DEV_H_
9#define PPAPI_C_DEV_PP_VIDEO_DEV_H_
10
11#include "ppapi/c/pp_macros.h"
12#include "ppapi/c/pp_resource.h"
13#include "ppapi/c/pp_size.h"
14#include "ppapi/c/pp_stdint.h"
15
16/**
17 * @file
18 * NOTE: these must be kept in sync with the versions in media/!
19 */
20
21
22/**
23 * @addtogroup Enums
24 * @{
25 */
26/**
27 * Video format.
28 *
29 * Keep the values in this enum unique, as they imply format (h.264 vs. VP8,
30 * for example), and keep the values for a particular format grouped together
31 * for clarity.
32 * Note: Keep these in sync with media::VideoCodecProfile.
33 */
34typedef enum {
35  PP_VIDEODECODER_PROFILE_UNKNOWN = -1,
36  PP_VIDEODECODER_H264PROFILE_NONE = 0,
37  PP_VIDEODECODER_H264PROFILE_BASELINE = 1,
38  PP_VIDEODECODER_H264PROFILE_MAIN = 2,
39  PP_VIDEODECODER_H264PROFILE_EXTENDED = 3,
40  PP_VIDEODECODER_H264PROFILE_HIGH = 4,
41  PP_VIDEODECODER_H264PROFILE_HIGH10PROFILE = 5,
42  PP_VIDEODECODER_H264PROFILE_HIGH422PROFILE = 6,
43  PP_VIDEODECODER_H264PROFILE_HIGH444PREDICTIVEPROFILE = 7,
44  PP_VIDEODECODER_H264PROFILE_SCALABLEBASELINE = 8,
45  PP_VIDEODECODER_H264PROFILE_SCALABLEHIGH = 9,
46  PP_VIDEODECODER_H264PROFILE_STEREOHIGH = 10,
47  PP_VIDEODECODER_H264PROFILE_MULTIVIEWHIGH = 11,
48  PP_VIDEODECODER_VP8PROFILE_MAIN = 12
49} PP_VideoDecoder_Profile;
50PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_VideoDecoder_Profile, 4);
51/**
52 * @}
53 */
54
55/**
56 * @addtogroup Structs
57 * @{
58 */
59/**
60 * The data structure for video bitstream buffer.
61 */
62struct PP_VideoBitstreamBuffer_Dev {
63  /**
64   * Client-specified identifier for the bitstream buffer. Valid values are
65   * non-negative.
66   */
67  int32_t id;
68  /**
69   * Buffer to hold the bitstream data. Should be allocated using the
70   * PPB_Buffer interface for consistent interprocess behaviour.
71   */
72  PP_Resource data;
73  /**
74   * Size of the bitstream contained in buffer (in bytes).
75   */
76  uint32_t size;
77};
78PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_VideoBitstreamBuffer_Dev, 12);
79
80/**
81 * Struct for specifying texture-backed picture data.
82 */
83struct PP_PictureBuffer_Dev {
84  /**
85   * Client-specified id for the picture buffer. By using this value client can
86   * keep track of the buffers it has assigned to the video decoder and how they
87   * are passed back to it. Valid values are non-negative.
88   */
89  int32_t id;
90  /**
91   * Dimensions of the buffer.
92   */
93  struct PP_Size size;
94  /**
95   * Texture ID in the given context where picture is stored.
96   */
97  uint32_t texture_id;
98};
99PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_PictureBuffer_Dev, 16);
100
101/**
102 * Structure to describe a decoded output frame.
103 */
104struct PP_Picture_Dev {
105  /**
106   * ID of the picture buffer where the picture is stored.
107   */
108  int32_t picture_buffer_id;
109  /**
110   * ID of the bitstream from which this data was decoded.
111   */
112  int32_t bitstream_buffer_id;
113};
114PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_Picture_Dev, 8);
115/**
116 * @}
117 */
118
119/**
120 * @addtogroup Enums
121 * @{
122 */
123/**
124 * Decoder error codes reported to the plugin. A reasonable naive
125 * error handling policy is for the plugin to Destroy() the decoder on error.
126 */
127typedef enum {
128  /**
129   * An operation was attempted during an incompatible decoder state.
130   */
131  PP_VIDEODECODERERROR_ILLEGAL_STATE = 1,
132  /**
133   * Invalid argument was passed to an API method.
134   */
135  PP_VIDEODECODERERROR_INVALID_ARGUMENT = 2,
136  /**
137   * Encoded input is unreadable.
138   */
139  PP_VIDEODECODERERROR_UNREADABLE_INPUT = 3,
140  /**
141   * A failure occurred at the browser layer or lower.  Examples of such
142   * failures include GPU hardware failures, GPU driver failures, GPU library
143   * failures, browser programming errors, and so on.
144   */
145  PP_VIDEODECODERERROR_PLATFORM_FAILURE = 4
146} PP_VideoDecodeError_Dev;
147PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_VideoDecodeError_Dev, 4);
148/**
149 * @}
150 */
151
152#endif  /* PPAPI_C_DEV_PP_VIDEO_DEV_H_ */
153
154