box: Remove redundant 'if's for freeing.
[L-SMASH.git] / core / summary.c
blob23e443ffdd8dcea802c3ae9309d2ba5a88d7af89
1 /*****************************************************************************
2 * summary.c:
3 *****************************************************************************
4 * Copyright (C) 2010-2014 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 )
42 return -1;
43 lsmash_bs_t* bs = lsmash_bs_create();
44 if( !bs )
45 return -1;
46 mp4a_AudioSpecificConfig_t *asc =
47 mp4a_create_AudioSpecificConfig( summary->aot,
48 summary->frequency,
49 summary->channels,
50 summary->sbr_mode,
51 NULL,/*FIXME*/
52 0 /*FIXME*/);
53 if( !asc )
55 lsmash_bs_cleanup( bs );
56 return -1;
58 mp4a_put_AudioSpecificConfig( bs, asc );
59 void *new_asc;
60 uint32_t new_length;
61 new_asc = lsmash_bs_export_data( bs, &new_length );
62 mp4a_remove_AudioSpecificConfig( asc );
63 lsmash_bs_cleanup( bs );
64 if( !new_asc )
65 return -1;
66 lsmash_codec_specific_t *specific = lsmash_malloc_zero( sizeof(lsmash_codec_specific_t) );
67 if( !specific )
69 lsmash_free( new_asc );
70 return -1;
72 specific->type = LSMASH_CODEC_SPECIFIC_DATA_TYPE_UNKNOWN;
73 specific->format = LSMASH_CODEC_SPECIFIC_FORMAT_UNSTRUCTURED;
74 specific->destruct = (lsmash_codec_specific_destructor_t)lsmash_free;
75 specific->size = new_length;
76 specific->data.unstructured = lsmash_memdup( new_asc, new_length );
77 if( !specific->data.unstructured
78 || lsmash_add_entry( &summary->opaque->list, specific ) < 0 )
80 lsmash_free( new_asc );
81 lsmash_destroy_codec_specific_data( specific );
82 return -1;
84 return 0;
87 lsmash_summary_t *lsmash_create_summary( lsmash_summary_type summary_type )
89 size_t summary_size;
90 switch( summary_type )
92 case LSMASH_SUMMARY_TYPE_VIDEO :
93 summary_size = sizeof(lsmash_video_summary_t);
94 break;
95 case LSMASH_SUMMARY_TYPE_AUDIO :
96 summary_size = sizeof(lsmash_audio_summary_t);
97 break;
98 default :
99 summary_size = sizeof(lsmash_summary_t);
100 return NULL;
102 lsmash_summary_t *summary = (lsmash_summary_t *)lsmash_malloc_zero( summary_size );
103 if( !summary )
104 return NULL;
105 summary->opaque = (lsmash_codec_specific_list_t *)lsmash_malloc_zero( sizeof(lsmash_codec_specific_list_t) );
106 if( !summary->opaque )
108 lsmash_free( summary );
109 return NULL;
111 summary->summary_type = summary_type;
112 summary->data_ref_index = 1;
113 return summary;
116 void lsmash_cleanup_summary( lsmash_summary_t *summary )
118 if( !summary )
119 return;
120 if( summary->opaque )
122 for( lsmash_entry_t *entry = summary->opaque->list.head; entry; )
124 lsmash_entry_t *next = entry->next;
125 lsmash_destroy_codec_specific_data( (lsmash_codec_specific_t *)entry->data );
126 lsmash_free( entry );
127 entry = next;
129 lsmash_free( summary->opaque );
131 lsmash_free( summary );
134 int lsmash_add_codec_specific_data( lsmash_summary_t *summary, lsmash_codec_specific_t *specific )
136 if( !summary || !summary->opaque || !specific )
137 return -1;
138 lsmash_codec_specific_t *dup = isom_duplicate_codec_specific_data( specific );
139 if( !dup )
140 return -1;
141 if( lsmash_add_entry( &summary->opaque->list, dup ) < 0 )
143 lsmash_destroy_codec_specific_data( dup );
144 return -1;
146 return 0;
149 uint32_t lsmash_count_summary( lsmash_root_t *root, uint32_t track_ID )
151 if( isom_check_initializer_present( root ) < 0 || track_ID == 0 )
152 return 0;
153 isom_trak_t *trak = isom_get_trak( root->file->initializer, track_ID );
154 if( !trak
155 || !trak->mdia
156 || !trak->mdia->mdhd
157 || !trak->mdia->hdlr
158 || !trak->mdia->minf
159 || !trak->mdia->minf->stbl
160 || !trak->mdia->minf->stbl->stsd )
161 return 0;
162 return trak->mdia->minf->stbl->stsd->list.entry_count;
165 lsmash_summary_t *lsmash_get_summary( lsmash_root_t *root, uint32_t track_ID, uint32_t description_number )
167 if( isom_check_initializer_present( root ) < 0 || track_ID == 0 || description_number == 0 )
168 return NULL;
169 isom_trak_t *trak = isom_get_trak( root->file->initializer, track_ID );
170 if( !trak
171 || !trak->mdia
172 || !trak->mdia->mdhd
173 || !trak->mdia->hdlr
174 || !trak->mdia->minf
175 || !trak->mdia->minf->stbl
176 || !trak->mdia->minf->stbl->stsd )
177 return NULL;
178 isom_minf_t *minf = trak->mdia->minf;
179 isom_stsd_t *stsd = minf->stbl->stsd;
180 uint32_t i = 1;
181 for( lsmash_entry_t *entry = stsd->list.head; entry; entry = entry->next )
183 if( i != description_number )
185 ++i;
186 continue;
188 isom_sample_entry_t *sample_entry = entry->data;
189 if( !sample_entry )
190 return NULL;
191 if( minf->vmhd )
192 return isom_create_video_summary_from_description( sample_entry );
193 else if( minf->smhd )
194 return isom_create_audio_summary_from_description( sample_entry );
195 else
196 return NULL;
198 return NULL;
201 int lsmash_compare_summary( lsmash_summary_t *a, lsmash_summary_t *b )
203 if( !a || !b )
204 return -1;
205 if( a->summary_type != b->summary_type
206 || !lsmash_check_box_type_identical( a->sample_type, b->sample_type ) )
207 return 1;
208 if( a->summary_type == LSMASH_SUMMARY_TYPE_VIDEO )
210 lsmash_video_summary_t *in_video = (lsmash_video_summary_t *)a;
211 lsmash_video_summary_t *out_video = (lsmash_video_summary_t *)b;
212 if( in_video->width != out_video->width
213 || in_video->height != out_video->height
214 || in_video->depth != out_video->depth
215 || in_video->par_h != out_video->par_h
216 || in_video->par_v != out_video->par_v
217 || memcmp( in_video->compressorname, out_video->compressorname, strlen( in_video->compressorname ) )
218 || in_video->clap.width.n != out_video->clap.width.n
219 || in_video->clap.width.d != out_video->clap.width.d
220 || in_video->clap.height.n != out_video->clap.height.n
221 || in_video->clap.height.d != out_video->clap.height.d
222 || in_video->clap.horizontal_offset.n != out_video->clap.horizontal_offset.n
223 || in_video->clap.horizontal_offset.d != out_video->clap.horizontal_offset.d
224 || in_video->clap.vertical_offset.n != out_video->clap.vertical_offset.n
225 || in_video->clap.vertical_offset.d != out_video->clap.vertical_offset.d
226 || in_video->color.primaries_index != out_video->color.primaries_index
227 || in_video->color.transfer_index != out_video->color.transfer_index
228 || in_video->color.matrix_index != out_video->color.matrix_index
229 || in_video->color.full_range != out_video->color.full_range )
230 return 1;
232 else if( a->summary_type == LSMASH_SUMMARY_TYPE_AUDIO )
234 lsmash_audio_summary_t *in_audio = (lsmash_audio_summary_t *)a;
235 lsmash_audio_summary_t *out_audio = (lsmash_audio_summary_t *)b;
236 if( in_audio->frequency != out_audio->frequency
237 || in_audio->channels != out_audio->channels
238 || in_audio->sample_size != out_audio->sample_size
239 || in_audio->samples_in_frame != out_audio->samples_in_frame )
240 return 1;
242 return isom_compare_opaque_extensions( a, b );
245 lsmash_codec_support_flag lsmash_check_codec_support( lsmash_codec_type_t sample_type )
247 static struct codec_support_table_tag
249 lsmash_codec_type_t type;
250 lsmash_codec_support_flag flags;
251 } codec_support_table[160] = { { LSMASH_CODEC_TYPE_INITIALIZER, LSMASH_CODEC_SUPPORT_FLAG_NONE } };
252 if( lsmash_check_codec_type_identical( codec_support_table[0].type, LSMASH_CODEC_TYPE_UNSPECIFIED ) )
254 /* Initialize the table. */
255 int i = 0;
256 #define ADD_CODEC_SUPPORT_TABLE_ELEMENT( type, flags ) \
257 codec_support_table[i++] = (struct codec_support_table_tag){ type, flags }
258 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_AC_3_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
259 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_ALAC_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
260 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_DTSC_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
261 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_DTSH_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
262 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_DTSL_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
263 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_DTSE_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
264 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_EC_3_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
265 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_MP4A_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
266 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_SAMR_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
267 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_SAWB_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
268 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_23NI_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
269 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_MAC3_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
270 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_MAC6_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
271 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_NONE_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
272 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_QCLP_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_DEMUX );
273 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_AGSM_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
274 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_ALAC_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
275 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_ALAW_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
276 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_FL32_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
277 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_FL64_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
278 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_IN24_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
279 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_IN32_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
280 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_LPCM_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
281 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_MP4A_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
282 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_RAW_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
283 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_SOWT_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
284 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_TWOS_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
285 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_ULAW_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
286 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_FULLMP3_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
287 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_ADPCM2_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
288 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_ADPCM17_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
289 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_GSM49_AUDIO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
290 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_NOT_SPECIFIED, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
291 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_AVC1_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
292 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_AVC3_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
293 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_HVC1_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
294 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_HEV1_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
295 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_MP4V_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_MUX );
296 ADD_CODEC_SUPPORT_TABLE_ELEMENT( ISOM_CODEC_TYPE_VC_1_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
297 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_2VUY_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
298 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_DV10_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
299 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_DVOO_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
300 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_APCH_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
301 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_APCN_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
302 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_APCS_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
303 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_APCO_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
304 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_AP4H_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
305 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_DVC_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
306 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_DVCP_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
307 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_DVPP_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
308 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_DV5N_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
309 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_DV5P_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
310 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_DVH2_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
311 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_DVH3_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
312 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_DVH5_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
313 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_DVH6_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
314 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_DVHP_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
315 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_DVHQ_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
316 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_FLIC_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
317 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_H261_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
318 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_H263_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
319 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_JPEG_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
320 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_MJPA_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
321 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_MJPB_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
322 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_PNG_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
323 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_RAW_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
324 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_RLE_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
325 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_RPZA_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
326 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_TGA_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
327 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_TIFF_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
328 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_ULRA_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
329 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_ULRG_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
330 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_ULY0_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
331 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_ULY2_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
332 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_ULH0_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
333 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_ULH2_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
334 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_V210_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
335 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_V216_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
336 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_V308_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
337 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_V408_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
338 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_V410_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
339 ADD_CODEC_SUPPORT_TABLE_ELEMENT( QT_CODEC_TYPE_YUV2_VIDEO, LSMASH_CODEC_SUPPORT_FLAG_REMUX );
340 ADD_CODEC_SUPPORT_TABLE_ELEMENT( LSMASH_CODEC_TYPE_UNSPECIFIED, LSMASH_CODEC_SUPPORT_FLAG_NONE );
342 for( int i = 0; !lsmash_check_codec_type_identical( codec_support_table[i].type, LSMASH_CODEC_TYPE_UNSPECIFIED ); i++ )
343 if( lsmash_check_codec_type_identical( sample_type, codec_support_table[i].type ) )
344 return codec_support_table[i].flags;
345 return LSMASH_CODEC_SUPPORT_FLAG_NONE;