From 99588f1ccc5c71d2130336725b286bc00dcccf8b Mon Sep 17 00:00:00 2001
From: smorlat <smorlat@3f6dc0c8-ddfe-455d-9043-3cd528dc4637>
Date: Mon, 30 Mar 2009 13:51:30 +0000
Subject: [PATCH] a few improvements

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@392 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
---
 linphone/gtk-glade/linphone.dev               | 12 +++++++++-
 linphone/gtk-glade/linphone.iss               |  3 +++
 .../build/win32native/mediastreamer2.dev      | 24 +++++++++++++++++--
 .../include/mediastreamer2/mswebcam.h         | 16 ++++++++++---
 linphone/mediastreamer2/src/mswebcam.c        |  5 ++++
 linphone/mediastreamer2/src/winvideods.c      |  8 ++++++-
 6 files changed, 61 insertions(+), 7 deletions(-)

diff --git a/linphone/gtk-glade/linphone.dev b/linphone/gtk-glade/linphone.dev
index 1287e8b80d..fb7533df0c 100755
--- a/linphone/gtk-glade/linphone.dev
+++ b/linphone/gtk-glade/linphone.dev
@@ -1,7 +1,7 @@
 [Project]
 FileName=linphone.dev
 Name=linphone
-UnitCount=10
+UnitCount=11
 PchHead=-1
 PchSource=-1
 Ver=3
@@ -184,3 +184,13 @@ Priority=1000
 OverrideBuildCmd=0
 BuildCmd=$(CC) -c buddylookup.c -o Objects/buddylookup.o $(CFLAGS)
 
+[Unit11]
+FileName=utils.c
+CompileCpp=0
+Folder=linphone
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=	$(CC) -c utils.c -o Objects/utils.o $(CFLAGS)
+
diff --git a/linphone/gtk-glade/linphone.iss b/linphone/gtk-glade/linphone.iss
index eaa45db313..e213aabcc3 100755
--- a/linphone/gtk-glade/linphone.iss
+++ b/linphone/gtk-glade/linphone.iss
@@ -78,6 +78,9 @@ Source: "..\coreapi\plugins\buddylookup\libbuddylookup.dll"; DestDir: "{app}\lib
 Source: "..\..\libsoup\bin\libsoup-2.4-1.dll"; DestDir: "{app}"; Flags: ignoreversion
 Source: "..\..\gnutls-2.6.4\bin\*.dll"; DestDir: "{app}"; Flags: ignoreversion
 
+;;Directshow capture plugin
+Source: "..\mediastreamer2\plugins\msdscap\libmsdscap.dll"; DestDir: "{app}\plugins" ; Flags: ignoreversion
+
 [Icons]
 Name: "{group}\Linphone"; Filename: "{app}\linphone.exe" ; WorkingDir: "{app}"
 Name: "{userdesktop}\Linphone"; Filename: "{app}\linphone.exe"; WorkingDir: "{app}" ; Tasks: desktopicon
diff --git a/linphone/mediastreamer2/build/win32native/mediastreamer2.dev b/linphone/mediastreamer2/build/win32native/mediastreamer2.dev
index ea12760bff..fa95fe0f57 100755
--- a/linphone/mediastreamer2/build/win32native/mediastreamer2.dev
+++ b/linphone/mediastreamer2/build/win32native/mediastreamer2.dev
@@ -1,7 +1,7 @@
 [Project]
 FileName=mediastreamer2.dev
 Name=mediastreamer2
-UnitCount=55
+UnitCount=57
 Type=2
 Ver=3
 IsCpp=1
@@ -513,7 +513,7 @@ PrivateResource=
 ResourceIncludes=
 MakeIncludes=
 Compiler=-ggdb_@@_-DINET6 _@@_-DORTP_INET6 _@@_-D_WIN32_WINNT=0x0501 _@@_-DNOSDL_@@_-DVIDEO_ENABLED_@@_-DNORESAMPLE_@@_-Wall _@@_-DHAVE_LIBAVCODEC_AVCODEC_H_@@_-D_TRUE_TIME_@@_
-CppCompiler=
+CppCompiler=-ggdb_@@_-DINET6 _@@_-DORTP_INET6 _@@_-D_WIN32_WINNT=0x0501 _@@_-Wall _@@_-DHAVE_LIBAVCODEC_AVCODEC_H_@@_
 Linker=-lortp_@@_-lswscale_@@_-lavcodec_@@_-lavutil_@@_-ltheora_@@_-lspeex_@@_-lspeexdsp_@@_-lgsm_@@_-lws2_32_@@_-lwinmm_@@_-lvfw32_@@_-logg_@@__@@_
 PreprocDefines=
 CompilerSettings=0000000000010000000000
