summaryrefslogtreecommitdiff
path: root/mm-core/inc/OMX_QCOMExtns.h
blob: 745df3219635cd1bf03790f6462f484d89770c7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
/*--------------------------------------------------------------------------
Copyright (c) 2009-2017, The Linux Foundation. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * Neither the name of The Linux Foundation nor
      the names of its contributors may be used to endorse or promote
      products derived from this software without specific prior written
      permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------*/
#ifndef __OMX_QCOM_EXTENSIONS_H__
#define __OMX_QCOM_EXTENSIONS_H__

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

/*============================================================================
*//** @file OMX_QCOMExtns.h
  This header contains constants and type definitions that specify the
  extensions added to the OpenMAX Vendor specific APIs.

*//*========================================================================*/


///////////////////////////////////////////////////////////////////////////////
//                             Include Files
///////////////////////////////////////////////////////////////////////////////
#include "OMX_Core.h"
#include "OMX_Video.h"
#include "string.h"

#define OMX_VIDEO_MAX_HP_LAYERS 6

/**
 * These MACROS used by Camera and Video to decide buffer count.
 * This is to avoid mismatch of buffer count between Camera and Video.
 * In Meta mode, read this count as buffer count in Camera and Header
 * count in Video.
 * 1) Number of buffers in Non-DCVS mode.
 * 2) DCVS resolution.
 * 3) Buffer count when Current resolution is greater than DCVS resolution
 * defined in 2)
 */

#define OMX_VIDEO_MIN_CAMERA_BUFFERS 9
#define OMX_VIDEO_ENC_DCVS_RESOLUTION 3840 * 2160
#define OMX_VIDEO_MIN_CAMERA_BUFFERS_DCVS 11

/**
 * This count indicates the number of Ints in the legacy Camera payload
 * used for HAL1
 */

#define VIDEO_METADATA_NUM_COMMON_INTS 1

/**
 * This extension is used to register mapping of a virtual
 * address to a physical address. This extension is a parameter
 * which can be set using the OMX_SetParameter macro. The data
 * pointer corresponding to this extension is
 * OMX_QCOM_MemMapEntry. This parameter is a 'write only'
 * parameter (Current value cannot be queried using
 * OMX_GetParameter macro).
 */
#define OMX_QCOM_EXTN_REGISTER_MMAP     "OMX.QCOM.index.param.register_mmap"

/**
 * This structure describes the data pointer corresponding to
 * the OMX_QCOM_MMAP_REGISTER_EXTN extension. This parameter
 * must be set only 'after' populating a port with a buffer
 * using OMX_UseBuffer, wherein the data pointer of the buffer
 * corresponds to the virtual address as specified in this
 * structure.
 */
struct OMX_QCOM_PARAM_MEMMAPENTRYTYPE
{
    OMX_U32 nSize;              /** Size of the structure in bytes */
    OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */
    OMX_U32 nPortIndex;         /**< Port number the structure applies to */

    /**
     * The virtual address of memory block
     */
    OMX_U64 nVirtualAddress;

    /**
     * The physical address corresponding to the virtual address. The physical
     * address is contiguous for the entire valid range of the virtual
     * address.
     */
    OMX_U64 nPhysicalAddress;
};

#define QOMX_VIDEO_IntraRefreshRandom (OMX_VIDEO_IntraRefreshVendorStartUnused + 0)

/* This error event is used for H.264 long-term reference (LTR) encoding.
 * When IL client specifies an LTR frame with its identifier via
 * OMX_QCOM_INDEX_CONFIG_VIDEO_LTRUSE to the encoder, if the specified
 * LTR frame can not be located by the encoder in its LTR list, the encoder
 * issues this error event to IL client to notify the failure of LTRUse config.
 */
#define QOMX_ErrorLTRUseFailed        (OMX_ErrorVendorStartUnused + 1)

/*
 * This rate control will be used for low bitrate applications to get better
 * video quality for a given bitrate.
 */
#define QOMX_Video_ControlRateMaxBitrate (OMX_Video_ControlRateVendorStartUnused + 1)

#define QOMX_Video_ControlRateMaxBitrateSkipFrames (OMX_Video_ControlRateVendorStartUnused + 2)

#define QOMX_VIDEO_BUFFERFLAG_BFRAME 0x00100000

#define QOMX_VIDEO_BUFFERFLAG_EOSEQ  0x00200000

#define QOMX_VIDEO_BUFFERFLAG_MBAFF  0x00400000

#define QOMX_VIDEO_BUFFERFLAG_CANCEL 0x00800000

#define OMX_QCOM_PORTDEFN_EXTN   "OMX.QCOM.index.param.portdefn"
/* Allowed APIs on the above Index: OMX_GetParameter() and OMX_SetParameter() */

typedef enum OMX_QCOMMemoryRegion
{
    OMX_QCOM_MemRegionInvalid,
    OMX_QCOM_MemRegionEBI1,
    OMX_QCOM_MemRegionSMI,
    OMX_QCOM_MemRegionMax = 0X7FFFFFFF
} OMX_QCOMMemoryRegion;

typedef enum OMX_QCOMCacheAttr
{
    OMX_QCOM_CacheAttrNone,
    OMX_QCOM_CacheAttrWriteBack,
    OMX_QCOM_CacheAttrWriteThrough,
    OMX_QCOM_CacheAttrMAX = 0X7FFFFFFF
} OMX_QCOMCacheAttr;

typedef struct OMX_QCOMRectangle
{
   OMX_S32 x;
   OMX_S32 y;
   OMX_S32 dx;
   OMX_S32 dy;
} OMX_QCOMRectangle;

/** OMX_QCOMFramePackingFormat
  * Input or output buffer format
  */
typedef enum OMX_QCOMFramePackingFormat
{
  /* 0 - unspecified
   */
  OMX_QCOM_FramePacking_Unspecified,

  /*  1 - Partial frames may be present OMX IL 1.1.1 Figure 2-10:
   *  Case 1??Each Buffer Filled In Whole or In Part
   */
  OMX_QCOM_FramePacking_Arbitrary,

  /*  2 - Multiple complete frames per buffer (integer number)
   *  OMX IL 1.1.1 Figure 2-11: Case 2-Each Buffer Filled with
   *  Only Complete Frames of Data
   */
  OMX_QCOM_FramePacking_CompleteFrames,

  /*  3 - Only one complete frame per buffer, no partial frame
   *  OMX IL 1.1.1 Figure 2-12: Case 3-Each Buffer Filled with
   *  Only One Frame of Compressed Data. Usually at least one
   *  complete unit of data will be delivered in a buffer for
   *  uncompressed data formats.
   */
  OMX_QCOM_FramePacking_OnlyOneCompleteFrame,

  /*  4 - Only one complete subframe per buffer, no partial subframe
   *  Example: In H264, one complete NAL per buffer, where one frame
   *  can contatin multiple NAL
   */
  OMX_QCOM_FramePacking_OnlyOneCompleteSubFrame,

  OMX_QCOM_FramePacking_MAX = 0X7FFFFFFF
} OMX_QCOMFramePackingFormat;

typedef struct OMX_QCOM_PARAM_PORTDEFINITIONTYPE {
 OMX_U32 nSize;           /** Size of the structure in bytes */
 OMX_VERSIONTYPE nVersion;/** OMX specification version information */
 OMX_U32 nPortIndex;    /** Portindex which is extended by this structure */

 /** Platform specific memory region EBI1, SMI, etc.,*/
 OMX_QCOMMemoryRegion nMemRegion;

 OMX_QCOMCacheAttr nCacheAttr; /** Cache attributes */

 /** Input or output buffer format */
 OMX_U32 nFramePackingFormat;

} OMX_QCOM_PARAM_PORTDEFINITIONTYPE;

typedef struct OMX_QCOM_VIDEO_CONFIG_QP {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_U32 nQP;
} OMX_QCOM_VIDEO_CONFIG_QP;

typedef struct OMX_QCOM_VIDEO_PARAM_IPB_QPRANGETYPE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_U32 minIQP;
    OMX_U32 maxIQP;
    OMX_U32 minPQP;
    OMX_U32 maxPQP;
    OMX_U32 minBQP;
    OMX_U32 maxBQP;
} OMX_QCOM_VIDEO_PARAM_IPB_QPRANGETYPE;

#define OMX_QCOM_PLATFORMPVT_EXTN   "OMX.QCOM.index.param.platformprivate"
/** Allowed APIs on the above Index: OMX_SetParameter() */

typedef enum OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE
{
    /** Enum for PMEM information */
    OMX_QCOM_PLATFORM_PRIVATE_PMEM = 0x1
} OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE;

/** IL client will set the following structure. A failure
 *  code will be returned if component does not support the
 *  value provided for 'type'.
 */
struct OMX_QCOM_PLATFORMPRIVATE_EXTN
{
    OMX_U32 nSize;        /** Size of the structure in bytes */
    OMX_VERSIONTYPE nVersion; /** OMX spec version information */
    OMX_U32 nPortIndex;  /** Port number on which usebuffer extn is applied */

    /** Type of extensions should match an entry from
     OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE
    */
    OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE type;
};

typedef struct OMX_QCOM_PLATFORM_PRIVATE_PMEM_INFO
{
    /** pmem file descriptor */
    unsigned long pmem_fd;
    /** Offset from pmem device base address */
    OMX_U32 offset;
    OMX_U32 size;
    OMX_U32 mapped_size;
    OMX_PTR buffer;
}OMX_QCOM_PLATFORM_PRIVATE_PMEM_INFO;

typedef struct OMX_QCOM_PLATFORM_PRIVATE_ENTRY
{
    /** Entry type */
    OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE type;

    /** Pointer to platform specific entry */
    OMX_PTR entry;
}OMX_QCOM_PLATFORM_PRIVATE_ENTRY;

typedef struct OMX_QCOM_PLATFORM_PRIVATE_LIST
{
    /** Number of entries */
    OMX_U32 nEntries;

    /** Pointer to array of platform specific entries *
     * Contiguous block of OMX_QCOM_PLATFORM_PRIVATE_ENTRY element
    */
    OMX_QCOM_PLATFORM_PRIVATE_ENTRY* entryList;
}OMX_QCOM_PLATFORM_PRIVATE_LIST;

#define OMX_QCOM_FRAME_PACKING_FORMAT   "OMX.QCOM.index.param.framepackfmt"
/* Allowed API call: OMX_GetParameter() */
/* IL client can use this index to rerieve the list of frame formats *
 * supported by the component */

typedef struct OMX_QCOM_FRAME_PACKINGFORMAT_TYPE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_U32 nIndex;
    OMX_QCOMFramePackingFormat eframePackingFormat;
} OMX_QCOM_FRAME_PACKINGFORMAT_TYPE;


/**
 * Following is the enum for color formats supported on Qualcomm
 * MSMs YVU420SemiPlanar color format is not defined in OpenMAX
 * 1.1.1 and prior versions of OpenMAX specification.
 */

enum OMX_QCOM_COLOR_FORMATTYPE
{

/** YVU420SemiPlanar: YVU planar format, organized with a first
 *  plane containing Y pixels, and a second plane containing
 *  interleaved V and U pixels. V and U pixels are sub-sampled
 *  by a factor of two both horizontally and vertically.
 */
    QOMX_COLOR_FormatYVU420SemiPlanar = 0x7FA30C00,
    QOMX_COLOR_FormatYVU420PackedSemiPlanar32m4ka,
    QOMX_COLOR_FormatYUV420PackedSemiPlanar16m2ka,
    QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka,
    QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m,
    QOMX_COLOR_FORMATYUV420PackedSemiPlanar32mMultiView,
    QOMX_COLOR_FORMATYUV420PackedSemiPlanar32mCompressed,
    QOMX_COLOR_Format32bitRGBA8888,
    QOMX_COLOR_Format32bitRGBA8888Compressed,
    QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m10bitCompressed,
    QOMX_COLOR_FormatAndroidOpaque = (OMX_COLOR_FORMATTYPE) OMX_COLOR_FormatVendorStartUnused  + 0x789,
};

