Commit 8e0e85af authored by Simon Morlat's avatar Simon Morlat

fix crash on windows and add vp8 codec support for windows

parent ba0d7463
......@@ -201,15 +201,16 @@ AC_DEFUN([MS_CHECK_VIDEO],[
*) AC_MSG_ERROR(bad value ${enableval} for --disable-vp8) ;;
esac],[vp8=true])
vp8dir=/usr
if test x$vp8 = xtrue; then
PKG_CHECK_MODULES(VP8, [vpx >= 0.9.6 ], [have_vp8=yes],
[have_vp8=no])
if test "$have_vp8" = "no" ; then
AC_CHECK_HEADERS([vpx/vpx_encoder.h],
[ have_vp8=yes
VP8_LIBS="-lvpx"
AC_SUBST(VP8_LIBS)
])
MS_CHECK_DEP([VP8 codec],[VP8],[${vp8dir}/include],
[${vp8dir}/lib],[vpx/vpx_encoder.h],[vpx],[vpx_codec_encode])
if test "$VP8_found" = "yes" ; then
have_vp8=yes
fi
fi
fi
......
......@@ -587,7 +587,8 @@ public:
return ret;
}
bool isTimeToSend(uint64_t ticker_time);
MSVideoSize getVSize()const{
MSVideoSize getVSize(){
if (!_ready) createDshowGraph(); /* so that _vsize is updated according to hardware capabilities*/
return _vsize;
}
void setVSize(MSVideoSize vsize){
......@@ -708,7 +709,7 @@ static char * fourcc_to_char(char *str, uint32_t fcc){
return str;
}
static int find_best_format(ComPtr<IAMStreamConfig> streamConfig, int count, MSVideoSize *requested_size, MSPixFmt requested_fmt ){
static int find_best_format(ComPtr<IAMStreamConfig> streamConfig, int count,MSVideoSize *requested_size, MSPixFmt requested_fmt ){
int i;
MSVideoSize best_found={0,0};
int best_index=-1;
......
......@@ -300,15 +300,16 @@ static void configure_video_source(VideoStream *stream){
if (stream->preview_window_id!=0){
video_stream_set_native_preview_window_id(stream, stream->preview_window_id);
}
ms_filter_call_method(stream->encoder,MS_FILTER_GET_VIDEO_SIZE,&vsize);
vsize=get_compatible_size(vsize,stream->sent_vsize);
ms_filter_call_method(stream->source,MS_FILTER_SET_VIDEO_SIZE,&vsize);
/*the camera may not support the target size and suggest a one close to the target */
ms_filter_call_method(stream->source,MS_FILTER_GET_VIDEO_SIZE,&cam_vsize);
if (cam_vsize.width*cam_vsize.height<=vsize.width*vsize.height){
if (cam_vsize.width*cam_vsize.height<vsize.width*vsize.height){
vsize=cam_vsize;
ms_message("Output video size adjusted to match camera resolution (%ix%i)\n",vsize.width,vsize.height);
} else {
} else if (cam_vsize.width*cam_vsize.height>vsize.width*vsize.height){
ms_warning("Camera video size greater than encoder one. A scaling filter will be used!\n");
}
ms_filter_call_method(stream->encoder,MS_FILTER_SET_VIDEO_SIZE,&vsize);
......@@ -318,9 +319,9 @@ static void configure_video_source(VideoStream *stream){
if (ms_filter_get_id(stream->source)!=MS_STATIC_IMAGE_ID) {
ms_filter_call_method(stream->source,MS_FILTER_SET_FPS,&fps);
}
/* get the output format for webcam reader */
ms_filter_call_method(stream->source,MS_FILTER_GET_PIX_FMT,&format);
if (format==MS_MJPEG){
stream->pixconv=ms_filter_new(MS_MJPEG_DEC_ID);
}else{
......
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