Allow esds in 'enca' Audio Description for encrypted audio
[L-SMASH.git] / core / summary.c
blob8cf2121e96efed85fda52bd9924bee434fb7dea2
1 /*****************************************************************************
2 * summary.c:
3 *****************************************************************************
4 * Copyright (C) 2010-2015 L-SMASH project
6 * Authors: Takashi Hirata <silverfilain@gmail.com>
8 * Permission to use, copy, modify, and/or distribute this software for any
9 * purpose with or without fee is hereby granted, provided that the above
10 * copyright notice and this permission notice appear in all copies.
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 *****************************************************************************/
21 /* This file is available under an ISC license. */
23 #include "common/internal.h" /* must be placed first */
25 #include <stdlib.h>
26 #include <string.h>
28 #include "box.h"
30 #include "codecs/mp4a.h"
31 #include "codecs/mp4sys.h"
32 #include "codecs/description.h"
34 /***************************************************************************
35 summary and AudioSpecificConfig relative tools
36 ***************************************************************************/
38 /* create AudioSpecificConfig as memory block from summary, and set it into that summary itself */
39 int lsmash_setup_AudioSpecificConfig( lsmash_audio_summary_t *summary )
41 if( !summary || !summary->opaque )
42 return LSMASH_ERR_FUNCTION_PARAM;
43 /* Remove an old one. */
44 for( lsmash_entry_t *entry = summary->opaque->list.head; entry; entry = entry->next )
46 lsmash_codec_specific_t *cs = (lsmash_codec_specific_t *)entry->data;
47 if( !cs || cs->type != LSMASH_CODEC_SPECIFIC_DATA_TYPE_MP4SYS_DECODER_CONFIG )
48 continue;
49 lsmash_remove_entry_direct( &summary->opaque->list, entry, lsmash_destroy_codec_specific_data );
51 /* Create and add a new one. */
52 uint32_t data_length;
53 uint8_t *data = mp4a_export_AudioSpecificConfig( summary->aot,
54 summary->frequency,
55 summary->channels,
56 summary->sbr_mode,
57 NULL, /* FIXME */
58 0, /* FIXME */
59 &data_length );
60 if( !data )
61 return LSMASH_ERR_NAMELESS;
62 lsmash_codec_specific_t *cs = lsmash_create_codec_specific_data( LSMASH_CODEC_SPECIFIC_DATA_TYPE_MP4SYS_DECODER_CONFIG,
63 LSMASH_CODEC_SPECIFIC_FORMAT_STRUCTURED );
64 if( !cs )
66 lsmash_free( data );
67 return LSMASH_ERR_MEMORY_ALLOC;
69 lsmash_mp4sys_decoder_parameters_t *param = (lsmash_mp4sys_decoder_parameters_t *)cs->data.structured;
70 param->objectTypeIndication = MP4SYS_OBJECT_TYPE_Audio_ISO_14496_3;
71 param->streamType = MP4SYS_STREAM_TYPE_AudioStream;
72 int err = lsmash_set_mp4sys_decoder_specific_info( param, data, data_length );
73 lsmash_free( data );
74 if( err < 0 || (err = lsmash_add_entry( &summary->opaque->list, cs )) < 0 )
76 lsmash_destroy_codec_specific_data( cs );
77 return err;
79 return 0;
82 lsmash_summary_t *lsmash_create_summary( lsmash_summary_type summary_type )
84 size_t summary_size;
85 switch( summary_type )
87 case LSMASH_SUMMARY_TYPE_VIDEO :
88 summary_size = sizeof(lsmash_video_summary_t);
89 break;
90 case LSMASH_SUMMARY_TYPE_AUDIO :
91 summary_size = sizeof(lsmash_audio_summary_t);
92 break;
93 default :
94 summary_size = sizeof(lsmash_summary_t);
95 return NULL;
97 lsmash_summary_t *summary = (lsmash_summary_t *)lsmash_malloc_zero( summary_size );
98 if( !summary )
99 return NULL;
100 summary->opaque = (lsmash_codec_specific_list_t *)lsmash_malloc_zero( sizeof(lsmash_codec_specific_list_t) );
101 if( !summary->opaque )
103 lsmash_free( summary );
104 return NULL;
106 summary->summary_type = summary_type;
107 summary->data_ref_index = 1;
108 return summary;
111 void lsmash_cleanup_summary( lsmash_summary_t *summary )
113 if( !summary )
114 return;
115 if( summary->opaque )
117 for( lsmash_entry_t *entry = summary->opaque->list.head; entry; )
119 lsmash_entry_t *next = entry->next;
120 lsmash_destroy_codec_specific_data( (lsmash_codec_specific_t *)entry->data );
121 lsmash_free( entry );
122 entry = next;
124 lsmash_free( summary->opaque );
126 lsmash_free( summary );
129 int lsmash_add_codec_specific_data( lsmash_summary_t *summary, lsmash_codec_specific_t *specific )
131 if( !summary || !summary->opaque || !specific )
132 return LSMASH_ERR_FUNCTION_PARAM;
133 lsmash_codec_specific_t *dup = isom_duplicate_codec_specific_data( specific );
134 if( !dup )
135 return LSMASH_ERR_NAMELESS;
136 if( lsmash_add_entry( &summary->opaque->list, dup ) < 0 )
138 lsmash_destroy_codec_specific_data( dup );
139 return LSMASH_ERR_MEMORY_ALLOC;
141 return 0;
144 uint32_t lsmash_count_summary( lsmash_root_t *root, uint32_t track_ID )
146 if( isom_check_initializer_present( root ) < 0 || track_ID == 0 )
147 return 0;
148 isom_trak_t *trak = isom_get_trak( root->file->initializer, track_ID );
149 if( !trak
150 || !trak->mdia
151 || !trak->mdia->mdhd
152 || !trak->mdia->hdlr
153 || !trak->mdia->minf
154 || !trak->mdia->minf->stbl
155 || !trak->mdia->minf->stbl->stsd )
156 return 0;
157 return trak->mdia->minf->stbl->stsd->list.entry_count;
160 lsmash_summary_t *lsmash_get_summary( lsmash_root_t *root, uint32_t track_ID, uint32_t description_number )
162 if( isom_check_initializer_present( root ) < 0 || track_ID == 0 || description_number == 0 )
163 return NULL;
164 isom_trak_t *trak = isom_get_trak( root->file->initializer, track_ID );
165 if( !trak
166 || !trak->mdia
167 || !trak->mdia->mdhd
168 || !trak->mdia->hdlr
169 || !trak->mdia->minf
170 || !trak->mdia->minf->stbl
171 || !trak->mdia->minf->stbl->stsd )
172 return NULL;
173 isom_minf_t *minf = trak->mdia->minf;
174 isom_stsd_t *stsd = minf->stbl->stsd;
175 uint32_t i = 1;
176 for( lsmash_entry_t *entry = stsd->list.head; entry; entry = entry->next )
178 if( i != description_number )
180 ++i;
181 continue;
183 isom_sample_entry_t *sample_entry = entry->data;
184 if( !sample_entry )
185 return NULL;
186 if( minf->vmhd )
187 return isom_create_video_summary_from_description( sample_entry );
188 else if( minf->smhd )
189 return isom_create_audio_summary_from_description( sample_entry );
190 else
191 return NULL;
193 return NULL;
196 int lsmash_compare_summary( lsmash_summary_t *a, lsmash_summary_t *b )
198 if( !a || !b )
199 return LSMASH_ERR_FUNCTION_PARAM;
200 if( a->summary_type != b->summary_type
201 || !lsmash_check_box_type_identical( a->sample_type, b->sample_type ) )
202 return 1;
203 if( a->summary_type == LSMASH_SUMMARY_TYPE_VIDEO )
205 lsmash_video_summary_t *in_video = (lsmash_video_summary_t *)a;
206 lsmash_video_summary_t *out_video = (lsmash_video_summary_t *)b;
207 if( in_video->width != out_video->width
208 || in_video->height != out_video->height
209 || in_video->depth != out_video->depth
210 || in_video->par_h != out_video->par_h
211 || in_video->par_v != out_video->par_v
212 || memcmp( in_video->compressorname, out_video->compressorname, strlen( in_video->compressorname ) )
213 || in_video->clap.width.n != out_video->clap.width.n
214 || in_video->clap.width.d != out_video->clap.width.d
215 || in_video->clap.height.n != out_video->clap.height.n
216 || in_video->clap.height.d != out_video->clap.height.d
217 || in_video->clap.horizontal_offset.n != out_video->clap.horizontal_offset.n
218 || in_video->clap.horizontal_offset.d != out_video->clap.horizontal_offset.d
219 || in_video->clap.vertical_offset.n != out_video->clap.vertical_offset.n
220 || in_video->clap.vertical_offset.d != out_video->clap.vertical_offset.d
221 || in_video->color.primaries_index != out_video->color.primaries_index
222 || in_video->color.transfer_index != out_video->color.transfer_index
223 || in_video->color.matrix_index != out_video->color.matrix_index
224 || in_video->color.full_range != out_video->color.full_range )
225 return 1;
227 else if( a->summary_type == LSMASH_SUMMARY_TYPE_AUDIO )
229 lsmash_audio_summary_t *in_audio = (lsmash_audio_summary_t *)a;
230 lsmash_audio_summary_t *out_audio = (lsmash_audio_summary_t *)b;
231 if( in_audio->frequency != out_audio->frequency
232 || in_audio->channels != out_audio->channels
233 || in_audio->sample_size != out_audio->sample_size
234 || in_audio->samples_in_frame != out_audio->samples_in_frame )
235 return 1;
237 return isom_compare_opaque_extensions( a, b );
240 lsmash_codec_support_flag lsmash_check_codec_support( lsmash_codec_type_t sample_type )
242 static struct codec_support_table_tag
244 lsmash_codec_type_t type;
245 lsmash_codec_support_flag flags;
246 } codec_support_table[160] = { { LSMASH_CODEC_TYPE_INITIALIZER, LSMASH_CODEC_SUPPORT_FLAG_NONE } };
247 if( lsmash_check_codec_type_identical( codec_support_table[0].type, LSMASH_CODEC_TYPE_UNSPECIFIED ) )
249 /* Initialize the table. */
250 int i = 0;
251 #define ADD_CODEC_SUPPORT_TABLE_ELEMENT( type, flags ) \
252 codec_support_table[i++] = (struct codec_support_table_tag){ type, flags }
253 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_AC_3_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
254 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_ALAC_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
255 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_DTSC_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
256 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_DTSH_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
257 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_DTSL_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
258 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_DTSE_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
259 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_EC_3_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
260 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_MP4A_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
261 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_SAMR_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
262 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_SAWB_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
263 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_23NI_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
264 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_MAC3_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
265 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_MAC6_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
266 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_NONE_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
267 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_QCLP_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_DEMUX );
268 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_AGSM_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
269 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_ALAC_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
270 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_ALAW_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
271 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_FL32_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
272 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_FL64_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
273 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_IN24_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
274 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_IN32_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
275 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_LPCM_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
276 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_MP4A_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
277 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_RAW_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
278 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_SOWT_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
279 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_TWOS_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
280 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_ULAW_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
281 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_FULLMP3_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
282 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_ADPCM2_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
283 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_ADPCM17_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
284 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_GSM49_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
285 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_NOT_SPECIFIED, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
286 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_AVC1_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
287 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_AVC3_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
288 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_HVC1_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
289 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_HEV1_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
290 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_MP4V_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_MUX );
291 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_VC_1_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
292 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_2VUY_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
293 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_DV10_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
294 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_DVOO_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
295 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_APCH_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
296 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_APCN_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
297 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_APCS_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
298 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_APCO_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
299 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_AP4H_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
300 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_AP4X_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
301 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_DVC_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
302 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_DVCP_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
303 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_DVPP_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
304 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_DV5N_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
305 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_DV5P_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
306 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_DVH2_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
307 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_DVH3_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
308 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_DVH5_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
309 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_DVH6_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
310 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_DVHP_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
311 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_DVHQ_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
312 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_FLIC_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
313 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_H261_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
314 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_H263_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
315 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_JPEG_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
316 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_MJPA_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
317 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_MJPB_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
318 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_PNG_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
319 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_RAW_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
320 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_RLE_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
321 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_RPZA_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
322 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_TGA_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
323 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_TIFF_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
324 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_ULRA_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
325 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_ULRG_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
326 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_ULY0_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
327 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_ULY2_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
328 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_ULH0_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
329 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_ULH2_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
330 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_UQY2_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
331 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_V210_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
332 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_V216_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
333 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_V308_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
334 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_V408_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
335 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_V410_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
336 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_YUV2_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
337 ADD_CODEC_SUPPORT_TABLE_ELEMENT( LSMASH_CODEC_TYPE_UNSPECIFIED, LSMASH_CODEC_SUPPORT_FLAG_NONE );
339 for( int i = 0; !lsmash_check_codec_type_identical( codec_support_table[i].type, LSMASH_CODEC_TYPE_UNSPECIFIED ); i++ )
340 if( lsmash_check_codec_type_identical( sample_type, codec_support_table[i].type ) )
341 return codec_support_table[i].flags;
342 return LSMASH_CODEC_SUPPORT_FLAG_NONE;