enum OMX_QCOM_VIDEO_CODINGTYPE
{
/** Codecs support by qualcomm which are not listed in OMX 1.1.x
 *  spec
 *   */
    OMX_QCOM_VIDEO_CodingVC1  = 0x7FA30C00 ,
    OMX_QCOM_VIDEO_CodingWMV9 = 0x7FA30C01,
    QOMX_VIDEO_CodingDivx = 0x7FA30C02,     /**< Value when coding is Divx */
    QOMX_VIDEO_CodingSpark = 0x7FA30C03,     /**< Value when coding is Sorenson Spark */
    QOMX_VIDEO_CodingVp = 0x7FA30C04,
    QOMX_VIDEO_CodingVp8 = OMX_VIDEO_CodingVP8,   /**< keeping old enum for backwards compatibility*/
    QOMX_VIDEO_CodingHevc = OMX_VIDEO_CodingHEVC, /**< keeping old enum for backwards compatibility*/
    QOMX_VIDEO_CodingMVC = 0x7FA30C07,
    QOMX_VIDEO_CodingVp9 = OMX_VIDEO_CodingVP9,   /**< keeping old enum for backwards compatibility*/
    QOMX_VIDEO_CodingTME = 0x7FA30C09,
};

enum OMX_QCOM_EXTN_INDEXTYPE
{
    /** Qcom proprietary extension index list */

    /* "OMX.QCOM.index.param.register_mmap" */
    OMX_QcomIndexRegmmap = 0x7F000000,

    /* "OMX.QCOM.index.param.platformprivate" */
    OMX_QcomIndexPlatformPvt = 0x7F000001,

    /* "OMX.QCOM.index.param.portdefn" */
    OMX_QcomIndexPortDefn = 0x7F000002,

    /* "OMX.QCOM.index.param.framepackingformat" */
    OMX_QcomIndexPortFramePackFmt = 0x7F000003,

    /*"OMX.QCOM.index.param.Interlaced */
    OMX_QcomIndexParamInterlaced = 0x7F000004,

    /*"OMX.QCOM.index.config.interlaceformat */
    OMX_QcomIndexConfigInterlaced = 0x7F000005,

    /*"OMX.QCOM.index.param.syntaxhdr" */
    QOMX_IndexParamVideoSyntaxHdr = 0x7F000006,

    /*"OMX.QCOM.index.config.intraperiod" */
    QOMX_IndexConfigVideoIntraperiod = 0x7F000007,

    /*"OMX.QCOM.index.config.randomIntrarefresh" */
    QOMX_IndexConfigVideoIntraRefresh = 0x7F000008,

    /*"OMX.QCOM.index.config.video.TemporalSpatialTradeOff" */
    QOMX_IndexConfigVideoTemporalSpatialTradeOff = 0x7F000009,

    /*"OMX.QCOM.index.param.video.EncoderMode" */
    QOMX_IndexParamVideoEncoderMode = 0x7F00000A,

    /*"OMX.QCOM.index.param.Divxtype */
    OMX_QcomIndexParamVideoDivx = 0x7F00000B,

    /*"OMX.QCOM.index.param.Sparktype */
    OMX_QcomIndexParamVideoSpark = 0x7F00000C,

    /*"OMX.QCOM.index.param.Vptype */
    OMX_QcomIndexParamVideoVp = 0x7F00000D,

    OMX_QcomIndexQueryNumberOfVideoDecInstance = 0x7F00000E,

    OMX_QcomIndexParamVideoSyncFrameDecodingMode = 0x7F00000F,

    OMX_QcomIndexParamVideoDecoderPictureOrder = 0x7F000010,

    /* "OMX.QCOM.index.config.video.FramePackingInfo" */
    OMX_QcomIndexConfigVideoFramePackingArrangement = 0x7F000011,

    OMX_QcomIndexParamConcealMBMapExtraData = 0x7F000012,

    OMX_QcomIndexParamFrameInfoExtraData = 0x7F000013,

    OMX_QcomIndexParamInterlaceExtraData = 0x7F000014,

    OMX_QcomIndexParamH264TimeInfo = 0x7F000015,

    OMX_QcomIndexParamIndexExtraDataType = 0x7F000016,

    OMX_GoogleAndroidIndexEnableAndroidNativeBuffers = 0x7F000017,

    OMX_GoogleAndroidIndexUseAndroidNativeBuffer = 0x7F000018,

    OMX_GoogleAndroidIndexGetAndroidNativeBufferUsage = 0x7F000019,

    /*"OMX.QCOM.index.param.EnableTimeStampReoder"*/
    OMX_QcomIndexParamEnableTimeStampReorder = 0x7F00001B,

    /*"OMX.google.android.index.storeMetaDataInBuffers"*/
    OMX_QcomIndexParamVideoMetaBufferMode = 0x7F00001C,

    /*"OMX.google.android.index.useAndroidNativeBuffer2"*/
    OMX_GoogleAndroidIndexUseAndroidNativeBuffer2 = 0x7F00001D,

    /*"OMX.QCOM.index.param.VideoMaxAllowedBitrateCheck"*/
    OMX_QcomIndexParamVideoMaxAllowedBitrateCheck = 0x7F00001E,

    OMX_QcomIndexEnableSliceDeliveryMode = 0x7F00001F,

    /* "OMX.QCOM.index.param.video.ExtnUserExtraData" */
    OMX_QcomIndexEnableExtnUserData = 0x7F000020,

    /*"OMX.QCOM.index.param.video.EnableSmoothStreaming"*/
    OMX_QcomIndexParamEnableSmoothStreaming = 0x7F000021,

    OMX_QcomIndexEnableH263PlusPType = 0x7F000023,

    /*"OMX.QCOM.index.param.video.LTRCount"*/
    QOMX_IndexParamVideoLTRCount = 0x7F000026,

    /*"OMX.QCOM.index.config.video.LTRUse"*/
    QOMX_IndexConfigVideoLTRUse = 0x7F000028,

    /*"OMX.QCOM.index.config.video.LTRMark"*/
    QOMX_IndexConfigVideoLTRMark = 0x7F000029,

    /* OMX.google.android.index.prependSPSPPSToIDRFrames */
    OMX_QcomIndexParamSequenceHeaderWithIDR = 0x7F00002A,

    OMX_QcomIndexParamAUDelimiter = 0x7F00002B,

    OMX_QcomIndexParamVideoDownScalar = 0x7F00002C,

    /* "OMX.QCOM.index.param.video.FramePackingExtradata" */
    OMX_QcomIndexParamVideoFramePackingExtradata = 0x7F00002D,

    /* "OMX.QCOM.index.config.activeregiondetection" */
    OMX_QcomIndexConfigActiveRegionDetection = 0x7F00002E,

    /* "OMX.QCOM.index.config.activeregiondetectionstatus" */
    OMX_QcomIndexConfigActiveRegionDetectionStatus = 0x7F00002F,

    /* "OMX.QCOM.index.config.scalingmode" */
    OMX_QcomIndexConfigScalingMode = 0x7F000030,

    /* "OMX.QCOM.index.config.noisereduction" */
    OMX_QcomIndexConfigNoiseReduction = 0x7F000031,

    /* "OMX.QCOM.index.config.imageenhancement" */
    OMX_QcomIndexConfigImageEnhancement = 0x7F000032,

    /* google smooth-streaming support */
    OMX_QcomIndexParamVideoAdaptivePlaybackMode = 0x7F000033,

    /* H.264 MVC codec index */
    QOMX_IndexParamVideoMvc = 0x7F000034,

    /* "OMX.QCOM.index.param.video.QPExtradata" */
    OMX_QcomIndexParamVideoQPExtraData = 0x7F000035,

    /* "OMX.QCOM.index.param.video.InputBitsInfoExtradata" */
    OMX_QcomIndexParamVideoInputBitsInfoExtraData = 0x7F000036,

    /* VP8 Hierarchical P support */
    OMX_QcomIndexHierarchicalStructure = 0x7F000037,

    OMX_QcomIndexParamH264VUITimingInfo = 0x7F000039,

    OMX_QcomIndexParamPeakBitrate = 0x7F00003A,

    /* Enable InitialQP : QOMX_EXTNINDEX_VIDEO_INITIALQP */
    QOMX_IndexParamVideoInitialQp = 0x7F00003B,

    OMX_QcomIndexParamSetMVSearchrange = 0x7F00003C,

    /* Note: This will get deprecated */
    OMX_QcomIndexConfigPerfLevel = 0x7F00003D,

    /*"OMX.QCOM.index.param.video.LTRCount"*/
    OMX_QcomIndexParamVideoLTRCount = QOMX_IndexParamVideoLTRCount,

    /*"OMX.QCOM.index.config.video.LTRUse"*/
    OMX_QcomIndexConfigVideoLTRUse = QOMX_IndexConfigVideoLTRUse,

    /*"OMX.QCOM.index.config.video.LTRMark"*/
    OMX_QcomIndexConfigVideoLTRMark = QOMX_IndexConfigVideoLTRMark,

    /*"OMX.QCOM.index.param.video.CustomBufferSize"*/
    OMX_QcomIndexParamVideoCustomBufferSize = 0x7F00003E,

    /* Max Hierarchical P layers */
    OMX_QcomIndexMaxHierarchicallayers = 0x7F000041,

    /* Set Hybrid Hier-p layers */
    OMX_QcomIndexParamVideoHybridHierpMode = 0x7F000043,

    OMX_QcomIndexFlexibleYUVDescription = 0x7F000044,

    /* Vpp Hqv Control Type */
    OMX_QcomIndexParamVppHqvControl = 0x7F000045,

    /* Enable VPP */
    OMX_QcomIndexParamEnableVpp = 0x7F000046,

    /* MBI statistics mode */
    OMX_QcomIndexParamMBIStatisticsMode = 0x7F000047,

    /* Set PictureTypeDecode */
    OMX_QcomIndexConfigPictureTypeDecode = 0x7F000048,

    OMX_QcomIndexConfigH264EntropyCodingCabac = 0x7F000049,

    /* "OMX.QCOM.index.param.video.InputBatch" */
    OMX_QcomIndexParamBatchSize = 0x7F00004A,

    OMX_QcomIndexConfigNumHierPLayers = 0x7F00004B,

    OMX_QcomIndexConfigRectType = 0x7F00004C,

    OMX_QcomIndexConfigBaseLayerId = 0x7F00004E,

    OMX_QcomIndexParamDriverVersion = 0x7F00004F,

    /* Reference : OMX_QCOM_VIDEO_CONFIG_QP */
    OMX_QcomIndexConfigQp = 0x7F000050,

    OMX_QcomIndexParamVencAspectRatio = 0x7F000051,

    OMX_QTIIndexParamVQZipSEIExtraData = 0x7F000052,

    /* Enable VQZIP SEI NAL type */
    OMX_QTIIndexParamVQZIPSEIType = 0x7F000053,

    OMX_QTIIndexParamPassInputBufferFd = 0x7F000054,

    /* Set Prefer-adaptive playback*/
    /* "OMX.QTI.index.param.video.PreferAdaptivePlayback" */
    OMX_QTIIndexParamVideoPreferAdaptivePlayback = 0x7F000055,

    /* Set time params */
    OMX_QTIIndexConfigSetTimeData = 0x7F000056,
    /* Force Compressed format for DPB when resolution <=1080p
     * and OPB is cpu_access */
    /* OMX.QTI.index.param.video.ForceCompressedForDPB */
    OMX_QTIIndexParamForceCompressedForDPB = 0x7F000057,

    /* Enable ROI info */
    OMX_QTIIndexParamVideoEnableRoiInfo = 0x7F000058,

    /* Configure ROI info */
    OMX_QTIIndexConfigVideoRoiInfo = 0x7F000059,

    /* Set Low Latency Mode */
    OMX_QTIIndexParamLowLatencyMode = 0x7F00005B,

    /* Force OPB to UnCompressed mode */
    OMX_QTIIndexParamForceUnCompressedForOPB = 0x7F00005C,

    /* OMX.google.android.index.allocateNativeHandle */
    OMX_GoogleAndroidIndexAllocateNativeHandle = 0x7F00005D,

    /* Configure BLUR resolution for encode */
    OMX_QTIIndexConfigVideoBlurResolution = 0x7F00005E,

    /* QP range for I/P/B frames : OMX_QCOM_VIDEO_PARAM_IPB_QPRANGETYPE */
    OMX_QcomIndexParamVideoIPBQPRange = 0x7F00005F,

    /* Enable client extradata */
    OMX_QTIIndexParamVideoClientExtradata = 0x7F000060,

    /* H264 transform 8x8 mode */
    OMX_QcomIndexConfigH264Transform8x8 = 0x7F000061,

    /*"OMX.google.android.index.describeColorAspects"*/
    OMX_QTIIndexConfigDescribeColorAspects = 0x7F000062,

    OMX_QTIIndexParamVUIExtraDataExtraData = 0x7F000063,

