1334de520b0369215b7931fefa424fb92d295f0ebJames Dong/* ------------------------------------------------------------------
2334de520b0369215b7931fefa424fb92d295f0ebJames Dong * Copyright (C) 1998-2009 PacketVideo
3334de520b0369215b7931fefa424fb92d295f0ebJames Dong *
4334de520b0369215b7931fefa424fb92d295f0ebJames Dong * Licensed under the Apache License, Version 2.0 (the "License");
5334de520b0369215b7931fefa424fb92d295f0ebJames Dong * you may not use this file except in compliance with the License.
6334de520b0369215b7931fefa424fb92d295f0ebJames Dong * You may obtain a copy of the License at
7334de520b0369215b7931fefa424fb92d295f0ebJames Dong *
8334de520b0369215b7931fefa424fb92d295f0ebJames Dong *      http://www.apache.org/licenses/LICENSE-2.0
9334de520b0369215b7931fefa424fb92d295f0ebJames Dong *
10334de520b0369215b7931fefa424fb92d295f0ebJames Dong * Unless required by applicable law or agreed to in writing, software
11334de520b0369215b7931fefa424fb92d295f0ebJames Dong * distributed under the License is distributed on an "AS IS" BASIS,
12334de520b0369215b7931fefa424fb92d295f0ebJames Dong * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13334de520b0369215b7931fefa424fb92d295f0ebJames Dong * express or implied.
14334de520b0369215b7931fefa424fb92d295f0ebJames Dong * See the License for the specific language governing permissions
15334de520b0369215b7931fefa424fb92d295f0ebJames Dong * and limitations under the License.
16334de520b0369215b7931fefa424fb92d295f0ebJames Dong * -------------------------------------------------------------------
17334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
18334de520b0369215b7931fefa424fb92d295f0ebJames Dong/*
19a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * Copyright (c) 2008 The Khronos Group Inc.
20a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *
21334de520b0369215b7931fefa424fb92d295f0ebJames Dong * Permission is hereby granted, free of charge, to any person obtaining
22334de520b0369215b7931fefa424fb92d295f0ebJames Dong * a copy of this software and associated documentation files (the
23334de520b0369215b7931fefa424fb92d295f0ebJames Dong * "Software"), to deal in the Software without restriction, including
24334de520b0369215b7931fefa424fb92d295f0ebJames Dong * without limitation the rights to use, copy, modify, merge, publish,
25334de520b0369215b7931fefa424fb92d295f0ebJames Dong * distribute, sublicense, and/or sell copies of the Software, and to
26334de520b0369215b7931fefa424fb92d295f0ebJames Dong * permit persons to whom the Software is furnished to do so, subject
27a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * to the following conditions:
28334de520b0369215b7931fefa424fb92d295f0ebJames Dong * The above copyright notice and this permission notice shall be included
29a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * in all copies or substantial portions of the Software.
30a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *
31334de520b0369215b7931fefa424fb92d295f0ebJames Dong * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
32334de520b0369215b7931fefa424fb92d295f0ebJames Dong * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
33334de520b0369215b7931fefa424fb92d295f0ebJames Dong * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
34334de520b0369215b7931fefa424fb92d295f0ebJames Dong * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
35334de520b0369215b7931fefa424fb92d295f0ebJames Dong * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
36334de520b0369215b7931fefa424fb92d295f0ebJames Dong * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
37a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
38334de520b0369215b7931fefa424fb92d295f0ebJames Dong *
39334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
40334de520b0369215b7931fefa424fb92d295f0ebJames Dong
41334de520b0369215b7931fefa424fb92d295f0ebJames Dong/** @file OMX_Other.h - OpenMax IL version 1.1.2
42334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  The structures needed by Other components to exchange
43334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  parameters and configuration data with the components.
44334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
45334de520b0369215b7931fefa424fb92d295f0ebJames Dong
46334de520b0369215b7931fefa424fb92d295f0ebJames Dong#ifndef OMX_Other_h
47334de520b0369215b7931fefa424fb92d295f0ebJames Dong#define OMX_Other_h
48334de520b0369215b7931fefa424fb92d295f0ebJames Dong
49334de520b0369215b7931fefa424fb92d295f0ebJames Dong#ifdef __cplusplus
50334de520b0369215b7931fefa424fb92d295f0ebJames Dongextern "C" {
51334de520b0369215b7931fefa424fb92d295f0ebJames Dong#endif /* __cplusplus */
52334de520b0369215b7931fefa424fb92d295f0ebJames Dong
53334de520b0369215b7931fefa424fb92d295f0ebJames Dong
54334de520b0369215b7931fefa424fb92d295f0ebJames Dong/* Each OMX header must include all required header files to allow the
55334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  header to compile without errors.  The includes below are required
56a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *  for this header file to compile successfully
57334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
58334de520b0369215b7931fefa424fb92d295f0ebJames Dong
59334de520b0369215b7931fefa424fb92d295f0ebJames Dong#include <OMX_Core.h>
60334de520b0369215b7931fefa424fb92d295f0ebJames Dong
61334de520b0369215b7931fefa424fb92d295f0ebJames Dong
62a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar/**
63334de520b0369215b7931fefa424fb92d295f0ebJames Dong * Enumeration of possible data types which match to multiple domains or no
64334de520b0369215b7931fefa424fb92d295f0ebJames Dong * domain at all.  For types which are vendor specific, a value above
65334de520b0369215b7931fefa424fb92d295f0ebJames Dong * OMX_OTHER_VENDORTSTART should be used.
66334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
67334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef enum OMX_OTHER_FORMATTYPE {
68a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    OMX_OTHER_FormatTime = 0, /**< Transmission of various timestamps, elapsed time,
69334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                   time deltas, etc */
70a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    OMX_OTHER_FormatPower,    /**< Perhaps used for enabling/disabling power
71334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                   management, setting clocks? */
72a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    OMX_OTHER_FormatStats,    /**< Could be things such as frame rate, frames
73334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                   dropped, etc */
74334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_OTHER_FormatBinary,   /**< Arbitrary binary data */
75a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    OMX_OTHER_FormatVendorReserved = 1000, /**< Starting value for vendor specific
76334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                                formats */
77334de520b0369215b7931fefa424fb92d295f0ebJames Dong
78a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    OMX_OTHER_FormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
79334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_OTHER_FormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
80334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_OTHER_FormatMax = 0x7FFFFFFF
81334de520b0369215b7931fefa424fb92d295f0ebJames Dong} OMX_OTHER_FORMATTYPE;
82334de520b0369215b7931fefa424fb92d295f0ebJames Dong
83a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar/**
84334de520b0369215b7931fefa424fb92d295f0ebJames Dong * Enumeration of seek modes.
85334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
86334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef enum OMX_TIME_SEEKMODETYPE {
87334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_TIME_SeekModeFast = 0, /**< Prefer seeking to an approximation
88a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar                                * of the requested seek position over
89334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                * the actual seek position if it
90334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                * results in a faster seek. */
91a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    OMX_TIME_SeekModeAccurate, /**< Prefer seeking to the actual seek
92334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                * position over an approximation
93334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                * of the requested seek position even
94334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                * if it results in a slower seek. */
95a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    OMX_TIME_SeekModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
96334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_TIME_SeekModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
97334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_TIME_SeekModeMax = 0x7FFFFFFF
98334de520b0369215b7931fefa424fb92d295f0ebJames Dong} OMX_TIME_SEEKMODETYPE;
99334de520b0369215b7931fefa424fb92d295f0ebJames Dong
100334de520b0369215b7931fefa424fb92d295f0ebJames Dong/* Structure representing the seekmode of the component */
101334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef struct OMX_TIME_CONFIG_SEEKMODETYPE {
102334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U32 nSize;                  /**< size of the structure in bytes */
103334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_VERSIONTYPE nVersion;       /**< OMX specification version information */
104334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_TIME_SEEKMODETYPE eType;    /**< The seek mode */
105334de520b0369215b7931fefa424fb92d295f0ebJames Dong} OMX_TIME_CONFIG_SEEKMODETYPE;
106334de520b0369215b7931fefa424fb92d295f0ebJames Dong
107a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar/** Structure representing a time stamp used with the following configs
108334de520b0369215b7931fefa424fb92d295f0ebJames Dong * on the Clock Component (CC):
109a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *
110a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * OMX_IndexConfigTimeCurrentWallTime: query of the CC's current wall
111334de520b0369215b7931fefa424fb92d295f0ebJames Dong *     time
112a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * OMX_IndexConfigTimeCurrentMediaTime: query of the CC's current media
113334de520b0369215b7931fefa424fb92d295f0ebJames Dong *     time
114a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * OMX_IndexConfigTimeCurrentAudioReference and
115a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * OMX_IndexConfigTimeCurrentVideoReference: audio/video reference
116334de520b0369215b7931fefa424fb92d295f0ebJames Dong *     clock sending SC its reference time
117a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * OMX_IndexConfigTimeClientStartTime: a Clock Component client sends
118a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *     this structure to the Clock Component via a SetConfig on its
119334de520b0369215b7931fefa424fb92d295f0ebJames Dong *     client port when it receives a buffer with
120334de520b0369215b7931fefa424fb92d295f0ebJames Dong *     OMX_BUFFERFLAG_STARTTIME set. It must use the timestamp
121a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *     specified by that buffer for nStartTimestamp.
122334de520b0369215b7931fefa424fb92d295f0ebJames Dong *
123a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * It's also used with the following config on components in general:
124334de520b0369215b7931fefa424fb92d295f0ebJames Dong *
125a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * OMX_IndexConfigTimePosition: IL client querying component position
126334de520b0369215b7931fefa424fb92d295f0ebJames Dong * (GetConfig) or commanding a component to seek to the given location
127334de520b0369215b7931fefa424fb92d295f0ebJames Dong * (SetConfig)
128a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar */
129334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef struct OMX_TIME_CONFIG_TIMESTAMPTYPE {
130334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U32 nSize;               /**< size of the structure in bytes */
131334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_VERSIONTYPE nVersion;    /**< OMX specification version
132334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                  *   information */
133a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    OMX_U32 nPortIndex;          /**< port that this structure applies to */
134a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    OMX_TICKS nTimestamp;        /**< timestamp .*/
135a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar} OMX_TIME_CONFIG_TIMESTAMPTYPE;
136334de520b0369215b7931fefa424fb92d295f0ebJames Dong
137334de520b0369215b7931fefa424fb92d295f0ebJames Dong/** Enumeration of possible reference clocks to the media time. */
138334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef enum OMX_TIME_UPDATETYPE {
139334de520b0369215b7931fefa424fb92d295f0ebJames Dong      OMX_TIME_UpdateRequestFulfillment,    /**< Update is the fulfillment of a media time request. */
140a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar      OMX_TIME_UpdateScaleChanged,          /**< Update was generated because the scale chagned. */
141334de520b0369215b7931fefa424fb92d295f0ebJames Dong      OMX_TIME_UpdateClockStateChanged,     /**< Update was generated because the clock state changed. */
142a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar      OMX_TIME_UpdateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
143334de520b0369215b7931fefa424fb92d295f0ebJames Dong      OMX_TIME_UpdateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
144334de520b0369215b7931fefa424fb92d295f0ebJames Dong      OMX_TIME_UpdateMax = 0x7FFFFFFF
145334de520b0369215b7931fefa424fb92d295f0ebJames Dong} OMX_TIME_UPDATETYPE;
146334de520b0369215b7931fefa424fb92d295f0ebJames Dong
147334de520b0369215b7931fefa424fb92d295f0ebJames Dong/** Enumeration of possible reference clocks to the media time. */
148334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef enum OMX_TIME_REFCLOCKTYPE {
149334de520b0369215b7931fefa424fb92d295f0ebJames Dong      OMX_TIME_RefClockNone,    /**< Use no references. */
150a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar      OMX_TIME_RefClockAudio,   /**< Use references sent through OMX_IndexConfigTimeCurrentAudioReference */
151334de520b0369215b7931fefa424fb92d295f0ebJames Dong      OMX_TIME_RefClockVideo,   /**< Use references sent through OMX_IndexConfigTimeCurrentVideoReference */
152a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar      OMX_TIME_RefClockKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
153334de520b0369215b7931fefa424fb92d295f0ebJames Dong      OMX_TIME_RefClockVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
154334de520b0369215b7931fefa424fb92d295f0ebJames Dong      OMX_TIME_RefClockMax = 0x7FFFFFFF
155334de520b0369215b7931fefa424fb92d295f0ebJames Dong} OMX_TIME_REFCLOCKTYPE;
156334de520b0369215b7931fefa424fb92d295f0ebJames Dong
157334de520b0369215b7931fefa424fb92d295f0ebJames Dong/** Enumeration of clock states. */
158334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef enum OMX_TIME_CLOCKSTATE {
159334de520b0369215b7931fefa424fb92d295f0ebJames Dong      OMX_TIME_ClockStateRunning,             /**< Clock running. */
160a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar      OMX_TIME_ClockStateWaitingForStartTime, /**< Clock waiting until the
161334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                               *   prescribed clients emit their
162334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                               *   start time. */
163334de520b0369215b7931fefa424fb92d295f0ebJames Dong      OMX_TIME_ClockStateStopped,             /**< Clock stopped. */
164a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar      OMX_TIME_ClockStateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
165334de520b0369215b7931fefa424fb92d295f0ebJames Dong      OMX_TIME_ClockStateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
166334de520b0369215b7931fefa424fb92d295f0ebJames Dong      OMX_TIME_ClockStateMax = 0x7FFFFFFF
167334de520b0369215b7931fefa424fb92d295f0ebJames Dong} OMX_TIME_CLOCKSTATE;
168334de520b0369215b7931fefa424fb92d295f0ebJames Dong
169334de520b0369215b7931fefa424fb92d295f0ebJames Dong/** Structure representing a media time request to the clock component.
170334de520b0369215b7931fefa424fb92d295f0ebJames Dong *
171334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  A client component sends this structure to the Clock Component via a SetConfig
172334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  on its client port to specify a media timestamp the Clock Component
173334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  should emit.  The Clock Component should fulfill the request by sending a
174a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *  OMX_TIME_MEDIATIMETYPE when its media clock matches the requested
175334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  timestamp.
176334de520b0369215b7931fefa424fb92d295f0ebJames Dong *
177334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  The client may require a media time request be fulfilled slightly
178a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *  earlier than the media time specified. In this case the client specifies
179a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *  an offset which is equal to the difference between wall time corresponding
180a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *  to the requested media time and the wall time when it will be
181a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *  fulfilled.
182334de520b0369215b7931fefa424fb92d295f0ebJames Dong *
183334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  A client component may uses these requests and the OMX_TIME_MEDIATIMETYPE to
184334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  time events according to timestamps. If a client must perform an operation O at
185a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *  a time T (e.g. deliver a video frame at its corresponding timestamp), it makes a
186334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  media time request at T (perhaps specifying an offset to ensure the request fulfillment
187334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  is a little early). When the clock component passes the resulting OMX_TIME_MEDIATIMETYPE
188334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  structure back to the client component, the client may perform operation O (perhaps having
189334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  to wait a slight amount more time itself as specified by the return values).
190334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
191334de520b0369215b7931fefa424fb92d295f0ebJames Dong
192334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef struct OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE {
193334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U32 nSize;              /**< size of the structure in bytes */
194334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_VERSIONTYPE nVersion;   /**< OMX specification version information */
195334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U32 nPortIndex;         /**< port that this structure applies to */
196a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    OMX_PTR pClientPrivate;     /**< Client private data to disabiguate this media time
197a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar                                 *   from others (e.g. the number of the frame to deliver).
198a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar                                 *   Duplicated in the media time structure that fulfills
199a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar                                 *   this request. A value of zero is reserved for time scale
200334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                 *   updates. */
201a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    OMX_TICKS nMediaTimestamp;  /**< Media timestamp requested.*/
202334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_TICKS nOffset;          /**< Amount of wall clock time by which this
203334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                 *   request should be fulfilled early */
204334de520b0369215b7931fefa424fb92d295f0ebJames Dong} OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE;
205334de520b0369215b7931fefa424fb92d295f0ebJames Dong
206a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar/**< Structure sent from the clock component client either when fulfilling
207a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *   a media time request or when the time scale has changed.
208334de520b0369215b7931fefa424fb92d295f0ebJames Dong *
209a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *   In the former case the Clock Component fills this structure and times its emission
210a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *   to a client component (via the client port) according to the corresponding media
211334de520b0369215b7931fefa424fb92d295f0ebJames Dong *   time request sent by the client. The Clock Component should time the emission to occur
212a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *   when the requested timestamp matches the Clock Component's media time but also the
213a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *   prescribed offset early.
214334de520b0369215b7931fefa424fb92d295f0ebJames Dong *
215334de520b0369215b7931fefa424fb92d295f0ebJames Dong *   Upon scale changes the clock component clears the nClientPrivate data, sends the current
216a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *   media time and sets the nScale to the new scale via the client port. It emits a
217a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *   OMX_TIME_MEDIATIMETYPE to all clients independent of any requests. This allows clients to
218a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *   alter processing to accomodate scaling. For instance a video component might skip inter-frames
219a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *   in the case of extreme fastforward. Likewise an audio component might add or remove samples
220a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *   from an audio frame to scale audio data.
221334de520b0369215b7931fefa424fb92d295f0ebJames Dong *
222334de520b0369215b7931fefa424fb92d295f0ebJames Dong *   It is expected that some clock components may not be able to fulfill requests
223a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *   at exactly the prescribed time. This is acceptable so long as the request is
224a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *   fulfilled at least as early as described and not later. This structure provides
225334de520b0369215b7931fefa424fb92d295f0ebJames Dong *   fields the client may use to wait for the remaining time.
226334de520b0369215b7931fefa424fb92d295f0ebJames Dong *
227a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *   The client may use either the nOffset or nWallTimeAtMedia fields to determine the
228334de520b0369215b7931fefa424fb92d295f0ebJames Dong *   wall time until the nMediaTimestamp actually occurs. In the latter case the
229334de520b0369215b7931fefa424fb92d295f0ebJames Dong *   client can get a more accurate value for offset by getting the current wall
230a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *   from the cloc component and subtracting it from nWallTimeAtMedia.
231334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
232334de520b0369215b7931fefa424fb92d295f0ebJames Dong
233334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef struct OMX_TIME_MEDIATIMETYPE {
234334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U32 nSize;                  /**< size of the structure in bytes */
235334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_VERSIONTYPE nVersion;       /**< OMX specification version information */
236a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    OMX_U32 nClientPrivate;         /**< Client private data to disabiguate this media time
237a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar                                     *   from others. Copied from the media time request.
238334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                     *   A value of zero is reserved for time scale updates. */
239334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_TIME_UPDATETYPE eUpdateType; /**< Reason for the update */
240a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    OMX_TICKS nMediaTimestamp;      /**< Media time requested. If no media time was
241a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar                                     *   requested then this is the current media time. */
242334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_TICKS nOffset;              /**< Amount of wall clock time by which this
243334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                     *   request was actually fulfilled early */
244334de520b0369215b7931fefa424fb92d295f0ebJames Dong
245334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_TICKS nWallTimeAtMediaTime; /**< Wall time corresponding to nMediaTimeStamp.
246334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                     *   A client may compare this value to current
247334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                     *   media time obtained from the Clock Component to determine
248334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                     *   the wall time until the media timestamp is really
249334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                     *   current. */
250334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_S32 xScale;                 /**< Current media time scale in Q16 format. */
251334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_TIME_CLOCKSTATE eState;     /* Seeking Change. Added 7/12.*/
252334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                    /**< State of the media time. */
253a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar} OMX_TIME_MEDIATIMETYPE;
254334de520b0369215b7931fefa424fb92d295f0ebJames Dong
255a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar/** Structure representing the current media time scale factor. Applicable only to clock
256334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  component, other components see scale changes via OMX_TIME_MEDIATIMETYPE buffers sent via
257a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *  the clock component client ports. Upon recieving this config the clock component changes
258a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *  the rate by which the media time increases or decreases effectively implementing trick modes.
259a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar */
260334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef struct OMX_TIME_CONFIG_SCALETYPE {
261334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U32 nSize;                  /**< size of the structure in bytes */
262334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_VERSIONTYPE nVersion;       /**< OMX specification version information */
263334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_S32 xScale;                 /**< This is a value in Q16 format which is used for
264334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                     * scaling the media time */
265334de520b0369215b7931fefa424fb92d295f0ebJames Dong} OMX_TIME_CONFIG_SCALETYPE;
266a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar
267a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar/** Bits used to identify a clock port. Used in OMX_TIME_CONFIG_CLOCKSTATETYPE's nWaitMask field */
268334de520b0369215b7931fefa424fb92d295f0ebJames Dong#define OMX_CLOCKPORT0 0x00000001
269334de520b0369215b7931fefa424fb92d295f0ebJames Dong#define OMX_CLOCKPORT1 0x00000002
270334de520b0369215b7931fefa424fb92d295f0ebJames Dong#define OMX_CLOCKPORT2 0x00000004
271334de520b0369215b7931fefa424fb92d295f0ebJames Dong#define OMX_CLOCKPORT3 0x00000008
272334de520b0369215b7931fefa424fb92d295f0ebJames Dong#define OMX_CLOCKPORT4 0x00000010
273334de520b0369215b7931fefa424fb92d295f0ebJames Dong#define OMX_CLOCKPORT5 0x00000020
274334de520b0369215b7931fefa424fb92d295f0ebJames Dong#define OMX_CLOCKPORT6 0x00000040
275334de520b0369215b7931fefa424fb92d295f0ebJames Dong#define OMX_CLOCKPORT7 0x00000080
276334de520b0369215b7931fefa424fb92d295f0ebJames Dong
277a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar/** Structure representing the current mode of the media clock.
278a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *  IL Client uses this config to change or query the mode of the
279334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  media clock of the clock component. Applicable only to clock
280a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *  component.
281a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *
282334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  On a SetConfig if eState is OMX_TIME_ClockStateRunning media time
283334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  starts immediately at the prescribed start time. If
284334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  OMX_TIME_ClockStateWaitingForStartTime the Clock Component ignores
285a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *  the given nStartTime and waits for all clients specified in the
286a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *  nWaitMask to send starttimes (via
287a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *  OMX_IndexConfigTimeClientStartTime). The Clock Component then starts
288a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *  the media clock using the earliest start time supplied. */
289334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef struct OMX_TIME_CONFIG_CLOCKSTATETYPE {
290334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U32 nSize;              /**< size of the structure in bytes */
291a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    OMX_VERSIONTYPE nVersion;   /**< OMX specification version
292334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                 *   information */
293334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_TIME_CLOCKSTATE eState; /**< State of the media time. */
294334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_TICKS nStartTime;       /**< Start time of the media time. */
295a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    OMX_TICKS nOffset;          /**< Time to offset the media time by
296334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                 * (e.g. preroll). Media time will be
297a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar                                 * reported to be nOffset ticks earlier.
298334de520b0369215b7931fefa424fb92d295f0ebJames Dong                                 */
299334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U32 nWaitMask;          /**< Mask of OMX_CLOCKPORT values. */
300334de520b0369215b7931fefa424fb92d295f0ebJames Dong} OMX_TIME_CONFIG_CLOCKSTATETYPE;
301334de520b0369215b7931fefa424fb92d295f0ebJames Dong
302334de520b0369215b7931fefa424fb92d295f0ebJames Dong/** Structure representing the reference clock currently being used to
303a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar *  compute media time. IL client uses this config to change or query the
304334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  clock component's active reference clock */
305334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef struct OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE {
306334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U32 nSize;                  /**< size of the structure in bytes */
307334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_VERSIONTYPE nVersion;       /**< OMX specification version information */
308a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar    OMX_TIME_REFCLOCKTYPE eClock;   /**< Reference clock used to compute media time */
309334de520b0369215b7931fefa424fb92d295f0ebJames Dong} OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE;
310334de520b0369215b7931fefa424fb92d295f0ebJames Dong
311334de520b0369215b7931fefa424fb92d295f0ebJames Dong/** Descriptor for setting specifics of power type.
312334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  Note: this structure is listed for backwards compatibility. */
313334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef struct OMX_OTHER_CONFIG_POWERTYPE {
314334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U32 nSize;            /**< size of the structure in bytes */
315334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
316334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_BOOL bEnablePM;       /**< Flag to enable Power Management */
317334de520b0369215b7931fefa424fb92d295f0ebJames Dong} OMX_OTHER_CONFIG_POWERTYPE;
318334de520b0369215b7931fefa424fb92d295f0ebJames Dong
319334de520b0369215b7931fefa424fb92d295f0ebJames Dong
320334de520b0369215b7931fefa424fb92d295f0ebJames Dong/** Descriptor for setting specifics of stats type.
321334de520b0369215b7931fefa424fb92d295f0ebJames Dong *  Note: this structure is listed for backwards compatibility. */
322334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef struct OMX_OTHER_CONFIG_STATSTYPE {
323334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U32 nSize;            /**< size of the structure in bytes */
324334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
325334de520b0369215b7931fefa424fb92d295f0ebJames Dong    /* what goes here */
326334de520b0369215b7931fefa424fb92d295f0ebJames Dong} OMX_OTHER_CONFIG_STATSTYPE;
327334de520b0369215b7931fefa424fb92d295f0ebJames Dong
328334de520b0369215b7931fefa424fb92d295f0ebJames Dong
329334de520b0369215b7931fefa424fb92d295f0ebJames Dong/**
330a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * The PortDefinition structure is used to define all of the parameters
331a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar * necessary for the compliant component to setup an input or an output other
332334de520b0369215b7931fefa424fb92d295f0ebJames Dong * path.
333334de520b0369215b7931fefa424fb92d295f0ebJames Dong */
334334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef struct OMX_OTHER_PORTDEFINITIONTYPE {
335334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_OTHER_FORMATTYPE eFormat;  /**< Type of data expected for this channel */
336334de520b0369215b7931fefa424fb92d295f0ebJames Dong} OMX_OTHER_PORTDEFINITIONTYPE;
337334de520b0369215b7931fefa424fb92d295f0ebJames Dong
338334de520b0369215b7931fefa424fb92d295f0ebJames Dong/**  Port format parameter.  This structure is used to enumerate
339334de520b0369215b7931fefa424fb92d295f0ebJames Dong  *  the various data input/output format supported by the port.
340334de520b0369215b7931fefa424fb92d295f0ebJames Dong  */
341334de520b0369215b7931fefa424fb92d295f0ebJames Dongtypedef struct OMX_OTHER_PARAM_PORTFORMATTYPE {
342334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U32 nSize; /**< size of the structure in bytes */
343334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
344334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U32 nPortIndex; /**< Indicates which port to set */
345334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_U32 nIndex; /**< Indicates the enumeration index for the format from 0x0 to N-1 */
346334de520b0369215b7931fefa424fb92d295f0ebJames Dong    OMX_OTHER_FORMATTYPE eFormat; /**< Type of data expected for this channel */
347a1ae5a4fe52192525f510dc14ecf1f7d4fb107f5Lajos Molnar} OMX_OTHER_PARAM_PORTFORMATTYPE;
348334de520b0369215b7931fefa424fb92d295f0ebJames Dong
349334de520b0369215b7931fefa424fb92d295f0ebJames Dong#ifdef __cplusplus
350334de520b0369215b7931fefa424fb92d295f0ebJames Dong}
351334de520b0369215b7931fefa424fb92d295f0ebJames Dong#endif /* __cplusplus */
352334de520b0369215b7931fefa424fb92d295f0ebJames Dong
353334de520b0369215b7931fefa424fb92d295f0ebJames Dong#endif
354334de520b0369215b7931fefa424fb92d295f0ebJames Dong/* File EOF */
355