OMX_Other.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. /*
  2. * Copyright (c) 2008 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. /** @file OMX_Other.h - OpenMax IL version 1.1.2
  24. * The structures needed by Other components to exchange
  25. * parameters and configuration data with the components.
  26. */
  27. #ifndef OMX_Other_h
  28. #define OMX_Other_h
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif /* __cplusplus */
  32. /* Each OMX header must include all required header files to allow the
  33. * header to compile without errors. The includes below are required
  34. * for this header file to compile successfully
  35. */
  36. #include <OMX_Core.h>
  37. /**
  38. * Enumeration of possible data types which match to multiple domains or no
  39. * domain at all. For types which are vendor specific, a value above
  40. * OMX_OTHER_VENDORTSTART should be used.
  41. */
  42. typedef enum OMX_OTHER_FORMATTYPE {
  43. OMX_OTHER_FormatTime = 0, /**< Transmission of various timestamps, elapsed time,
  44. time deltas, etc */
  45. OMX_OTHER_FormatPower, /**< Perhaps used for enabling/disabling power
  46. management, setting clocks? */
  47. OMX_OTHER_FormatStats, /**< Could be things such as frame rate, frames
  48. dropped, etc */
  49. OMX_OTHER_FormatBinary, /**< Arbitrary binary data */
  50. OMX_OTHER_FormatVendorReserved = 1000, /**< Starting value for vendor specific
  51. formats */
  52. OMX_OTHER_FormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  53. OMX_OTHER_FormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  54. OMX_OTHER_FormatMax = 0x7FFFFFFF
  55. } OMX_OTHER_FORMATTYPE;
  56. /**
  57. * Enumeration of seek modes.
  58. */
  59. typedef enum OMX_TIME_SEEKMODETYPE {
  60. OMX_TIME_SeekModeFast = 0, /**< Prefer seeking to an approximation
  61. * of the requested seek position over
  62. * the actual seek position if it
  63. * results in a faster seek. */
  64. OMX_TIME_SeekModeAccurate, /**< Prefer seeking to the actual seek
  65. * position over an approximation
  66. * of the requested seek position even
  67. * if it results in a slower seek. */
  68. OMX_TIME_SeekModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  69. OMX_TIME_SeekModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  70. OMX_TIME_SeekModeMax = 0x7FFFFFFF
  71. } OMX_TIME_SEEKMODETYPE;
  72. /* Structure representing the seekmode of the component */
  73. typedef struct OMX_TIME_CONFIG_SEEKMODETYPE {
  74. OMX_U32 nSize; /**< size of the structure in bytes */
  75. OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  76. OMX_TIME_SEEKMODETYPE eType; /**< The seek mode */
  77. } OMX_TIME_CONFIG_SEEKMODETYPE;
  78. /**
  79. * colorspace
  80. */
  81. typedef enum OMX_ROCKCHIP_EXT_COLORSPACE {
  82. OMX_RK_EXT_ColorspaceBT709 = 1,
  83. OMX_RK_EXT_ColorspaceBT2020,
  84. OMX_RK_EXT_ColorspaceMax = 0x7FFFFFFF
  85. } OMX_RK_EXT_COLORSPACE;
  86. /**
  87. * dynamic range
  88. */
  89. typedef enum OMX_ROCKCHIP_EXT_DYNCRANGE {
  90. OMX_RK_EXT_DyncrangeSDR = 0,
  91. OMX_RK_EXT_DyncrangeHDR10,
  92. OMX_RK_EXT_DyncrangeHDRHLG,
  93. OMX_RK_EXT_DyncrangeHDRDOLBY,
  94. OMX_RK_EXT_DyncrangeMax = 0x7FFFFFFF
  95. } OMX_RK_EXT_DYNCRANGE;
  96. /* Structure Rockchip extension HDR param of the component */
  97. typedef struct OMX_EXTENSION_VIDEO_PARAM_HDR {
  98. OMX_U32 nSize; /**< size of the structure in bytes */
  99. OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  100. OMX_RK_EXT_COLORSPACE eColorSpace; /**< Color space */
  101. OMX_RK_EXT_DYNCRANGE eDyncRange; /**< dynamic range */
  102. } OMX_EXTENSION_VIDEO_PARAM_HDR;
  103. /** Structure representing a time stamp used with the following configs
  104. * on the Clock Component (CC):
  105. *
  106. * OMX_IndexConfigTimeCurrentWallTime: query of the CC’s current wall
  107. * time
  108. * OMX_IndexConfigTimeCurrentMediaTime: query of the CC’s current media
  109. * time
  110. * OMX_IndexConfigTimeCurrentAudioReference and
  111. * OMX_IndexConfigTimeCurrentVideoReference: audio/video reference
  112. * clock sending SC its reference time
  113. * OMX_IndexConfigTimeClientStartTime: a Clock Component client sends
  114. * this structure to the Clock Component via a SetConfig on its
  115. * client port when it receives a buffer with
  116. * OMX_BUFFERFLAG_STARTTIME set. It must use the timestamp
  117. * specified by that buffer for nStartTimestamp.
  118. *
  119. * It’s also used with the following config on components in general:
  120. *
  121. * OMX_IndexConfigTimePosition: IL client querying component position
  122. * (GetConfig) or commanding a component to seek to the given location
  123. * (SetConfig)
  124. */
  125. typedef struct OMX_TIME_CONFIG_TIMESTAMPTYPE {
  126. OMX_U32 nSize; /**< size of the structure in bytes */
  127. OMX_VERSIONTYPE nVersion; /**< OMX specification version
  128. * information */
  129. OMX_U32 nPortIndex; /**< port that this structure applies to */
  130. OMX_TICKS nTimestamp; /**< timestamp .*/
  131. } OMX_TIME_CONFIG_TIMESTAMPTYPE;
  132. /** Enumeration of possible reference clocks to the media time. */
  133. typedef enum OMX_TIME_UPDATETYPE {
  134. OMX_TIME_UpdateRequestFulfillment, /**< Update is the fulfillment of a media time request. */
  135. OMX_TIME_UpdateScaleChanged, /**< Update was generated because the scale chagned. */
  136. OMX_TIME_UpdateClockStateChanged, /**< Update was generated because the clock state changed. */
  137. OMX_TIME_UpdateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  138. OMX_TIME_UpdateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  139. OMX_TIME_UpdateMax = 0x7FFFFFFF
  140. } OMX_TIME_UPDATETYPE;
  141. /** Enumeration of possible reference clocks to the media time. */
  142. typedef enum OMX_TIME_REFCLOCKTYPE {
  143. OMX_TIME_RefClockNone, /**< Use no references. */
  144. OMX_TIME_RefClockAudio, /**< Use references sent through OMX_IndexConfigTimeCurrentAudioReference */
  145. OMX_TIME_RefClockVideo, /**< Use references sent through OMX_IndexConfigTimeCurrentVideoReference */
  146. OMX_TIME_RefClockKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  147. OMX_TIME_RefClockVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  148. OMX_TIME_RefClockMax = 0x7FFFFFFF
  149. } OMX_TIME_REFCLOCKTYPE;
  150. /** Enumeration of clock states. */
  151. typedef enum OMX_TIME_CLOCKSTATE {
  152. OMX_TIME_ClockStateRunning, /**< Clock running. */
  153. OMX_TIME_ClockStateWaitingForStartTime, /**< Clock waiting until the
  154. * prescribed clients emit their
  155. * start time. */
  156. OMX_TIME_ClockStateStopped, /**< Clock stopped. */
  157. OMX_TIME_ClockStateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  158. OMX_TIME_ClockStateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  159. OMX_TIME_ClockStateMax = 0x7FFFFFFF
  160. } OMX_TIME_CLOCKSTATE;
  161. /** Structure representing a media time request to the clock component.
  162. *
  163. * A client component sends this structure to the Clock Component via a SetConfig
  164. * on its client port to specify a media timestamp the Clock Component
  165. * should emit. The Clock Component should fulfill the request by sending a
  166. * OMX_TIME_MEDIATIMETYPE when its media clock matches the requested
  167. * timestamp.
  168. *
  169. * The client may require a media time request be fulfilled slightly
  170. * earlier than the media time specified. In this case the client specifies
  171. * an offset which is equal to the difference between wall time corresponding
  172. * to the requested media time and the wall time when it will be
  173. * fulfilled.
  174. *
  175. * A client component may uses these requests and the OMX_TIME_MEDIATIMETYPE to
  176. * time events according to timestamps. If a client must perform an operation O at
  177. * a time T (e.g. deliver a video frame at its corresponding timestamp), it makes a
  178. * media time request at T (perhaps specifying an offset to ensure the request fulfillment
  179. * is a little early). When the clock component passes the resulting OMX_TIME_MEDIATIMETYPE
  180. * structure back to the client component, the client may perform operation O (perhaps having
  181. * to wait a slight amount more time itself as specified by the return values).
  182. */
  183. typedef struct OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE {
  184. OMX_U32 nSize; /**< size of the structure in bytes */
  185. OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  186. OMX_U32 nPortIndex; /**< port that this structure applies to */
  187. OMX_PTR pClientPrivate; /**< Client private data to disabiguate this media time
  188. * from others (e.g. the number of the frame to deliver).
  189. * Duplicated in the media time structure that fulfills
  190. * this request. A value of zero is reserved for time scale
  191. * updates. */
  192. OMX_TICKS nMediaTimestamp; /**< Media timestamp requested.*/
  193. OMX_TICKS nOffset; /**< Amount of wall clock time by which this
  194. * request should be fulfilled early */
  195. } OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE;
  196. /**< Structure sent from the clock component client either when fulfilling
  197. * a media time request or when the time scale has changed.
  198. *
  199. * In the former case the Clock Component fills this structure and times its emission
  200. * to a client component (via the client port) according to the corresponding media
  201. * time request sent by the client. The Clock Component should time the emission to occur
  202. * when the requested timestamp matches the Clock Component's media time but also the
  203. * prescribed offset early.
  204. *
  205. * Upon scale changes the clock component clears the nClientPrivate data, sends the current
  206. * media time and sets the nScale to the new scale via the client port. It emits a
  207. * OMX_TIME_MEDIATIMETYPE to all clients independent of any requests. This allows clients to
  208. * alter processing to accomodate scaling. For instance a video component might skip inter-frames
  209. * in the case of extreme fastforward. Likewise an audio component might add or remove samples
  210. * from an audio frame to scale audio data.
  211. *
  212. * It is expected that some clock components may not be able to fulfill requests
  213. * at exactly the prescribed time. This is acceptable so long as the request is
  214. * fulfilled at least as early as described and not later. This structure provides
  215. * fields the client may use to wait for the remaining time.
  216. *
  217. * The client may use either the nOffset or nWallTimeAtMedia fields to determine the
  218. * wall time until the nMediaTimestamp actually occurs. In the latter case the
  219. * client can get a more accurate value for offset by getting the current wall
  220. * from the cloc component and subtracting it from nWallTimeAtMedia.
  221. */
  222. typedef struct OMX_TIME_MEDIATIMETYPE {
  223. OMX_U32 nSize; /**< size of the structure in bytes */
  224. OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  225. OMX_U32 nClientPrivate; /**< Client private data to disabiguate this media time
  226. * from others. Copied from the media time request.
  227. * A value of zero is reserved for time scale updates. */
  228. OMX_TIME_UPDATETYPE eUpdateType; /**< Reason for the update */
  229. OMX_TICKS nMediaTimestamp; /**< Media time requested. If no media time was
  230. * requested then this is the current media time. */
  231. OMX_TICKS nOffset; /**< Amount of wall clock time by which this
  232. * request was actually fulfilled early */
  233. OMX_TICKS nWallTimeAtMediaTime; /**< Wall time corresponding to nMediaTimeStamp.
  234. * A client may compare this value to current
  235. * media time obtained from the Clock Component to determine
  236. * the wall time until the media timestamp is really
  237. * current. */
  238. OMX_S32 xScale; /**< Current media time scale in Q16 format. */
  239. OMX_TIME_CLOCKSTATE eState; /* Seeking Change. Added 7/12.*/
  240. /**< State of the media time. */
  241. } OMX_TIME_MEDIATIMETYPE;
  242. /** Structure representing the current media time scale factor. Applicable only to clock
  243. * component, other components see scale changes via OMX_TIME_MEDIATIMETYPE buffers sent via
  244. * the clock component client ports. Upon recieving this config the clock component changes
  245. * the rate by which the media time increases or decreases effectively implementing trick modes.
  246. */
  247. typedef struct OMX_TIME_CONFIG_SCALETYPE {
  248. OMX_U32 nSize; /**< size of the structure in bytes */
  249. OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  250. OMX_S32 xScale; /**< This is a value in Q16 format which is used for
  251. * scaling the media time */
  252. } OMX_TIME_CONFIG_SCALETYPE;
  253. /** Bits used to identify a clock port. Used in OMX_TIME_CONFIG_CLOCKSTATETYPE’s nWaitMask field */
  254. #define OMX_CLOCKPORT0 0x00000001
  255. #define OMX_CLOCKPORT1 0x00000002
  256. #define OMX_CLOCKPORT2 0x00000004
  257. #define OMX_CLOCKPORT3 0x00000008
  258. #define OMX_CLOCKPORT4 0x00000010
  259. #define OMX_CLOCKPORT5 0x00000020
  260. #define OMX_CLOCKPORT6 0x00000040
  261. #define OMX_CLOCKPORT7 0x00000080
  262. /** Structure representing the current mode of the media clock.
  263. * IL Client uses this config to change or query the mode of the
  264. * media clock of the clock component. Applicable only to clock
  265. * component.
  266. *
  267. * On a SetConfig if eState is OMX_TIME_ClockStateRunning media time
  268. * starts immediately at the prescribed start time. If
  269. * OMX_TIME_ClockStateWaitingForStartTime the Clock Component ignores
  270. * the given nStartTime and waits for all clients specified in the
  271. * nWaitMask to send starttimes (via
  272. * OMX_IndexConfigTimeClientStartTime). The Clock Component then starts
  273. * the media clock using the earliest start time supplied. */
  274. typedef struct OMX_TIME_CONFIG_CLOCKSTATETYPE {
  275. OMX_U32 nSize; /**< size of the structure in bytes */
  276. OMX_VERSIONTYPE nVersion; /**< OMX specification version
  277. * information */
  278. OMX_TIME_CLOCKSTATE eState; /**< State of the media time. */
  279. OMX_TICKS nStartTime; /**< Start time of the media time. */
  280. OMX_TICKS nOffset; /**< Time to offset the media time by
  281. * (e.g. preroll). Media time will be
  282. * reported to be nOffset ticks earlier.
  283. */
  284. OMX_U32 nWaitMask; /**< Mask of OMX_CLOCKPORT values. */
  285. } OMX_TIME_CONFIG_CLOCKSTATETYPE;
  286. /** Structure representing the reference clock currently being used to
  287. * compute media time. IL client uses this config to change or query the
  288. * clock component's active reference clock */
  289. typedef struct OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE {
  290. OMX_U32 nSize; /**< size of the structure in bytes */
  291. OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  292. OMX_TIME_REFCLOCKTYPE eClock; /**< Reference clock used to compute media time */
  293. } OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE;
  294. /** Descriptor for setting specifics of power type.
  295. * Note: this structure is listed for backwards compatibility. */
  296. typedef struct OMX_OTHER_CONFIG_POWERTYPE {
  297. OMX_U32 nSize; /**< size of the structure in bytes */
  298. OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  299. OMX_BOOL bEnablePM; /**< Flag to enable Power Management */
  300. } OMX_OTHER_CONFIG_POWERTYPE;
  301. /** Descriptor for setting specifics of stats type.
  302. * Note: this structure is listed for backwards compatibility. */
  303. typedef struct OMX_OTHER_CONFIG_STATSTYPE {
  304. OMX_U32 nSize; /**< size of the structure in bytes */
  305. OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  306. /* what goes here */
  307. } OMX_OTHER_CONFIG_STATSTYPE;
  308. /**
  309. * The PortDefinition structure is used to define all of the parameters
  310. * necessary for the compliant component to setup an input or an output other
  311. * path.
  312. */
  313. typedef struct OMX_OTHER_PORTDEFINITIONTYPE {
  314. OMX_OTHER_FORMATTYPE eFormat; /**< Type of data expected for this channel */
  315. } OMX_OTHER_PORTDEFINITIONTYPE;
  316. /** Port format parameter. This structure is used to enumerate
  317. * the various data input/output format supported by the port.
  318. */
  319. typedef struct OMX_OTHER_PARAM_PORTFORMATTYPE {
  320. OMX_U32 nSize; /**< size of the structure in bytes */
  321. OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  322. OMX_U32 nPortIndex; /**< Indicates which port to set */
  323. OMX_U32 nIndex; /**< Indicates the enumeration index for the format from 0x0 to N-1 */
  324. OMX_OTHER_FORMATTYPE eFormat; /**< Type of data expected for this channel */
  325. } OMX_OTHER_PARAM_PORTFORMATTYPE;
  326. #ifdef __cplusplus
  327. }
  328. #endif /* __cplusplus */
  329. #endif
  330. /* File EOF */