Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / ppapi / c / pp_codecs.h
1 /* Copyright (c) 2014 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 pp_codecs.idl modified Wed Nov  5 13:38:52 2014. */
7
8 #ifndef PPAPI_C_PP_CODECS_H_
9 #define PPAPI_C_PP_CODECS_H_
10
11 #include "ppapi/c/pp_macros.h"
12 #include "ppapi/c/pp_point.h"
13 #include "ppapi/c/pp_rect.h"
14 #include "ppapi/c/pp_size.h"
15 #include "ppapi/c/pp_stdint.h"
16
17 /**
18  * @file
19  * Video profiles.
20  */
21
22
23 /**
24  * @addtogroup Enums
25  * @{
26  */
27 typedef enum {
28   PP_VIDEOPROFILE_H264BASELINE = 0,
29   PP_VIDEOPROFILE_H264MAIN = 1,
30   PP_VIDEOPROFILE_H264EXTENDED = 2,
31   PP_VIDEOPROFILE_H264HIGH = 3,
32   PP_VIDEOPROFILE_H264HIGH10PROFILE = 4,
33   PP_VIDEOPROFILE_H264HIGH422PROFILE = 5,
34   PP_VIDEOPROFILE_H264HIGH444PREDICTIVEPROFILE = 6,
35   PP_VIDEOPROFILE_H264SCALABLEBASELINE = 7,
36   PP_VIDEOPROFILE_H264SCALABLEHIGH = 8,
37   PP_VIDEOPROFILE_H264STEREOHIGH = 9,
38   PP_VIDEOPROFILE_H264MULTIVIEWHIGH = 10,
39   PP_VIDEOPROFILE_VP8_ANY = 11,
40   PP_VIDEOPROFILE_VP9_ANY = 12,
41   PP_VIDEOPROFILE_MAX = PP_VIDEOPROFILE_VP9_ANY
42 } PP_VideoProfile;
43
44 /**
45  * Hardware acceleration options.
46  */
47 typedef enum {
48   /** Create a hardware accelerated resource only. */
49   PP_HARDWAREACCELERATION_ONLY = 0,
50   /**
51    * Create a hardware accelerated resource if possible. Otherwise, fall back
52    * to the software implementation.
53    */
54   PP_HARDWAREACCELERATION_WITHFALLBACK = 1,
55   /** Create the software implementation only. */
56   PP_HARDWAREACCELERATION_NONE = 2,
57   PP_HARDWAREACCELERATION_LAST = PP_HARDWAREACCELERATION_NONE
58 } PP_HardwareAcceleration;
59 /**
60  * @}
61  */
62
63 /**
64  * @addtogroup Structs
65  * @{
66  */
67 /**
68  * Struct describing a decoded video picture. The decoded picture data is stored
69  * in the GL texture corresponding to |texture_id|. The plugin can determine
70  * which Decode call generated the picture using |decode_id|.
71  */
72 struct PP_VideoPicture {
73   /**
74    * |decode_id| parameter of the Decode call which generated this picture.
75    * See the PPB_VideoDecoder function Decode() for more details.
76    */
77   uint32_t decode_id;
78   /**
79    * Texture ID in the plugin's GL context. The plugin can use this to render
80    * the decoded picture.
81    */
82   uint32_t texture_id;
83   /**
84    * The GL texture target for the decoded picture. Possible values are:
85    *   GL_TEXTURE_2D
86    *   GL_TEXTURE_RECTANGLE_ARB
87    *   GL_TEXTURE_EXTERNAL_OES
88    *
89    * The pixel format of the texture is GL_RGBA.
90    */
91   uint32_t texture_target;
92   /**
93    * Dimensions of the texture holding the decoded picture.
94    */
95   struct PP_Size texture_size;
96   /**
97    * The visible subrectangle of the picture. The plugin should display only
98    * this part of the picture.
99    */
100   struct PP_Rect visible_rect;
101 };
102
103 /**
104  * Struct describing a decoded video picture. The decoded picture data is stored
105  * in the GL texture corresponding to |texture_id|. The plugin can determine
106  * which Decode call generated the picture using |decode_id|.
107  */
108 struct PP_VideoPicture_0_1 {
109   /**
110    * |decode_id| parameter of the Decode call which generated this picture.
111    * See the PPB_VideoDecoder function Decode() for more details.
112    */
113   uint32_t decode_id;
114   /**
115    * Texture ID in the plugin's GL context. The plugin can use this to render
116    * the decoded picture.
117    */
118   uint32_t texture_id;
119   /**
120    * The GL texture target for the decoded picture. Possible values are:
121    *   GL_TEXTURE_2D
122    *   GL_TEXTURE_RECTANGLE_ARB
123    *   GL_TEXTURE_EXTERNAL_OES
124    *
125    * The pixel format of the texture is GL_RGBA.
126    */
127   uint32_t texture_target;
128   /**
129    * Dimensions of the texture holding the decoded picture.
130    */
131   struct PP_Size texture_size;
132 };
133 /**
134  * @}
135  */
136
137 #endif  /* PPAPI_C_PP_CODECS_H_ */
138