Commit a0e4a661 authored by Simon Morlat's avatar Simon Morlat
Browse files

portrait formats

parent acbfcd6c
......@@ -207,6 +207,10 @@ static inline bool_t ms_video_size_greater_than(MSVideoSize vs1, MSVideoSize vs2
return (vs1.width>=vs2.width) && (vs1.height>=vs2.height);
}
static inline bool_t ms_video_size_area_greater_than(MSVideoSize vs1, MSVideoSize vs2){
return (vs1.width*vs1.height >= vs2.width*vs2.height);
}
static inline MSVideoSize ms_video_size_max(MSVideoSize vs1, MSVideoSize vs2){
return ms_video_size_greater_than(vs1,vs2) ? vs1 : vs2;
}
......@@ -215,6 +219,14 @@ static inline MSVideoSize ms_video_size_min(MSVideoSize vs1, MSVideoSize vs2){
return ms_video_size_greater_than(vs1,vs2) ? vs2 : vs1;
}
static inline MSVideoSize ms_video_size_area_max(MSVideoSize vs1, MSVideoSize vs2){
return ms_video_size_area_greater_than(vs1,vs2) ? vs1 : vs2;
}
static inline MSVideoSize ms_video_size_area_min(MSVideoSize vs1, MSVideoSize vs2){
return ms_video_size_area_greater_than(vs1,vs2) ? vs2 : vs1;
}
static inline bool_t ms_video_size_equal(MSVideoSize vs1, MSVideoSize vs2){
return vs1.width==vs2.width && vs1.height==vs2.height;
}
......
......@@ -252,7 +252,7 @@ static void configure_video_source(VideoStream *stream){
MSPixFmt format;
ms_filter_call_method(stream->encoder,MS_FILTER_GET_VIDEO_SIZE,&vsize);
vsize=ms_video_size_min(vsize,stream->sent_vsize);
vsize=ms_video_size_area_min(vsize,stream->sent_vsize);
ms_filter_call_method(stream->encoder,MS_FILTER_SET_VIDEO_SIZE,&vsize);
ms_filter_call_method(stream->encoder,MS_FILTER_GET_FPS,&fps);
ms_message("Setting sent vsize=%ix%i, fps=%f",vsize.width,vsize.height,fps);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment