Ejemplo n.º 1
0
int dc_audio_muxer_init(AudioOutputFile * p_aoutf, AudioData * p_adata,
		AudioMuxerType muxer_type, int frame_per_seg, int frame_per_frag) {

	char name[256];
	sprintf(name, "audio encoder %s", p_adata->psz_name);
	dc_consumer_init(&p_aoutf->acon, AUDIO_CB_SIZE, name);

	p_aoutf->p_sample = gf_isom_sample_new();
	p_aoutf->p_isof = NULL;
	p_aoutf->muxer_type = muxer_type;

	p_aoutf->i_frame_per_seg = frame_per_seg;
	p_aoutf->i_frame_per_frag = frame_per_frag;

	return 0;
}
Ejemplo n.º 2
0
int dc_audio_muxer_init(AudioOutputFile *audio_output_file, AudioDataConf *audio_data_conf, AudioMuxerType muxer_type, int frame_per_seg, int frame_per_frag, u32 seg_marker)
{
	char name[GF_MAX_PATH];
	snprintf(name, sizeof(name), "audio encoder %s", audio_data_conf->filename);
	dc_consumer_init(&audio_output_file->consumer, AUDIO_CB_SIZE, name);

#ifndef GPAC_DISABLE_ISOM
	audio_output_file->sample = gf_isom_sample_new();
	audio_output_file->isof = NULL;
#endif

	audio_output_file->muxer_type = muxer_type;
	audio_output_file->frame_per_seg = frame_per_seg;
	audio_output_file->frame_per_frag = frame_per_frag;
	audio_output_file->seg_marker = seg_marker;
	return 0;
}
Ejemplo n.º 3
0
int dc_video_scaler_data_init(VideoInputData *video_input_data, VideoScaledData *video_scaled_data, int max_source, int video_cb_size)
{
	int i;
	char name[GF_MAX_PATH];
	snprintf(name, sizeof(name), "video scaler %dx%d", video_scaled_data->out_width, video_scaled_data->out_height);

	dc_producer_init(&video_scaled_data->producer, video_cb_size, name);
	dc_consumer_init(&video_scaled_data->consumer, video_cb_size, name);

	video_scaled_data->num_producers = max_source;
	video_scaled_data->out_pix_fmt = PIX_FMT_YUV420P;
	GF_SAFE_ALLOC_N(video_scaled_data->vsprop, max_source, VideoScaledProp);
	memset(video_scaled_data->vsprop, 0, max_source * sizeof(VideoScaledProp));

	dc_circular_buffer_create(&video_scaled_data->circular_buf, video_cb_size, video_input_data->circular_buf.mode, video_scaled_data->num_consumers);
	for (i=0; i<video_cb_size; i++) {
		video_scaled_data->circular_buf.list[i].data = dc_video_scaler_node_create(video_scaled_data->out_width, video_scaled_data->out_height, video_input_data->vprop[i].crop_x, video_input_data->vprop[i].crop_y, video_scaled_data->out_pix_fmt);
	}

	return 0;
}
Ejemplo n.º 4
0
int dc_video_muxer_init(VideoOutputFile *video_output_file, VideoDataConf *video_data_conf, VideoMuxerType muxer_type, int frame_per_segment, int frame_per_fragment, u32 seg_marker, int gdr, int seg_dur, int frag_dur, int frame_dur, int gop_size, int video_cb_size)
{
	char name[GF_MAX_PATH];
	memset(video_output_file, 0, sizeof(VideoOutputFile));
	snprintf(name, sizeof(name), "video encoder %s", video_data_conf->filename);
	dc_consumer_init(&video_output_file->consumer, video_cb_size, name);

	video_output_file->sample = gf_isom_sample_new();
	video_output_file->isof = NULL;
	video_output_file->muxer_type = muxer_type;

	video_output_file->frame_per_segment = frame_per_segment;
	video_output_file->frame_per_fragment = frame_per_fragment;

	video_output_file->seg_dur = seg_dur;
	video_output_file->frag_dur = frag_dur;

	video_output_file->seg_marker = seg_marker;
	video_output_file->gdr = gdr;
	video_output_file->gop_size = gop_size;
	video_output_file->frame_dur = frame_dur;

	return 0;
}