    OMX_QTIIndexParamMPEG2SeqDispExtraData = 0x7F000064,

    OMX_QTIIndexParamVC1SeqDispExtraData = 0x7F000065,

    OMX_QTIIndexParamVPXColorSpaceExtraData = 0x7F000066,

    /*"OMX.google.android.index.describeHDRStaticInfo"*/
    OMX_QTIIndexConfigDescribeHDRColorInfo = 0x7F000067,

    /* Configure to disable PQ*/
    OMX_QTIIndexParamDisablePQ = 0x7F000068,

    /* Dither control for 10bit */
    OMX_QTIIndexParamDitherControl = 0x7F000069,

    /* Suggest how big Iframe sizes should be */
    OMX_QTIIndexParamIframeSizeType = 0x7F000070,

    /* use av-timer ticks as timestamp (used by VT-client) */
    OMX_QTIIndexParamEnableAVTimerTimestamps = 0x7F000071,

    /* Output Crop extradata (includes MISR) */
    OMX_QcomIndexParamOutputCropExtraData = 0x7F000072,

    /* Controlled Input queue mode for frame accurate configuration */
    OMX_QcomIndexParamVencControlInputQueue = 0x7F000073,

    /**
    *  Configure Slice Header Spacing
    *  This index will be used to configure both byte based
    *  and MB based slice header spacing. This is the preferred
    *  alternative to OMX_IndexParamVideoAvc (for MB based)
    *  and OMX_IndexParamVideoErrorCorrection (for byte based)
    */
    OMX_QcomIndexParamVideoSliceSpacing = 0x7F000074,

    /* OMX.QTI.index.config.video.getdsmode */
    OMX_QTIIndexConfigGetDSMode = 0x7F000075,

    /*
     * Client configured profile and level for sufficiency
     * This index will be set by the OMX client which will
     * specify profile and level of the clip upto which
     * buffer sufficiency should be considered. if the profile
     * or level of the clip exceeds the client specified
     * profile and level via this index, sufficient buffer
     * events will be converted to insufficient.
     * Structure to be used for this extension is:
     * typedef struct OMX_VIDEO_PARAM_PROFILELEVELTYPE {
     * OMX_U32 nSize;
     * OMX_VERSIONTYPE nVersion;
     * OMX_U32 nPortIndex;
     * OMX_U32 eProfile;
     * OMX_U32 eLevel;
     * OMX_U32 nProfileIndex; // index not needed
     * } OMX_VIDEO_PARAM_PROFILELEVELTYPE;
     */
    OMX_QTIIndexParamClientConfiguredProfileLevelForSufficiency = 0x7F000076,

    /* TME configuration */
    OMX_IndexParamVideoTme = 0x7F000077,

    /* Set Color Space Conversion */
    OMX_QTIIndexParamColorSpaceConversion = 0x7F000078,

    /* Capabilities */
    OMX_QTIIndexParamCapabilitiesVTDriverVersion = 0x7F100000,

    OMX_QTIIndexParamCapabilitiesMaxTemporalLayers = 0x7F100001,

    OMX_QTIIndexParamCapabilitiesMaxLTR = 0x7F100002,

    OMX_QTIIndexParamCapabilitiesMaxDownScaleRatio = 0x7F100003,

    OMX_QTIIndexParamCapabilitiesRotationSupport = 0x7F100004,
};

/**
* This is custom extension to configure Low Latency Mode.
*
* STRUCT MEMBERS
*
* nSize         : Size of Structure in bytes
* nVersion      : OpenMAX IL specification version information
* bEnableLowLatencyMode   : Enable/Disable Low Latency mode
* nNumFrames    : Latency in terms of num of frames
*                 0: Minimum possible latency,
*                 n: n-frame latency
*                 Valid when bEnableLowLatencyMode is TRUE
*/

typedef struct QOMX_EXTNINDEX_VIDEO_LOW_LATENCY_MODE
{
   OMX_U32 nSize;
   OMX_VERSIONTYPE nVersion;
   OMX_BOOL bEnableLowLatencyMode;
   OMX_U32  nNumFrames;
} QOMX_EXTNINDEX_VIDEO_LOW_LATENCY_MODE;

/**
* This is custom extension to configure Encoder Aspect Ratio.
*
* STRUCT MEMBERS
*
* nSize         : Size of Structure in bytes
* nVersion      : OpenMAX IL specification version information
* nSARWidth     : Horizontal aspect size
* nSARHeight    : Vertical aspect size
*/

typedef struct QOMX_EXTNINDEX_VIDEO_VENC_SAR
{
   OMX_U32 nSize;
   OMX_VERSIONTYPE nVersion;
   OMX_U32 nSARWidth;
   OMX_U32 nSARHeight;
} QOMX_EXTNINDEX_VIDEO_VENC_SAR;

/**
* This is custom extension to configure Hier-p layers.
* This mode configures Hier-p layers dynamically.
*
* STRUCT MEMBERS
*
* nSize         : Size of Structure in bytes
* nVersion      : OpenMAX IL specification version information
* nNumHierLayers: Set the number of Hier-p layers for the session
*                  - This should be less than the MAX Hier-P
*                    layers set for the session.
*/

typedef struct QOMX_EXTNINDEX_VIDEO_HIER_P_LAYERS {
   OMX_U32 nSize;
   OMX_VERSIONTYPE nVersion;
   OMX_U32 nNumHierLayers;
} QOMX_EXTNINDEX_VIDEO_HIER_P_LAYERS;


/**
* This is custom extension to configure Hybrid Hier-p settings.
* This mode is different from enabling Hier-p mode. This
* property enables Hier-p encoding with LTR referencing in each
* sub-GOP.
*
* STRUCT MEMBERS
*
* nSize         : Size of Structure in bytes
* nVersion      : OpenMAX IL specification version information
* nKeyFrameInterval : Indicates the I frame interval
* nHpLayers     : Set the number of Hier-p layers for the session
*                  - This should be <= 6. (1 Base layer +
*                    5 Enhancement layers)
* nTemporalLayerBitrateRatio[OMX_VIDEO_MAX_HP_LAYERS] : Bitrate to
*                    be set for each enhancement layer
* nMinQuantizer  : minimum session QP
* nMaxQuantizer  : Maximun session QP
*/

typedef struct QOMX_EXTNINDEX_VIDEO_HYBRID_HP_MODE {
   OMX_U32 nSize;
   OMX_VERSIONTYPE nVersion;
   OMX_U32 nKeyFrameInterval;
   OMX_U32 nTemporalLayerBitrateRatio[OMX_VIDEO_MAX_HP_LAYERS];
   OMX_U32 nMinQuantizer;
   OMX_U32 nMaxQuantizer;
   OMX_U32 nHpLayers;
} QOMX_EXTNINDEX_VIDEO_HYBRID_HP_MODE;

/**
 * Initial QP parameter.  This structure is used to enable
 * vendor specific extension to let client enable setting
 * initial QP values to I P B Frames
 *
 * STRUCT MEMBERS:
 *  nSize              : Size of Structure in bytes
 *  nVersion           : OpenMAX IL specification version information
 *  nPortIndex         : Index of the port to which this structure applies
 *  OMX_U32 nQpI       : First Iframe QP
 *  OMX_U32 nQpP       : First Pframe QP
 *  OMX_U32 nQpB       : First Bframe QP
 *  OMX_U32 bEnableInitQp : Bit field indicating which frame type(s) shall
 *                             use the specified initial QP.
 *                          Bit 0: Enable initial QP for I/IDR
 *                                 and use value specified in nInitQpI
 *                          Bit 1: Enable initial QP for
 *                                 and use value specified in nInitQpP
 *                          Bit 2: Enable initial QP for B
 *                                 and use value specified in nInitQpB
 */
typedef struct QOMX_EXTNINDEX_VIDEO_INITIALQP {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_U32 nQpI;
    OMX_U32 nQpP;
    OMX_U32 nQpB;
    OMX_U32 bEnableInitQp;
} QOMX_EXTNINDEX_VIDEO_INITIALQP;

/**
 * Extension index parameter.  This structure is used to enable
 * vendor specific extension on input/output port and
 * to pass the required flags and data, if any.
 * The format of flags and data being passed is known to
 * the client and component apriori.
 *
 * STRUCT MEMBERS:
 *  nSize              : Size of Structure plus pData size
 *  nVersion           : OMX specification version information
 *  nPortIndex         : Indicates which port to set
 *  bEnable            : Extension index enable (1) or disable (0)
 *  nFlags             : Extension index flags, if any
 *  nDataSize          : Size of the extension index data to follow
 *  pData              : Extension index data, if present.
 */
typedef struct QOMX_EXTNINDEX_PARAMTYPE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_BOOL bEnable;
    OMX_U32 nFlags;
    OMX_U32 nDataSize;
    OMX_PTR pData;
} QOMX_EXTNINDEX_PARAMTYPE;

/**
 * Range index parameter.  This structure is used to enable
 * vendor specific extension on input/output port and
 * to pass the required minimum and maximum values
 *
 * STRUCT MEMBERS:
 *  nSize              : Size of Structure in bytes
 *  nVersion           : OpenMAX IL specification version information
 *  nPortIndex         : Index of the port to which this structure applies
 *  nMin               : Minimum value
 *  nMax               : Maximum value
 *  nSteSize           : Step size
 */
typedef struct QOMX_EXTNINDEX_RANGETYPE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_S32 nMin;
    OMX_S32 nMax;
    OMX_S32 nStepSize;
} QOMX_EXTNINDEX_RANGETYPE;

/**
 * LTR count index parameter.  This structure is used
 * to enable vendor specific extension on output port
 * to pass the LTR count information.
 *
 * STRUCT MEMBERS:
 *  nSize              : Size of Structure in bytes
 *  nVersion           : OpenMAX IL specification version information
 *  nPortIndex         : Index of the port to which this structure applies
 *  nCount             : Specifies the number of LTR frames stored in the
 *                       encoder component
 */
typedef struct QOMX_VIDEO_PARAM_LTRCOUNT_TYPE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_U32 nCount;
} QOMX_VIDEO_PARAM_LTRCOUNT_TYPE;


/**
 * This should be used with OMX_QcomIndexParamVideoLTRCount extension.
 */
typedef QOMX_VIDEO_PARAM_LTRCOUNT_TYPE OMX_QCOM_VIDEO_PARAM_LTRCOUNT_TYPE;

/**
 * Marks the next encoded frame as an LTR frame.
 * STRUCT MEMBERS:
 *  nSize              : Size of Structure in bytes
 *  nVersion           : OpenMAX IL specification version information
 *  nPortIndex         : Index of the port to which this structure applies
 *  nID                : Specifies the identifier of the LTR frame to be marked
 *                       as reference frame for encoding subsequent frames.
 */
typedef struct QOMX_VIDEO_CONFIG_LTRMARK_TYPE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_U32 nID;
} QOMX_VIDEO_CONFIG_LTRMARK_TYPE;

/**
 * This should be used with OMX_QcomIndexConfigVideoLTRMark extension.
 */
typedef QOMX_VIDEO_CONFIG_LTRMARK_TYPE OMX_QCOM_VIDEO_CONFIG_LTRMARK_TYPE;

/**
 * Specifies an LTR frame to encode subsequent frames.
 * STRUCT MEMBERS:
 *  nSize              : Size of Structure in bytes
 *  nVersion           : OpenMAX IL specification version information
 *  nPortIndex         : Index of the port to which this structure applies
 *  nID                : Specifies the identifier of the LTR frame to be used
                         as reference frame for encoding subsequent frames.
 *  nFrames            : Specifies the number of subsequent frames to be
                         encoded using the LTR frame with its identifier
                         nID as reference frame. Short-term reference frames
                         will be used thereafter. The value of 0xFFFFFFFF
                         indicates that all subsequent frames will be
                         encodedusing this LTR frame as reference frame.
 */
typedef struct QOMX_VIDEO_CONFIG_LTRUSE_TYPE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_U32 nID;
    OMX_U32 nFrames;
} QOMX_VIDEO_CONFIG_LTRUSE_TYPE;

/**
 * This should be used with OMX_QcomIndexConfigVideoLTRUse extension.
 */
typedef QOMX_VIDEO_CONFIG_LTRUSE_TYPE OMX_QCOM_VIDEO_CONFIG_LTRUSE_TYPE;

