[Mt-daapd-cvs] SF.net SVN: mt-daapd: [1631] trunk
Status: Beta
Brought to you by:
andrew40
From: <rp...@us...> - 2007-08-10 00:48:36
|
Revision: 1631 http://mt-daapd.svn.sourceforge.net/mt-daapd/?rev=1631&view=rev Author: rpedde Date: 2007-08-09 17:48:31 -0700 (Thu, 09 Aug 2007) Log Message: ----------- win32 fixes for new plugin model Modified Paths: -------------- trunk/src/ff-plugins.h trunk/src/plugins/ssc-ffmpeg.c trunk/src/plugins/ssc-wma.cpp trunk/src/plugins/w32-event.c trunk/win32/mt-daapd.vcproj trunk/win32/out-daap/out-daap.vcproj trunk/win32/rsp.vcproj trunk/win32/ssc-ffmpeg.vcproj trunk/win32/ssc-wma/ssc-wma.vcproj trunk/win32/w32-event.vcproj Modified: trunk/src/ff-plugins.h =================================================================== --- trunk/src/ff-plugins.h 2007-08-09 07:10:35 UTC (rev 1630) +++ trunk/src/ff-plugins.h 2007-08-10 00:48:31 UTC (rev 1631) @@ -25,7 +25,11 @@ #include "ff-dbstruct.h" #ifdef WIN32 -# define EXPORT __declspec(dllimport) +# ifdef _WINDLL +# define EXPORT __declspec(dllimport) +# else +# define EXPORT __declspec(dllexport) +# endif #else # define EXPORT #endif @@ -129,10 +133,14 @@ void *priv; } DB_QUERY; +#ifdef __cplusplus +extern "C" { +#endif + /* webserver functions */ -extern EXPORT EXPORT char *pi_ws_uri(struct tag_ws_conninfo *); -extern EXPORT EXPORT void pi_ws_will_close(struct tag_ws_conninfo *); -extern EXPORT EXPORT int pi_ws_returnerror(struct tag_ws_conninfo *, int, char *); +extern EXPORT char *pi_ws_uri(struct tag_ws_conninfo *); +extern EXPORT void pi_ws_will_close(struct tag_ws_conninfo *); +extern EXPORT int pi_ws_returnerror(struct tag_ws_conninfo *, int, char *); extern EXPORT char *pi_ws_getvar(struct tag_ws_conninfo *, char *); extern EXPORT int pi_ws_writefd(struct tag_ws_conninfo *, char *, ...); extern EXPORT int pi_ws_addresponseheader(struct tag_ws_conninfo *, char *, char *, ...); @@ -173,5 +181,8 @@ extern EXPORT void pi_config_set_status(struct tag_ws_conninfo *pwsc, int session, char *fmt, ...); +#ifdef __cplusplus +} +#endif #endif /* _FF_PLUGINS_ */ Modified: trunk/src/plugins/ssc-ffmpeg.c =================================================================== --- trunk/src/plugins/ssc-ffmpeg.c 2007-08-09 07:10:35 UTC (rev 1630) +++ trunk/src/plugins/ssc-ffmpeg.c 2007-08-10 00:48:31 UTC (rev 1631) @@ -110,8 +110,6 @@ int ssc_ffmpeg_read(void *pv, char *buffer, int len); char *ssc_ffmpeg_error(void *pv); -PLUGIN_INFO *plugin_info(PLUGIN_INPUT_FN*); - /* Globals */ PLUGIN_TRANSCODE_FN _ptfn = { ssc_ffmpeg_init, @@ -122,8 +120,6 @@ ssc_ffmpeg_error }; -PLUGIN_INPUT_FN *_ppi; - PLUGIN_INFO _pi = { PLUGIN_VERSION, /* version */ PLUGIN_TRANSCODE, /* type */ @@ -141,8 +137,7 @@ return ssc_ffmpeg_errors[handle->errnum]; } -PLUGIN_INFO *plugin_info(PLUGIN_INPUT_FN *ppi) { - _ppi = ppi; +PLUGIN_INFO *plugin_info(void) { av_register_all(); return &_pi; Modified: trunk/src/plugins/ssc-wma.cpp =================================================================== --- trunk/src/plugins/ssc-wma.cpp 2007-08-09 07:10:35 UTC (rev 1630) +++ trunk/src/plugins/ssc-wma.cpp 2007-08-10 00:48:31 UTC (rev 1631) @@ -73,8 +73,6 @@ int ssc_wma_read(void *pv, char *buffer, int len); char *ssc_wma_error(void *pv); -PLUGIN_INFO *plugin_info(PLUGIN_INPUT_FN*); - /* Globals */ PLUGIN_TRANSCODE_FN _ptfn = { ssc_wma_init, @@ -85,8 +83,6 @@ ssc_wma_error }; -PLUGIN_INPUT_FN *_ppi; - PLUGIN_INFO _pi = { PLUGIN_VERSION, /* version */ PLUGIN_TRANSCODE, /* type */ @@ -107,8 +103,7 @@ return _ssc_wma_errors[handle->errnum]; } -PLUGIN_INFO *plugin_info(PLUGIN_INPUT_FN *ppi) { - _ppi = ppi; +PLUGIN_INFO *plugin_info(void) { return &_pi; } @@ -118,7 +113,7 @@ hr = CoInitializeEx(NULL,COINIT_MULTITHREADED); if(FAILED(hr)) { - _ppi->log(E_INF,"Could not initialize COM, Error code: 0x%08X\n",hr); + pi_log(E_INF,"Could not initialize COM, Error code: 0x%08X\n",hr); return NULL; } @@ -164,7 +159,7 @@ hr = WMCreateSyncReader(NULL,0,&handle->pReader); if(FAILED(hr)) { - _ppi->log(E_INF,"Could not create WMA reader. Error code: 0x%08X\n",hr); + pi_log(E_INF,"Could not create WMA reader. Error code: 0x%08X\n",hr); handle->errnum = SSC_WMA_E_NOREADER; return FALSE; } @@ -174,20 +169,20 @@ hr = handle->pReader->Open(fname); if(FAILED(hr)) { - _ppi->log(E_INF,"Could not open file. Error code: 0x%08X\n",hr); + pi_log(E_INF,"Could not open file. Error code: 0x%08X\n",hr); return FALSE; } handle->state=STATE_OPEN; hr = handle->pReader->SetRange(0,0); if(FAILED(hr)) { - _ppi->log(E_INF,"Could not set range. Error code: 0x%08X\n",hr); + pi_log(E_INF,"Could not set range. Error code: 0x%08X\n",hr); return FALSE; } hr = handle->pReader->SetReadStreamSamples(1,0); if(FAILED(hr)) { - _ppi->log(E_INF,"Could not stream samples. Error code: 0x%08X\n",hr); + pi_log(E_INF,"Could not stream samples. Error code: 0x%08X\n",hr); return FALSE; } @@ -198,19 +193,19 @@ IWMOutputMediaProps *pprops; hr = handle->pReader->GetOutputFormat(0,0,&pprops); if(FAILED(hr)) { - _ppi->log(E_LOG,"Could not get output format for %s\n",file); + pi_log(E_LOG,"Could not get output format for %s\n",file); return TRUE; /* we'll assume 44100/16/2 */ } hr = pprops->GetMediaType(NULL,&byte_count); if(FAILED(hr)) { - _ppi->log(E_LOG,"Could not get media type for %s\n",file); + pi_log(E_LOG,"Could not get media type for %s\n",file); return TRUE; } WM_MEDIA_TYPE *ptype = (WM_MEDIA_TYPE*)calloc(byte_count,1); if(!ptype) { - _ppi->log(E_FATAL,"ssc_wma_open: malloc\n"); + pi_log(E_FATAL,"ssc_wma_open: malloc\n"); } hr = pprops->GetMediaType(ptype, &byte_count); @@ -280,9 +275,9 @@ byte_rate = sample_rate * channels * bits_per_sample / 8; block_align = channels * bits_per_sample / 8; - _ppi->log(E_DBG,"Channels.......: %d\n",channels); - _ppi->log(E_DBG,"Sample rate....: %d\n",sample_rate); - _ppi->log(E_DBG,"Bits/Sample....: %d\n",bits_per_sample); + pi_log(E_DBG,"Channels.......: %d\n",channels); + pi_log(E_DBG,"Sample rate....: %d\n",sample_rate); + pi_log(E_DBG,"Bits/Sample....: %d\n",bits_per_sample); memcpy(&handle->wav_header[0],"RIFF",4); *((unsigned int*)(&handle->wav_header[4])) = 36 + sample_len; @@ -332,12 +327,12 @@ if(SUCCEEDED(hr)) { hr = handle->pBuffer->GetBufferAndLength(&handle->pdata, &handle->data_len); if(FAILED(hr)) { - _ppi->log(E_LOG,"Read error while transcoding file\n"); + pi_log(E_LOG,"Read error while transcoding file\n"); handle->errnum = SSC_WMA_E_READ; return -1; } -// _ppi->log(E_SPAM,"Read %d bytes\n",handle->data_len); +// pi_log(E_SPAM,"Read %d bytes\n",handle->data_len); bytes_returned = handle->data_len; if(bytes_returned > len) Modified: trunk/src/plugins/w32-event.c =================================================================== --- trunk/src/plugins/w32-event.c 2007-08-09 07:10:35 UTC (rev 1630) +++ trunk/src/plugins/w32-event.c 2007-08-10 00:48:31 UTC (rev 1631) @@ -6,14 +6,12 @@ #include "ff-plugins.h" /* Forwards */ -PLUGIN_INFO *plugin_info(PLUGIN_INPUT_FN *ppi); void plugin_handler(int, int, void *, int); #define PIPE_BUFFER_SIZE 4096 /* Globals */ PLUGIN_EVENT_FN _pefn = { plugin_handler }; -PLUGIN_INPUT_FN *_ppi; PLUGIN_INFO _pi = { PLUGIN_VERSION, /* version */ @@ -34,8 +32,7 @@ } PLUGIN_MSG; -PLUGIN_INFO *plugin_info(PLUGIN_INPUT_FN *ppi) { - _ppi = ppi; +PLUGIN_INFO *plugin_info(void) { return &_pi; } Modified: trunk/win32/mt-daapd.vcproj =================================================================== --- trunk/win32/mt-daapd.vcproj 2007-08-09 07:10:35 UTC (rev 1630) +++ trunk/win32/mt-daapd.vcproj 2007-08-10 00:48:31 UTC (rev 1631) @@ -71,6 +71,7 @@ GenerateDebugInformation="true" ProgramDatabaseFile="$(OutDir)/mt-daapd.pdb" SubSystem="1" + ImportLibrary="firefly.lib" TargetMachine="1" /> <Tool @@ -152,6 +153,7 @@ SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" + ImportLibrary="firefly.lib" TargetMachine="1" /> <Tool @@ -229,6 +231,10 @@ > </File> <File + RelativePath="..\src\ff-plugins.c" + > + </File> + <File RelativePath="..\src\getopt.c" > </File> Modified: trunk/win32/out-daap/out-daap.vcproj =================================================================== --- trunk/win32/out-daap/out-daap.vcproj 2007-08-09 07:10:35 UTC (rev 1630) +++ trunk/win32/out-daap/out-daap.vcproj 2007-08-10 00:48:31 UTC (rev 1631) @@ -42,7 +42,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..;..\..\src" - PreprocessorDefinitions="HAVE_CONFIG_H" + PreprocessorDefinitions="HAVE_CONFIG_H;WIN32" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="1" @@ -62,6 +62,7 @@ /> <Tool Name="VCLinkerTool" + AdditionalDependencies="firefly.lib" OutputFile="$(OutDir)/out-daap.dll" LinkIncremental="2" ModuleDefinitionFile="out-daap.def" @@ -122,7 +123,7 @@ <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="..;..\..\src" - PreprocessorDefinitions="HAVE_CONFIG_H" + PreprocessorDefinitions="HAVE_CONFIG_H;WIN32" RuntimeLibrary="2" UsePrecompiledHeader="0" WarningLevel="3" @@ -140,6 +141,7 @@ /> <Tool Name="VCLinkerTool" + AdditionalDependencies="..\firefly.lib" OutputFile="$(OutDir)/out-daap.dll" LinkIncremental="1" ModuleDefinitionFile="out-daap.def" @@ -231,6 +233,10 @@ > </File> </Filter> + <File + RelativePath="..\firefly.lib" + > + </File> </Files> <Globals> </Globals> Modified: trunk/win32/rsp.vcproj =================================================================== --- trunk/win32/rsp.vcproj 2007-08-09 07:10:35 UTC (rev 1630) +++ trunk/win32/rsp.vcproj 2007-08-10 00:48:31 UTC (rev 1631) @@ -4,6 +4,7 @@ Version="8.00" Name="rsp" ProjectGUID="{68CCEA19-503F-4894-8AE3-B1673FDEA920}" + RootNamespace="rsp" Keyword="Win32Proj" > <Platforms> @@ -41,7 +42,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\win32;.;..\src" - PreprocessorDefinitions="_WIN32;HAVE_CONFIG_H;ZLIB_DLL" + PreprocessorDefinitions="_WIN32;HAVE_CONFIG_H;ZLIB_DLL;WIN32;PLUGIN" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -61,7 +62,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="zdll.lib" + AdditionalDependencies="zdll.lib firefly.lib" OutputFile="$(OutDir)/rsp.dll" LinkIncremental="2" IgnoreAllDefaultLibraries="false" @@ -123,7 +124,7 @@ <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="..\win32;.;..\src" - PreprocessorDefinitions="_WIN32;HAVE_CONFIG_H;ZLIB_DLL" + PreprocessorDefinitions="_WIN32;HAVE_CONFIG_H;ZLIB_DLL;WIN32;PLUGIN" RuntimeLibrary="2" UsePrecompiledHeader="0" WarningLevel="3" @@ -141,7 +142,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="zdll.lib" + AdditionalDependencies="zdll.lib firefly.lib" OutputFile="$(OutDir)/rsp.dll" LinkIncremental="1" IgnoreAllDefaultLibraries="false" Modified: trunk/win32/ssc-ffmpeg.vcproj =================================================================== --- trunk/win32/ssc-ffmpeg.vcproj 2007-08-09 07:10:35 UTC (rev 1630) +++ trunk/win32/ssc-ffmpeg.vcproj 2007-08-10 00:48:31 UTC (rev 1631) @@ -4,6 +4,7 @@ Version="8.00" Name="ssc-ffmpeg" ProjectGUID="{DA27D6F4-7E9F-40CA-AC5C-480DC81A1C56}" + RootNamespace="ssc-ffmpeg" Keyword="Win32Proj" > <Platforms> @@ -41,7 +42,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\win32;.;..\src" - PreprocessorDefinitions="HAVE_CONFIG_H;_WIN32" + PreprocessorDefinitions="HAVE_CONFIG_H;_WIN32;WIN32" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="1" @@ -61,7 +62,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="avcodec.lib avformat.lib avutil.lib" + AdditionalDependencies="avcodec.lib avformat.lib avutil.lib firefly.lib" OutputFile="$(OutDir)/ssc-ffmpeg.dll" LinkIncremental="2" ModuleDefinitionFile="ssc-ffmpeg.def" @@ -122,7 +123,7 @@ <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="..\win32;.;..\src" - PreprocessorDefinitions="HAVE_CONFIG_H;_WIN32" + PreprocessorDefinitions="HAVE_CONFIG_H;_WIN32;WIN32" RuntimeLibrary="0" UsePrecompiledHeader="0" WarningLevel="3" @@ -140,7 +141,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="avcodec.lib avformat.lib avutil.lib" + AdditionalDependencies="avcodec.lib avformat.lib avutil.lib firefly.lib" OutputFile="$(OutDir)/ssc-ffmpeg.dll" LinkIncremental="1" ModuleDefinitionFile="ssc-ffmpeg.def" Modified: trunk/win32/ssc-wma/ssc-wma.vcproj =================================================================== --- trunk/win32/ssc-wma/ssc-wma.vcproj 2007-08-09 07:10:35 UTC (rev 1630) +++ trunk/win32/ssc-wma/ssc-wma.vcproj 2007-08-10 00:48:31 UTC (rev 1631) @@ -4,6 +4,7 @@ Version="8.00" Name="ssc-wma" ProjectGUID="{C1EF5133-DFB3-4FEC-B999-3655DBB14785}" + RootNamespace="ssc-wma" Keyword="Win32Proj" > <Platforms> @@ -41,7 +42,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..;..\..\src" - PreprocessorDefinitions="HAVE_CONFIG_H" + PreprocessorDefinitions="HAVE_CONFIG_H;WIN32" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="1" @@ -61,7 +62,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="wmvcore.lib" + AdditionalDependencies="wmvcore.lib ..\firefly.lib" OutputFile="$(OutDir)/ssc-wma.dll" LinkIncremental="2" ModuleDefinitionFile="ssc-wma.def" @@ -122,7 +123,7 @@ <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="..;..\..\src" - PreprocessorDefinitions="HAVE_CONFIG_H" + PreprocessorDefinitions="HAVE_CONFIG_H;WIN32" RuntimeLibrary="0" UsePrecompiledHeader="0" WarningLevel="3" @@ -140,7 +141,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="wmvcore.lib" + AdditionalDependencies="wmvcore.lib ..\firefly.lib" OutputFile="$(OutDir)/ssc-wma.dll" LinkIncremental="1" ModuleDefinitionFile="ssc-wma.def" Modified: trunk/win32/w32-event.vcproj =================================================================== --- trunk/win32/w32-event.vcproj 2007-08-09 07:10:35 UTC (rev 1630) +++ trunk/win32/w32-event.vcproj 2007-08-10 00:48:31 UTC (rev 1631) @@ -42,7 +42,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\win32;.;..\src" - PreprocessorDefinitions="HAVE_CONFIG_H;_WIN32" + PreprocessorDefinitions="HAVE_CONFIG_H;_WIN32;WIN32" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="1" @@ -62,7 +62,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="wsock32.lib" + AdditionalDependencies="wsock32.lib firefly.lib" OutputFile="$(OutDir)/w32-event.dll" LinkIncremental="2" ModuleDefinitionFile="w32-event.def" @@ -123,7 +123,7 @@ <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="..\win32;.;..\src" - PreprocessorDefinitions="HAVE_CONFIG_H;_WIN32" + PreprocessorDefinitions="HAVE_CONFIG_H;_WIN32;WIN32" RuntimeLibrary="0" UsePrecompiledHeader="0" WarningLevel="3" @@ -141,7 +141,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="wsock32.lib" + AdditionalDependencies="wsock32.lib firefly.lib" OutputFile="$(OutDir)/w32-event.dll" LinkIncremental="1" ModuleDefinitionFile="w32-event.def" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |