3 #define _REPLACE_TYPE(_old, _new) typedef _new _old __attribute__((__deprecated__("use " #_new " instead")))
4 #define _REPLACE_TYPE_ERROR(_old, _new) typedef _new _old __attribute__((__unavailable__("use " #_new " instead")))
5 #define _REPLACE_VALUE(_old, _new) _old __attribute__((__deprecated__("use " #_new " instead"))) = (_new)
6 #define _REPLACE_STRUCT(_old, _new) struct _old __attribute__((__unavailable__("use struct " #_new " instead")))
7 #define _REPLACE_ENUM(_old, _new) enum _old __attribute__((__unavailable__("use enum " #_new " instead")))
9 typedef void (*ResourceReleased)(
const char *type);
11 _REPLACE_TYPE(NDLInitCallback, ResourceReleased);
13 typedef enum NDL_DIRECTVIDEO_SRC_TYPE_ {
14 NDL_DIRECTVIDEO_SRC_TYPE_NONE = 0,
15 NDL_DIRECTVIDEO_SRC_TYPE_H264 = 1,
16 } NDL_DIRECTVIDEO_SRC_TYPE;
18 typedef enum NDL_DIRECTAUDIO_SRC_TYPE_ {
19 NDL_DIRECTAUDIO_SRC_TYPE_NONE = 0,
21 NDL_DIRECTAUDIO_SRC_TYPE_PCM = 1,
22 NDL_DIRECTAUDIO_SRC_TYPE_AC3 = 2,
24 NDL_DIRECTAUDIO_SRC_TYPE_AAC = 3,
25 NDL_DIRECTAUDIO_SRC_TYPE_WTF = 4,
26 } NDL_DIRECTAUDIO_SRC_TYPE;
28 _REPLACE_TYPE(NDL_DIRECTAUDIO_SRC_TYPE_T, NDL_DIRECTAUDIO_SRC_TYPE);
30 typedef enum NDL_DIRECTAUDIO_SAMPLING_FREQ_ {
31 NDL_DIRECTAUDIO_SAMPLING_FREQ_NONE = 0,
32 NDL_DIRECTAUDIO_SAMPLING_FREQ_4_KHZ = 1,
33 _REPLACE_VALUE(NDL_DIRECTAUDIO_SAMPLING_FREQ_4KHZ, NDL_DIRECTAUDIO_SAMPLING_FREQ_4_KHZ),
34 NDL_DIRECTAUDIO_SAMPLING_FREQ_8_KHZ = 2,
35 _REPLACE_VALUE(NDL_DIRECTAUDIO_SAMPLING_FREQ_8KHZ, NDL_DIRECTAUDIO_SAMPLING_FREQ_8_KHZ),
36 NDL_DIRECTAUDIO_SAMPLING_FREQ_11_025KHZ = 3,
37 _REPLACE_VALUE(NDL_DIRECTAUDIO_SAMPLING_FREQ_11KHZ, NDL_DIRECTAUDIO_SAMPLING_FREQ_11_025KHZ),
38 NDL_DIRECTAUDIO_SAMPLING_FREQ_12_KHZ = 4,
39 _REPLACE_VALUE(NDL_DIRECTAUDIO_SAMPLING_FREQ_12KHZ, NDL_DIRECTAUDIO_SAMPLING_FREQ_12_KHZ),
40 NDL_DIRECTAUDIO_SAMPLING_FREQ_16_KHZ = 5,
41 _REPLACE_VALUE(NDL_DIRECTAUDIO_SAMPLING_FREQ_16KHZ, NDL_DIRECTAUDIO_SAMPLING_FREQ_16_KHZ),
42 NDL_DIRECTAUDIO_SAMPLING_FREQ_22_05KHZ = 6,
43 _REPLACE_VALUE(NDL_DIRECTAUDIO_SAMPLING_FREQ_22KHZ, NDL_DIRECTAUDIO_SAMPLING_FREQ_22_05KHZ),
44 NDL_DIRECTAUDIO_SAMPLING_FREQ_24_KHZ = 7,
45 _REPLACE_VALUE(NDL_DIRECTAUDIO_SAMPLING_FREQ_24KHZ, NDL_DIRECTAUDIO_SAMPLING_FREQ_24_KHZ),
46 NDL_DIRECTAUDIO_SAMPLING_FREQ_32_KHZ = 8,
47 _REPLACE_VALUE(NDL_DIRECTAUDIO_SAMPLING_FREQ_32KHZ, NDL_DIRECTAUDIO_SAMPLING_FREQ_32_KHZ),
48 NDL_DIRECTAUDIO_SAMPLING_FREQ_44_1KHZ = 9,
49 _REPLACE_VALUE(NDL_DIRECTAUDIO_SAMPLING_FREQ_44KHZ, NDL_DIRECTAUDIO_SAMPLING_FREQ_44_1KHZ),
50 NDL_DIRECTAUDIO_SAMPLING_FREQ_48_KHZ = 10,
51 _REPLACE_VALUE(NDL_DIRECTAUDIO_SAMPLING_FREQ_48KHZ, NDL_DIRECTAUDIO_SAMPLING_FREQ_48_KHZ),
52 NDL_DIRECTAUDIO_SAMPLING_FREQ_64_KHZ = 11,
53 } NDL_DIRECTAUDIO_SAMPLING_FREQ;
55 _REPLACE_TYPE(NDL_DIRECTAUDIO_SAMPLING_FREQ_T, NDL_DIRECTAUDIO_SAMPLING_FREQ);
57 typedef enum NDL_DIRECTAUDIO_CH_ {
58 NDL_DIRECTAUDIO_CH_MAIN = 0,
59 NDL_DIRECTAUDIO_CH_SUB = 1,
60 NDL_DIRECTAUDIO_CH_MAX = 2,
63 _REPLACE_TYPE(NDL_DIRECTAUDIO_CH_T, NDL_DIRECTAUDIO_CH);
65 typedef enum NDL_DIRECTAUDIO_NODELAY_MODE_ {
66 NDL_DIRECTAUDIO_NODELAY_MODE_DISABLED = -1,
67 NDL_DIRECTAUDIO_NODELAY_MODE_DEFAULT = 0,
68 NDL_DIRECTAUDIO_NODELAY_MODE_CUSTOM = 1,
69 } NDL_DIRECTAUDIO_NODELAY_MODE;
71 typedef enum NDL_DIRECTMEDIA_APP_STATE_ {
72 NDL_DIRECTMEDIA_APP_STATE_FOREGROUND = 0,
73 NDL_DIRECTMEDIA_APP_STATE_BACKGROUND = 1,
74 } NDL_DIRECTMEDIA_APP_STATE;
76 _REPLACE_TYPE(NDL_DIRECTMEDIA_APP_STATE_T, NDL_DIRECTMEDIA_APP_STATE);
78 typedef struct NDL_DIRECTAUDIO_DATA_INFO {
79 unsigned int number_of_channel;
80 unsigned int bit_per_sample;
81 NDL_DIRECTAUDIO_NODELAY_MODE no_delay_mode;
82 int no_delay_upper_time;
83 int no_delay_lower_time;
84 NDL_DIRECTAUDIO_CH channel;
85 NDL_DIRECTAUDIO_SRC_TYPE source;
86 NDL_DIRECTAUDIO_SAMPLING_FREQ frequency;
91 typedef struct NDL_DIRECTVIDEO_DATA_INFO {
94 NDL_DIRECTVIDEO_SRC_TYPE source;
99 #if defined(NDL_DIRECTMEDIA_API_VERSION) && (NDL_DIRECTMEDIA_API_VERSION >= 2)
102 typedef void (*NDLMediaLoadCallback)(int,
long long,
const char *);
104 #define NDL_DIRECTMEDIA_AUDIO_PCM_FORMAT_S16LE "S16LE"
105 #define NDL_DIRECTMEDIA_AUDIO_PCM_MODE_MONO "mono"
106 #define NDL_DIRECTMEDIA_AUDIO_PCM_MODE_STEREO "stereo"
107 #define NDL_DIRECTMEDIA_AUDIO_PCM_MODE_6_CHANNEL "6-channel"
108 #define NDL_DIRECTMEDIA_AUDIO_PCM_LAYOUT_INTERLEAVED "interleaved"
109 #define NDL_DIRECTMEDIA_AUDIO_PCM_LAYOUT_NON_INTERLEAVED "non-interleaved"
111 typedef enum NDL_VIDEO_TYPE_ {
112 NDL_VIDEO_TYPE_H264 = 1,
113 NDL_VIDEO_TYPE_H265 = 2,
114 NDL_VIDEO_TYPE_VP9 = 3,
115 NDL_VIDEO_TYPE_AV1 = 4,
116 NDL_VIDEO_TYPE_MAX = 0x7FFFFFFF,
119 _REPLACE_ENUM(NDL_VIDEO_TYPE, NDL_VIDEO_TYPE_);
121 typedef enum NDL_AUDIO_TYPE_ {
122 NDL_AUDIO_TYPE_PCM = 1,
123 NDL_AUDIO_TYPE_MP3 = 2,
124 NDL_AUDIO_TYPE_OPUS = 3,
125 NDL_AUDIO_TYPE_MAX = 0x7FFFFFFF,
128 _REPLACE_ENUM(NDL_AUDIO_TYPE, NDL_AUDIO_TYPE_);
130 typedef enum NDL_DIRECTMEDIA_AUDIO_PCM_SAMPLE_RATE_ {
132 NDL_DIRECTMEDIA_AUDIO_PCM_SAMPLE_RATE_NONE = 0,
133 NDL_DIRECTMEDIA_AUDIO_PCM_SAMPLE_RATE_48KHZ = 1,
134 NDL_DIRECTMEDIA_AUDIO_PCM_SAMPLE_RATE_44KHZ = 2,
135 NDL_DIRECTMEDIA_AUDIO_PCM_SAMPLE_RATE_32KHZ = 3,
136 NDL_DIRECTMEDIA_AUDIO_PCM_SAMPLE_RATE_24KHZ = 4,
137 NDL_DIRECTMEDIA_AUDIO_PCM_SAMPLE_RATE_22KHZ = 5,
138 NDL_DIRECTMEDIA_AUDIO_PCM_SAMPLE_RATE_16KHZ = 6,
139 NDL_DIRECTMEDIA_AUDIO_PCM_SAMPLE_RATE_12KHZ = 7,
140 NDL_DIRECTMEDIA_AUDIO_PCM_SAMPLE_RATE_8KHZ = 8,
141 } NDL_DIRECTMEDIA_AUDIO_PCM_SAMPLE_RATE;
143 _REPLACE_ENUM(NDL_DIRECTMEDIA_AUDIO_PCM_SAMPLE_RATE, NDL_DIRECTMEDIA_AUDIO_PCM_SAMPLE_RATE_);
145 static inline __attribute__((__const__)) NDL_DIRECTMEDIA_AUDIO_PCM_SAMPLE_RATE NDL_DIRECTMEDIA_AUDIO_PCM_SAMPLE_RATE_OF(
int hertz) {
148 return NDL_DIRECTMEDIA_AUDIO_PCM_SAMPLE_RATE_48KHZ;
150 return NDL_DIRECTMEDIA_AUDIO_PCM_SAMPLE_RATE_44KHZ;
152 return NDL_DIRECTMEDIA_AUDIO_PCM_SAMPLE_RATE_32KHZ;
154 return NDL_DIRECTMEDIA_AUDIO_PCM_SAMPLE_RATE_24KHZ;
156 return NDL_DIRECTMEDIA_AUDIO_PCM_SAMPLE_RATE_22KHZ;
158 return NDL_DIRECTMEDIA_AUDIO_PCM_SAMPLE_RATE_16KHZ;
160 return NDL_DIRECTMEDIA_AUDIO_PCM_SAMPLE_RATE_12KHZ;
162 return NDL_DIRECTMEDIA_AUDIO_PCM_SAMPLE_RATE_8KHZ;
164 return NDL_DIRECTMEDIA_AUDIO_PCM_SAMPLE_RATE_NONE;
169 typedef struct NDL_DIRECTAUDIO_PCM_INFO_ {
174 const char *channelMode;
175 NDL_DIRECTMEDIA_AUDIO_PCM_SAMPLE_RATE sampleRate;
176 } NDL_DIRECTAUDIO_PCM_INFO_T;
178 _REPLACE_STRUCT(NDL_DIRECTMEDIA_AUDIO_PCM_INFO_T, NDL_DIRECTAUDIO_PCM_INFO_);
179 _REPLACE_TYPE(NDL_DIRECTMEDIA_AUDIO_PCM_INFO, NDL_DIRECTAUDIO_PCM_INFO_T);
181 typedef struct NDL_DIRECTMEDIA_AUDIO_OPUS_INFO {
187 const char *streamHeader;
188 } NDL_DIRECTMEDIA_AUDIO_OPUS_INFO_T;
190 _REPLACE_STRUCT(NDL_DIRECTMEDIA_AUDIO_OPUS_INFO_T, NDL_DIRECTMEDIA_AUDIO_OPUS_INFO);
191 _REPLACE_TYPE(NDL_DIRECTMEDIA_AUDIO_OPUS_INFO, NDL_DIRECTMEDIA_AUDIO_OPUS_INFO_T);
194 typedef struct NDL_DIRECTMEDIA_DATA_INFO {
195 struct NDL_DIRECTMEDIA_VIDEO_INFO {
203 NDL_DIRECTAUDIO_PCM_INFO_T pcm;
204 NDL_DIRECTMEDIA_AUDIO_OPUS_INFO_T opus;
207 } NDL_DIRECTMEDIA_DATA_INFO_T;
209 _REPLACE_STRUCT(NDL_DIRECTMEDIA_DATA_INFO_T, NDL_DIRECTMEDIA_DATA_INFO);
210 _REPLACE_TYPE(NDL_DIRECTMEDIA_DATA_INFO, NDL_DIRECTMEDIA_DATA_INFO_T);
213 typedef struct NDL_DIRECTVIDEO_HDR_INFO {
214 int displayPrimariesX0;
215 int displayPrimariesY0;
216 int displayPrimariesX1;
217 int displayPrimariesY1;
218 int displayPrimariesX2;
219 int displayPrimariesY2;
222 int maxDisplayMasteringLuminance;
223 int minDisplayMasteringLuminance;
224 int maxContentLightLevel;
225 int maxPicAverageLightLevel;
226 int transferCharacteristics;
229 unsigned char reserved[32];
230 } NDL_DIRECTVIDEO_HDR_INFO_T;
232 _REPLACE_STRUCT(NDL_DIRECTVIDEO_HDR_INFO_T, NDL_DIRECTVIDEO_HDR_INFO);
233 _REPLACE_TYPE(NDL_DIRECTVIDEO_HDR_INFO, NDL_DIRECTVIDEO_HDR_INFO_T);
238 #undef _REPLACE_VALUE
239 #undef _REPLACE_STRUCT
Definition: NDL_directmedia_types.h:78
Definition: NDL_directmedia_types.h:91