OMX_Other.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  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. /** Structure representing a time stamp used with the following configs
  79. * on the Clock Component (CC):
  80. *
  81. * OMX_IndexConfigTimeCurrentWallTime: query of the CC’s current wall
  82. * time
  83. * OMX_IndexConfigTimeCurrentMediaTime: query of the CC’s current media
  84. * time
  85. * OMX_IndexConfigTimeCurrentAudioReference and
  86. * OMX_IndexConfigTimeCurrentVideoReference: audio/video reference
  87. * clock sending SC its reference time
  88. * OMX_IndexConfigTimeClientStartTime: a Clock Component client sends
  89. * this structure to the Clock Component via a SetConfig on its
  90. * client port when it receives a buffer with
  91. * OMX_BUFFERFLAG_STARTTIME set. It must use the timestamp
  92. * specified by that buffer for nStartTimestamp.
  93. *
  94. * It’s also used with the following config on components in general:
  95. *
  96. * OMX_IndexConfigTimePosition: IL client querying component position
  97. * (GetConfig) or commanding a component to seek to the given location
  98. * (SetConfig)
  99. */
  100. typedef struct OMX_TIME_CONFIG_TIMESTAMPTYPE {
  101. OMX_U32 nSize; /**< size of the structure in bytes */
  102. OMX_VERSIONTYPE nVersion; /**< OMX specification version
  103. * information */
  104. OMX_U32 nPortIndex; /**< port that this structure applies to */
  105. OMX_TICKS nTimestamp; /**< timestamp .*/
  106. } OMX_TIME_CONFIG_TIMESTAMPTYPE;
  107. /** Enumeration of possible reference clocks to the media time. */
  108. typedef enum OMX_TIME_UPDATETYPE {
  109. OMX_TIME_UpdateRequestFulfillment, /**< Update is the fulfillment of a media time request. */
  110. OMX_TIME_UpdateScaleChanged, /**< Update was generated because the scale chagned. */
  111. OMX_TIME_UpdateClockStateChanged, /**< Update was generated because the clock state changed. */
  112. OMX_TIME_UpdateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  113. OMX_TIME_UpdateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  114. OMX_TIME_UpdateMax = 0x7FFFFFFF
  115. } OMX_TIME_UPDATETYPE;
  116. /** Enumeration of possible reference clocks to the media time. */
  117. typedef enum OMX_TIME_REFCLOCKTYPE {
  118. OMX_TIME_RefClockNone, /**< Use no references. */
  119. OMX_TIME_RefClockAudio, /**< Use references sent through OMX_IndexConfigTimeCurrentAudioReference */
  120. OMX_TIME_RefClockVideo, /**< Use references sent through OMX_IndexConfigTimeCurrentVideoReference */
  121. OMX_TIME_RefClockKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  122. OMX_TIME_RefClockVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  123. OMX_TIME_RefClockMax = 0x7FFFFFFF
  124. } OMX_TIME_REFCLOCKTYPE;
  125. /** Enumeration of clock states. */
  126. typedef enum OMX_TIME_CLOCKSTATE {
  127. OMX_TIME_ClockStateRunning, /**< Clock running. */
  128. OMX_TIME_ClockStateWaitingForStartTime, /**< Clock waiting until the
  129. * prescribed clients emit their
  130. * start time. */
  131. OMX_TIME_ClockStateStopped, /**< Clock stopped. */
  132. OMX_TIME_ClockStateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
  133. OMX_TIME_ClockStateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
  134. OMX_TIME_ClockStateMax = 0x7FFFFFFF
  135. } OMX_TIME_CLOCKSTATE;
  136. /** Structure representing a media time request to the clock component.
  137. *
  138. * A client component sends this structure to the Clock Component via a SetConfig
  139. * on its client port to specify a media timestamp the Clock Component
  140. * should emit. The Clock Component should fulfill the request by sending a
  141. * OMX_TIME_MEDIATIMETYPE when its media clock matches the requested
  142. * timestamp.
  143. *
  144. * The client may require a media time request be fulfilled slightly
  145. * earlier than the media time specified. In this case the client specifies
  146. * an offset which is equal to the difference between wall time corresponding
  147. * to the requested media time and the wall time when it will be
  148. * fulfilled.
  149. *
  150. * A client component may uses these requests and the OMX_TIME_MEDIATIMETYPE to
  151. * time events according to timestamps. If a client must perform an operation O at
  152. * a time T (e.g. deliver a video frame at its corresponding timestamp), it makes a
  153. * media time request at T (perhaps specifying an offset to ensure the request fulfillment
  154. * is a little early). When the clock component passes the resulting OMX_TIME_MEDIATIMETYPE
  155. * structure back to the client component, the client may perform operation O (perhaps having
  156. * to wait a slight amount more time itself as specified by the return values).
  157. */
  158. typedef struct OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE {
  159. OMX_U32 nSize; /**< size of the structure in bytes */
  160. OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  161. OMX_U32 nPortIndex; /**< port that this structure applies to */
  162. OMX_PTR pClientPrivate; /**< Client private data to disabiguate this media time
  163. * from others (e.g. the number of the frame to deliver).
  164. * Duplicated in the media time structure that fulfills
  165. * this request. A value of zero is reserved for time scale
  166. * updates. */
  167. OMX_TICKS nMediaTimestamp; /**< Media timestamp requested.*/
  168. OMX_TICKS nOffset; /**< Amount of wall clock time by which this
  169. * request should be fulfilled early */
  170. } OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE;
  171. /**< Structure sent from the clock component client either when fulfilling
  172. * a media time request or when the time scale has changed.
  173. *
  174. * In the former case the Clock Component fills this structure and times its emission
  175. * to a client component (via the client port) according to the corresponding media
  176. * time request sent by the client. The Clock Component should time the emission to occur
  177. * when the requested timestamp matches the Clock Component's media time but also the
  178. * prescribed offset early.
  179. *
  180. * Upon scale changes the clock component clears the nClientPrivate data, sends the current
  181. * media time and sets the nScale to the new scale via the client port. It emits a
  182. * OMX_TIME_MEDIATIMETYPE to all clients independent of any requests. This allows clients to
  183. * alter processing to accomodate scaling. For instance a video component might skip inter-frames
  184. * in the case of extreme fastforward. Likewise an audio component might add or remove samples
  185. * from an audio frame to scale audio data.
  186. *
  187. * It is expected that some clock components may not be able to fulfill requests
  188. * at exactly the prescribed time. This is acceptable so long as the request is
  189. * fulfilled at least as early as described and not later. This structure provides
  190. * fields the client may use to wait for the remaining time.
  191. *
  192. * The client may use either the nOffset or nWallTimeAtMedia fields to determine the
  193. * wall time until the nMediaTimestamp actually occurs. In the latter case the
  194. * client can get a more accurate value for offset by getting the current wall
  195. * from the cloc component and subtracting it from nWallTimeAtMedia.
  196. */
  197. typedef struct OMX_TIME_MEDIATIMETYPE {
  198. OMX_U32 nSize; /**< size of the structure in bytes */
  199. OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  200. OMX_U32 nClientPrivate; /**< Client private data to disabiguate this media time
  201. * from others. Copied from the media time request.
  202. * A value of zero is reserved for time scale updates. */
  203. OMX_TIME_UPDATETYPE eUpdateType; /**< Reason for the update */
  204. OMX_TICKS nMediaTimestamp; /**< Media time requested. If no media time was
  205. * requested then this is the current media time. */
  206. OMX_TICKS nOffset; /**< Amount of wall clock time by which this
  207. * request was actually fulfilled early */
  208. OMX_TICKS nWallTimeAtMediaTime; /**< Wall time corresponding to nMediaTimeStamp.
  209. * A client may compare this value to current
  210. * media time obtained from the Clock Component to determine
  211. * the wall time until the media timestamp is really
  212. * current. */
  213. OMX_S32 xScale; /**< Current media time scale in Q16 format. */
  214. OMX_TIME_CLOCKSTATE eState; /* Seeking Change. Added 7/12.*/
  215. /**< State of the media time. */
  216. } OMX_TIME_MEDIATIMETYPE;
  217. /** Structure representing the current media time scale factor. Applicable only to clock
  218. * component, other components see scale changes via OMX_TIME_MEDIATIMETYPE buffers sent via
  219. * the clock component client ports. Upon recieving this config the clock component changes
  220. * the rate by which the media time increases or decreases effectively implementing trick modes.
  221. */
  222. typedef struct OMX_TIME_CONFIG_SCALETYPE {
  223. OMX_U32 nSize; /**< size of the structure in bytes */
  224. OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  225. OMX_S32 xScale; /**< This is a value in Q16 format which is used for
  226. * scaling the media time */
  227. } OMX_TIME_CONFIG_SCALETYPE;
  228. /** Bits used to identify a clock port. Used in OMX_TIME_CONFIG_CLOCKSTATETYPE’s nWaitMask field */
  229. #define OMX_CLOCKPORT0 0x00000001
  230. #define OMX_CLOCKPORT1 0x00000002
  231. #define OMX_CLOCKPORT2 0x00000004
  232. #define OMX_CLOCKPORT3 0x00000008
  233. #define OMX_CLOCKPORT4 0x00000010
  234. #define OMX_CLOCKPORT5 0x00000020
  235. #define OMX_CLOCKPORT6 0x00000040
  236. #define OMX_CLOCKPORT7 0x00000080
  237. /** Structure representing the current mode of the media clock.
  238. * IL Client uses this config to change or query the mode of the
  239. * media clock of the clock component. Applicable only to clock
  240. * component.
  241. *
  242. * On a SetConfig if eState is OMX_TIME_ClockStateRunning media time
  243. * starts immediately at the prescribed start time. If
  244. * OMX_TIME_ClockStateWaitingForStartTime the Clock Component ignores
  245. * the given nStartTime and waits for all clients specified in the
  246. * nWaitMask to send starttimes (via
  247. * OMX_IndexConfigTimeClientStartTime). The Clock Component then starts
  248. * the media clock using the earliest start time supplied. */
  249. typedef struct OMX_TIME_CONFIG_CLOCKSTATETYPE {
  250. OMX_U32 nSize; /**< size of the structure in bytes */
  251. OMX_VERSIONTYPE nVersion; /**< OMX specification version
  252. * information */
  253. OMX_TIME_CLOCKSTATE eState; /**< State of the media time. */
  254. OMX_TICKS nStartTime; /**< Start time of the media time. */
  255. OMX_TICKS nOffset; /**< Time to offset the media time by
  256. * (e.g. preroll). Media time will be
  257. * reported to be nOffset ticks earlier.
  258. */
  259. OMX_U32 nWaitMask; /**< Mask of OMX_CLOCKPORT values. */
  260. } OMX_TIME_CONFIG_CLOCKSTATETYPE;
  261. /** Structure representing the reference clock currently being used to
  262. * compute media time. IL client uses this config to change or query the
  263. * clock component's active reference clock */
  264. typedef struct OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE {
  265. OMX_U32 nSize; /**< size of the structure in bytes */
  266. OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  267. OMX_TIME_REFCLOCKTYPE eClock; /**< Reference clock used to compute media time */
  268. } OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE;
  269. /** Descriptor for setting specifics of power type.
  270. * Note: this structure is listed for backwards compatibility. */
  271. typedef struct OMX_OTHER_CONFIG_POWERTYPE {
  272. OMX_U32 nSize; /**< size of the structure in bytes */
  273. OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  274. OMX_BOOL bEnablePM; /**< Flag to enable Power Management */
  275. } OMX_OTHER_CONFIG_POWERTYPE;
  276. /** Descriptor for setting specifics of stats type.
  277. * Note: this structure is listed for backwards compatibility. */
  278. typedef struct OMX_OTHER_CONFIG_STATSTYPE {
  279. OMX_U32 nSize; /**< size of the structure in bytes */
  280. OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  281. /* what goes here */
  282. } OMX_OTHER_CONFIG_STATSTYPE;
  283. /**
  284. * The PortDefinition structure is used to define all of the parameters
  285. * necessary for the compliant component to setup an input or an output other
  286. * path.
  287. */
  288. typedef struct OMX_OTHER_PORTDEFINITIONTYPE {
  289. OMX_OTHER_FORMATTYPE eFormat; /**< Type of data expected for this channel */
  290. } OMX_OTHER_PORTDEFINITIONTYPE;
  291. /** Port format parameter. This structure is used to enumerate
  292. * the various data input/output format supported by the port.
  293. */
  294. typedef struct OMX_OTHER_PARAM_PORTFORMATTYPE {
  295. OMX_U32 nSize; /**< size of the structure in bytes */
  296. OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
  297. OMX_U32 nPortIndex; /**< Indicates which port to set */
  298. OMX_U32 nIndex; /**< Indicates the enumeration index for the format from 0x0 to N-1 */
  299. OMX_OTHER_FORMATTYPE eFormat; /**< Type of data expected for this channel */
  300. } OMX_OTHER_PARAM_PORTFORMATTYPE;
  301. #ifdef __cplusplus
  302. }
  303. #endif /* __cplusplus */
  304. #endif
  305. /* File EOF */