blob: 752b004d99b320c50221b25c9c4c9ae0aa3516c6 [file] [log] [blame]
James Dong334de522012-03-12 12:47:14 -07001/*
2 * Copyright (C) 2009 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef HARDWARE_API_H_
18
19#define HARDWARE_API_H_
20
Andreas Huber00e595f2013-06-25 10:08:42 -070021#include <media/hardware/OMXPluginBase.h>
22#include <media/hardware/MetadataBufferType.h>
James Dong334de522012-03-12 12:47:14 -070023#include <system/window.h>
24#include <utils/RefBase.h>
25
26#include <OMX_Component.h>
27
28namespace android {
29
Lajos Molnard5f79352016-02-11 14:20:39 -080030// This structure is used to enable Android native buffer use for either
31// graphic buffers or secure buffers.
32//
33// TO CONTROL ANDROID GRAPHIC BUFFER USAGE:
34//
James Dong334de522012-03-12 12:47:14 -070035// A pointer to this struct is passed to the OMX_SetParameter when the extension
36// index for the 'OMX.google.android.index.enableAndroidNativeBuffers' extension
37// is given.
38//
39// When Android native buffer use is disabled for a port (the default state),
40// the OMX node should operate as normal, and expect UseBuffer calls to set its
41// buffers. This is the mode that will be used when CPU access to the buffer is
42// required.
43//
44// When Android native buffer use has been enabled for a given port, the video
45// color format for the port is to be interpreted as an Android pixel format
Lajos Molnar5f39f602013-07-17 14:55:55 -070046// rather than an OMX color format. Enabling Android native buffers may also
47// change how the component receives the native buffers. If store-metadata-mode
48// is enabled on the port, the component will receive the buffers as specified
49// in the section below. Otherwise, unless the node supports the
50// 'OMX.google.android.index.useAndroidNativeBuffer2' extension, it should
51// expect to receive UseAndroidNativeBuffer calls (via OMX_SetParameter) rather
52// than UseBuffer calls for that port.
Lajos Molnard5f79352016-02-11 14:20:39 -080053//
54// TO CONTROL ANDROID SECURE BUFFER USAGE:
55//
56// A pointer to this struct is passed to the OMX_SetParameter when the extension
57// index for the 'OMX.google.android.index.allocateNativeHandle' extension
58// is given.
59//
60// When native handle use is disabled for a port (the default state),
61// the OMX node should operate as normal, and expect AllocateBuffer calls to
62// return buffer pointers. This is the mode that will be used for non-secure
63// buffers if component requires allocate buffers instead of use buffers.
64//
65// When native handle use has been enabled for a given port, the component
66// shall allocate native_buffer_t objects containing that can be passed between
67// processes using binder. This is the mode that will be used for secure buffers.
68// When an OMX component allocates native handle for buffers, it must close and
69// delete that handle when it frees those buffers. Even though pBuffer will point
70// to a native handle, nFilledLength, nAllocLength and nOffset will correspond
71// to the data inside the opaque buffer.
James Dong334de522012-03-12 12:47:14 -070072struct EnableAndroidNativeBuffersParams {
73 OMX_U32 nSize;
74 OMX_VERSIONTYPE nVersion;
75 OMX_U32 nPortIndex;
76 OMX_BOOL enable;
77};
78
Lajos Molnard5f79352016-02-11 14:20:39 -080079typedef struct EnableAndroidNativeBuffersParams AllocateNativeHandleParams;
80
Lajos Molnar9f590df2015-05-15 20:31:57 -070081// A pointer to this struct is passed to OMX_SetParameter() when the extension index
82// "OMX.google.android.index.storeMetaDataInBuffers" or
83// "OMX.google.android.index.storeANWBufferInMetadata" is given.
James Dong334de522012-03-12 12:47:14 -070084//
85// When meta data is stored in the video buffers passed between OMX clients
86// and OMX components, interpretation of the buffer data is up to the
87// buffer receiver, and the data may or may not be the actual video data, but
88// some information helpful for the receiver to locate the actual data.
89// The buffer receiver thus needs to know how to interpret what is stored
90// in these buffers, with mechanisms pre-determined externally. How to
Lajos Molnar9f590df2015-05-15 20:31:57 -070091// interpret the meta data is outside of the scope of this parameter.
James Dong334de522012-03-12 12:47:14 -070092//
Lajos Molnar9f590df2015-05-15 20:31:57 -070093// Currently, this is used to pass meta data from video source (camera component, for instance) to
94// video encoder to avoid memcpying of input video frame data, as well as to pass dynamic output
95// buffer to video decoder. To do this, bStoreMetaData is set to OMX_TRUE.
Lajos Molnar5f39f602013-07-17 14:55:55 -070096//
Lajos Molnar9f590df2015-05-15 20:31:57 -070097// If bStoreMetaData is set to false, real YUV frame data will be stored in input buffers, and
98// the output buffers contain either real YUV frame data, or are themselves native handles as
99// directed by enable/use-android-native-buffer parameter settings.
100// In addition, if no OMX_SetParameter() call is made on a port with the corresponding extension
101// index, the component should not assume that the client is not using metadata mode for the port.
Lajos Molnar5f39f602013-07-17 14:55:55 -0700102//
Lajos Molnar9f590df2015-05-15 20:31:57 -0700103// If the component supports this using the "OMX.google.android.index.storeANWBufferInMetadata"
104// extension and bStoreMetaData is set to OMX_TRUE, data is passed using the VideoNativeMetadata
105// layout as defined below. Each buffer will be accompanied by a fence. The fence must signal
106// before the buffer can be used (e.g. read from or written into). When returning such buffer to
107// the client, component must provide a new fence that must signal before the returned buffer can
108// be used (e.g. read from or written into). The component owns the incoming fenceFd, and must close
109// it when fence has signaled. The client will own and close the returned fence file descriptor.
110//
111// If the component supports this using the "OMX.google.android.index.storeMetaDataInBuffers"
112// extension and bStoreMetaData is set to OMX_TRUE, data is passed using VideoGrallocMetadata
113// (the layout of which is the VideoGrallocMetadata defined below). Camera input can be also passed
114// as "CameraSource", the layout of which is vendor dependent.
115//
116// Metadata buffers are registered with the component using UseBuffer calls, or can be allocated
117// by the component for encoder-metadata-output buffers.
James Dong334de522012-03-12 12:47:14 -0700118struct StoreMetaDataInBuffersParams {
119 OMX_U32 nSize;
120 OMX_VERSIONTYPE nVersion;
121 OMX_U32 nPortIndex;
122 OMX_BOOL bStoreMetaData;
123};
124
Lajos Molnar07d93d12013-05-03 13:20:53 -0700125// Meta data buffer layout used to transport output frames to the decoder for
126// dynamic buffer handling.
Lajos Molnar9f590df2015-05-15 20:31:57 -0700127struct VideoGrallocMetadata {
128 MetadataBufferType eType; // must be kMetadataBufferTypeGrallocSource
Lajos Molnarabaaf702015-07-20 15:29:24 -0700129#ifdef OMX_ANDROID_COMPILE_AS_32BIT_ON_64BIT_PLATFORMS
130 OMX_PTR pHandle;
131#else
Lajos Molnard910f3c2015-06-02 19:43:16 -0700132 buffer_handle_t pHandle;
Lajos Molnarabaaf702015-07-20 15:29:24 -0700133#endif
Lajos Molnar9f590df2015-05-15 20:31:57 -0700134};
135
Lajos Molnara8c24542015-06-01 21:13:47 -0700136// Legacy name for VideoGrallocMetadata struct.
Lajos Molnard910f3c2015-06-02 19:43:16 -0700137struct VideoDecoderOutputMetaData : public VideoGrallocMetadata {};
Lajos Molnara8c24542015-06-01 21:13:47 -0700138
Lajos Molnar9f590df2015-05-15 20:31:57 -0700139struct VideoNativeMetadata {
140 MetadataBufferType eType; // must be kMetadataBufferTypeANWBuffer
Lajos Molnarabaaf702015-07-20 15:29:24 -0700141#ifdef OMX_ANDROID_COMPILE_AS_32BIT_ON_64BIT_PLATFORMS
142 OMX_PTR pBuffer;
143#else
Lajos Molnar9f590df2015-05-15 20:31:57 -0700144 struct ANativeWindowBuffer* pBuffer;
Lajos Molnarabaaf702015-07-20 15:29:24 -0700145#endif
Lajos Molnar9f590df2015-05-15 20:31:57 -0700146 int nFenceFd; // -1 if unused
Lajos Molnar07d93d12013-05-03 13:20:53 -0700147};
148
Praveen Chavan99908372016-01-13 01:32:25 -0800149// Meta data buffer layout for passing a native_handle to codec
150struct VideoNativeHandleMetadata {
151 MetadataBufferType eType; // must be kMetadataBufferTypeNativeHandleSource
152
153#ifdef OMX_ANDROID_COMPILE_AS_32BIT_ON_64BIT_PLATFORMS
154 OMX_PTR pHandle;
155#else
156 native_handle_t *pHandle;
157#endif
158};
159
Lajos Molnardde86f72013-05-03 13:22:13 -0700160// A pointer to this struct is passed to OMX_SetParameter() when the extension
161// index "OMX.google.android.index.prepareForAdaptivePlayback" is given.
162//
163// This method is used to signal a video decoder, that the user has requested
164// seamless resolution change support (if bEnable is set to OMX_TRUE).
165// nMaxFrameWidth and nMaxFrameHeight are the dimensions of the largest
166// anticipated frames in the video. If bEnable is OMX_FALSE, no resolution
167// change is expected, and the nMaxFrameWidth/Height fields are unused.
168//
169// If the decoder supports dynamic output buffers, it may ignore this
170// request. Otherwise, it shall request resources in such a way so that it
171// avoids full port-reconfiguration (due to output port-definition change)
172// during resolution changes.
173//
174// DO NOT USE THIS STRUCTURE AS IT WILL BE REMOVED. INSTEAD, IMPLEMENT
175// METADATA SUPPORT FOR VIDEO DECODERS.
176struct PrepareForAdaptivePlaybackParams {
177 OMX_U32 nSize;
178 OMX_VERSIONTYPE nVersion;
179 OMX_U32 nPortIndex;
180 OMX_BOOL bEnable;
181 OMX_U32 nMaxFrameWidth;
182 OMX_U32 nMaxFrameHeight;
183};
184
James Dong334de522012-03-12 12:47:14 -0700185// A pointer to this struct is passed to OMX_SetParameter when the extension
186// index for the 'OMX.google.android.index.useAndroidNativeBuffer' extension is
187// given. This call will only be performed if a prior call was made with the
188// 'OMX.google.android.index.enableAndroidNativeBuffers' extension index,
189// enabling use of Android native buffers.
190struct UseAndroidNativeBufferParams {
191 OMX_U32 nSize;
192 OMX_VERSIONTYPE nVersion;
193 OMX_U32 nPortIndex;
194 OMX_PTR pAppPrivate;
195 OMX_BUFFERHEADERTYPE **bufferHeader;
196 const sp<ANativeWindowBuffer>& nativeBuffer;
197};
198
199// A pointer to this struct is passed to OMX_GetParameter when the extension
200// index for the 'OMX.google.android.index.getAndroidNativeBufferUsage'
201// extension is given. The usage bits returned from this query will be used to
202// allocate the Gralloc buffers that get passed to the useAndroidNativeBuffer
203// command.
204struct GetAndroidNativeBufferUsageParams {
205 OMX_U32 nSize; // IN
206 OMX_VERSIONTYPE nVersion; // IN
207 OMX_U32 nPortIndex; // IN
208 OMX_U32 nUsage; // OUT
209};
210
211// An enum OMX_COLOR_FormatAndroidOpaque to indicate an opaque colorformat
212// is declared in media/stagefright/openmax/OMX_IVCommon.h
213// This will inform the encoder that the actual
214// colorformat will be relayed by the GRalloc Buffers.
215// OMX_COLOR_FormatAndroidOpaque = 0x7F000001,
216
Andreas Huber7682a9c2012-09-28 11:32:16 -0700217// A pointer to this struct is passed to OMX_SetParameter when the extension
218// index for the 'OMX.google.android.index.prependSPSPPSToIDRFrames' extension
219// is given.
220// A successful result indicates that future IDR frames will be prefixed by
221// SPS/PPS.
222struct PrependSPSPPSToIDRFramesParams {
223 OMX_U32 nSize;
224 OMX_VERSIONTYPE nVersion;
225 OMX_BOOL bEnable;
226};
James Dong334de522012-03-12 12:47:14 -0700227
Lajos Molnar524077c2014-07-25 07:53:56 -0700228// Structure describing a media image (frame)
229// Currently only supporting YUV
Lajos Molnar8d513b22016-01-26 18:21:25 -0800230// @deprecated. Use MediaImage2 instead
Lajos Molnar524077c2014-07-25 07:53:56 -0700231struct MediaImage {
232 enum Type {
233 MEDIA_IMAGE_TYPE_UNKNOWN = 0,
234 MEDIA_IMAGE_TYPE_YUV,
235 };
236
237 enum PlaneIndex {
238 Y = 0,
239 U,
240 V,
241 MAX_NUM_PLANES
242 };
243
244 Type mType;
Lajos Molnarabaaf702015-07-20 15:29:24 -0700245 uint32_t mNumPlanes; // number of planes
246 uint32_t mWidth; // width of largest plane (unpadded, as in nFrameWidth)
247 uint32_t mHeight; // height of largest plane (unpadded, as in nFrameHeight)
248 uint32_t mBitDepth; // useable bit depth
Lajos Molnar524077c2014-07-25 07:53:56 -0700249 struct PlaneInfo {
Lajos Molnarabaaf702015-07-20 15:29:24 -0700250 uint32_t mOffset; // offset of first pixel of the plane in bytes
251 // from buffer offset
252 uint32_t mColInc; // column increment in bytes
253 uint32_t mRowInc; // row increment in bytes
254 uint32_t mHorizSubsampling; // subsampling compared to the largest plane
255 uint32_t mVertSubsampling; // subsampling compared to the largest plane
Lajos Molnar524077c2014-07-25 07:53:56 -0700256 };
257 PlaneInfo mPlane[MAX_NUM_PLANES];
258};
259
Lajos Molnar8d513b22016-01-26 18:21:25 -0800260struct MediaImage2 {
261 enum Type {
262 MEDIA_IMAGE_TYPE_UNKNOWN = 0,
263 MEDIA_IMAGE_TYPE_YUV,
264 MEDIA_IMAGE_TYPE_YUVA,
265 MEDIA_IMAGE_TYPE_RGB,
266 MEDIA_IMAGE_TYPE_RGBA,
267 MEDIA_IMAGE_TYPE_Y,
268 };
269
270 enum PlaneIndex {
271 Y = 0,
272 U = 1,
273 V = 2,
274 R = 0,
275 G = 1,
276 B = 2,
277 A = 3,
278 MAX_NUM_PLANES = 4,
279 };
280
281 Type mType;
282 uint32_t mNumPlanes; // number of planes
283 uint32_t mWidth; // width of largest plane (unpadded, as in nFrameWidth)
284 uint32_t mHeight; // height of largest plane (unpadded, as in nFrameHeight)
285 uint32_t mBitDepth; // useable bit depth (always MSB)
286 uint32_t mBitDepthAllocated; // bits per component (must be 8 or 16)
287
288 struct PlaneInfo {
289 uint32_t mOffset; // offset of first pixel of the plane in bytes
290 // from buffer offset
291 int32_t mColInc; // column increment in bytes
292 int32_t mRowInc; // row increment in bytes
293 uint32_t mHorizSubsampling; // subsampling compared to the largest plane
294 uint32_t mVertSubsampling; // subsampling compared to the largest plane
295 };
296 PlaneInfo mPlane[MAX_NUM_PLANES];
297};
298
Lajos Molnar524077c2014-07-25 07:53:56 -0700299// A pointer to this struct is passed to OMX_GetParameter when the extension
300// index for the 'OMX.google.android.index.describeColorFormat'
301// extension is given. This method can be called from any component state
302// other than invalid. The color-format, frame width/height, and stride/
303// slice-height parameters are ones that are associated with a raw video
304// port (input or output), but the stride/slice height parameters may be
Lajos Molnarea5da672015-01-30 10:36:11 -0800305// incorrect. bUsingNativeBuffers is OMX_TRUE if native android buffers will
306// be used (while specifying this color format).
307//
308// The component shall fill out the MediaImage structure that
Lajos Molnar524077c2014-07-25 07:53:56 -0700309// corresponds to the described raw video format, and the potentially corrected
310// stride and slice-height info.
311//
Lajos Molnarea5da672015-01-30 10:36:11 -0800312// The behavior is slightly different if bUsingNativeBuffers is OMX_TRUE,
313// though most implementations can ignore this difference. When using native buffers,
314// the component may change the configured color format to an optimized format.
315// Additionally, when allocating these buffers for flexible usecase, the framework
316// will set the SW_READ/WRITE_OFTEN usage flags. In this case (if bUsingNativeBuffers
317// is OMX_TRUE), the component shall fill out the MediaImage information for the
318// scenario when these SW-readable/writable buffers are locked using gralloc_lock.
319// Note, that these buffers may also be locked using gralloc_lock_ycbcr, which must
320// be supported for vendor-specific formats.
321//
322// For non-YUV packed planar/semiplanar image formats, or if bUsingNativeBuffers
323// is OMX_TRUE and the component does not support this color format with native
324// buffers, the component shall set mNumPlanes to 0, and mType to MEDIA_IMAGE_TYPE_UNKNOWN.
Lajos Molnar8d513b22016-01-26 18:21:25 -0800325
326// @deprecated: use DescribeColorFormat2Params
Lajos Molnar524077c2014-07-25 07:53:56 -0700327struct DescribeColorFormatParams {
328 OMX_U32 nSize;
329 OMX_VERSIONTYPE nVersion;
330 // input: parameters from OMX_VIDEO_PORTDEFINITIONTYPE
331 OMX_COLOR_FORMATTYPE eColorFormat;
332 OMX_U32 nFrameWidth;
333 OMX_U32 nFrameHeight;
334 OMX_U32 nStride;
335 OMX_U32 nSliceHeight;
Lajos Molnarea5da672015-01-30 10:36:11 -0800336 OMX_BOOL bUsingNativeBuffers;
Lajos Molnar524077c2014-07-25 07:53:56 -0700337
338 // output: fill out the MediaImage fields
339 MediaImage sMediaImage;
340};
341
Lajos Molnar8d513b22016-01-26 18:21:25 -0800342// A pointer to this struct is passed to OMX_GetParameter when the extension
343// index for the 'OMX.google.android.index.describeColorFormat2'
344// extension is given. This is operationally the same as DescribeColorFormatParams
345// but can be used for HDR and RGBA/YUVA formats.
346struct DescribeColorFormat2Params {
347 OMX_U32 nSize;
348 OMX_VERSIONTYPE nVersion;
349 // input: parameters from OMX_VIDEO_PORTDEFINITIONTYPE
350 OMX_COLOR_FORMATTYPE eColorFormat;
351 OMX_U32 nFrameWidth;
352 OMX_U32 nFrameHeight;
353 OMX_U32 nStride;
354 OMX_U32 nSliceHeight;
355 OMX_BOOL bUsingNativeBuffers;
356
357 // output: fill out the MediaImage2 fields
358 MediaImage2 sMediaImage;
359};
360
Rachad7cb0d392014-07-29 17:53:53 -0700361// A pointer to this struct is passed to OMX_SetParameter or OMX_GetParameter
362// when the extension index for the
363// 'OMX.google.android.index.configureVideoTunnelMode' extension is given.
364// If the extension is supported then tunneled playback mode should be supported
365// by the codec. If bTunneled is set to OMX_TRUE then the video decoder should
366// operate in "tunneled" mode and output its decoded frames directly to the
367// sink. In this case nAudioHwSync is the HW SYNC ID of the audio HAL Output
368// stream to sync the video with. If bTunneled is set to OMX_FALSE, "tunneled"
369// mode should be disabled and nAudioHwSync should be ignored.
370// OMX_GetParameter is used to query tunneling configuration. bTunneled should
371// return whether decoder is operating in tunneled mode, and if it is,
372// pSidebandWindow should contain the codec allocated sideband window handle.
373struct ConfigureVideoTunnelModeParams {
374 OMX_U32 nSize; // IN
375 OMX_VERSIONTYPE nVersion; // IN
376 OMX_U32 nPortIndex; // IN
377 OMX_BOOL bTunneled; // IN/OUT
378 OMX_U32 nAudioHwSync; // IN
379 OMX_PTR pSidebandWindow; // OUT
380};
381
Lajos Molnar51de0ba2016-01-15 16:12:33 -0800382// Color description parameters. This is passed via OMX_SetConfig or OMX_GetConfig
383// to video encoders and decoders when the
384// 'OMX.google.android.index.describeColorAspects' extension is given.
385//
386// Video encoders: the framework uses OMX_SetConfig to specify color aspects
387// of the coded video before the component transitions to idle state.
388//
389// Video decoders: the framework uses OMX_SetConfig to specify color aspects
390// of the coded video parsed from the container before the component transitions
391// to idle state. If the bitstream contains color information, the component should
392// update the appropriate color aspects - unless the bitstream contains the
393// "unspecified" value. For "reserved" values, the component should set the aspect
394// to "Other".
395//
396// The framework subsequently uses OMX_GetConfig to get any updates of the
397// color aspects from the decoder. If the color aspects change at any time
398// during the processing of the stream, the component shall signal a
399// OMX_EventPortSettingsChanged event with data2 set to the extension index
400// (or OMX_IndexConfigCommonOutputCrop, as it is handled identically). Component
401// shall not signal a separate event purely for color aspect change, if it occurs
402// together with a port definition (e.g. size) or crop change.
403//
404// NOTE: this structure is expected to grow in the future if new color aspects are
405// added to codec bitstreams. OMX component should not require a specific nSize
406// though could verify that nSize is at least the size of the structure at the
407// time of implementation. All new fields will be added at the end of the structure
408// ensuring backward compatibility.
409
410struct DescribeColorAspectsParams {
411 OMX_U32 nSize; // IN
412 OMX_VERSIONTYPE nVersion; // IN
413 OMX_U32 nPortIndex; // IN
414 OMX_U32 nRange; // IN/OUT (one of the ColorAspects.Range enums)
415 OMX_U32 nPrimaries; // IN/OUT (one of the ColorAspects.Primaries enums)
416 OMX_U32 nTransfer; // IN/OUT (one of the ColorAspects.Transfer enums)
417 OMX_U32 nMatrixCoeffs; // IN/OUT (one of the ColorAspects.MatrixCoeffs enums)
418};
419
420struct ColorAspects {
421 // this is in sync with the range values in graphics.h
422 enum Range : uint32_t {
423 RangeUnspecified,
424 RangeFull,
425 RangeLimited,
426 RangeOther = 0xff,
427 };
428
429 enum Primaries : uint32_t {
430 PrimariesUnspecified,
431 PrimariesBT709_5, // Rec.ITU-R BT.709-5 or equivalent
432 PrimariesBT470_6M, // Rec.ITU-R BT.470-6 System M or equivalent
433 PrimariesBT601_6_625, // Rec.ITU-R BT.601-6 625 or equivalent
434 PrimariesBT601_6_525, // Rec.ITU-R BT.601-6 525 or equivalent
435 PrimariesGenericFilm, // Generic Film
436 PrimariesBT2020, // Rec.ITU-R BT.2020 or equivalent
437 PrimariesOther = 0xff,
438 };
439
440 // this partially in sync with the transfer values in graphics.h prior to the transfers
441 // unlikely to be required by Android section
442 enum Transfer : uint32_t {
443 TransferUnspecified,
444 TransferLinear, // Linear transfer characteristics
445 TransferSRGB, // sRGB or equivalent
446 TransferSMPTE170M, // SMPTE 170M or equivalent (e.g. BT.601/709/2020)
447 TransferGamma22, // Assumed display gamma 2.2
448 TransferGamma28, // Assumed display gamma 2.8
449 TransferST2084, // SMPTE ST 2084 for 10/12/14/16 bit systems
450 TransferHLG, // ARIB STD-B67 hybrid-log-gamma
451
452 // transfers unlikely to be required by Android
453 TransferSMPTE240M = 0x40, // SMPTE 240M
454 TransferXvYCC, // IEC 61966-2-4
455 TransferBT1361, // Rec.ITU-R BT.1361 extended gamut
456 TransferST428, // SMPTE ST 428-1
457 TransferOther = 0xff,
458 };
459
460 enum MatrixCoeffs : uint32_t {
461 MatrixUnspecified,
462 MatrixBT709_5, // Rec.ITU-R BT.709-5 or equivalent
463 MatrixBT470_6M, // KR=0.30, KB=0.11 or equivalent
464 MatrixBT601_6, // Rec.ITU-R BT.601-6 625 or equivalent
465 MatrixSMPTE240M, // SMPTE 240M or equivalent
466 MatrixBT2020, // Rec.ITU-R BT.2020 non-constant luminance
467 MatrixBT2020Constant, // Rec.ITU-R BT.2020 constant luminance
468 MatrixOther = 0xff,
469 };
470
471 // this is in sync with the standard values in graphics.h
472 enum Standard : uint32_t {
473 StandardUnspecified,
474 StandardBT709, // PrimariesBT709_5 and MatrixBT709_5
475 StandardBT601_625, // PrimariesBT601_6_625 and MatrixBT601_6
476 StandardBT601_625_Unadjusted, // PrimariesBT601_6_625 and KR=0.222, KB=0.071
477 StandardBT601_525, // PrimariesBT601_6_525 and MatrixBT601_6
478 StandardBT601_525_Unadjusted, // PrimariesBT601_6_525 and MatrixSMPTE240M
479 StandardBT2020, // PrimariesBT2020 and MatrixBT2020
480 StandardBT2020Constant, // PrimariesBT2020 and MatrixBT2020Constant
481 StandardBT470M, // PrimariesBT470_6M and MatrixBT470_6M
482 StandardFilm, // PrimariesGenericFilm and KR=0.253, KB=0.068
483 StandardOther = 0xff,
484 };
485};
486
James Dong334de522012-03-12 12:47:14 -0700487} // namespace android
488
489extern android::OMXPluginBase *createOMXPlugin();
490
491#endif // HARDWARE_API_H_