OMX_IntelVideoExt.h revision 0e0c2732815205370638a066fe4f25743310a531
1/*
2 * Copyright (c) 2010 The Khronos Group Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining
5 * a copy of this software and associated documentation files (the
6 * "Software"), to deal in the Software without restriction, including
7 * without limitation the rights to use, copy, modify, merge, publish,
8 * distribute, sublicense, and/or sell copies of the Software, and to
9 * permit persons to whom the Software is furnished to do so, subject
10 * to the following conditions:
11 * The above copyright notice and this permission notice shall be included
12 * in all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 *
22 */
23
24/** OMX_VideoExt.h - OpenMax IL version 1.1.2
25 * The OMX_VideoExt header file contains extensions to the
26 * definitions used by both the application and the component to
27 * access video items.
28 */
29
30#ifndef OMX_IntelVideoExt_h
31#define OMX_IntelVideoExt_h
32
33#ifdef __cplusplus
34extern "C" {
35#endif /* __cplusplus */
36
37/* Each OMX header shall include all required header files to allow the
38 * header to compile without errors.  The includes below are required
39 * for this header file to compile successfully
40 */
41#include <OMX_Core.h>
42/** NALU Formats */
43typedef enum OMX_INTEL_NALUFORMATSTYPE {
44    OMX_NaluFormatZeroByteInterleaveLength = 32,
45    OMX_NaluFormatStartCodesSeparateFirstHeader = 64,
46    OMX_NaluFormatLengthPrefixedSeparateFirstHeader = 128,
47} OMX_INTEL_NALUFORMATSTYPE;
48
49
50typedef struct OMX_VIDEO_PARAM_BYTESTREAMTYPE {
51     OMX_U32 nSize;                 // Size of the structure
52     OMX_VERSIONTYPE nVersion;      // OMX specification version
53     OMX_U32 nPortIndex;            // Port that this structure applies to
54     OMX_BOOL bBytestream;          // Enable/disable bytestream support
55} OMX_VIDEO_PARAM_BYTESTREAMTYPE;
56
57typedef struct OMX_VIDEO_CONFIG_INTEL_BITRATETYPE {
58     OMX_U32 nSize;
59     OMX_VERSIONTYPE nVersion;
60     OMX_U32 nPortIndex;
61     OMX_U32 nMaxEncodeBitrate;    // Maximum bitrate
62     OMX_U32 nTargetPercentage;    // Target bitrate as percentage of maximum bitrate; e.g. 95 is 95%
63     OMX_U32 nWindowSize;          // Window size in milliseconds allowed for bitrate to reach target
64     OMX_U32 nInitialQP;           // Initial QP for I frames
65     OMX_U32 nMinQP;
66     OMX_U32 nMaxQP;
67     OMX_U32 nFrameRate;
68     OMX_U32 nTemporalID;
69} OMX_VIDEO_CONFIG_INTEL_BITRATETYPE;
70
71typedef enum OMX_VIDEO_INTEL_CONTROLRATETYPE {
72    OMX_Video_Intel_ControlRateDisable,
73    OMX_Video_Intel_ControlRateVariable,
74    OMX_Video_Intel_ControlRateConstant,
75    OMX_Video_Intel_ControlRateVideoConferencingMode,
76    OMX_Video_Intel_ControlRateMax = 0x7FFFFFFF
77} OMX_VIDEO_INTEL_CONTROLRATETYPE;
78
79typedef struct OMX_VIDEO_PARAM_INTEL_BITRATETYPE {
80     OMX_U32 nSize;
81     OMX_VERSIONTYPE nVersion;
82     OMX_U32 nPortIndex;
83     OMX_VIDEO_INTEL_CONTROLRATETYPE eControlRate;
84     OMX_U32 nTargetBitrate;
85} OMX_VIDEO_PARAM_INTEL_BITRATETYPE;
86
87typedef struct OMX_VIDEO_PARAM_INTEL_AVC_DECODE_SETTINGS {
88     OMX_U32 nSize;                       // Size of the structure
89     OMX_VERSIONTYPE nVersion;            // OMX specification version
90     OMX_U32 nPortIndex;                  // Port that this structure applies to
91     OMX_U32 nMaxNumberOfReferenceFrame;  // Maximum number of reference frames
92     OMX_U32 nMaxWidth;                   // Maximum width of video
93     OMX_U32 nMaxHeight;                  // Maximum height of video
94} OMX_VIDEO_PARAM_INTEL_AVC_DECODE_SETTINGS;
95
96
97typedef struct OMX_VIDEO_CONFIG_INTEL_SLICE_NUMBERS {
98     OMX_U32 nSize;                       // Size of the structure
99     OMX_VERSIONTYPE nVersion;            // OMX specification version
100     OMX_U32 nPortIndex;                  // Port that this structure applies to
101     OMX_U32 nISliceNumber;               // I frame slice number
102     OMX_U32 nPSliceNumber;               // P frame slice number
103} OMX_VIDEO_CONFIG_INTEL_SLICE_NUMBERS;
104
105
106typedef struct OMX_VIDEO_CONFIG_INTEL_AIR {
107     OMX_U32 nSize;                       // Size of the structure
108     OMX_VERSIONTYPE nVersion;            // OMX specification version
109     OMX_U32 nPortIndex;                  // Port that this structure applies to
110     OMX_BOOL bAirEnable;                 // Enable AIR
111     OMX_BOOL bAirAuto;                   // AIR auto
112     OMX_U32 nAirMBs;                     // Number of AIR MBs
113     OMX_U32 nAirThreshold;               // AIR Threshold
114
115} OMX_VIDEO_CONFIG_INTEL_AIR;
116
117typedef struct OMX_VIDEO_PARAM_INTEL_AVCVUI {
118     OMX_U32 nSize;                       // Size of the structure
119     OMX_VERSIONTYPE nVersion;            // OMX specification version
120     OMX_U32 nPortIndex;                  // Port that this structure applies to
121     OMX_BOOL  bVuiGeneration;            // Enable/disable VUI generation
122
123} OMX_VIDEO_PARAM_INTEL_AVCVUI;
124
125typedef struct OMX_VIDEO_PARAM_INTEL_ADAPTIVE_SLICE_CONTROL {
126     OMX_U32 nSize;                       // Size of the structure
127     OMX_VERSIONTYPE nVersion;            // OMX specification version
128     OMX_U32 nPortIndex;                  // Port that this structure applies to
129     OMX_BOOL bEnable;                    // enable adaptive slice control
130     OMX_U32 nMinPSliceNumber;            // minimum number of P slices
131     OMX_U32 nNumPFramesToSkip;           // number of P frames after an I frame to skip before kicking in adaptive slice control
132     OMX_U32 nSliceSizeThreshold;         // Slice size threshold for adaptive slice control to start a new slice
133     OMX_U32 nSliceSizeSkipThreshold;     // Slice size skip threshold for adaptive slice control to start a new slice
134} OMX_VIDEO_PARAM_INTEL_ADAPTIVE_SLICE_CONTROL;
135
136/**
137 * Vendor Private Configs
138 *
139 * STRUCT MEMBERS:
140 *  nSize      : Size of the structure in bytes
141 *  nVersion   : OMX specification version information
142 *  nPortIndex : Port that this structure applies to
143 *  nCapacity  : Specifies the private unit size
144 *  nHolder    : Pointer to private unit address
145 */
146typedef struct OMX_VIDEO_CONFIG_PRI_INFOTYPE {
147    OMX_U32 nSize;
148    OMX_VERSIONTYPE nVersion;
149    OMX_U32 nPortIndex;
150    OMX_U32 nCapacity;
151    OMX_PTR nHolder;
152} OMX_VIDEO_CONFIG_PRI_INFOTYPE;
153
154// Error reporting data structure
155typedef struct OMX_VIDEO_CONFIG_INTEL_ERROR_REPORT {
156    OMX_U32 nSize;
157    OMX_VERSIONTYPE nVersion;
158    OMX_U32 nPortIndex;
159    OMX_BOOL bEnable;
160} OMX_VIDEO_CONFIG_INTEL_ERROR_REPORT;
161
162#define MAX_ERR_NUM 10
163
164typedef enum
165{
166    OMX_Decode_HeaderError   = 0,
167    OMX_Decode_MBError       = 1,
168    OMX_Decode_SliceMissing  = 2,
169    OMX_Decode_RefMissing    = 3,
170} OMX_VIDEO_DECODE_ERRORTYPE;
171
172typedef struct OMX_VIDEO_ERROR_INFO {
173    OMX_VIDEO_DECODE_ERRORTYPE type;
174    OMX_U32 num_mbs;
175    union {
176        struct {OMX_U32 start_mb; OMX_U32 end_mb;} mb_pos;
177    } error_data;
178};
179
180typedef struct OMX_VIDEO_ERROR_BUFFER {
181    OMX_U32 errorNumber;   // Error number should be no more than MAX_ERR_NUM
182    OMX_S64 timeStamp;      // presentation time stamp
183    OMX_VIDEO_ERROR_INFO errorArray[MAX_ERR_NUM];
184};
185
186// Force K frame for VP8 encode
187typedef struct OMX_VIDEO_CONFIG_INTEL_VP8_FORCE_KFRAME {
188    OMX_U32 nSize;
189    OMX_VERSIONTYPE nVersion;
190    OMX_U32 nPortIndex;
191    OMX_BOOL bForceKFrame;
192} OMX_VIDEO_CONFIG_INTEL_VP8_FORCE_KFRAME;
193
194// max frame size for VP8 encode during WebRTC feature
195typedef struct OMX_VIDEO_CONFIG_INTEL_VP8_MAX_FRAME_SIZE_RATIO {
196    OMX_U32 nSize;
197    OMX_VERSIONTYPE nVersion;
198    OMX_U32 nPortIndex;
199    OMX_U32 nMaxFrameSizeRatio;
200} OMX_VIDEO_CONFIG_INTEL_VP8_MAX_FRAME_SIZE_RATIO;
201
202// number of temporal layer for WebRTC and Sand
203typedef struct OMX_VIDEO_PARAM_INTEL_NUMBER_OF_TEMPORAL_LAYER {
204    OMX_U32 nSize;
205    OMX_VERSIONTYPE nVersion;
206    OMX_U32 nPortIndex;
207    OMX_U32 nNumberOfTemporalLayer;
208} OMX_VIDEO_PARAM_INTEL_NUMBER_OF_TEMPORAL_LAYER;
209
210
211// Request OMX to allocate a black frame to video mute feature
212typedef struct OMX_VIDEO_INTEL_REQUEST_BALCK_FRAME_POINTER {
213    OMX_U32 nSize;
214    OMX_VERSIONTYPE nVersion;
215    OMX_U32 nPortIndex;
216    OMX_U32 nFramePointer;
217} OMX_VIDEO_INTEL_REQUEST_BALCK_FRAME_POINTER;
218
219#ifdef __cplusplus
220}
221#endif /* __cplusplus */
222
223#endif /* OMX_VideoExt_h */
224/* File EOF */
225