/**
 * Enumeration used to define the video encoder modes
 *
 * ENUMS:
 *  EncoderModeDefault : Default video recording mode.
 *                       All encoder settings made through
 *                       OMX_SetParameter/OMX_SetConfig are applied. No
 *                       parameter is overridden.
 *  EncoderModeMMS : Video recording mode for MMS (Multimedia Messaging
 *                   Service). This mode is similar to EncoderModeDefault
 *                   except that here the Rate control mode is overridden
 *                   internally and set as a variant of variable bitrate with
 *                   variable frame rate. After this mode is set if the IL
 *                   client tries to set OMX_VIDEO_CONTROLRATETYPE via
 *                   OMX_IndexParamVideoBitrate that would be rejected. For
 *                   this, client should set mode back to EncoderModeDefault
 *                   first and then change OMX_VIDEO_CONTROLRATETYPE.
 */
typedef enum QOMX_VIDEO_ENCODERMODETYPE
{
    QOMX_VIDEO_EncoderModeDefault        = 0x00,
    QOMX_VIDEO_EncoderModeMMS            = 0x01,
    QOMX_VIDEO_EncoderModeMax            = 0x7FFFFFFF
} QOMX_VIDEO_ENCODERMODETYPE;

/**
 * This structure is used to set the video encoder mode.
 *
 * STRUCT MEMBERS:
 *  nSize      : Size of the structure in bytes
 *  nVersion   : OMX specification version info
 *  nPortIndex : Port that this structure applies to
 *  nMode : defines the video encoder mode
 */
typedef struct QOMX_VIDEO_PARAM_ENCODERMODETYPE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    QOMX_VIDEO_ENCODERMODETYPE nMode;
} QOMX_VIDEO_PARAM_ENCODERMODETYPE;

/**
 * This structure describes the parameters corresponding to the
 * QOMX_VIDEO_SYNTAXHDRTYPE extension. This parameter can be queried
 * during the loaded state.
 */

typedef struct QOMX_VIDEO_SYNTAXHDRTYPE
{
   OMX_U32 nSize;           /** Size of the structure in bytes */
   OMX_VERSIONTYPE nVersion;/** OMX specification version information */
   OMX_U32 nPortIndex;      /** Portindex which is extended by this structure */
   OMX_U32 nBytes;          /** The number of bytes filled in to the buffer */
   OMX_U8 data[1];          /** Buffer to store the header information */
} QOMX_VIDEO_SYNTAXHDRTYPE;

/**
 * This structure describes the parameters corresponding to the
 * QOMX_VIDEO_TEMPORALSPATIALTYPE extension. This parameter can be set
 * dynamically during any state except the state invalid.  This is primarily
 * used for setting MaxQP from the application.  This is set on the out port.
 */

typedef struct QOMX_VIDEO_TEMPORALSPATIALTYPE
{
   OMX_U32 nSize;           /** Size of the structure in bytes */
   OMX_VERSIONTYPE nVersion;/** OMX specification version information */
   OMX_U32 nPortIndex;      /** Portindex which is extended by this structure */
   OMX_U32 nTSFactor;       /** Temoral spatial tradeoff factor value in 0-100 */
} QOMX_VIDEO_TEMPORALSPATIALTYPE;

/**
 * This structure describes the parameters corresponding to the
 * OMX_QCOM_VIDEO_CONFIG_INTRAPERIODTYPE extension. This parameter can be set
 * dynamically during any state except the state invalid.  This is set on the out port.
 */

typedef struct QOMX_VIDEO_INTRAPERIODTYPE
{
   OMX_U32 nSize;           /** Size of the structure in bytes */
   OMX_VERSIONTYPE nVersion;/** OMX specification version information */
   OMX_U32 nPortIndex;      /** Portindex which is extended by this structure */
   OMX_U32 nIDRPeriod;      /** This specifies coding a frame as IDR after every nPFrames
                                of intra frames. If this parameter is set to 0, only the
                                first frame of the encode session is an IDR frame. This
                                field is ignored for non-AVC codecs and is used only for
                                codecs that support IDR Period */
   OMX_U32 nPFrames;         /** The number of "P" frames between two "I" frames */
   OMX_U32 nBFrames;         /** The number of "B" frames between two "I" frames */
} QOMX_VIDEO_INTRAPERIODTYPE;

/**
 * This structure describes the parameters corresponding to the
 * OMX_QCOM_VIDEO_CONFIG_ULBUFFEROCCUPANCYTYPE extension. This parameter can be set
 * dynamically during any state except the state invalid. This is used for the buffer negotiation
 * with other clients.  This is set on the out port.
 */
typedef struct OMX_QCOM_VIDEO_CONFIG_ULBUFFEROCCUPANCYTYPE
{
   OMX_U32 nSize;            /** Size of the structure in bytes */
   OMX_VERSIONTYPE nVersion; /** OMX specification version information */
   OMX_U32 nPortIndex;       /** Portindex which is extended by this structure */
   OMX_U32 nBufferOccupancy; /** The number of bytes to be set for the buffer occupancy */
} OMX_QCOM_VIDEO_CONFIG_ULBUFFEROCCUPANCYTYPE;

/**
 * This structure describes the parameters corresponding to the
 * OMX_QCOM_VIDEO_CONFIG_RANDOMINTRAREFRESHTYPE extension. This parameter can be set
 * dynamically during any state except the state invalid. This is primarily used for the dynamic/random
 * intrarefresh.  This is set on the out port.
 */
typedef struct OMX_QCOM_VIDEO_CONFIG_RANDOMINTRAREFRESHTYPE
{
   OMX_U32 nSize;           /** Size of the structure in bytes */
   OMX_VERSIONTYPE nVersion;/** OMX specification version information */
   OMX_U32 nPortIndex;      /** Portindex which is extended by this structure */
   OMX_U32 nRirMBs;         /** The number of MBs to be set for intrarefresh */
} OMX_QCOM_VIDEO_CONFIG_RANDOMINTRAREFRESHTYPE;

/**
 * This structure describes the parameters for the
 * OMX_QcomIndexParamAUDelimiter extension. It enables/disables
 * the AU delimiters in H264/HEVC stream.
 */
typedef struct OMX_QCOM_VIDEO_CONFIG_AUD
{
    OMX_U32 nSize;           /** Size of the structure in bytes */
    OMX_VERSIONTYPE nVersion;/** OMX specification version information */
    OMX_BOOL bEnable;        /** Enable/disable the setting */
} OMX_QCOM_VIDEO_CONFIG_AUD;

#define QOMX_VIDEO_HIGH_PERF_OPERATING_MODE    (0x7FFFFFFF)

/**
 * Note: This will get deprecated
 */
typedef enum QOMX_VIDEO_PERF_LEVEL
{
    OMX_QCOM_PerfLevelNominal,
    OMX_QCOM_PerfLevelTurbo
} QOMX_VIDEO_PERF_LEVEL;

/**
  * This structure describes the parameters corresponding
  * to OMX_QcomIndexParamPerfLevel extension. It will set
  * the performance mode specified as QOMX_VIDEO_PERF_LEVEL.
  * Note: This will get deprecated
  */
typedef struct OMX_QCOM_VIDEO_PARAM_PERF_LEVEL {
    OMX_U32 nSize;                      /** Size of the structure in bytes */
    OMX_VERSIONTYPE nVersion;           /** OMX specification version information */
    QOMX_VIDEO_PERF_LEVEL ePerfLevel;   /** Performance level */
} OMX_QCOM_VIDEO_PARAM_PERF_LEVEL;

/**
 * This structure describes the parameters corresponding
 * to OMX_QcomIndexConfigPerfLevel extension. It will set
 * the performance mode specified as QOMX_VIDEO_PERF_LEVEL.
 * Note: This will get deprecated
 */
typedef struct OMX_QCOM_VIDEO_CONFIG_PERF_LEVEL {
    OMX_U32 nSize;                      /** Size of the structure in bytes */
    OMX_VERSIONTYPE nVersion;           /** OMX specification version information */
    QOMX_VIDEO_PERF_LEVEL ePerfLevel;   /** Performance level */
} OMX_QCOM_VIDEO_CONFIG_PERF_LEVEL;

typedef enum QOMX_VIDEO_PICTURE_TYPE_DECODE
{
    OMX_QCOM_PictypeDecode_IPB,
    OMX_QCOM_PictypeDecode_I
} QOMX_VIDEO_PICTURE_TYPE_DECODE;

/**
 * This structure describes the parameters corresponding
 * to OMX_QcomIndexConfigPictureTypeDecode extension. It
 * will set the picture type decode specified by eDecodeType.
 */
typedef struct OMX_QCOM_VIDEO_CONFIG_PICTURE_TYPE_DECODE {
    OMX_U32 nSize;                      /** Size of the structure in bytes */
    OMX_VERSIONTYPE nVersion;           /** OMX specification version information */
    QOMX_VIDEO_PICTURE_TYPE_DECODE eDecodeType;   /** Decode type */
} OMX_QCOM_VIDEO_CONFIG_PICTURE_TYPE_DECODE;

/**
 * This structure describes the parameters corresponding
 * to OMX_QcomIndexParamH264VUITimingInfo extension. It
 * will enable/disable the VUI timing info.
 */
typedef struct OMX_QCOM_VIDEO_PARAM_VUI_TIMING_INFO {
    OMX_U32 nSize;              /** Size of the structure in bytes */
    OMX_VERSIONTYPE nVersion;   /** OMX specification version information */
    OMX_BOOL bEnable;           /** Enable/disable the setting */
} OMX_QCOM_VIDEO_PARAM_VUI_TIMING_INFO;

/**
 * This structure describes the parameters corresponding
 * to OMX_QcomIndexParamVQZIPSEIType extension. It
 * will enable/disable the VQZIP SEI info.
 */
typedef struct OMX_QTI_VIDEO_PARAM_VQZIP_SEI_TYPE {
    OMX_U32 nSize;              /** Size of the structure in bytes */
    OMX_VERSIONTYPE nVersion;   /** OMX specification version information */
    OMX_BOOL bEnable;           /** Enable/disable the setting */
} OMX_QTI_VIDEO_PARAM_VQZIP_SEI_TYPE;

/**
 * This structure describes the parameters corresponding
 * to OMX_QcomIndexParamPeakBitrate extension. It will
 * set the peak bitrate specified by nPeakBitrate.
 */
typedef struct OMX_QCOM_VIDEO_PARAM_PEAK_BITRATE {
    OMX_U32 nSize;              /** Size of the structure in bytes */
    OMX_VERSIONTYPE nVersion;   /** OMX specification version information */
    OMX_U32 nPeakBitrate;       /** Peak bitrate value */
} OMX_QCOM_VIDEO_PARAM_PEAK_BITRATE;

/**
 * This structure describes the parameters corresponding
 * to OMX_QTIIndexParamForceCompressedForDPB extension. Enabling
 * this extension will force the split mode DPB(compressed)/OPB(Linear)
 * for all resolutions.On some chipsets preferred mode would be combined
 * Linear for both DPB/OPB to save memory. For example on 8996 preferred mode
 * would be combined linear for resolutions <= 1080p .
 * Enabling this might save power but with the cost
 * of increased memory i.e almost double the number on output YUV buffers.
 */
typedef struct OMX_QTI_VIDEO_PARAM_FORCE_COMPRESSED_FOR_DPB_TYPE {
    OMX_U32 nSize;              /** Size of the structure in bytes */
    OMX_VERSIONTYPE nVersion;   /** OMX specification version information */
    OMX_BOOL bEnable;           /** Enable/disable the setting */
} OMX_QTI_VIDEO_PARAM_FORCE_COMPRESSED_FOR_DPB_TYPE;

/**
 * This structure describes the parameters corresponding
 * to OMX_QTIIndexParamForceUnCompressedForOPB extension. Enabling this
 * extension will force the OPB to be linear for the current video session.
 * If this property is not set, then the OPB will be set to linear or compressed
 * based on resolution selected and/or if cpu access is requested on the
 * OPB buffer.
 */
typedef struct OMX_QTI_VIDEO_PARAM_FORCE_UNCOMPRESSED_FOR_OPB_TYPE {
    OMX_U32 nSize;              /** Sizeo f the structure in bytes */
    OMX_VERSIONTYPE nVersion;   /** OMX specification version information */
    OMX_BOOL bEnable;           /** Enable/disable the setting */
} OMX_QTI_VIDEO_PARAM_FORCE_UNCOMPRESSED_FOR_OPB_TYPE;

typedef struct OMX_VENDOR_EXTRADATATYPE  {
    OMX_U32 nPortIndex;
    OMX_U32 nDataSize;
    OMX_U8  *pData;     // cdata (codec_data/extradata)
} OMX_VENDOR_EXTRADATATYPE;

