Commit 9b5dd7b1 authored by smorlat's avatar smorlat
Browse files

ready for 3.1.1, fix a severe bug in directshow capture plugin

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@416 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
parent dc9271ce
......@@ -33,7 +33,7 @@
#endif
#ifndef LINPHONE_VERSION
#define LINPHONE_VERSION "3.0.0"
#define LINPHONE_VERSION "3.1.1"
#endif
#ifndef LIBLINPHONE_VERSION
......
......@@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define PACKAGE_DATA_DIR "./"
#ifndef LINPHONE_VERSION
#define LINPHONE_VERSION "3.1.0-20090402"
#define LINPHONE_VERSION "3.1.1"
#endif
#endif
......
......@@ -3,7 +3,7 @@
[Setup]
AppName=Linphone
AppVerName=Linphone version 3.1.0
AppVerName=Linphone version 3.1.1
AppPublisher=linphone.org
AppPublisherURL=http://www.linphone.org
AppSupportURL=http://www.linphone.org
......
......@@ -908,6 +908,16 @@ int main(int argc, char *argv[]){
g_warning("This instance is going to exit now.");
return 0;
}
#ifdef WIN32
/*workaround for windows: sometimes LANG is defined to an integer value, not understood by gtk */
if ((lang=getenv("LANG"))!=NULL){
if (atoi(lang)!=0){
char tmp[128];
snprintf(tmp,sizeof(tmp),"LANG=",lang);
_putenv(tmp);
}
}
#endif
if ((lang=linphone_gtk_get_lang(config_file))!=NULL && lang[0]!='\0'){
#ifdef WIN32
......
......@@ -619,15 +619,25 @@ Compile=0
Link=0
Priority=1000
OverrideBuildCmd=0
BuildCmd= $(CPP) -c winvideods.c -o "Default Profile/winvideods.o" $(CXXFLAGS)
BuildCmd=$(CPP) -c winvideods.c -o "Default Profile/winvideods.o" $(CXXFLAGS)
[Unit58]
FileName=..\..\src\void.c
CompileCpp=0
Folder=mediastreamer2
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd= $(CC) -c void.c -o "Default Profile/void.o" $(CFLAGS)
[Unit57]
FileName=..\..\src\mingw-dshow.h
CompileCpp=1
Folder=
FileName=..\..\src\void.c
CompileCpp=0
Folder=mediastreamer2
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
BuildCmd= $(CC) -c void.c -o "Default Profile/void.o" $(CFLAGS)
......@@ -77,8 +77,8 @@ Includes=../../include;../../../oRTP/include
Libs=../../build/win32native/;../../../oRTP/build/win32native
ResourceIncludes=
MakeIncludes=
Compiler=-DBUILDING_DLL=1_@@_-DORTP_INET6_@@_
CppCompiler=-DBUILDING_DLL=1_@@_
Compiler=_@@_
CppCompiler=-DBUILDING_DLL=1_@@_-DORTP_INET6_@@_-ggdb -02_@@_-Wall_@@_
Linker=--no-export-all-symbols_@@_--add-stdcall-alias_@@_-lole32_@@_-loleaut32_@@_-lwinmm_@@_-luuid_@@_-lmediastreamer2_@@_-lortp_@@_
PreprocDefines=
CompilerSettings=0000000001001000000000
......
......@@ -502,6 +502,7 @@ public:
_frame_count=0;
_pixfmt=MS_YUV420P;
_ready=false;
m_refCount=1;
}
virtual ~DSCapture(){
if (_ready) stopAndClean();
......@@ -552,6 +553,7 @@ private:
float _start_time;
int _frame_count;
MSPixFmt _pixfmt;
ComPtr< IGraphBuilder > _graphBuilder;
ComPtr< IBaseFilter > _source;
ComPtr< IBaseFilter > _nullRenderer;
ComPtr< IBaseFilter > _grabberBase;
......@@ -746,10 +748,8 @@ int DSCapture::createDshowGraph(){
createDevEnum.reset();
enumMoniker->Reset();
int index = 0;
ULONG fetched = 0;
ComPtr< IGraphBuilder > graphBuilder;
graphBuilder.coCreateInstance( CLSID_FilterGraph, IID_IGraphBuilder,
_graphBuilder.coCreateInstance( CLSID_FilterGraph, IID_IGraphBuilder,
"Could not create graph builder "
"interface" );
ComPtr< IMoniker > moniker;
......@@ -767,7 +767,7 @@ int DSCapture::createDshowGraph(){
}
moniker.reset();
enumMoniker.reset();
if (graphBuilder->AddFilter( _source.get(), L"Source" )!=S_OK){
if (_graphBuilder->AddFilter( _source.get(), L"Source" )!=S_OK){
ms_error("Error adding camera source to filter graph" );
return -1;
}
......@@ -798,7 +798,7 @@ int DSCapture::createDshowGraph(){
ms_error("Error creating sample grabber" );
return -1;
}
if (graphBuilder->AddFilter( _grabberBase.get(), L"Grabber" )!=S_OK){
if (_graphBuilder->AddFilter( _grabberBase.get(), L"Grabber" )!=S_OK){
ms_error("Error adding sample grabber to filter graph");
return -1;
}
......@@ -836,32 +836,33 @@ int DSCapture::createDshowGraph(){
ms_error("Error creating Null Renderer" );
return -1;
}
if (graphBuilder->AddFilter( _nullRenderer.get(), L"Sink" )!=S_OK){
if (_graphBuilder->AddFilter( _nullRenderer.get(), L"Sink" )!=S_OK){
ms_error("Error adding null renderer to filter graph" );
return -1;
}
ComPtr< IPin > nullIn = getPin( _nullRenderer.get(), PINDIR_INPUT, 0 );
if (graphBuilder->Connect( sourceOut.get(), grabberIn.get() )!=S_OK){
if (_graphBuilder->Connect( sourceOut.get(), grabberIn.get() )!=S_OK){
ms_error("Error connecting source to sample grabber" );
return -1;
}
if (graphBuilder->Connect( grabberOut.get(), nullIn.get() )!=S_OK){
if (_graphBuilder->Connect( grabberOut.get(), nullIn.get() )!=S_OK){
ms_error("Error connecting sample grabber to sink" );
return -1;
}
ms_message("Directshow graph is now ready to run.");
if (graphBuilder->QueryInterface( IID_IMediaControl,
if (_graphBuilder->QueryInterface( IID_IMediaControl,
(void **)&_mediaControl )!=S_OK){
ms_error("Error requesting media control interface" );
return -1;
}
if (graphBuilder->QueryInterface( IID_IMediaEvent,
if (_graphBuilder->QueryInterface( IID_IMediaEvent,
(void **)&_mediaEvent )!=S_OK){
ms_error("Error requesting event interface" );
return -1;
}
_ready=true;
return 0;
}
int DSCapture::startDshowGraph(){
......@@ -874,20 +875,31 @@ int DSCapture::startDshowGraph(){
return -1;
}
ms_message("Graph started");
return 0;
}
void DSCapture::stopAndClean(){
if (_mediaControl.get()!=NULL){
_mediaControl->Stop();
long evCode = 0;
_mediaEvent->WaitForCompletion( INFINITE, &evCode );
HRESULT r;
r=_mediaControl->Stop();
if (r!=S_OK){
ms_error("msdscap: Could not stop graph !");
fflush(NULL);
}
_graphBuilder->RemoveFilter(_source.get());
_graphBuilder->RemoveFilter(_grabberBase.get());
_graphBuilder->RemoveFilter(_nullRenderer.get());
}
_source.reset();
_grabberBase.reset();
_nullRenderer.reset();
_mediaControl.reset();
_mediaEvent.reset();
_graphBuilder.reset();
CoUninitialize();
ms_mutex_lock(&_mutex);
flushq(&_rq,0);
ms_mutex_unlock(&_mutex);
_ready=false;
}
......@@ -918,7 +930,6 @@ static void dscap_process(MSFilter * obj){
DSCapture *s=(DSCapture*)obj->data;
mblk_t *m;
uint32_t timestamp;
int cur_frame;
if (s->isTimeToSend(obj->ticker->time)){
mblk_t *om=NULL;
......@@ -1002,8 +1013,6 @@ static MSWebCamDesc ms_dshow_cam_desc={
};
static void ms_dshow_detect(MSWebCamManager *obj){
int i;
MSWebCam *cam;
ComPtr<IPropertyBag> pBag;
CoInitialize(NULL);
......@@ -1020,7 +1029,6 @@ static void ms_dshow_detect(MSWebCamManager *obj){
createDevEnum.reset();
enumMoniker->Reset();
int index = 0;
ULONG fetched = 0;
ComPtr< IMoniker > moniker;
for ( int i=0;enumMoniker->Next( 1, &moniker, &fetched )==S_OK;++i ) {
......
......@@ -752,6 +752,7 @@ static void video_out_process(MSFilter *f){
qvga_size.width=MS_VIDEO_SIZE_QVGA_W;
qvga_size.height=MS_VIDEO_SIZE_QVGA_H;
obj->prevsize=newsize;
ms_message("received size is %ix%i",newsize.width,newsize.height);
/*don't resize less than QVGA, it is too small*/
if (ms_video_size_greater_than(qvga_size,newsize)){
newsize.width=MS_VIDEO_SIZE_QVGA_W;
......
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