Пример #1
0
GF_Err dc_audio_muxer_open(AudioOutputFile *audio_output_file, char *directory, char *id_name, int seg)
{
	GF_Err ret = GF_NOT_SUPPORTED;
	char name[GF_MAX_PATH];

	switch (audio_output_file->muxer_type) {
	case FFMPEG_AUDIO_MUXER:
		snprintf(name, sizeof(name), "%s/%s_%d_ffmpeg.mp4", directory, id_name, seg);
		return dc_ffmpeg_audio_muxer_open(audio_output_file, name);
#ifndef GPAC_DISABLE_ISOM
	case GPAC_AUDIO_MUXER:
		snprintf(name, sizeof(name), "%s/%s_%d_gpac.mp4", directory, id_name, seg);
		dc_gpac_audio_moov_create(audio_output_file, name);
		return dc_gpac_audio_isom_open_seg(audio_output_file, NULL);
	case GPAC_INIT_AUDIO_MUXER:
		if (seg == 1) {
			snprintf(name, sizeof(name), "%s/%s_init_gpac.mp4", directory, id_name);
			dc_gpac_audio_moov_create(audio_output_file, name);
			audio_output_file->first_dts = 0;
		}
		snprintf(name, sizeof(name), "%s/%s_%d_gpac.m4s", directory, id_name, seg);
		ret = dc_gpac_audio_isom_open_seg(audio_output_file, name);
		return ret;
#endif
	default:
		ret = GF_BAD_PARAM;
		break;
	}

	return ret;
}
Пример #2
0
GF_Err dc_audio_muxer_open(AudioOutputFile * p_aoutf, char * psz_directory, char * psz_id, int i_seg) {

	GF_Err ret;
	char psz_name[256];

	switch (p_aoutf->muxer_type) {

	case FFMPEG_AUDIO_MUXER:
		sprintf(psz_name, "%s/%s_%d_ffmpeg.mp4",
				psz_directory, psz_id, i_seg);
		return dc_ffmpeg_audio_muxer_open(p_aoutf, psz_name);
	case GPAC_AUDIO_MUXER:
		sprintf(psz_name, "%s/%s_%d_gpac.mp4",
				psz_directory, psz_id, i_seg);
		dc_gpac_audio_moov_create(p_aoutf, psz_name);
		return dc_gpac_audio_isom_open_seg(p_aoutf, NULL);
	case GPAC_INIT_AUDIO_MUXER:
		if(i_seg == 0) {
			sprintf(psz_name, "%s/%s_init_gpac.mp4",
								psz_directory, psz_id);
			dc_gpac_audio_moov_create(p_aoutf, psz_name);
			p_aoutf->i_first_dts = 0;
		}
		sprintf(psz_name, "%s/%s_%d_gpac.m4s",
							psz_directory, psz_id, i_seg);

		ret = dc_gpac_audio_isom_open_seg(p_aoutf, psz_name);
		return ret;
	default:
		return GF_BAD_PARAM;
	};

	return GF_BAD_PARAM;
}