webOS Userland
Native system APIs for webOS
media-types.h
1 /*
2  * Copyright (c) 2008-2018 LG Electronics, Inc.
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 
11 
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17 
18  * SPDX-License-Identifier: Apache-2.0
19  */
20 
21 #ifndef NDL_DIRECTMEDIA2_MEDIA_TYPES_H_
22 #define NDL_DIRECTMEDIA2_MEDIA_TYPES_H_
23 
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #else
28 #include <stdbool.h>
29 #endif
30 
34  typedef enum {
35  NDL_ESP_AUDIO_ES,
36  NDL_ESP_VIDEO_ES,
37  } NDL_ESP_STREAM_T;
38 
42  typedef enum {
43  NDL_ESP_VIDEO_NONE,
44  NDL_ESP_VIDEO_CODEC_H262,
45  NDL_ESP_VIDEO_CODEC_H264,
46  NDL_ESP_VIDEO_CODEC_H265,
47  NDL_ESP_VIDEO_CODEC_MPEG,
48  NDL_ESP_VIDEO_CODEC_MVC,
49  NDL_ESP_VIDEO_CODEC_SVC,
50  NDL_ESP_VIDEO_CODEC_VP8,
51  NDL_ESP_VIDEO_CODEC_VP9,
52  NDL_ESP_VIDEO_CODEC_RM,
53  NDL_ESP_VIDEO_CODEC_AVS,
54  NDL_ESP_VIDEO_CODEC_MJPEG
55  } NDL_ESP_VIDEO_CODEC;
56 
60  typedef enum {
61  NDL_ESP_AUDIO_NONE,
62  NDL_ESP_AUDIO_CODEC_MP2,
63  NDL_ESP_AUDIO_CODEC_MP3,
64  NDL_ESP_AUDIO_CODEC_AC3,
65  NDL_ESP_AUDIO_CODEC_EAC3,
66  NDL_ESP_AUDIO_CODEC_AAC,
67  NDL_ESP_AUDIO_CODEC_HEAAC,
68  NDL_ESP_AUDIO_CODEC_PCM_44100_2CH, // 16bit only
69  NDL_ESP_AUDIO_CODEC_PCM_48000_2CH, // 16bit only
70  } NDL_ESP_AUDIO_CODEC;
71 
75  typedef enum {
76  SCANTYPE_PROGRESSIVE,
77  SCANTYPE_INTERLACED
78  } NDL_ESP_SCAN_TYPE;
79 
83  typedef enum {
84  EASE_TYPE_LINEAR,
85  EASE_TYPE_INCUNBIC,
86  EASE_TYPE_OUTCUBIC
87  } NDL_ESP_EASE_TYPE;
88 
92  typedef enum {
93  E3DTYPE_NONE,
94  E3DTYPE_CHECKERBOARD,
95  E3DTYPE_COLUMN_ALTERNATION,
96  E3DTYPE_ROW_ALTERNATION,
97  E3DTYPE_SIDE_BY_SIDE,
98  E3DTYPE_TOP_BOTTOM,
99  E3DTYPE_FRAME_ALTERNATION,
100  } NDL_ESP_3D_TYPE;
101 
105  typedef enum {
106  HDR_TYPE_NONE = 0,
107  HDR_TYPE_HDR10,
108  HDR_TYPE_DOLBY,
109  HDR_TYPE_VP9,
110  HDR_TYPE_HLG,
111  HDR_TYPE_TOTAL,
112  } HDR_TYPE;
113 
114  typedef enum {
115  VALID_HDR_PQ = 16,
116  VALID_HDR_HLG = 18,
117  } TRANSFER_CHARACTERISTICS;
118 
119  typedef struct {
120  uint32_t size; /* size of the structure in bytes */
121  uint32_t width; /* Video Width */
122  uint32_t height; /* Video Height */
123  uint32_t framerateNum; /* framerate numerator */
124  uint32_t framerateDen; /* framerate denominator */
125  uint32_t PARwidth; /* Width of PAR( Pixel Aspect Ratio) */
126  uint32_t PARheight; /* Height of PAR( Pixel Aspect Ratio) */
127  NDL_ESP_SCAN_TYPE SCANTYPE; /* 0 is progressive, 1 is interaced */
128  NDL_ESP_3D_TYPE E3DTYPE; /* 3D Type */
129 
130  bool hasHdrInfo; /* true : HDR, false : No HDR */
131  HDR_TYPE hdrType; /* HDR Type*/
132 
133  /* SEI */
134  uint16_t displayPrimariesX[3];/* 0~50000 Only for HEVC V2,
135  HDR static metadata mastering display information*/
136  uint16_t displayPrimariesY[3];/* 0~50000 Only for HEVC V2*/
137  uint16_t whitePointX; /* 0~50000 Only for HEVC V2*/
138  uint16_t whitePointY; /* 0~50000 Only for HEVC V2*/
139  uint32_t minDisplayMasteringLuminance;/* Only for HEVC V2 */
140  uint32_t maxDisplayMasteringLuminance;/* Only for HEVC V2 */
141  uint32_t maxContentLightLevel;
142  uint32_t maxPicAverageLightLevel;
143 
144  /* VUI */
145  uint8_t transferCharacteristics; /* 10,12,14,16 Only for HEVC V2 (HDR EOTF)*/
146  uint8_t colorPrimaries; /* 0~255 Only for HEVC V2*/
147  uint8_t matrixCoeffs; /* the matrix coefficients used in deriving
148  luma and chroma signals*/
149  bool videoFullRangeFlag;
151 
152 #ifdef __cplusplus
153 }
154 #endif
155 
156 #endif // NDL_DIRECTMEDIA2_MEDIA_TYPES_H_
Definition: media-types.h:119