/**
 * This structure describes the parameters corresponding to the
 * OMX_VENDOR_VIDEOFRAMERATE extension. This parameter can be set
 * dynamically during any state except the state invalid. This is
 * used for frame rate to be set from the application. This
 * is set on the in port.
 */
typedef struct OMX_VENDOR_VIDEOFRAMERATE  {
   OMX_U32 nSize;           /** Size of the structure in bytes */
   OMX_VERSIONTYPE nVersion;/** OMX specification version information */
   OMX_U32 nPortIndex;      /** Portindex which is extended by this structure */
   OMX_U32 nFps;            /** Frame rate value */
   OMX_BOOL bEnabled;       /** Flag to enable or disable client's frame rate value */
} OMX_VENDOR_VIDEOFRAMERATE;

typedef enum OMX_INDEXVENDORTYPE {
    OMX_IndexVendorFileReadInputFilename = 0xFF000001,
    OMX_IndexVendorParser3gpInputFilename = 0xFF000002,
    OMX_IndexVendorVideoExtraData = 0xFF000003,
    OMX_IndexVendorAudioExtraData = 0xFF000004,
    OMX_IndexVendorVideoFrameRate = 0xFF000005,
} OMX_INDEXVENDORTYPE;

typedef enum OMX_QCOM_VC1RESOLUTIONTYPE
{
   OMX_QCOM_VC1_PICTURE_RES_1x1,
   OMX_QCOM_VC1_PICTURE_RES_2x1,
   OMX_QCOM_VC1_PICTURE_RES_1x2,
   OMX_QCOM_VC1_PICTURE_RES_2x2
} OMX_QCOM_VC1RESOLUTIONTYPE;

typedef enum OMX_QCOM_INTERLACETYPE
{
    OMX_QCOM_InterlaceFrameProgressive,
    OMX_QCOM_InterlaceInterleaveFrameTopFieldFirst,
    OMX_QCOM_InterlaceInterleaveFrameBottomFieldFirst,
    OMX_QCOM_InterlaceFrameTopFieldFirst,
    OMX_QCOM_InterlaceFrameBottomFieldFirst,
    OMX_QCOM_InterlaceFieldTop,
    OMX_QCOM_InterlaceFieldBottom
}OMX_QCOM_INTERLACETYPE;

typedef struct OMX_QCOM_PARAM_VIDEO_INTERLACETYPE
{
    OMX_U32 nSize;           /** Size of the structure in bytes */
    OMX_VERSIONTYPE nVersion;/** OMX specification version information */
    OMX_U32 nPortIndex;    /** Portindex which is extended by this structure */
    OMX_BOOL bInterlace;  /** Interlace content **/
}OMX_QCOM_PARAM_VIDEO_INTERLACETYPE;

typedef struct OMX_QCOM_CONFIG_INTERLACETYPE
{
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_U32 nIndex;
    OMX_QCOM_INTERLACETYPE eInterlaceType;
}OMX_QCOM_CONFIG_INTERLACETYPE;

#define MAX_PAN_SCAN_WINDOWS 4

typedef struct OMX_QCOM_MISR_INFO {
    OMX_U32 misr_dpb_luma;
    OMX_U32 misr_dpb_chroma;
    OMX_U32 misr_opb_luma;
    OMX_U32 misr_opb_chroma;
} OMX_QCOM_MISR_INFO;

typedef struct OMX_QCOM_OUTPUT_CROP {
    OMX_U32 size;
    OMX_U32 version;
    OMX_U32 port_index;
    OMX_U32 left;
    OMX_U32 top;
    OMX_U32 display_width;
    OMX_U32 display_height;
    OMX_U32 width;
    OMX_U32 height;
    OMX_U32 frame_num;
    OMX_U32 bit_depth_y;
    OMX_U32 bit_depth_c;
    OMX_QCOM_MISR_INFO misr_info[2];
} OMX_QCOM_OUTPUT_CROP;

typedef struct OMX_QCOM_PANSCAN
{
   OMX_U32 numWindows;
   OMX_QCOMRectangle window[MAX_PAN_SCAN_WINDOWS];
} OMX_QCOM_PANSCAN;

typedef struct OMX_QCOM_ASPECT_RATIO
{
   OMX_U32 aspectRatioX;
   OMX_U32 aspectRatioY;
} OMX_QCOM_ASPECT_RATIO;

typedef struct OMX_QCOM_DISPLAY_ASPECT_RATIO
{
   OMX_U32 displayVerticalSize;
   OMX_U32 displayHorizontalSize;
} OMX_QCOM_DISPLAY_ASPECT_RATIO;

typedef struct OMX_QCOM_FRAME_PACK_ARRANGEMENT
{
  OMX_U32 nSize;
  OMX_VERSIONTYPE nVersion;
  OMX_U32 nPortIndex;
  OMX_U32 id;
  OMX_U32 cancel_flag;
  OMX_U32 type;
  OMX_U32 quincunx_sampling_flag;
  OMX_U32 content_interpretation_type;
  OMX_U32 spatial_flipping_flag;
  OMX_U32 frame0_flipped_flag;
  OMX_U32 field_views_flag;
  OMX_U32 current_frame_is_frame0_flag;
  OMX_U32 frame0_self_contained_flag;
  OMX_U32 frame1_self_contained_flag;
  OMX_U32 frame0_grid_position_x;
  OMX_U32 frame0_grid_position_y;
  OMX_U32 frame1_grid_position_x;
  OMX_U32 frame1_grid_position_y;
  OMX_U32 reserved_byte;
  OMX_U32 repetition_period;
  OMX_U32 extension_flag;
} OMX_QCOM_FRAME_PACK_ARRANGEMENT;

typedef struct OMX_QCOM_EXTRADATA_QP
{
   OMX_U32        nQP;
   OMX_U32        nQPSum;           /* Decode Only */
   OMX_U32        nSkipQPSum;       /* Decode Only */
   OMX_U32        nSkipNumBlocks;   /* Decode Only */
   OMX_U32        nTotalNumBlocks;  /* Decode Only */
} OMX_QCOM_EXTRADATA_QP;

typedef struct OMX_QCOM_EXTRADATA_BITS_INFO
{
   OMX_U32 header_bits;
   OMX_U32 frame_bits;
} OMX_QCOM_EXTRADATA_BITS_INFO;

typedef struct OMX_QCOM_EXTRADATA_USERDATA {
   OMX_U32 type;
   OMX_U32 data[1];
} OMX_QCOM_EXTRADATA_USERDATA;

typedef struct OMX_QCOM_EXTRADATA_FRAMEINFO
{
   // common frame meta data. interlace related info removed
   OMX_VIDEO_PICTURETYPE  ePicType;
   OMX_QCOM_INTERLACETYPE interlaceType;
   OMX_QCOM_PANSCAN       panScan;
   OMX_QCOM_ASPECT_RATIO  aspectRatio;
   OMX_QCOM_DISPLAY_ASPECT_RATIO displayAspectRatio;
   OMX_U32                nConcealedMacroblocks;
   OMX_U32                nRecoverySeiFlag;
   OMX_U32                nFrameRate;
   OMX_TICKS              nTimeStamp;
} OMX_QCOM_EXTRADATA_FRAMEINFO;

typedef struct OMX_QCOM_EXTRADATA_FRAMEDIMENSION
{
   /** Frame Dimensions added to each YUV buffer */
   OMX_U32   nDecWidth;  /** Width  rounded to multiple of 16 */
   OMX_U32   nDecHeight; /** Height rounded to multiple of 16 */
   OMX_U32   nActualWidth; /** Actual Frame Width */
   OMX_U32   nActualHeight; /** Actual Frame Height */

} OMX_QCOM_EXTRADATA_FRAMEDIMENSION;

typedef struct OMX_QCOM_H264EXTRADATA
{
   OMX_U64 seiTimeStamp;
} OMX_QCOM_H264EXTRADATA;

typedef struct OMX_QCOM_VC1EXTRADATA
{
   OMX_U32                     nVC1RangeY;
   OMX_U32                     nVC1RangeUV;
   OMX_QCOM_VC1RESOLUTIONTYPE eVC1PicResolution;
} OMX_QCOM_VC1EXTRADATA;

typedef union OMX_QCOM_EXTRADATA_CODEC_DATA
{
   OMX_QCOM_H264EXTRADATA h264ExtraData;
   OMX_QCOM_VC1EXTRADATA vc1ExtraData;
} OMX_QCOM_EXTRADATA_CODEC_DATA;

typedef struct OMX_QCOM_EXTRADATA_MBINFO
{
   OMX_U32 nFormat;
   OMX_U32 nDataSize;
   OMX_U8  data[0];
} OMX_QCOM_EXTRADATA_MBINFO;

typedef struct OMX_QCOM_EXTRADATA_VQZIPSEI {
    OMX_U32 nSize;
    OMX_U8 data[0];
} OMX_QCOM_EXTRADATA_VQZIPSEI;

typedef struct OMX_QTI_VIDEO_PARAM_ENABLE_ROIINFO {
    OMX_U32         nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32         nPortIndex;
    OMX_BOOL        bEnableRoiInfo;
} OMX_QTI_VIDEO_PARAM_ENABLE_ROIINFO;

typedef struct OMX_QTI_VIDEO_CONFIG_ROIINFO {
    OMX_U32         nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32         nPortIndex;
    OMX_S32         nUpperQpOffset;
    OMX_S32         nLowerQpOffset;
    OMX_BOOL        bUseRoiInfo;
    OMX_S32         nRoiMBInfoSize;
    OMX_PTR         pRoiMBInfo;
} OMX_QTI_VIDEO_CONFIG_ROIINFO;

typedef enum OMX_QTI_VIDEO_BLUR_RESOLUTION {
    BLUR_RESOL_DISABLED = 0,
    BLUR_RESOL_240      = 1,
    BLUR_RESOL_480      = 2,
    BLUR_RESOL_720      = 3,
    BLUR_RESOL_1080     = 4,
} OMX_QTI_VIDEO_BLUR_RESOLUTION;

typedef struct OMX_QTI_VIDEO_CONFIG_BLURINFO {
    OMX_U32         nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32         nPortIndex;
    OMX_QTI_VIDEO_BLUR_RESOLUTION eTargetResol;
} OMX_QTI_VIDEO_CONFIG_BLURINFO;

typedef enum OMX_QCOM_EXTRADATATYPE
{
    OMX_ExtraDataFrameInfo =               0x7F000001,
    OMX_ExtraDataH264 =                    0x7F000002,
    OMX_ExtraDataVC1 =                     0x7F000003,
    OMX_ExtraDataFrameDimension =          0x7F000004,
    OMX_ExtraDataVideoEncoderSliceInfo =   0x7F000005,
    OMX_ExtraDataConcealMB =               0x7F000006,
    OMX_ExtraDataInterlaceFormat =         0x7F000007,
    OMX_ExtraDataPortDef =                 0x7F000008,
    OMX_ExtraDataMP2ExtnData =             0x7F000009,
    OMX_ExtraDataMP2UserData =             0x7F00000a,
    OMX_ExtraDataVideoLTRInfo =            0x7F00000b,
    OMX_ExtraDataFramePackingArrangement = 0x7F00000c,
    OMX_ExtraDataQP =                      0x7F00000d,
    OMX_ExtraDataInputBitsInfo =           0x7F00000e,
    OMX_ExtraDataVideoEncoderMBInfo =      0x7F00000f,
    OMX_ExtraDataVQZipSEI  =               0x7F000010,
    OMX_ExtraDataDisplayColourSEI =        0x7F000011,
    OMX_ExtraDataLightLevelSEI =           0x7F000012,
    OMX_ExtraDataOutputCropInfo =          0x7F000014,
} OMX_QCOM_EXTRADATATYPE;

struct ExtraDataMap {
        const char *type;
        OMX_QCOM_EXTRADATATYPE index;
};
static const struct ExtraDataMap kExtradataMap[] = {
        { "ltrinfo", OMX_ExtraDataVideoLTRInfo },
        { "mbinfo", OMX_ExtraDataVideoEncoderMBInfo },
        { "outputcropinfo", OMX_ExtraDataOutputCropInfo },
};

static inline OMX_S32 getIndexForExtradataType(char * type) {
    if(type == NULL) return -1;
    for(int i = 0; i< (int)(sizeof(kExtradataMap)/ sizeof(struct ExtraDataMap)); i++){
        if(!strcmp(kExtradataMap[i].type,type)){
            return kExtradataMap[i].index;
        }
    }
    return -1;
}

