GF_Err gf_isom_get_tmcd_config(GF_ISOFile *movie, u32 trackNumber, u32 descriptionIndex, u32 *tmcd_flags, u32 *tmcd_fps_num, u32 *tmcd_fps_den, u32 *tmcd_fpt)
{
	GF_TimeCodeSampleEntryBox *tmcd;
	GF_TrackBox *trak;
	trak = gf_isom_get_track_from_file(movie, trackNumber);
	if (!trak || !descriptionIndex) return GF_BAD_PARAM;

	tmcd = (GF_TimeCodeSampleEntryBox *)gf_list_get(trak->Media->information->sampleTable->SampleDescription->child_boxes, descriptionIndex-1);
	if (!tmcd) return GF_BAD_PARAM;
	if (tmcd->type != GF_QT_BOX_TYPE_TMCD) return GF_BAD_PARAM;

	if (tmcd_flags) *tmcd_flags = tmcd->flags;
	if (tmcd_fps_num) *tmcd_fps_num = tmcd->timescale;
	if (tmcd_fps_den) *tmcd_fps_den = tmcd->frame_duration;
	if (tmcd_fpt) *tmcd_fpt = tmcd->frames_per_counter_tick;
	return GF_OK;
}
GF_Err gf_isom_get_tmcd_config(GF_ISOFile *movie, u32 trackNumber, u32 descriptionIndex, u32 *tmcd_flags, u32 *tmcd_fps_num, u32 *tmcd_fps_den, u32 *tmcd_fpt)
{
	GF_TimeCodeSampleEntryBox *tmcd;
	GF_TrackBox *trak;
	trak = gf_isom_get_track_from_file(movie, trackNumber);
	if (!trak || !descriptionIndex) return GF_BAD_PARAM;

	tmcd = (GF_TimeCodeSampleEntryBox *)gf_list_get(trak->Media->information->sampleTable->SampleDescription->child_boxes, descriptionIndex-1);
	if (!tmcd) return GF_BAD_PARAM;
	if (tmcd->type != GF_QT_BOX_TYPE_TMCD) return GF_BAD_PARAM;

	if (tmcd_flags) *tmcd_flags = tmcd->flags;
	if (tmcd_fps_num) *tmcd_fps_num = tmcd->timescale;
	if (tmcd_fps_den) *tmcd_fps_den = tmcd->frame_duration;
	if (tmcd_fpt) *tmcd_fpt = tmcd->frames_per_counter_tick;
	return GF_OK;
}