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#include <OMX_Video.h>
43
44/** NALU Formats */
45typedef enum OMX_INTEL_NALUFORMATSTYPE {
46    OMX_NaluFormatZeroByteInterleaveLength = 32,
47    OMX_NaluFormatStartCodesSeparateFirstHeader = 64,
48    OMX_NaluFormatLengthPrefixedSeparateFirstHeader = 128,
49} OMX_INTEL_NALUFORMATSTYPE;
50
51
52typedef struct OMX_VIDEO_PARAM_BYTESTREAMTYPE {
53     OMX_U32 nSize;                 // Size of the structure
54     OMX_VERSIONTYPE nVersion;      // OMX specification version
55     OMX_U32 nPortIndex;            // Port that this structure applies to
56     OMX_BOOL bBytestream;          // Enable/disable bytestream support
57} OMX_VIDEO_PARAM_BYTESTREAMTYPE;
58
59typedef struct OMX_VIDEO_CONFIG_INTEL_BITRATETYPE {
60     OMX_U32 nSize;
61     OMX_VERSIONTYPE nVersion;
62     OMX_U32 nPortIndex;
63     OMX_U32 nMaxEncodeBitrate;    // Maximum bitrate
64     OMX_U32 nTargetPercentage;    // Target bitrate as percentage of maximum bitrate; e.g. 95 is 95%
65     OMX_U32 nWindowSize;          // Window size in milliseconds allowed for bitrate to reach target
66     OMX_U32 nInitialQP;           // Initial QP for I frames
67     OMX_U32 nMinQP;
68     OMX_U32 nMaxQP;
69     OMX_U32 nFrameRate;
70     OMX_U32 nTemporalID;
71} OMX_VIDEO_CONFIG_INTEL_BITRATETYPE;
72
73enum  {
74    OMX_Video_Intel_ControlRateVideoConferencingMode = OMX_Video_ControlRateVendorStartUnused + 1
75};
76
77typedef struct OMX_VIDEO_PARAM_INTEL_AVC_DECODE_SETTINGS {
78     OMX_U32 nSize;                       // Size of the structure
79     OMX_VERSIONTYPE nVersion;            // OMX specification version
80     OMX_U32 nPortIndex;                  // Port that this structure applies to
81     OMX_U32 nMaxNumberOfReferenceFrame;  // Maximum number of reference frames
82     OMX_U32 nMaxWidth;                   // Maximum width of video
83     OMX_U32 nMaxHeight;                  // Maximum height of video
84} OMX_VIDEO_PARAM_INTEL_AVC_DECODE_SETTINGS;
85
86
87typedef struct OMX_VIDEO_CONFIG_INTEL_SLICE_NUMBERS {
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 nISliceNumber;               // I frame slice number
92     OMX_U32 nPSliceNumber;               // P frame slice number
93} OMX_VIDEO_CONFIG_INTEL_SLICE_NUMBERS;
94
95
96typedef struct OMX_VIDEO_CONFIG_INTEL_AIR {
97     OMX_U32 nSize;                       // Size of the structure
98     OMX_VERSIONTYPE nVersion;            // OMX specification version
99     OMX_U32 nPortIndex;                  // Port that this structure applies to
100     OMX_BOOL bAirEnable;                 // Enable AIR
101     OMX_BOOL bAirAuto;                   // AIR auto
102     OMX_U32 nAirMBs;                     // Number of AIR MBs
103     OMX_U32 nAirThreshold;               // AIR Threshold
104
105} OMX_VIDEO_CONFIG_INTEL_AIR;
106
107typedef struct OMX_VIDEO_PARAM_INTEL_AVCVUI {
108     OMX_U32 nSize;                       // Size of the structure
109     OMX_VERSIONTYPE nVersion;            // OMX specification version
110     OMX_U32 nPortIndex;                  // Port that this structure applies to
111     OMX_BOOL  bVuiGeneration;            // Enable/disable VUI generation
112
113} OMX_VIDEO_PARAM_INTEL_AVCVUI;
114
115typedef struct OMX_VIDEO_PARAM_INTEL_ADAPTIVE_SLICE_CONTROL {
116     OMX_U32 nSize;                       // Size of the structure
117     OMX_VERSIONTYPE nVersion;            // OMX specification version
118     OMX_U32 nPortIndex;                  // Port that this structure applies to
119     OMX_BOOL bEnable;                    // enable adaptive slice control
120     OMX_U32 nMinPSliceNumber;            // minimum number of P slices
121     OMX_U32 nNumPFramesToSkip;           // number of P frames after an I frame to skip before kicking in adaptive slice control
122     OMX_U32 nSliceSizeThreshold;         // Slice size threshold for adaptive slice control to start a new slice
123     OMX_U32 nSliceSizeSkipThreshold;     // Slice size skip threshold for adaptive slice control to start a new slice
124} OMX_VIDEO_PARAM_INTEL_ADAPTIVE_SLICE_CONTROL;
125
126/**
127 * Vendor Private Configs
128 *
129 * STRUCT MEMBERS:
130 *  nSize      : Size of the structure in bytes
131 *  nVersion   : OMX specification version information
132 *  nPortIndex : Port that this structure applies to
133 *  nCapacity  : Specifies the private unit size
134 *  nHolder    : Pointer to private unit address
135 */
136typedef struct OMX_VIDEO_CONFIG_PRI_INFOTYPE {
137    OMX_U32 nSize;
138    OMX_VERSIONTYPE nVersion;
139    OMX_U32 nPortIndex;
140    OMX_U32 nCapacity;
141    OMX_PTR nHolder;
142} OMX_VIDEO_CONFIG_PRI_INFOTYPE;
143
144// Error reporting data structure
145typedef struct OMX_VIDEO_CONFIG_INTEL_ERROR_REPORT {
146    OMX_U32 nSize;
147    OMX_VERSIONTYPE nVersion;
148    OMX_U32 nPortIndex;
149    OMX_BOOL bEnable;
150} OMX_VIDEO_CONFIG_INTEL_ERROR_REPORT;
151
152#define MAX_ERR_NUM 10
153
154typedef enum
155{
156    OMX_Decode_HeaderError   = 0,
157    OMX_Decode_MBError       = 1,
158    OMX_Decode_SliceMissing  = 2,
159    OMX_Decode_RefMissing    = 3,
160} OMX_VIDEO_DECODE_ERRORTYPE;
161
162typedef struct OMX_VIDEO_ERROR_INFO {
163    OMX_VIDEO_DECODE_ERRORTYPE type;
164    OMX_U32 num_mbs;
165    union {
166        struct {OMX_U32 start_mb; OMX_U32 end_mb;} mb_pos;
167    } error_data;
168} OMX_VIDEO_ERROR_INFO;
169
170typedef struct OMX_VIDEO_ERROR_BUFFER {
171    OMX_U32 errorNumber;   // Error number should be no more than MAX_ERR_NUM
172    OMX_S64 timeStamp;      // presentation time stamp
173    OMX_VIDEO_ERROR_INFO errorArray[MAX_ERR_NUM];
174} OMX_VIDEO_ERROR_BUFFER;
175
176// Force K frame for VP8 encode
177typedef struct OMX_VIDEO_CONFIG_INTEL_VP8_FORCE_KFRAME {
178    OMX_U32 nSize;
179    OMX_VERSIONTYPE nVersion;
180    OMX_U32 nPortIndex;
181    OMX_BOOL bForceKFrame;
182} OMX_VIDEO_CONFIG_INTEL_VP8_FORCE_KFRAME;
183
184// max frame size for VP8 encode during WebRTC feature
185typedef struct OMX_VIDEO_CONFIG_INTEL_VP8_MAX_FRAME_SIZE_RATIO {
186    OMX_U32 nSize;
187    OMX_VERSIONTYPE nVersion;
188    OMX_U32 nPortIndex;
189    OMX_U32 nMaxFrameSizeRatio;
190} OMX_VIDEO_CONFIG_INTEL_VP8_MAX_FRAME_SIZE_RATIO;
191
192// temporal layer for Sand
193typedef struct OMX_VIDEO_PARAM_INTEL_TEMPORAL_LAYER {
194    OMX_U32 nSize;
195    OMX_VERSIONTYPE nVersion;
196    OMX_U32 nPortIndex;
197    OMX_U32 nNumberOfTemporalLayer;
198    OMX_U32 nPeriodicity;
199    OMX_U32 nLayerID[32];
200} OMX_VIDEO_PARAM_INTEL_TEMPORAL_LAYER;
201
202
203// Request OMX to allocate a black frame to video mute feature
204typedef struct OMX_VIDEO_INTEL_REQUEST_BALCK_FRAME_POINTER {
205    OMX_U32 nSize;
206    OMX_VERSIONTYPE nVersion;
207    OMX_U32 nPortIndex;
208    OMX_U32 nFramePointer;
209} OMX_VIDEO_INTEL_REQUEST_BALCK_FRAME_POINTER;
210
211#define OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar (OMX_COLOR_FORMATTYPE)0x7FA00E00
212#define OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar_Tiled (OMX_COLOR_FORMATTYPE)0x7FA00F00
213
214#ifdef __cplusplus
215}
216#endif /* __cplusplus */
217
218#endif /* OMX_VideoExt_h */
219/* File EOF */
220