예제 #1
0
static int enc_set_br(MSFilter *f, void *arg) {
	EncData *d = (EncData *)f->data;
	int br = *(int *)arg;
	if (d->codec != NULL) {
		/* Encoding is already ongoing, do not change video size, only bitrate. */
		d->vconf.required_bitrate = br;
		enc_set_configuration(f,&d->vconf);
	} else {
		MSVideoConfiguration best_vconf = ms_video_find_best_configuration_for_bitrate(d->vconf_list, br, ms_get_cpu_count());
		enc_set_configuration(f, &best_vconf);
	}
	return 0;
}
예제 #2
0
static int enc_set_br(MSFilter *f, void *data) {
	EncState *s = (EncState *)f->data;
	int br = *(int *)data;
	if (s->ready) {
		/* Encoding is already ongoing, do not change video size, only bitrate. */
		s->vconf.required_bitrate = br;
		enc_set_configuration(f, &s->vconf);
	} else {
		MSVideoConfiguration best_vconf = ms_video_find_best_configuration_for_bitrate(s->vconf_list, br, ms_factory_get_cpu_count(f->factory));
		enc_set_configuration(f, &best_vconf);
	}
	return 0;
}
예제 #3
0
static int enc_set_fps(MSFilter *f, void *data){
	float *fps=(float*)data;
	EncState *s=(EncState*)f->data;
	s->vconf.fps=*fps;
	enc_set_configuration(f, &s->vconf);
	return 0;
}
예제 #4
0
static int enc_set_br(MSFilter *f, void*data) {
	MSVideoConfiguration best_vconf;
	EncState *s = (EncState *)f->data;
	int br = *(int *)data;
	best_vconf = ms_video_find_best_configuration_for_bitrate(s->vconf_list, br);
	enc_set_configuration(f, &best_vconf);
	return 0;
}
예제 #5
0
static int enc_set_br(MSFilter *f, void *arg) {
	MSVideoConfiguration best_vconf;
	EncData *d = (EncData *)f->data;
	int br = *(int *)arg;
	best_vconf = ms_video_find_best_configuration_for_bitrate(d->vconf_list, br);
	enc_set_configuration(f, &best_vconf);
	return 0;
}
예제 #6
0
static int enc_set_vsize(MSFilter *f, void *data) {
	MSVideoConfiguration best_vconf;
	MSVideoSize *vs = (MSVideoSize *)data;
	EncState *s = (EncState *)f->data;
	best_vconf = ms_video_find_best_configuration_for_size(s->vconf_list, *vs);
	s->vconf.vsize = *vs;
	s->vconf.fps = best_vconf.fps;
	s->vconf.bitrate_limit = best_vconf.bitrate_limit;
	enc_set_configuration(f, &s->vconf);
	return 0;
}
예제 #7
0
static int enc_set_vsize(MSFilter *f, void *arg){
	MSVideoConfiguration best_vconf;
	EncData *d = (EncData *)f->data;
	MSVideoSize *vs = (MSVideoSize *)arg;
	best_vconf = ms_video_find_best_configuration_for_size(d->vconf_list, *vs, ms_get_cpu_count());
	d->vconf.vsize = *vs;
	d->vconf.fps = best_vconf.fps;
	d->vconf.bitrate_limit = best_vconf.bitrate_limit;
	enc_set_configuration(f, &d->vconf);
	return 0;
}
예제 #8
0
static int enc_set_br(MSFilter *f, void*data) {
	int br = *(int *)data;
	const MSVideoConfiguration *current_vconf;
	const MSVideoConfiguration *closer_to_best_vconf = NULL;
	MSVideoConfiguration best_vconf;

	if (ms_get_cpu_count() > 1) current_vconf = &multicore_vp8_conf_list[0];
	else current_vconf = &vp8_conf_list[0];
	while (closer_to_best_vconf == NULL) {
		if ((br >= current_vconf->bitrate) || (current_vconf->bitrate == 0)) {
			closer_to_best_vconf = current_vconf;
		} else {
			current_vconf++;
		}
	}

	memcpy(&best_vconf, closer_to_best_vconf, sizeof(best_vconf));
	best_vconf.bitrate = br;
	enc_set_configuration(f, &best_vconf);
	return 0;
}
예제 #9
0
static int enc_set_fps(MSFilter *f, void *arg){
	EncData *d=(EncData*)f->data;
	d->vconf.fps=*(float*)arg;
	enc_set_configuration(f, &d->vconf);
	return 0;
}