static inline const char * getStringForExtradataType(int64_t index) {
    for(int i = 0; i< (int)(sizeof(kExtradataMap)/sizeof(struct ExtraDataMap)); i++){
        if(kExtradataMap[i].index == index){
            return kExtradataMap[i].type;
        }
    }
    return NULL;
}

typedef struct  OMX_STREAMINTERLACEFORMATTYPE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_BOOL bInterlaceFormat;
    OMX_U32 nInterlaceFormats;
} OMX_STREAMINTERLACEFORMAT;

typedef enum OMX_INTERLACETYPE
{
   OMX_InterlaceFrameProgressive,
   OMX_InterlaceInterleaveFrameTopFieldFirst,
   OMX_InterlaceInterleaveFrameBottomFieldFirst,
   OMX_InterlaceFrameTopFieldFirst,
   OMX_InterlaceFrameBottomFieldFirst
} OMX_INTERLACES;

typedef enum QOMX_VIDEO_RECOVERYSEITYPE {
/*
 * 0: Frame reconstruction is incorrect
 *   a) Open Gop, frames before recovery point SEI
 * 1: Frame reconstruction is correct.
 *   a) Closed Gop, When decoding starts from the top of closed GOP at IDR
 *   b) Open Gop, Output at and subsequent to recovery point SEI with
 *      exact_match_flag = true
 * 2: Frame reconstruction is approximately correct:
 *   a) Closed Gop, When decoding starts from a P/B/I frames wihtout
 *      any recovery point SEI information
 *   b) Open Gop, Output at and subsequent to recovery point SEI with
 *      exact_match_flag = false
 * In case flag is set to 0 or 2, DATACORRUPT shall be enabled
 * for buffer (nFlags) in FILL_BUFFER_DONE
 */
    OMX_FRAME_RECONSTRUCTION_INCORRECT = 0,
    OMX_FRAME_RECONSTRUCTION_CORRECT = 1,
    OMX_FRAME_RECONSTRUCTION_APPROXIMATELY_CORRECT = 2
} QOMX_VIDEO_RECOVERYSEI;

#define OMX_EXTRADATA_HEADER_SIZE 20

/**
 * AVC profile types, each profile indicates support for various
 * performance bounds and different annexes.
 */
typedef enum QOMX_VIDEO_AVCPROFILETYPE {
    QOMX_VIDEO_AVCProfileBaseline      = OMX_VIDEO_AVCProfileBaseline,
    QOMX_VIDEO_AVCProfileMain          = OMX_VIDEO_AVCProfileMain,
    QOMX_VIDEO_AVCProfileExtended      = OMX_VIDEO_AVCProfileExtended,
    QOMX_VIDEO_AVCProfileHigh          = OMX_VIDEO_AVCProfileHigh,
    QOMX_VIDEO_AVCProfileHigh10        = OMX_VIDEO_AVCProfileHigh10,
    QOMX_VIDEO_AVCProfileHigh422       = OMX_VIDEO_AVCProfileHigh422,
    QOMX_VIDEO_AVCProfileHigh444       = OMX_VIDEO_AVCProfileHigh444,
    /* QCom specific profile indexes */
    QOMX_VIDEO_AVCProfileConstrained           = OMX_VIDEO_AVCProfileVendorStartUnused,
    QOMX_VIDEO_AVCProfileConstrainedBaseline,
    QOMX_VIDEO_AVCProfileConstrainedHigh,
} QOMX_VIDEO_AVCPROFILETYPE;


/**
 * H.264 MVC Profiles
  */
typedef enum QOMX_VIDEO_MVCPROFILETYPE {
    QOMX_VIDEO_MVCProfileStereoHigh = 0x1,
    QOMX_VIDEO_MVCProfileMultiViewHigh = 0x2,
    QOMX_VIDEO_MVCProfileKhronosExtensions = 0x6F000000,
    QOMX_VIDEO_MVCProfileVendorStartUnused = 0x7F000000,
    QOMX_VIDEO_MVCProfileMax = 0x7FFFFFFF
} QOMX_VIDEO_MVCPROFILETYPE;

/**
 * H.264 MVC Levels
  */
typedef enum QOMX_VIDEO_MVCLEVELTYPE {
    QOMX_VIDEO_MVCLevel1   = 0x01,     /**< Level 1 */
    QOMX_VIDEO_MVCLevel1b  = 0x02,     /**< Level 1b */
    QOMX_VIDEO_MVCLevel11  = 0x04,     /**< Level 1.1 */
    QOMX_VIDEO_MVCLevel12  = 0x08,     /**< Level 1.2 */
    QOMX_VIDEO_MVCLevel13  = 0x10,     /**< Level 1.3 */
    QOMX_VIDEO_MVCLevel2   = 0x20,     /**< Level 2 */
    QOMX_VIDEO_MVCLevel21  = 0x40,     /**< Level 2.1 */
    QOMX_VIDEO_MVCLevel22  = 0x80,     /**< Level 2.2 */
    QOMX_VIDEO_MVCLevel3   = 0x100,    /**< Level 3 */
    QOMX_VIDEO_MVCLevel31  = 0x200,    /**< Level 3.1 */
    QOMX_VIDEO_MVCLevel32  = 0x400,    /**< Level 3.2 */
    QOMX_VIDEO_MVCLevel4   = 0x800,    /**< Level 4 */
    QOMX_VIDEO_MVCLevel41  = 0x1000,   /**< Level 4.1 */
    QOMX_VIDEO_MVCLevel42  = 0x2000,   /**< Level 4.2 */
    QOMX_VIDEO_MVCLevel5   = 0x4000,   /**< Level 5 */
    QOMX_VIDEO_MVCLevel51  = 0x8000,   /**< Level 5.1 */
    QOMX_VIDEO_MVCLevelKhronosExtensions = 0x6F000000,
    QOMX_VIDEO_MVCLevelVendorStartUnused = 0x7F000000,
    QOMX_VIDEO_MVCLevelMax = 0x7FFFFFFF
} QOMX_VIDEO_MVCLEVELTYPE;

/**
 * DivX Versions
 */
typedef enum  QOMX_VIDEO_DIVXFORMATTYPE {
    QOMX_VIDEO_DIVXFormatUnused = 0x01, /**< Format unused or unknown */
    QOMX_VIDEO_DIVXFormat311    = 0x02, /**< DivX 3.11 */
    QOMX_VIDEO_DIVXFormat4      = 0x04, /**< DivX 4 */
    QOMX_VIDEO_DIVXFormat5      = 0x08, /**< DivX 5 */
    QOMX_VIDEO_DIVXFormat6      = 0x10, /**< DivX 6 */
    QOMX_VIDEO_DIVXFormatKhronosExtensions = 0x6F000000,
    QOMX_VIDEO_DIVXFormatVendorStartUnused = 0x7F000000,
    QOMX_VIDEO_DIVXFormatMax = 0x7FFFFFFF
} QOMX_VIDEO_DIVXFORMATTYPE;

/**
 * DivX profile types, each profile indicates support for
 * various performance bounds.
 */
typedef enum QOMX_VIDEO_DIVXPROFILETYPE {
    QOMX_VIDEO_DivXProfileqMobile = 0x01, /**< qMobile Profile */
    QOMX_VIDEO_DivXProfileMobile  = 0x02, /**< Mobile Profile */
    QOMX_VIDEO_DivXProfileMT      = 0x04, /**< Mobile Theatre Profile */
    QOMX_VIDEO_DivXProfileHT      = 0x08, /**< Home Theatre Profile */
    QOMX_VIDEO_DivXProfileHD      = 0x10, /**< High Definition Profile */
    QOMX_VIDEO_DIVXProfileKhronosExtensions = 0x6F000000,
    QOMX_VIDEO_DIVXProfileVendorStartUnused = 0x7F000000,
    QOMX_VIDEO_DIVXProfileMax = 0x7FFFFFFF
} QOMX_VIDEO_DIVXPROFILETYPE;

/**
 * DivX Video Params
 *
 *  STRUCT MEMBERS:
 *  nSize      : Size of the structure in bytes
 *  nVersion   : OMX specification version information
 *  nPortIndex : Port that this structure applies to
 *  eFormat    : Version of DivX stream / data
 *  eProfile   : Profile of DivX stream / data
 */
typedef struct QOMX_VIDEO_PARAM_DIVXTYPE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    QOMX_VIDEO_DIVXFORMATTYPE eFormat;
    QOMX_VIDEO_DIVXPROFILETYPE eProfile;
} QOMX_VIDEO_PARAM_DIVXTYPE;



/**
 *  VP Versions
 */
typedef enum QOMX_VIDEO_VPFORMATTYPE {
    QOMX_VIDEO_VPFormatUnused = 0x01, /**< Format unused or unknown */
    QOMX_VIDEO_VPFormat6      = 0x02, /**< VP6 Video Format */
    QOMX_VIDEO_VPFormat7      = 0x04, /**< VP7 Video Format */
    QOMX_VIDEO_VPFormat8      = 0x08, /**< VP8 Video Format */
    QOMX_VIDEO_VPFormat9      = 0x10, /**< VP9 Video Format */
    QOMX_VIDEO_VPFormatKhronosExtensions = 0x6F000000,
    QOMX_VIDEO_VPFormatVendorStartUnused = 0x7F000000,
    QOMX_VIDEO_VPFormatMax = 0x7FFFFFFF
} QOMX_VIDEO_VPFORMATTYPE;

/**
 * VP profile types, each profile indicates support for various
 * encoding tools.
 */
typedef enum QOMX_VIDEO_VPPROFILETYPE {
    QOMX_VIDEO_VPProfileSimple   = 0x01, /**< Simple Profile, applies to VP6 only */
    QOMX_VIDEO_VPProfileAdvanced = 0x02, /**< Advanced Profile, applies to VP6 only */
    QOMX_VIDEO_VPProfileVersion0 = 0x04, /**< Version 0, applies to VP7 and VP8 */
    QOMX_VIDEO_VPProfileVersion1 = 0x08, /**< Version 1, applies to VP7 and VP8 */
    QOMX_VIDEO_VPProfileVersion2 = 0x10, /**< Version 2, applies to VP8 only */
    QOMX_VIDEO_VPProfileVersion3 = 0x20, /**< Version 3, applies to VP8 only */
    QOMX_VIDEO_VPProfileKhronosExtensions = 0x6F000000,
    QOMX_VIDEO_VPProfileVendorStartUnused = 0x7F000000,
    QOMX_VIDEO_VPProfileMax = 0x7FFFFFFF
} QOMX_VIDEO_VPPROFILETYPE;

/**
 * VP Video Params
 *
 *  STRUCT MEMBERS:
 *  nSize      : Size of the structure in bytes
 *  nVersion   : OMX specification version information
 *  nPortIndex : Port that this structure applies to
 *  eFormat    : Format of VP stream / data
 *  eProfile   : Profile or Version of VP stream / data
 */
typedef struct QOMX_VIDEO_PARAM_VPTYPE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    QOMX_VIDEO_VPFORMATTYPE eFormat;
    QOMX_VIDEO_VPPROFILETYPE eProfile;
} QOMX_VIDEO_PARAM_VPTYPE;

/**
 * Spark Versions
 */
typedef enum QOMX_VIDEO_SPARKFORMATTYPE {
    QOMX_VIDEO_SparkFormatUnused = 0x01, /**< Format unused or unknown */
    QOMX_VIDEO_SparkFormat0      = 0x02, /**< Video Format Version 0 */
    QOMX_VIDEO_SparkFormat1      = 0x04, /**< Video Format Version 1 */
    QOMX_VIDEO_SparkFormatKhronosExtensions = 0x6F000000,
    QOMX_VIDEO_SparkFormatVendorStartUnused = 0x7F000000,
    QOMX_VIDEO_SparkFormatMax = 0x7FFFFFFF
} QOMX_VIDEO_SPARKFORMATTYPE;

/**
 * Spark Video Params
 *
 *  STRUCT MEMBERS:
 *  nSize      : Size of the structure in bytes
 *  nVersion   : OMX specification version information
 *  nPortIndex : Port that this structure applies to
 *  eFormat    : Version of Spark stream / data
 */
typedef struct QOMX_VIDEO_PARAM_SPARKTYPE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    QOMX_VIDEO_SPARKFORMATTYPE eFormat;
} QOMX_VIDEO_PARAM_SPARKTYPE;