@@ -611,3 +611,23 @@ Priority=1000
 OverrideBuildCmd=0
 BuildCmd=$(CC) -c winvideo2.c -o "Default Profile/winvideo2.o" $(CFLAGS)
 
+[Unit56]
+FileName=..\..\src\winvideods.c
+CompileCpp=1
+Folder=mediastreamer2
+Compile=0
+Link=0
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=	$(CPP) -c winvideods.c -o "Default Profile/winvideods.o" $(CXXFLAGS)
+
+[Unit57]
+FileName=..\..\src\mingw-dshow.h
+CompileCpp=1
+Folder=
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
diff --git a/linphone/mediastreamer2/include/mediastreamer2/mswebcam.h b/linphone/mediastreamer2/include/mediastreamer2/mswebcam.h
index 3a662b8897..3628dae3ff 100644
--- a/linphone/mediastreamer2/include/mediastreamer2/mswebcam.h
+++ b/linphone/mediastreamer2/include/mediastreamer2/mswebcam.h
@@ -128,14 +128,24 @@ MSWebCam * ms_web_cam_manager_get_default_cam(MSWebCamManager *m);
 const MSList * ms_web_cam_manager_get_list(MSWebCamManager *m);
 
 /**
- * Add a sound card object in a sound card manager's list.
+ * Add a sound card object in a webcam  manager's list.
  *
- * @param m    A sound card manager containing sound cards.
- * @param c    A sound card object.
+ * @param m    A webcam  manager containing webcams
+ * @param c    A web cam object.
  *
  */
 void ms_web_cam_manager_add_cam(MSWebCamManager *m, MSWebCam *c);
 
+/**
+ * Add a sound card object on top of list of the webcam  manager's list.
+ *
+ * @param m    A webcam  manager containing webcams
+ * @param c    A web cam object.
+ *
+ */
+void ms_web_cam_manager_prepend_cam(MSWebCamManager *m, MSWebCam *c);
+
+
 /**
  * Register a sound card description in a sound card manager.
  *
diff --git a/linphone/mediastreamer2/src/mswebcam.c b/linphone/mediastreamer2/src/mswebcam.c
index 8cdd757196..5548c9295e 100644
--- a/linphone/mediastreamer2/src/mswebcam.c
+++ b/linphone/mediastreamer2/src/mswebcam.c
@@ -72,6 +72,11 @@ void ms_web_cam_manager_add_cam(MSWebCamManager *m, MSWebCam *c){
 	m->cams=ms_list_append(m->cams,c);
 }
 
+void ms_web_cam_manager_prepend_cam(MSWebCamManager *m, MSWebCam *c){
+	ms_message("Webcam %s prepended",ms_web_cam_get_string_id(c));
+	m->cams=ms_list_prepend(m->cams,c);
+}
+
 void ms_web_cam_manager_register_desc(MSWebCamManager *m, MSWebCamDesc *desc){
 	if (desc->detect!=NULL)
 		desc->detect(m);
diff --git a/linphone/mediastreamer2/src/winvideods.c b/linphone/mediastreamer2/src/winvideods.c
index d2ea41884d..9ca00cb13d 100644
--- a/linphone/mediastreamer2/src/winvideods.c
+++ b/linphone/mediastreamer2/src/winvideods.c
@@ -27,7 +27,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "mediastreamer2/mswebcam.h"
 
 #include "nowebcam.h"
+
+#ifdef HAVE_LIBAVCODEC_AVCODEC_H
+#include <libavcodec/avcodec.h>
+#else
 #include <ffmpeg/avcodec.h>
+#endif
 
 #include <dshow.h>
 #include <dmodshow.h>
@@ -35,6 +40,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include <streams.h>
 #include <initguid.h>
+
 #include "dxfilter.h"
 EXTERN_C const CLSID CLSID_NullRenderer;
 
@@ -1414,7 +1420,7 @@ static MSFilterMethod methods[]={
 	{	0								,	NULL			}
 };
 
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__cplusplus) 
 
 MSFilterDesc ms_v4w_desc={
 	MS_V4L_ID,
-- 
GitLab