From 7a9e71f886066bdcb29525e95f6a34bee0b39fc1 Mon Sep 17 00:00:00 2001 From: smorlat Date: Mon, 27 Oct 2008 21:41:28 +0000 Subject: [PATCH] fix bug in videoout on windows, introduced by previous changes. git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@124 3f6dc0c8-ddfe-455d-9043-3cd528dc4637 --- .../mediastreamer2/include/mediastreamer2/msfilter.h | 7 +++++++ linphone/mediastreamer2/plugins/msx264/msx264.iss | 2 +- linphone/mediastreamer2/src/msticker.c | 2 +- linphone/mediastreamer2/src/videoout.c | 12 ++++++++++-- linphone/mediastreamer2/src/videostream.c | 7 ------- 5 files changed, 19 insertions(+), 11 deletions(-) diff --git a/linphone/mediastreamer2/include/mediastreamer2/msfilter.h b/linphone/mediastreamer2/include/mediastreamer2/msfilter.h index e4712a964..06b1336d1 100644 --- a/linphone/mediastreamer2/include/mediastreamer2/msfilter.h +++ b/linphone/mediastreamer2/include/mediastreamer2/msfilter.h @@ -89,6 +89,12 @@ enum _MSFilterCategory{ */ typedef enum _MSFilterCategory MSFilterCategory; +enum _MSFilterFlags{ + MS_FILTER_IS_PUMP = 1 +}; + +typedef enum _MSFilterFlags MSFilterFlags; + struct _MSFilterDesc{ MSFilterId id; /* the id declared in allfilters.h */ const char *name; /* filter name */ @@ -103,6 +109,7 @@ struct _MSFilterDesc{ MSFilterFunc postprocess; /*called once after processing */ MSFilterFunc uninit; MSFilterMethod *methods; + unsigned int flags; }; /** diff --git a/linphone/mediastreamer2/plugins/msx264/msx264.iss b/linphone/mediastreamer2/plugins/msx264/msx264.iss index ac74a2004..584f67197 100755 --- a/linphone/mediastreamer2/plugins/msx264/msx264.iss +++ b/linphone/mediastreamer2/plugins/msx264/msx264.iss @@ -3,7 +3,7 @@ [Setup] AppName=msx264 -AppVerName=msx264 version 1.1.5., an H.264 plugin for linphone. +AppVerName=msx264 version 1.1.6., an H.264 plugin for linphone. AppPublisher=linphone.org AppPublisherURL=http://www.linphone.org AppSupportURL=http://www.linphone.org diff --git a/linphone/mediastreamer2/src/msticker.c b/linphone/mediastreamer2/src/msticker.c index 0f8a336d6..55672bd87 100644 --- a/linphone/mediastreamer2/src/msticker.c +++ b/linphone/mediastreamer2/src/msticker.c @@ -184,7 +184,7 @@ static bool_t filter_can_process(MSFilter *f, int tick){ static void call_process(MSFilter *f){ bool_t process_done=FALSE; - if (f->desc->ninputs==0){ + if (f->desc->ninputs==0 || f->desc->flags & MS_FILTER_IS_PUMP){ ms_filter_process(f); }else{ while (ms_filter_inputs_have_data(f)) { diff --git a/linphone/mediastreamer2/src/videoout.c b/linphone/mediastreamer2/src/videoout.c index 07d58037f..9bc195ee2 100644 --- a/linphone/mediastreamer2/src/videoout.c +++ b/linphone/mediastreamer2/src/videoout.c @@ -387,6 +387,7 @@ static void win_display_update(MSDisplay *obj){ HDC hdc; BITMAPINFOHEADER bi; RECT rect; + MSG msg; bool_t ret; if (wd->window==NULL) return; hdc=GetDC(wd->window); @@ -426,6 +427,11 @@ static void win_display_update(MSDisplay *obj){ if (!ret) ms_error("DrawDibDraw failed."); ReleaseDC(NULL,hdc); + while (PeekMessage(&msg, wd->window, 0, 0, PM_REMOVE) != 0) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } } static void win_display_uninit(MSDisplay *obj){ @@ -814,7 +820,8 @@ MSFilterDesc ms_video_out_desc={ video_out_process, video_out_postprocess, video_out_uninit, - methods + methods, + MS_FILTER_IS_PUMP }; #else @@ -831,7 +838,8 @@ MSFilterDesc ms_video_out_desc={ .process=video_out_process, .postprocess=video_out_postprocess, .uninit=video_out_uninit, - .methods=methods + .methods=methods, + .flags=MS_FILTER_IS_PUMP }; #endif diff --git a/linphone/mediastreamer2/src/videostream.c b/linphone/mediastreamer2/src/videostream.c index 0951d97f9..f5d2155a8 100644 --- a/linphone/mediastreamer2/src/videostream.c +++ b/linphone/mediastreamer2/src/videostream.c @@ -21,14 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "mediastreamer2/msfilter.h" #include "mediastreamer2/msvideo.h" #include "mediastreamer2/msrtp.h" - - -#if (defined(WIN32) || defined(_WIN32_WCE)) -/* avoid double declaration of ms_win_display_desc */ -#define MS_VIDEO_OUT_HANDLE_RESIZING MS_FILTER_METHOD_NO_ARG(MS_VIDEO_OUT_ID,1) -#else #include "mediastreamer2/msvideoout.h" -#endif #ifdef HAVE_CONFIG_H #include "mediastreamer-config.h"