typedef enum QOMX_VIDEO_TMEPROFILETYPE {
    QOMX_VIDEO_TMEProfile0  = 0x1,
    QOMX_VIDEO_TMEProfile1  = 0x2,
    QOMX_VIDEO_TMEProfile2  = 0x4,
    QOMX_VIDEO_TMEProfile3  = 0x8,
} QOMX_VIDEO_TMEPROFILETYPE;

typedef enum QOMX_VIDEO_TMELEVELTYPE {
    QOMX_VIDEO_TMELevelInteger  = 0x1,
} QOMX_VIDEO_TMELEVELTYPE;

typedef struct QOMX_VIDEO_PARAM_TMETYPE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    QOMX_VIDEO_TMEPROFILETYPE eProfile;
    QOMX_VIDEO_TMELEVELTYPE eLevel;
    OMX_U32 ePayloadVersion;
} QOMX_VIDEO_PARAM_TMETYPE;

typedef struct QOMX_VIDEO_QUERY_DECODER_INSTANCES {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_U32 nNumOfInstances;
} QOMX_VIDEO_QUERY_DECODER_INSTANCES;

typedef struct QOMX_ENABLETYPE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_BOOL bEnable;
} QOMX_ENABLETYPE;

typedef struct QOMX_DISABLETYPE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_BOOL bDisable;
} QOMX_DISABLETYPE;

typedef enum QOMX_VIDEO_EVENTS {
    OMX_EventIndexsettingChanged = OMX_EventVendorStartUnused
} QOMX_VIDEO_EVENTS;

typedef enum QOMX_VIDEO_PICTURE_ORDER {
    QOMX_VIDEO_DISPLAY_ORDER = 0x1,
    QOMX_VIDEO_DECODE_ORDER = 0x2
} QOMX_VIDEO_PICTURE_ORDER;

typedef struct QOMX_VIDEO_DECODER_PICTURE_ORDER {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    QOMX_VIDEO_PICTURE_ORDER eOutputPictureOrder;
} QOMX_VIDEO_DECODER_PICTURE_ORDER;

typedef struct QOMX_INDEXEXTRADATATYPE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_BOOL bEnabled;
    OMX_INDEXTYPE nIndex;
} QOMX_INDEXEXTRADATATYPE;

typedef struct QOMX_INDEXTIMESTAMPREORDER {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_BOOL bEnable;
} QOMX_INDEXTIMESTAMPREORDER;

typedef struct QOMX_INDEXDOWNSCALAR {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_BOOL bEnable;
    OMX_U32 nOutputWidth;
    OMX_U32 nOutputHeight;
} QOMX_INDEXDOWNSCALAR;

typedef struct QOMX_VIDEO_CUSTOM_BUFFERSIZE {
        OMX_U32 nSize;
        OMX_VERSIONTYPE nVersion;
        OMX_U32 nPortIndex;
        OMX_U32 nBufferSize;
} QOMX_VIDEO_CUSTOM_BUFFERSIZE;

#define OMX_QCOM_INDEX_PARAM_VIDEO_SYNCFRAMEDECODINGMODE "OMX.QCOM.index.param.video.SyncFrameDecodingMode"
#define OMX_QCOM_INDEX_PARAM_INDEXEXTRADATA "OMX.QCOM.index.param.IndexExtraData"
#define OMX_QCOM_INDEX_PARAM_VIDEO_SLICEDELIVERYMODE "OMX.QCOM.index.param.SliceDeliveryMode"
#define OMX_QCOM_INDEX_PARAM_VIDEO_FRAMEPACKING_EXTRADATA "OMX.QCOM.index.param.video.FramePackingExtradata"
#define OMX_QCOM_INDEX_PARAM_VIDEO_QP_EXTRADATA "OMX.QCOM.index.param.video.QPExtradata"
#define OMX_QCOM_INDEX_PARAM_VIDEO_INPUTBITSINFO_EXTRADATA "OMX.QCOM.index.param.video.InputBitsInfoExtradata"
#define OMX_QCOM_INDEX_PARAM_VIDEO_EXTNUSER_EXTRADATA "OMX.QCOM.index.param.video.ExtnUserExtraData"
#define OMX_QCOM_INDEX_PARAM_VIDEO_EXTNOUTPUTCROP_EXTRADATA "OMX.QCOM.index.param.video.ExtnOutputCropExtraData"
#define OMX_QCOM_INDEX_CONFIG_VIDEO_FRAMEPACKING_INFO "OMX.QCOM.index.config.video.FramePackingInfo"
#define OMX_QCOM_INDEX_PARAM_VIDEO_MPEG2SEQDISP_EXTRADATA "OMX.QCOM.index.param.video.Mpeg2SeqDispExtraData"

#define OMX_QCOM_INDEX_PARAM_VIDEO_HIERSTRUCTURE "OMX.QCOM.index.param.video.HierStructure"
#define OMX_QCOM_INDEX_PARAM_VIDEO_LTRCOUNT "OMX.QCOM.index.param.video.LTRCount"
#define OMX_QCOM_INDEX_PARAM_VIDEO_LTRPERIOD "OMX.QCOM.index.param.video.LTRPeriod"
#define OMX_QCOM_INDEX_CONFIG_VIDEO_LTRUSE "OMX.QCOM.index.config.video.LTRUse"
#define OMX_QCOM_INDEX_CONFIG_VIDEO_LTRMARK "OMX.QCOM.index.config.video.LTRMark"
#define OMX_QCOM_INDEX_CONFIG_VIDEO_HIER_P_LAYERS "OMX.QCOM.index.config.video.hierplayers"
#define OMX_QCOM_INDEX_CONFIG_RECTANGLE_TYPE "OMX.QCOM.index.config.video.rectangle"
#define OMX_QCOM_INDEX_PARAM_VIDEO_BASE_LAYER_ID "OMX.QCOM.index.param.video.baselayerid"
#define OMX_QCOM_INDEX_CONFIG_VIDEO_QP "OMX.QCOM.index.config.video.qp"
#define OMX_QCOM_INDEX_PARAM_VIDEO_SAR "OMX.QCOM.index.param.video.sar"
#define OMX_QTI_INDEX_PARAM_VIDEO_LOW_LATENCY "OMX.QTI.index.param.video.LowLatency"

#define OMX_QCOM_INDEX_PARAM_VIDEO_PASSINPUTBUFFERFD "OMX.QCOM.index.param.video.PassInputBufferFd"
#define OMX_QTI_INDEX_PARAM_VIDEO_PREFER_ADAPTIVE_PLAYBACK "OMX.QTI.index.param.video.PreferAdaptivePlayback"
#define OMX_QTI_INDEX_CONFIG_VIDEO_SETTIMEDATA "OMX.QTI.index.config.video.settimedata"
#define OMX_QTI_INDEX_PARAM_VIDEO_FORCE_COMPRESSED_FOR_DPB "OMX.QTI.index.param.video.ForceCompressedForDPB"
#define OMX_QTI_INDEX_PARAM_VIDEO_ENABLE_ROIINFO "OMX.QTI.index.param.enableRoiInfo"
#define OMX_QTI_INDEX_CONFIG_VIDEO_ROIINFO "OMX.QTI.index.config.RoiInfo"
#define OMX_QTI_INDEX_CONFIG_VIDEO_BLURINFO "OMX.QTI.index.config.BlurInfo"
#define OMX_QTI_INDEX_PARAM_VIDEO_CLIENT_EXTRADATA "OMX.QTI.index.param.client.extradata"
#define OMX_QTI_INDEX_CONFIG_COLOR_ASPECTS "OMX.google.android.index.describeColorAspects"
#define OMX_QTI_INDEX_CONFIG_VIDEO_GETDSMODE "OMX.QTI.index.config.video.getdsmode"
#define OMX_QTI_INDEX_PARAM_TME "OMX.QTI.index.param.tme"

typedef enum {
    QOMX_VIDEO_FRAME_PACKING_CHECKERBOARD = 0,
    QOMX_VIDEO_FRAME_PACKING_COLUMN_INTERLEAVE = 1,
    QOMX_VIDEO_FRAME_PACKING_ROW_INTERLEAVE = 2,
    QOMX_VIDEO_FRAME_PACKING_SIDE_BY_SIDE = 3,
    QOMX_VIDEO_FRAME_PACKING_TOP_BOTTOM = 4,
    QOMX_VIDEO_FRAME_PACKING_TEMPORAL = 5,
} QOMX_VIDEO_FRAME_PACKING_ARRANGEMENT;

typedef enum {
    QOMX_VIDEO_CONTENT_UNSPECIFIED = 0,
    QOMX_VIDEO_CONTENT_LR_VIEW = 1,
    QOMX_VIDEO_CONTENT_RL_VIEW = 2,
} QOMX_VIDEO_CONTENT_INTERPRETATION;

/**
 * Specifies the extended picture types. These values should be
 * OR'd along with the types defined in OMX_VIDEO_PICTURETYPE to
 * signal all pictures types which are allowed.
 *
 * ENUMS:
 *  H.264 Specific Picture Types:   IDR
 */
typedef enum QOMX_VIDEO_PICTURETYPE {
    QOMX_VIDEO_PictureTypeIDR = OMX_VIDEO_PictureTypeVendorStartUnused + 0x1000
} QOMX_VIDEO_PICTURETYPE;

#define OMX_QCOM_INDEX_CONFIG_ACTIVE_REGION_DETECTION           "OMX.QCOM.index.config.activeregiondetection"
#define OMX_QCOM_INDEX_CONFIG_ACTIVE_REGION_DETECTION_STATUS    "OMX.QCOM.index.config.activeregiondetectionstatus"
#define OMX_QCOM_INDEX_CONFIG_SCALING_MODE                      "OMX.QCOM.index.config.scalingmode"
#define OMX_QCOM_INDEX_CONFIG_NOISEREDUCTION                    "OMX.QCOM.index.config.noisereduction"
#define OMX_QCOM_INDEX_CONFIG_IMAGEENHANCEMENT                  "OMX.QCOM.index.config.imageenhancement"
#define OMX_QCOM_INDEX_PARAM_HELDBUFFERCOUNT                    "OMX.QCOM.index.param.HeldBufferCount" /**< reference: QOMX_HELDBUFFERCOUNTTYPE */


typedef struct QOMX_RECTTYPE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_S32 nLeft;
    OMX_S32 nTop;
    OMX_U32 nWidth;
    OMX_U32 nHeight;
} QOMX_RECTTYPE;

typedef struct QOMX_ACTIVEREGIONDETECTIONTYPE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_BOOL bEnable;
    QOMX_RECTTYPE sROI;
    OMX_U32 nNumExclusionRegions;
    QOMX_RECTTYPE sExclusionRegions[1];
} QOMX_ACTIVEREGIONDETECTIONTYPE;

typedef struct QOMX_ACTIVEREGIONDETECTION_STATUSTYPE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_BOOL bDetected;
    QOMX_RECTTYPE sDetectedRegion;
} QOMX_ACTIVEREGIONDETECTION_STATUSTYPE;

typedef enum QOMX_SCALE_MODETYPE {
    QOMX_SCALE_MODE_Normal,
    QOMX_SCALE_MODE_Anamorphic,
    QOMX_SCALE_MODE_Max = 0x7FFFFFFF
} QOMX_SCALE_MODETYPE;

typedef struct QOMX_SCALINGMODETYPE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    QOMX_SCALE_MODETYPE  eScaleMode;
} QOMX_SCALINGMODETYPE;

typedef struct QOMX_NOISEREDUCTIONTYPE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_BOOL bEnable;
    OMX_BOOL bAutoMode;
    OMX_S32 nNoiseReduction;
} QOMX_NOISEREDUCTIONTYPE;

typedef struct QOMX_IMAGEENHANCEMENTTYPE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_BOOL bEnable;
    OMX_BOOL bAutoMode;
    OMX_S32 nImageEnhancement;
} QOMX_IMAGEENHANCEMENTTYPE;

/*
 * these are part of OMX1.2 but JB MR2 branch doesn't have them defined
 * OMX_IndexParamInterlaceFormat
 * OMX_INTERLACEFORMATTYPE
 */
#ifndef OMX_IndexParamInterlaceFormat
#define OMX_IndexParamInterlaceFormat (0x7FF00000)
typedef struct OMX_INTERLACEFORMATTYPE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_U32 nFormat;
    OMX_TICKS nTimeStamp;
} OMX_INTERLACEFORMATTYPE;
#endif

/**
 * This structure is used to indicate the maximum number of buffers
 * that a port will hold during data flow.
 *
 * STRUCT MEMBERS:
 *  nSize              : Size of the structure in bytes
 *  nVersion           : OMX specification version info
 *  nPortIndex         : Port that this structure applies to
 *  nHeldBufferCount   : Read-only, maximum number of buffers that will be held
 */
typedef struct QOMX_HELDBUFFERCOUNTTYPE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_U32 nHeldBufferCount;
} QOMX_HELDBUFFERCOUNTTYPE;

typedef enum QOMX_VIDEO_HIERARCHICALCODINGTYPE {
    QOMX_HIERARCHICALCODING_P = 0x01,
    QOMX_HIERARCHICALCODING_B = 0x02,
} QOMX_VIDEO_HIERARCHICALCODINGTYPE;

typedef struct QOMX_VIDEO_HIERARCHICALLAYERS {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_U32 nNumLayers;
    QOMX_VIDEO_HIERARCHICALCODINGTYPE eHierarchicalCodingType;
} QOMX_VIDEO_HIERARCHICALLAYERS;

typedef struct QOMX_VIDEO_H264ENTROPYCODINGTYPE {
   OMX_U32 nSize;
   OMX_VERSIONTYPE nVersion;
   OMX_BOOL bCabac;
   OMX_U32 nCabacInitIdc;
} QOMX_VIDEO_H264ENTROPYCODINGTYPE;

typedef enum QOMX_VIDEO_IFRAMESIZE_TYPE {
    QOMX_IFRAMESIZE_DEFAULT,
    QOMX_IFRAMESIZE_MEDIUM,
    QOMX_IFRAMESIZE_HUGE,
    QOMX_IFRAMESIZE_UNLIMITED,
} QOMX_VIDEO_IFRAMESIZE_TYPE;

typedef struct QOMX_VIDEO_IFRAMESIZE {
   OMX_U32 nSize;
   OMX_VERSIONTYPE nVersion;
   QOMX_VIDEO_IFRAMESIZE_TYPE eType;
} QOMX_VIDEO_IFRAMESIZE;

/* VIDEO POSTPROCESSING CTRLS AND ENUMS */
/* MUST KEEP SAME AS IN vpp.h */
#define QOMX_VPP_HQV_CUSTOMPAYLOAD_SZ 256
#define VPP_HQV_CONTROL_GLOBAL_START (VPP_HQV_CONTROL_CUST + 1)

typedef enum QOMX_VPP_HQV_MODE {
    VPP_HQV_MODE_OFF,
    VPP_HQV_MODE_AUTO,
    VPP_HQV_MODE_MANUAL,
    VPP_HQV_MODE_MAX
} QOMX_VPP_HQV_MODE;

typedef enum QOMX_VPP_HQVCONTROLTYPE {
    VPP_HQV_CONTROL_CADE = 0x1,
    VPP_HQV_CONTROL_DI = 0x02,
    VPP_HQV_CONTROL_CNR = 0x04,
    VPP_HQV_CONTROL_AIE = 0x05,
    VPP_HQV_CONTROL_FRC = 0x06,
    VPP_HQV_CONTROL_CUST = 0x07,
    VPP_HQV_CONTROL_GLOBAL_DEMO = VPP_HQV_CONTROL_GLOBAL_START,
    VPP_HQV_CONTROL_MAX,
} QOMX_VPP_HQVCONTROLTYPE;

typedef enum QOMX_VPP_HQV_DI_MODE {
    VPP_HQV_DI_MODE_OFF,
    VPP_HQV_DI_MODE_VIDEO_1F,
    VPP_HQV_DI_MODE_VIDEO_3F,
    VPP_HQV_DI_MODE_AUTO,
    VPP_HQV_DI_MODE_MAX,
} QOMX_VPP_HQV_DI_MODE;

typedef enum QOMX_VPP_HQV_HUE_MODE {
    VPP_HQV_HUE_MODE_OFF,
    VPP_HQV_HUE_MODE_ON,
    VPP_HQV_HUE_MODE_MAX,
} QOMX_VPP_HQV_HUE_MODE;

typedef enum QOMX_VPP_SPLIT_DIRECTION {
    VPP_HQV_SPLIT_LEFT_TO_RIGHT,
    VPP_HQV_SPLIT_RIGHT_TO_LEFT,
    VPP_HQV_SPLIT_TOP_TO_BOTTOM,
    VPP_HQV_SPLIT_BOTTOM_TO_TOP,
    VPP_HQV_SPLIT_MAX,
} QOMX_VPP_SPLIT_DIRECTION;

typedef enum QOMX_VPP_HQV_FRC_MODE {
   VPP_HQV_FRC_MODE_OFF,
   VPP_HQV_FRC_MODE_LOW,
   VPP_HQV_FRC_MODE_MED,
   VPP_HQV_FRC_MODE_HIGH,
   VPP_HQV_FRC_MODE_MAX,
} QOMX_VPP_HQV_FRC_MODE;


typedef struct QOMX_VPP_HQVCTRL_CADE {
    QOMX_VPP_HQV_MODE mode;
    OMX_U32 level;
    OMX_S32 contrast;
    OMX_S32 saturation;
} QOMX_VPP_HQVCTRL_CADE;

typedef struct QOMX_VPP_HQVCTRL_DI {
    QOMX_VPP_HQV_DI_MODE mode;
} QOMX_VPP_HQVCTRL_DI;

typedef struct QOMX_VPP_HQVCTRL_CNR {
    QOMX_VPP_HQV_MODE mode;
    OMX_U32 level;
} QOMX_VPP_HQVCTRL_CNR;

typedef struct QOMX_VPP_HQVCTRL_AIE {
    QOMX_VPP_HQV_MODE mode;
    QOMX_VPP_HQV_HUE_MODE hue_mode;
    OMX_U32 cade_level;
    OMX_U32 ltm_level;
} QOMX_VPP_HQVCTRL_AIE;

typedef struct QOMX_VPP_HQVCTRL_CUSTOM {
    OMX_U32 id;
    OMX_U32 len;
    OMX_U8 data[QOMX_VPP_HQV_CUSTOMPAYLOAD_SZ];
} QOMX_VPP_HQVCTRL_CUSTOM;

typedef struct QOMX_VPP_HQVCTRL_GLOBAL_DEMO {
    OMX_U32 process_percent;
    QOMX_VPP_SPLIT_DIRECTION process_direction;
} QOMX_VPP_HQVCTRL_GLOBAL_DEMO;

typedef struct QOMX_VPP_HQVCTRL_FRC {
    QOMX_VPP_HQV_FRC_MODE mode;
} QOMX_VPP_HQVCTRL_FRC;

/* VIDEO POSTPROCESSING OMX CTRLS */
typedef struct QOMX_VPP_HQVCONTROL {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    QOMX_VPP_HQV_MODE mode;
    QOMX_VPP_HQVCONTROLTYPE ctrl_type;
    union {
        QOMX_VPP_HQVCTRL_CADE cade;
        QOMX_VPP_HQVCTRL_DI di;
        QOMX_VPP_HQVCTRL_CNR cnr;
        QOMX_VPP_HQVCTRL_AIE aie;
        QOMX_VPP_HQVCTRL_CUSTOM custom;
        QOMX_VPP_HQVCTRL_GLOBAL_DEMO global_demo;
        QOMX_VPP_HQVCTRL_FRC frc;
    };
} QOMX_VPP_HQVCONTROL;

/* STRUCTURE TO TURN VPP ON */
typedef struct QOMX_VPP_ENABLE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_BOOL enable_vpp;
} QOMX_VPP_ENABLE;

typedef struct QOMX_EXTRADATA_ENABLE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_BOOL bEnable;
} QOMX_EXTRADATA_ENABLE;

typedef enum OMX_QOMX_VIDEO_MBISTATISTICSTYPE {
    QOMX_MBI_STATISTICS_MODE_DEFAULT = 0,
    QOMX_MBI_STATISTICS_MODE_1 = 0x01,
    QOMX_MBI_STATISTICS_MODE_2 = 0x02,
} OMX_QOMX_VIDEO_MBISTATISTICSTYPE;

typedef struct OMX_QOMX_VIDEO_MBI_STATISTICS {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_QOMX_VIDEO_MBISTATISTICSTYPE eMBIStatisticsType;
} OMX_QOMX_VIDEO_MBI_STATISTICS;

typedef struct QOMX_VIDEO_BATCHSIZETYPE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_U32 nBatchSize;
} QOMX_VIDEO_BATCHSIZETYPE;

typedef struct QOMX_VIDEO_CLIENT_EXTRADATA {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_U32 nFd;
    OMX_U32 nExtradataAllocSize;
    OMX_U32 nExtradataSize;
} QOMX_VIDEO_CLIENT_EXTRADATATYPE;

#if defined(__cplusplus) && defined(USE_CAMERA_METABUFFER_UTILS)

#define CAM_META_BUFFER_EVENT_PERF 0x01

/**
 * Camera1 meta-buffer payload create/access/modify utility
 */
struct MetaBufferUtil {

    enum {
        INT_OFFSET      = 1,
        INT_SIZE        = 2,
        INT_USAGE       = 3,
        INT_TIMESTAMP   = 4,
        INT_COLORFORMAT = 5,
        INT_BUFINDEX    = 6,
        INT_BUFEVENT    = 7,
        INT_TOTAL       = INT_BUFINDEX,
    };

    static int getNumFdsForBatch(int batchSize) {
        return batchSize;
    }
    static int getNumIntsForBatch(int batchSize) {
        return batchSize * INT_TOTAL;
    }
    static int getBatchSize(const native_handle_t *hnd) {
        return MetaBufferUtil::isHandleSane(hnd) ? hnd->numFds : -1;
    }

    /* getters */
    /* return a fd at index or -1 if index is invalid */
    static int getFdAt(const native_handle_t *hnd, int index) {
        return (MetaBufferUtil::isHandleSane(hnd) && (index < hnd->numFds)) ? hnd->data[index] : -1;
    }
    /* return a int of type at index or -1 if index or type is invalid */
    static int getIntAt(const native_handle_t *hnd, int index, int type) {
        int idx = MetaBufferUtil::getIntIndex(hnd, index, type);
        return idx < 0 ? -1 : hnd->data[idx];
    }

    /* setters */
    /* replace the fd at index and return 0. Return -1 if index is invalid */
    static int setFdAt(native_handle_t *hnd, int index, int fd) {
        return (MetaBufferUtil::isHandleSane(hnd) && (index < hnd->numFds)) ? hnd->data[index] = fd, 0 : -1;
    }
    /* replace an int of type at index and return 0. Return -1 if index or type is invalid */
    static int setIntAt(native_handle_t *hnd, int index, int type, int value) {
        int idx = MetaBufferUtil::getIntIndex(hnd, index, type);
        return idx < 0 ? -1 : hnd->data[idx] = value, 0;
    }

private:
    static bool isHandleSane(const native_handle_t *hnd) {
        return hnd && hnd->version == sizeof(native_handle_t);
    }

    static int getIntIndex(const native_handle_t *hnd, int index, int type) {
        int idx = index + type * MetaBufferUtil::getBatchSize(hnd);
        return (MetaBufferUtil::isHandleSane(hnd) && (idx < (hnd->numInts + hnd->numFds))) ? idx : -1;
    }
};

#endif // __cplusplus

typedef enum QOMX_VIDEO_DITHERTYPE {
    QOMX_DITHER_DISABLE = 0,
    QOMX_DITHER_COLORSPACE_EXCEPT_BT2020 = 0x01,
    QOMX_DITHER_ALL_COLORSPACE = 0x02,
} QOMX_VIDEO_DITHERTYPE;

typedef struct QOMX_VIDEO_DITHER_CONTROL {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    QOMX_VIDEO_DITHERTYPE eDitherType;
} QOMX_VIDEO_DITHER_CONTROL;

typedef enum QOMX_VIDEO_SLICEMODETYPE {
    QOMX_SLICEMODE_DISABLE = 0,
    QOMX_SLICEMODE_MB_COUNT = 0x01,
    QOMX_SLICEMODE_BYTE_COUNT = 0x02,
} QOMX_VIDEO_SLICEMODETYPE;

typedef struct QOMX_VIDEO_PARAM_SLICE_SPACING_TYPE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    QOMX_VIDEO_SLICEMODETYPE eSliceMode;
    OMX_U32 nSliceSize;
} QOMX_VIDEO_PARAM_SLICE_SPACING_TYPE;

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* __OMX_QCOM_EXTENSIONS_H__ */