Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow filters to be build as unicode

  • Loading branch information...
commit e16a8e18691dae1eb8141a3db9a7d94feff2aa19 1 parent a3cde5e
@tourettes tourettes authored
Showing with 227 additions and 194 deletions.
  1. +4 −4 DirectShowFilters/BDReader/BDReader.vcxproj
  2. +2 −2 DirectShowFilters/BDReader/source/BDReader.cpp
  3. +8 −6 DirectShowFilters/BDReader/source/LibBlurayWrapper.cpp
  4. +10 −8 DirectShowFilters/BDReader/source/utils.cpp
  5. +4 −4 DirectShowFilters/DVBSubtitle3/DVBSubtitle3.vcxproj
  6. +1 −1  DirectShowFilters/DVBSubtitle3/Source/DVBSub.cpp
  7. +5 −5 DirectShowFilters/DVBSubtitle3/Source/dllmain.cpp
  8. +2 −2 DirectShowFilters/DvbCoreUtils/DvbCoreUtils.vcxproj
  9. +2 −2 DirectShowFilters/LiveMedia555/LiveMedia555.vcxproj
  10. +1 −1  DirectShowFilters/MPAudioRenderer/AE_mixer/StdString.h
  11. +4 −4 DirectShowFilters/MPAudioRenderer/AudioRenderer.vcxproj
  12. +26 −18 DirectShowFilters/MPAudioRenderer/source/Settings.cpp
  13. +15 −15 DirectShowFilters/MPAudioRenderer/source/SettingsProp.cpp
  14. +1 −1  DirectShowFilters/MPAudioRenderer/source/WASAPIRenderFilter.cpp
  15. +16 −13 DirectShowFilters/MPAudioRenderer/source/dllmain.cpp
  16. +4 −4 DirectShowFilters/MPIPTVSource/MPIPTVSource.vcxproj
  17. +17 −10 DirectShowFilters/MPIPTVSource/source/mpiptvsource.cpp
  18. +3 −3 DirectShowFilters/MPIPTVSource/source/mpiptvsource.h
  19. +4 −4 DirectShowFilters/MPWriter/MPWriter.vcxproj
  20. +2 −1  DirectShowFilters/MPWriter/source/MPFileWriter.cpp
  21. +2 −1  DirectShowFilters/MPWriter/source/MemoryBuffer.cpp
  22. +7 −7 DirectShowFilters/MPWriter/source/MultiFileWriter.cpp
  23. +4 −4 DirectShowFilters/StreamingServer/StreamingServer.vcxproj
  24. +4 −4 DirectShowFilters/TsMuxer/TsMuxer.vcxproj
  25. +2 −1  DirectShowFilters/TsMuxer/source/MemoryBuffer.cpp
  26. +4 −3 DirectShowFilters/TsMuxer/source/TsMuxer.cpp
  27. +9 −9 DirectShowFilters/TsReader/source/TsReader.cpp
  28. +2 −2 DirectShowFilters/TsWriter/MPTSWriter.vcxproj
  29. +6 −2 DirectShowFilters/TsWriter/source/MHWDecoder.cpp
  30. +1 −1  DirectShowFilters/TsWriter/source/MultiFileWriter.cpp
  31. +3 −3 DirectShowFilters/shared/DebugSettings.h
  32. +2 −2 mediaportal/Core.cpp/DXUtil/DXUtil.vcxproj
  33. +4 −4 mediaportal/Core.cpp/DirectShowHelper/dshowhelper.vcxproj
  34. +1 −1  mediaportal/Core.cpp/DirectShowHelper/source/GrabBitmaps.cpp
  35. +10 −10 mediaportal/Core.cpp/DirectShowHelper/source/StatsRenderer.cpp
  36. +18 −18 mediaportal/Core.cpp/DirectShowHelper/source/dshowhelper.cpp
  37. +4 −4 mediaportal/Core.cpp/Win7RefreshRateHelper/Win7RefreshRateHelper.vcxproj
  38. +4 −4 mediaportal/Core.cpp/fontEngine/fontEngine.vcxproj
  39. +8 −6 mediaportal/Core.cpp/fontEngine/source/fontEngine.cpp
  40. +1 −0  mediaportal/Core.cpp/fontEngine/source/stdafx.h
View
8 DirectShowFilters/BDReader/BDReader.vcxproj
@@ -19,13 +19,13 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>Dynamic</UseOfMfc>
<UseOfAtl>Static</UseOfAtl>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>Dynamic</UseOfMfc>
<UseOfAtl>Dynamic</UseOfAtl>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -101,7 +101,7 @@
<ShowProgress>NotSet</ShowProgress>
<OutputFile>bin\Release/BDReader.ax</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
- <AdditionalLibraryDirectories>$(DSHOW_BASE)Release_MBCS; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib; ..\shared;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(DSHOW_BASE)Release; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib; ..\shared;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<IgnoreSpecificDefaultLibraries>libcmt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<ModuleDefinitionFile>.\source\BDReader.def</ModuleDefinitionFile>
@@ -152,7 +152,7 @@
<AdditionalDependencies>DvbCoreUtilsD.lib;strmbasd.lib;quartz.lib;winmm.lib;msvcrtd.lib;ws2_32.lib;mfuuid.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>bin\Debug/BDReader.ax</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
- <AdditionalLibraryDirectories>$(DSHOW_BASE)Debug_MBCS; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib;..\shared;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(DSHOW_BASE)Debug; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib;..\shared;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<IgnoreSpecificDefaultLibraries>libcmtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<ModuleDefinitionFile>.\source\BDReader.def</ModuleDefinitionFile>
View
4 DirectShowFilters/BDReader/source/BDReader.cpp
@@ -40,8 +40,8 @@
#include "..\..\alloctracing.h"
extern void SetThreadName(DWORD dwThreadID, char* threadName);
-extern void LogDebug(const char *fmt, ...);
-extern void GetLogFile(char *pLog);
+extern void LogDebug(const char* fmt, ...);
+extern void GetLogFile(TCHAR* pLog);
const AMOVIESETUP_MEDIATYPE acceptAudioPinTypes =
{
View
14 DirectShowFilters/BDReader/source/LibBlurayWrapper.cpp
@@ -122,21 +122,23 @@ void CLibBlurayWrapper::StaticOverlayProc(void *this_gen, const BD_OVERLAY * con
bool CLibBlurayWrapper::Initialize()
{
- TCHAR szDirectory[MAX_PATH] = "";
- TCHAR szPath[MAX_PATH] = "";
+ USES_CONVERSION;
+
+ TCHAR szDirectory[MAX_PATH] = _T("");
+ TCHAR szPath[MAX_PATH] = _T("");
GetModuleFileName(NULL, szPath, sizeof(szPath) - 1);
- strncpy(szDirectory, szPath, strrchr(szPath, '\\') - szPath);
- szDirectory[strlen(szDirectory)] = '\0';
+ _tcsncpy(szDirectory, szPath, _tcsrchr(szPath, '\\') - szPath);
+ szDirectory[_tcslen(szDirectory)] = '\0';
- wsprintf(szDirectory,"%s\\bluray.dll", szDirectory);
+ _stprintf_s(szDirectory, _T("%s\\bluray.dll"), szDirectory);
LogDebug("CLibBlurayWrapper - Load bluray: %s", szDirectory);
m_hDLL = LoadLibrary(szDirectory);
if (!m_hDLL)
{
LogDebug("Failed to load the DLL from application exe path, trying c:\\");
- m_hDLL = LoadLibrary("c:\\bluray.dll");
+ m_hDLL = LoadLibrary(_T("c:\\bluray.dll"));
}
if (!m_hDLL)
View
18 DirectShowFilters/BDReader/source/utils.cpp
@@ -5,26 +5,28 @@
#include <streams.h>
#include <initguid.h>
#include <shlobj.h>
-#include <tchar.h>
// For more details for memory leak detection see the alloctracing.h header
#include "..\..\alloctracing.h"
-static char logFile[MAX_PATH];
+static TCHAR logFile[MAX_PATH];
static WORD logFileParsed = -1;
-void GetLogFile(char *pLog)
+void GetLogFile(TCHAR* pLog)
{
SYSTEMTIME systemTime;
GetLocalTime(&systemTime);
- if(logFileParsed != systemTime.wDay)
+ if (logFileParsed != systemTime.wDay)
{
TCHAR folder[MAX_PATH];
::SHGetSpecialFolderPath(NULL,folder,CSIDL_COMMON_APPDATA,FALSE);
- sprintf(logFile,"%s\\Team MediaPortal\\MediaPortal\\Log\\BDReader-%04.4d-%02.2d-%02.2d.Log",folder, systemTime.wYear, systemTime.wMonth, systemTime.wDay);
+
+ _stprintf_s(logFile, _T("%s\\Team MediaPortal\\MediaPortal\\Log\\BDReader-%04.4d-%02.2d-%02.2d.Log"),
+ folder, systemTime.wYear, systemTime.wMonth, systemTime.wDay);
+
logFileParsed=systemTime.wDay; // rec
}
- strcpy(pLog, &logFile[0]);
+ _tcscpy(pLog, &logFile[0]);
}
void LogDebug(const char *fmt, ...)
@@ -43,9 +45,9 @@ void LogDebug(const char *fmt, ...)
//#ifdef DONTLOG
TCHAR filename[1024];
GetLogFile(filename);
- FILE* fp = fopen(filename,"a+");
+ FILE* fp = _tfopen(filename, _T("a+"));
- if (fp != NULL)
+ if (fp)
{
fprintf(fp,"%02.2d-%02.2d-%04.4d %02.2d:%02.2d:%02.2d.%03.3d [%5x]%s\n",
systemTime.wDay, systemTime.wMonth, systemTime.wYear,
View
8 DirectShowFilters/DVBSubtitle3/DVBSubtitle3.vcxproj
@@ -24,13 +24,13 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<UseOfAtl>Static</UseOfAtl>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<UseOfAtl>false</UseOfAtl>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -107,7 +107,7 @@
<AdditionalDependencies>strmbase.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>bin\Release/DVBSub3.ax</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
- <AdditionalLibraryDirectories>$(DSHOW_BASE)Release_MBCS; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\libSource\Hdmv\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(DSHOW_BASE)Release; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\libSource\Hdmv\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<IgnoreSpecificDefaultLibraries>uafxcwd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<ModuleDefinitionFile>.\source\DVBSub3.def</ModuleDefinitionFile>
@@ -159,7 +159,7 @@
<AdditionalDependencies>strmbasd.lib;winmm.lib;gdiplus.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>bin\Debug/DVBSub3.ax</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
- <AdditionalLibraryDirectories>$(DSHOW_BASE)Debug_MBCS; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib;Source\Hdmv\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(DSHOW_BASE)Debug; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib;Source\Hdmv\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<IgnoreSpecificDefaultLibraries>uafxcwd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<ModuleDefinitionFile>.\source\DVBSub3.def</ModuleDefinitionFile>
View
2  DirectShowFilters/DVBSubtitle3/Source/DVBSub.cpp
@@ -33,7 +33,7 @@
extern void LogDebug( const char *fmt, ... );
extern void LogDebugPTS( const char *fmt, uint64_t pts );
-extern void GetLogFile(char *pLog);
+extern void GetLogFile(TCHAR* pLog);
//
// Constructor
View
10 DirectShowFilters/DVBSubtitle3/Source/dllmain.cpp
@@ -106,12 +106,12 @@ BOOL APIENTRY DllMain(HANDLE hModule,
// Logging
//#ifdef DEBUG
-char *logbuffer=NULL;
-void GetLogFile(char *pLog)
+char* logbuffer = NULL;
+void GetLogFile(TCHAR* pLog)
{
TCHAR folder[MAX_PATH];
::SHGetSpecialFolderPath(NULL,folder,CSIDL_COMMON_APPDATA,FALSE);
- sprintf(pLog,"%s\\Team MediaPortal\\MediaPortal\\Log\\DVBSubs.log",folder);
+ _stprintf(pLog, _T("%s\\Team MediaPortal\\MediaPortal\\Log\\DVBSubs.log"), folder);
}
@@ -131,9 +131,9 @@ void LogDebug(const char *fmt, ...)
//#ifdef DONTLOG
TCHAR filename[1024];
GetLogFile(filename);
- FILE* fp = fopen(filename,"a+");
+ FILE* fp = _tfopen(filename, _T("a+"));
- if (fp!=NULL)
+ if (fp)
{
fprintf(fp,"%02.2d-%02.2d-%04.4d %02.2d:%02.2d:%02.2d.%03.3d [%x]%s\n",
systemTime.wDay, systemTime.wMonth, systemTime.wYear,
View
4 DirectShowFilters/DvbCoreUtils/DvbCoreUtils.vcxproj
@@ -19,12 +19,12 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>false</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
View
4 DirectShowFilters/LiveMedia555/LiveMedia555.vcxproj
@@ -18,12 +18,12 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>false</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
View
2  DirectShowFilters/MPAudioRenderer/AE_mixer/StdString.h
@@ -4105,7 +4105,7 @@ struct FmtArg<std::wstring>
#ifdef _MFC_VER
inline CArchive& AFXAPI operator<<(CArchive& ar, const CStdStringA& strA)
{
- CString strTemp = strA;
+ CStdStringA strTemp = strA;
return ar << strTemp;
}
/*
View
8 DirectShowFilters/MPAudioRenderer/AudioRenderer.vcxproj
@@ -20,13 +20,13 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>Dynamic</UseOfMfc>
<UseOfAtl>false</UseOfAtl>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>Dynamic</UseOfMfc>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -66,7 +66,7 @@
<AdditionalDependencies>strmbasd.lib;Winmm.lib;dsound.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ShowProgress>LinkVerboseLib</ShowProgress>
<OutputFile>bin\Debug/mpaudiorenderer.ax</OutputFile>
- <AdditionalLibraryDirectories>$(DSHOW_BASE)Debug_MBCS; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(DSHOW_BASE)Debug; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<IgnoreSpecificDefaultLibraries>libcmtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<ModuleDefinitionFile>.\source\MpAudioRenderer.def</ModuleDefinitionFile>
@@ -103,7 +103,7 @@
<AdditionalDependencies>strmbase.lib;Winmm.lib;dsound.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ShowProgress>LinkVerboseLib</ShowProgress>
<OutputFile>bin\Release/mpaudiorenderer.ax</OutputFile>
- <AdditionalLibraryDirectories>$(DSHOW_BASE)Release_MBCS; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(DSHOW_BASE)Release; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>libcmt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<ModuleDefinitionFile>.\source\MpAudioRenderer.def</ModuleDefinitionFile>
<GenerateDebugInformation>false</GenerateDebugInformation>
View
44 DirectShowFilters/MPAudioRenderer/source/Settings.cpp
@@ -138,8 +138,6 @@ AudioRendererSettings::~AudioRendererSettings()
void AudioRendererSettings::LoadSettingsFromRegistry()
{
- USES_CONVERSION; // this is required for T2W macro
-
Log("Loading settings from registry");
HKEY hKey;
@@ -367,13 +365,15 @@ void AudioRendererSettings::LoadSettingsFromRegistry()
delete[] m_wWASAPIPreferredDeviceId;
m_wWASAPIPreferredDeviceId = new WCHAR[MAX_REG_LENGTH];
- wcsncpy(m_wWASAPIPreferredDeviceId, T2W(WASAPIPreferredDeviceData), MAX_REG_LENGTH);
+ _tcsncpy(m_wWASAPIPreferredDeviceId, WASAPIPreferredDeviceData, MAX_REG_LENGTH);
delete[] WASAPIPreferredDeviceData;
}
else // no settings in registry, create default values
{
- Log("Failed to open %s", folder);
+ USES_CONVERSION;
+
+ Log("Failed to open %s", T2A(folder));
Log("Initializing registry with default settings");
LONG result = RegCreateKeyEx(HKEY_CURRENT_USER, folder, 0, NULL, REG_OPTION_NON_VOLATILE,
@@ -411,7 +411,7 @@ void AudioRendererSettings::LoadSettingsFromRegistry()
delete[] m_wWASAPIPreferredDeviceId;
m_wWASAPIPreferredDeviceId = new WCHAR[MAX_REG_LENGTH];
- wcsncpy(m_wWASAPIPreferredDeviceId, T2W(WASAPIPreferredDeviceData), MAX_REG_LENGTH);
+ _tcsncpy(m_wWASAPIPreferredDeviceId, WASAPIPreferredDeviceData, MAX_REG_LENGTH);
WriteRegistryKeyString(hKey, WASAPIPreferredDevice, WASAPIPreferredDeviceData);
}
@@ -494,6 +494,8 @@ void AudioRendererSettings::SaveSettingsToRegistry(HKEY hKey)
void AudioRendererSettings::ReadRegistryKeyDword(HKEY hKey, LPCTSTR& lpSubKey, DWORD& data)
{
+ USES_CONVERSION;
+
DWORD dwSize = sizeof(DWORD);
DWORD dwType = REG_DWORD;
LONG error = RegQueryValueEx(hKey, lpSubKey, NULL, &dwType, (PBYTE)&data, &dwSize);
@@ -501,26 +503,30 @@ void AudioRendererSettings::ReadRegistryKeyDword(HKEY hKey, LPCTSTR& lpSubKey, D
{
if (error == ERROR_FILE_NOT_FOUND)
{
- Log(" create default value for %s", lpSubKey);
+ Log(" create default value for %s", T2A(lpSubKey));
WriteRegistryKeyDword(hKey, lpSubKey, data);
}
else
- Log(" faíled to create default value for %s", lpSubKey);
+ Log(" faíled to create default value for %s", T2A(lpSubKey));
}
}
void AudioRendererSettings::WriteRegistryKeyDword(HKEY hKey, LPCTSTR& lpSubKey, DWORD& data)
-{
+{
+ USES_CONVERSION;
+
DWORD dwSize = sizeof(DWORD);
LONG result = RegSetValueEx(hKey, lpSubKey, 0, REG_DWORD, (LPBYTE)&data, dwSize);
if (result == ERROR_SUCCESS)
- Log("Success writing to Registry: %s", lpSubKey);
+ Log("Success writing to Registry: %s", T2A(lpSubKey));
else
- Log("Error writing to Registry - subkey: %s error: %d", lpSubKey, result);
+ Log("Error writing to Registry - subkey: %s error: %d", T2A(lpSubKey), result);
}
void AudioRendererSettings::ReadRegistryKeyString(HKEY hKey, LPCTSTR& lpSubKey, LPCTSTR& data)
{
+ USES_CONVERSION;
+
DWORD dwSize = MAX_REG_LENGTH;
DWORD dwType = REG_SZ;
LONG error = RegQueryValueEx(hKey, lpSubKey, NULL, &dwType, (PBYTE)data, &dwSize);
@@ -529,23 +535,25 @@ void AudioRendererSettings::ReadRegistryKeyString(HKEY hKey, LPCTSTR& lpSubKey,
{
if (error == ERROR_FILE_NOT_FOUND)
{
- Log(" create default value for %s", lpSubKey);
+ Log(" create default value for %s", T2A(lpSubKey));
WriteRegistryKeyString(hKey, lpSubKey, data);
}
else if (error == ERROR_MORE_DATA)
- Log(" too much data, corrupted registry setting(?): %s", lpSubKey);
+ Log(" too much data, corrupted registry setting(?): %s", T2A(lpSubKey));
else
- Log(" error: %d subkey: %s", error, lpSubKey);
+ Log(" error: %d subkey: %s", error, T2A(lpSubKey));
}
}
void AudioRendererSettings::WriteRegistryKeyString(HKEY hKey, LPCTSTR& lpSubKey, LPCTSTR& data)
{
- LONG result = RegSetValueEx(hKey, lpSubKey, 0, REG_SZ, (LPBYTE)data, strlen(data)+1);
+ USES_CONVERSION;
+
+ LONG result = RegSetValueEx(hKey, lpSubKey, 0, REG_SZ, (LPBYTE)data, _tcslen(data) * sizeof(TCHAR));
if (result == ERROR_SUCCESS)
- Log("Success writing to Registry: %s", lpSubKey);
+ Log("Success writing to Registry: %s", T2A(lpSubKey));
else
- Log("Error writing to Registry - subkey: %s error: %d", lpSubKey, result);
+ Log("Error writing to Registry - subkey: %s error: %d", T2A(lpSubKey), result);
}
bool AudioRendererSettings::AllowedValue(unsigned int allowedRates[], unsigned int size, unsigned int rate)
@@ -747,8 +755,8 @@ HRESULT AudioRendererSettings::GetAvailableAudioDevices(IMMDeviceCollection** pp
{
if (hDialog)
{
- LPSTR defaultDevice = "<OS default audio device>";
- SendDlgItemMessage(hDialog, IDC_AUDIO_DEVICE, CB_ADDSTRING, 0, (LPARAM)defaultDevice);
+ TCHAR* pDefaultDevice = _T("<OS default audio device>");
+ SendDlgItemMessage(hDialog, IDC_AUDIO_DEVICE, CB_ADDSTRING, 0, (LPARAM)pDefaultDevice);
SendDlgItemMessage(hDialog, IDC_AUDIO_DEVICE, CB_SETCURSEL, 0, 0);
}
View
30 DirectShowFilters/MPAudioRenderer/source/SettingsProp.cpp
@@ -90,11 +90,11 @@ HRESULT CSettingsProp::OnActivate()
// Expand mono to stereo
SendDlgItemMessage(m_Dlg, IDC_EXPAND_MONO, BM_SETCHECK, m_pSettings->GetExpandMonoToStereo() , 0);
- CHAR settingString[256] = "";
+ TCHAR settingString[512] = _T("");
- CHAR stringAuto[] = "Auto";
- CHAR stringDisabled[] = "Disabled";
- CHAR stringForced[] = "Forced";
+ TCHAR stringAuto[] = _T("Auto");
+ TCHAR stringDisabled[] = _T("Disabled");
+ TCHAR stringForced[] = _T("Forced");
// AC3 encoding mode
SendDlgItemMessage(m_Dlg, IDC_AC3_MODE, CB_RESETCONTENT, 0, 0);
@@ -110,20 +110,20 @@ HRESULT CSettingsProp::OnActivate()
for (unsigned int i = 0; i < numOfBitrates; i++)
{
- sprintf_s(settingString, "%d", gAllowedAC3bitrates[i]);
+ _stprintf_s(settingString, _T("%d"), gAllowedAC3bitrates[i]);
SendDlgItemMessage(m_Dlg, IDC_AC3_BITRATE, CB_ADDSTRING, 0, (LPARAM)settingString);
if (AC3Bitrate == gAllowedAC3bitrates[i])
SendDlgItemMessage(m_Dlg, IDC_AC3_BITRATE, CB_SETCURSEL, i, 0);
}
// Audio delay
- sprintf_s(settingString, "%d", m_pSettings->GetAudioDelay());
+ _stprintf_s(settingString, _T("%d"), m_pSettings->GetAudioDelay());
SendDlgItemMessage(m_Dlg, IDC_AUDIO_DELAY, WM_SETTEXT, 0, (LPARAM)settingString);
// Bit depth
- CHAR string16[] = "16";
- CHAR string24[] = "24";
- CHAR string32[] = "32";
+ TCHAR string16[] = _T("16");
+ TCHAR string24[] = _T("24");
+ TCHAR string32[] = _T("32");
SendDlgItemMessage(m_Dlg, IDC_BITDEPTH, CB_RESETCONTENT, 0, 0);
SendDlgItemMessage(m_Dlg, IDC_BITDEPTH, CB_ADDSTRING, 0, (LPARAM)stringAuto);
@@ -161,7 +161,7 @@ HRESULT CSettingsProp::OnActivate()
for (unsigned int i = 0; i < nNumOfSampleRates; i++)
{
- sprintf_s(settingString, "%d", gAllowedSampleRates[i]);
+ _stprintf_s(settingString, _T("%d"), gAllowedSampleRates[i]);
SendDlgItemMessage(m_Dlg, IDC_SAMPLERATE, CB_ADDSTRING, 0, (LPARAM)settingString);
if (nSampleRate == gAllowedSampleRates[i])
SendDlgItemMessage(m_Dlg, IDC_SAMPLERATE, CB_SETCURSEL, i + 1, 0);
@@ -191,7 +191,7 @@ HRESULT CSettingsProp::OnActivate()
for (unsigned int i = 0; i < nNumOfSpeakerConfigs; i++)
{
int nConfig = speakerConfigs[i];
- sprintf_s(settingString, "%d", nConfig);
+ _stprintf_s(settingString, _T("%d"), nConfig);
SendDlgItemMessage(m_Dlg, IDC_SPEAKER_SETUP, CB_ADDSTRING, 0, (LPARAM)m_pSettings->SpeakerConfigAsString(nConfig));
if (nSpeakerSetup == speakerConfigs[i])
SendDlgItemMessage(m_Dlg, IDC_SPEAKER_SETUP, CB_SETCURSEL, i, 0);
@@ -252,9 +252,9 @@ HRESULT CSettingsProp::OnApplyChanges()
m_pSettings->SetAC3Bitrate(gAllowedAC3bitrates[nValue]);
// Audio delay
- CHAR delay[50];
+ TCHAR delay[50];
SendDlgItemMessage(m_Dlg, IDC_AUDIO_DELAY, WM_GETTEXT, 50, (LPARAM)&delay);
- m_pSettings->SetAudioDelay(atoi(delay));
+ m_pSettings->SetAudioDelay(_ttoi(delay));
nValue = (int)SendDlgItemMessage(m_Dlg, IDC_BITDEPTH, CB_GETCURSEL, 0, 0);
@@ -330,9 +330,9 @@ INT_PTR CSettingsProp::OnReceiveMessage(HWND hwnd, UINT uMsg, WPARAM wParam, LPA
}
else if (LOWORD(wParam) == IDC_AUDIO_DELAY && HIWORD(wParam) == EN_CHANGE)
{
- CHAR delay[50];
+ TCHAR delay[50];
SendDlgItemMessage(m_Dlg, IDC_AUDIO_DELAY, WM_GETTEXT, 50, (LPARAM)&delay);
- if (atoi(delay) != m_pSettings->GetAudioDelay())
+ if (_ttoi(delay) != m_pSettings->GetAudioDelay())
{
m_bDirty = TRUE;
if (m_pPageSite)
View
2  DirectShowFilters/MPAudioRenderer/source/WASAPIRenderFilter.cpp
@@ -58,7 +58,7 @@ CWASAPIRenderFilter::CWASAPIRenderFilter(AudioRendererSettings* pSettings, CSync
Log("Disabling WASAPI - OS version earlier than Vista detected");
// Load Vista specifics DLLs
- m_hLibAVRT = LoadLibrary ("AVRT.dll");
+ m_hLibAVRT = LoadLibrary (_T("AVRT.dll"));
if (m_hLibAVRT && bWASAPIAvailable)
{
pfAvSetMmThreadCharacteristicsW = (PTR_AvSetMmThreadCharacteristicsW) GetProcAddress (m_hLibAVRT, "AvSetMmThreadCharacteristicsW");
View
29 DirectShowFilters/MPAudioRenderer/source/dllmain.cpp
@@ -102,22 +102,25 @@ STDAPI DllUnregisterServer()
// To be replaced when MP2 has generic C++ log framework available
//
-void LogPath(char* dest, char* name)
+const int MAX_LOG_LINE_LENGHT = 1000;
+const int LOG_LINE_RESERVED = 32;
+
+void LogPath(TCHAR* dest, TCHAR* name)
{
TCHAR folder[MAX_PATH];
SHGetSpecialFolderPath(NULL,folder,CSIDL_COMMON_APPDATA,FALSE);
- sprintf(dest,"%s\\Team Mediaportal\\MediaPortal\\log\\AudioRenderer.%s",folder,name);
+ _stprintf(dest, _T("%s\\Team Mediaportal\\MediaPortal\\log\\AudioRenderer.%s"), folder, name);
}
void LogRotate()
{
TCHAR fileName[MAX_PATH];
- LogPath(fileName, "log");
+ LogPath(fileName, _T("log"));
TCHAR bakFileName[MAX_PATH];
- LogPath(bakFileName, "bak");
- remove(bakFileName);
+ LogPath(bakFileName, _T("bak"));
+ _tremove(bakFileName);
// ignore if rename fails
- (void)rename(fileName, bakFileName);
+ (void)_trename(fileName, bakFileName);
}
CCritSec m_qLock;
@@ -142,7 +145,7 @@ UINT CALLBACK LogThread(void* param)
SetThreadName(0, "LoggerThread");
TCHAR fileName[MAX_PATH];
- LogPath(fileName, "log");
+ LogPath(fileName, _T("log"));
HANDLE handles[2];
handles[0] = m_eLog;
@@ -152,7 +155,7 @@ UINT CALLBACK LogThread(void* param)
{
if (m_logQueue.size() > 0)
{
- FILE* pFile = fopen(fileName, "a+");
+ FILE* pFile = _tfopen(fileName, _T("a+"));
if (pFile)
{
SYSTEMTIME systemTime;
@@ -171,7 +174,7 @@ UINT CALLBACK LogThread(void* param)
if (result == WAIT_FAILED)
{
DWORD error = GetLastError();
- FILE* pFile = fopen(fileName, "a+");
+ FILE* pFile = _tfopen(fileName, _T("a+"));
if (pFile)
{
fprintf(pFile, "LoggerThread - WaitForMultipleObjects failed, result: %d error: %d\n", result, error);
@@ -212,10 +215,10 @@ void Log(const char *fmt, ...)
m_bLoggerRunning = true;
StartLogger();
}
- char buffer[1000];
+ char buffer[MAX_LOG_LINE_LENGHT - LOG_LINE_RESERVED];
int ret;
va_start(ap, fmt);
- ret = vsprintf(buffer, fmt, ap);
+ ret = _vsnprintf(buffer, MAX_LOG_LINE_LENGHT - LOG_LINE_RESERVED, fmt, ap);
va_end(ap);
if (ret < 0)
@@ -223,8 +226,8 @@ void Log(const char *fmt, ...)
SYSTEMTIME systemTime;
GetLocalTime(&systemTime);
- char msg[500];
- sprintf_s(msg, 500,"%02.2d-%02.2d-%04.4d %02.2d:%02.2d:%02.2d.%03.3d [%5x] %s\n",
+ char msg[MAX_LOG_LINE_LENGHT];
+ sprintf_s(msg, MAX_LOG_LINE_LENGHT,"%02.2d-%02.2d-%04.4d %02.2d:%02.2d:%02.2d.%03.3d [%5x] %s\n",
systemTime.wDay, systemTime.wMonth, systemTime.wYear,
systemTime.wHour, systemTime.wMinute, systemTime.wSecond,
systemTime.wMilliseconds,
View
8 DirectShowFilters/MPIPTVSource/MPIPTVSource.vcxproj
@@ -18,12 +18,12 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -65,7 +65,7 @@
<Link>
<AdditionalDependencies>strmbasd.lib;winmm.lib;wininet.lib;wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>bin\Debug/$(ProjectName).ax</OutputFile>
- <AdditionalLibraryDirectories>$(DSHOW_BASE)Debug_MBCS;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(DSHOW_BASE)Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<ModuleDefinitionFile>.\source\mpiptvsource.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -95,7 +95,7 @@
<Link>
<AdditionalDependencies>strmbase.lib;winmm.lib;wininet.lib;wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>bin\Release/$(ProjectName).ax</OutputFile>
- <AdditionalLibraryDirectories>$(DSHOW_BASE)Release_MBCS;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(DSHOW_BASE)Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ModuleDefinitionFile>.\source\mpiptvsource.def</ModuleDefinitionFile>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
View
27 DirectShowFilters/MPIPTVSource/source/mpiptvsource.cpp
@@ -25,6 +25,8 @@
#include <windows.h>
#include <stdio.h>
#include <shlobj.h>
+#include <AtlBase.h>
+#include <AtlConv.h>
#include "mpiptvsource.h"
//#define logging
@@ -212,6 +214,7 @@ HRESULT CMPIptvSourceStream::DecideBufferSize(IMemAllocator *pAlloc, ALLOCATOR_P
HRESULT CMPIptvSourceStream::DoBufferProcessingLoop(void)
{
+ USES_CONVERSION;
Command com;
OnThreadStartPlay();
@@ -226,16 +229,16 @@ HRESULT CMPIptvSourceStream::DoBufferProcessingLoop(void)
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
if (localip) {
- addr.sin_addr.s_addr = inet_addr(localip);
+ addr.sin_addr.s_addr = inet_addr(T2A(localip));
} else {
addr.sin_addr.s_addr = htonl(INADDR_ANY);
}
addr.sin_port = htons((u_short)port);
ip_mreq imr;
- imr.imr_multiaddr.s_addr = inet_addr(ip);
+ imr.imr_multiaddr.s_addr = inet_addr(T2A(ip));
if (localip) {
- imr.imr_interface.s_addr = inet_addr(localip);
+ imr.imr_interface.s_addr = inet_addr(T2A(localip));
} else {
imr.imr_interface.s_addr = INADDR_ANY;
}
@@ -446,19 +449,19 @@ bool CMPIptvSourceStream::Load(const TCHAR* fn)
return false;
}
memset(ip, 0, (url.dwHostNameLength + 1) * sizeof(TCHAR));
- strncat(ip, url.lpszHostName, url.dwHostNameLength);
+ _tcsncat(ip, url.lpszHostName, url.dwHostNameLength);
if (url.dwUserNameLength > 0) {
if (!(localip = (TCHAR*) CoTaskMemAlloc((url.dwUserNameLength + 1) * sizeof(TCHAR)))) {
return false;
}
memset(localip, 0, (url.dwUserNameLength + 1) * sizeof(TCHAR));
- strncat(localip, url.lpszUserName, url.dwUserNameLength);
+ _tcsncat(localip, url.lpszUserName, url.dwUserNameLength);
}
if (!(protocol = (TCHAR*) CoTaskMemAlloc((url.dwSchemeLength + 1) * sizeof(TCHAR)))) {
return false;
}
memset(protocol, 0, (url.dwSchemeLength + 1) * sizeof(TCHAR));
- strncat(protocol, url.lpszScheme, url.dwSchemeLength);
+ _tcsncat(protocol, url.lpszScheme, url.dwSchemeLength);
port = url.nPort;
return true;
@@ -504,10 +507,13 @@ STDMETHODIMP CMPIptvSource::NonDelegatingQueryInterface(REFIID riid, void** ppv)
STDMETHODIMP CMPIptvSource::Load(LPCOLESTR pszFileName, const AM_MEDIA_TYPE* pmt)
{
- size_t length = wcstombs(NULL, pszFileName, 0);
+ size_t length = _tcslen(pszFileName);
+
if(!(m_fn = (TCHAR*)CoTaskMemAlloc((length+1)*sizeof(TCHAR))))
return E_OUTOFMEMORY;
- wcstombs(m_fn, pszFileName, length + 1);
+
+ _tcsncpy(m_fn, pszFileName, length);
+
if(!m_stream->Load(m_fn))
return E_FAIL;
@@ -518,10 +524,11 @@ STDMETHODIMP CMPIptvSource::GetCurFile(LPOLESTR* ppszFileName, AM_MEDIA_TYPE* pm
{
if(!ppszFileName) return E_POINTER;
- if(!(*ppszFileName = (LPOLESTR)CoTaskMemAlloc((strlen(m_fn)+1)*sizeof(WCHAR))))
+ if(!(*ppszFileName = (LPOLESTR)CoTaskMemAlloc((_tcslen(m_fn)+1)*sizeof(WCHAR))))
return E_OUTOFMEMORY;
- mbstowcs(*ppszFileName, m_fn, strlen(m_fn) + 1);
+ size_t length = _tcslen(m_fn);
+ _tcsncpy(*ppszFileName, m_fn, length);
return S_OK;
}
View
6 DirectShowFilters/MPIPTVSource/source/mpiptvsource.h
@@ -39,9 +39,9 @@ DEFINE_GUID(CLSID_MPIptvSource,
// url format: udp://[interface]@ip:port, example: udp://192.168.1.44@233.2.3.4:1000, rtp://@233.2.3.4:1000
-#define EMPTY_STRING ""
-#define UDP_PROTOCOL "udp"
-#define RTP_PROTOCOL "rtp"
+#define EMPTY_STRING _T("")
+#define UDP_PROTOCOL _T("udp")
+#define RTP_PROTOCOL _T("rtp")
#define IPTV_BUFFER_SIZE 128 * 1024 //By default 64KB buffer size
#define IPTV_SOCKET_BUFFER_SIZE 32 * 1024 //Socket receive buffer size - not related to read buffer size above
#define FILL_DIRECTLY_INTO_BUFFER
View
8 DirectShowFilters/MPWriter/MPWriter.vcxproj
@@ -19,13 +19,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<UseOfAtl>false</UseOfAtl>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -89,7 +89,7 @@
<AdditionalDependencies>strmbase.lib;livemedia555.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>bin\Release/MPFileWriter.ax</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
- <AdditionalLibraryDirectories>$(DSHOW_BASE)Release_MBCS; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib; ..\shared;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(DSHOW_BASE)Release; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib; ..\shared;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<ModuleDefinitionFile>.\source\MPFileWriter.def</ModuleDefinitionFile>
@@ -136,7 +136,7 @@
<AdditionalDependencies>strmbasd.lib;livemedia555D.lib;winmm.lib;WS2_32.Lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>bin\Debug/MPFileWriter.ax</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
- <AdditionalLibraryDirectories>$(DSHOW_BASE)Debug_MBCS; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib; ..\shared;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(DSHOW_BASE)Debug; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib; ..\shared;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<ModuleDefinitionFile>.\source\MPFileWriter.def</ModuleDefinitionFile>
View
3  DirectShowFilters/MPWriter/source/MPFileWriter.cpp
@@ -28,6 +28,7 @@
#include <streams.h>
#include <initguid.h>
#include <shlobj.h>
+#include <tchar.h>
#include "MPFileWriter.h"
#include "liveMedia.hh"
#include "ChannelScan.h"
@@ -401,7 +402,7 @@ m_pTeletextInputPin(NULL)
{
LogDebug("CMPFileWriter::ctor()");
- DeleteFile("MPFileWriter.log");
+ DeleteFile(_T("MPFileWriter.log"));
m_id=0;
m_pFilter = new CMPFileWriterFilter(this, GetOwner(), &m_Lock, phr);
if (m_pFilter == NULL)
View
3  DirectShowFilters/MPWriter/source/MemoryBuffer.cpp
@@ -2,6 +2,7 @@
#include <winsock2.h>
#include <ws2tcpip.h>
#include <streams.h>
+#include <tchar.h>
#include "MemoryBuffer.h"
#define MAX_MEMORY_BUFFER_SIZE (500000)
@@ -9,7 +10,7 @@
extern void LogDebug(const char *fmt, ...) ;
CMemoryBuffer::CMemoryBuffer(void)
-:m_event(NULL,TRUE,FALSE,"memevent")
+:m_event(NULL,TRUE,FALSE,_T("memevent"))
{
m_BytesInBuffer=0;
m_pcallback=NULL;
View
14 DirectShowFilters/MPWriter/source/MultiFileWriter.cpp
@@ -359,7 +359,7 @@ HRESULT MultiFileWriter::ReuseTSFile()
// Check if file is being read by something.
TCHAR sz[MAX_PATH];
- sprintf(sz, "%S", pFilename);
+ _stprintf(sz, _T("%S"), pFilename);
// Can be locked temporarily to update duration or definitely (!) if timeshift is paused.
do
{
@@ -552,14 +552,14 @@ HRESULT MultiFileWriter::GetAvailableDiskSpace(__int64* llAvailableDiskSpace)
HRESULT hr;
- char *pszDrive = NULL;
- char szDrive[4];
+ TCHAR* pszDrive = NULL;
+ TCHAR szDrive[8];
if (m_pTSBufferFileName[1] == ':')
{
szDrive[0] = (char)m_pTSBufferFileName[0];
- szDrive[1] = ':';
- szDrive[2] = '\\';
- szDrive[3] = '\0';
+ szDrive[1] = _T(':');
+ szDrive[2] = _T('\\');
+ szDrive[3] = _T('\0');
pszDrive = szDrive;
}
@@ -587,7 +587,7 @@ void MultiFileWriter::setRegFileName(LPTSTR fileName)
{
// CheckPointer(fileName,E_POINTER);
- if(strlen(fileName) > MAX_PATH)
+ if (_tcslen(fileName) > MAX_PATH)
return;// ERROR_FILENAME_EXCED_RANGE;
// Take a copy of the filename
View
8 DirectShowFilters/StreamingServer/StreamingServer.vcxproj
@@ -18,13 +18,13 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -68,7 +68,7 @@
<Link>
<AdditionalDependencies>DvbCoreUtilsD.lib;strmbasd.lib;winmm.lib;livemedia555D.lib;WS2_32.Lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>.\bin\Debug\$(ProjectName).dll</OutputFile>
- <AdditionalLibraryDirectories>$(DSHOW_BASE)Debug_MBCS; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib; ..\shared;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(DSHOW_BASE)Debug; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib; ..\shared;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>libcmtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<ModuleDefinitionFile>Source\StreamingServer.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -102,7 +102,7 @@
<Link>
<AdditionalDependencies>DvbCoreUtils.lib;strmbase.lib;livemedia555.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>bin\Release\$(ProjectName).dll</OutputFile>
- <AdditionalLibraryDirectories>$(DSHOW_BASE)Release_MBCS; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib; ..\shared;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(DSHOW_BASE)Release; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib; ..\shared;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>libcmt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<ModuleDefinitionFile>Source\StreamingServer.def</ModuleDefinitionFile>
<GenerateDebugInformation>false</GenerateDebugInformation>
View
8 DirectShowFilters/TsMuxer/TsMuxer.vcxproj
@@ -18,13 +18,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<UseOfAtl>false</UseOfAtl>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -88,7 +88,7 @@
<AdditionalDependencies>strmbase.lib;livemedia555.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>bin\Release/TsMuxer.ax</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
- <AdditionalLibraryDirectories>$(DSHOW_BASE)Release_MBCS; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib; ..\shared;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(DSHOW_BASE)Release; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib; ..\shared;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<ModuleDefinitionFile>.\source\TsMuxer.def</ModuleDefinitionFile>
@@ -136,7 +136,7 @@
<AdditionalDependencies>strmbasd.lib;livemedia555D.lib;winmm.lib;WS2_32.Lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>bin\Debug/TsMuxer.ax</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
- <AdditionalLibraryDirectories>$(DSHOW_BASE)Debug_MBCS; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib; ..\shared;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(DSHOW_BASE)Debug; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib; ..\shared;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<ModuleDefinitionFile>.\source\TsMuxer.def</ModuleDefinitionFile>
View
3  DirectShowFilters/TsMuxer/source/MemoryBuffer.cpp
@@ -2,6 +2,7 @@
#include <winsock2.h>
#include <ws2tcpip.h>
#include <streams.h>
+#include <tchar.h>
#include "MemoryBuffer.h"
#define MAX_MEMORY_BUFFER_SIZE (500000)
@@ -9,7 +10,7 @@
extern void LogDebug(const char *fmt, ...) ;
CMemoryBuffer::CMemoryBuffer(void)
-:m_event(NULL,TRUE,FALSE,"memevent")
+:m_event(NULL,TRUE,FALSE,_T("memevent"))
{
m_BytesInBuffer=0;
m_pcallback=NULL;
View
7 DirectShowFilters/TsMuxer/source/TsMuxer.cpp
@@ -28,6 +28,7 @@
#include <streams.h>
#include <initguid.h>
#include <shlobj.h>
+#include <tchar.h>
#include "TsMuxer.h"
#include "liveMedia.hh"
#include "ChannelScan.h"
@@ -133,9 +134,9 @@ void LogDebug(const char *fmt, ...)
TCHAR folder[MAX_PATH];
TCHAR fileName[MAX_PATH];
::SHGetSpecialFolderPath(NULL,folder,CSIDL_COMMON_APPDATA,FALSE);
- sprintf(fileName,"%s\\Team MediaPortal\\MediaPortal TV Server\\log\\TsMuxer.Log",folder);
+ _stprintf(fileName, _T("%s\\Team MediaPortal\\MediaPortal TV Server\\log\\TsMuxer.Log"), folder);
- FILE* fp = fopen(fileName,"a+");
+ FILE* fp = _tfopen(fileName, _T("a+"));
if (fp!=NULL)
{
SYSTEMTIME systemTime;
@@ -279,7 +280,7 @@ m_pTsOutputPin(NULL)
{
LogDebug("CTsMuxer::ctor()");
- DeleteFile("TsMuxer.log");
+ DeleteFile(_T("TsMuxer.log"));
m_pFilter = new CTsMuxerFilter(this, GetOwner(), &m_Lock, phr);
if (m_pFilter == NULL)
{
View
18 DirectShowFilters/TsReader/source/TsReader.cpp
@@ -46,14 +46,14 @@
// For more details for memory leak detection see the alloctracing.h header
#include "..\..\alloctracing.h"
-static char logFile[MAX_PATH];
+static TCHAR logFile[MAX_PATH];
static WORD logFileParsed = -1;
DWORD m_tGTStartTime = 0;
DEFINE_MP_DEBUG_SETTING(DoNotAllowSlowMotionDuringZapping)
-void GetLogFile(char *pLog)
+void GetLogFile(TCHAR* pLog)
{
SYSTEMTIME systemTime;
GetLocalTime(&systemTime);
@@ -61,10 +61,10 @@ void GetLogFile(char *pLog)
{
TCHAR folder[MAX_PATH];
::SHGetSpecialFolderPath(NULL,folder,CSIDL_COMMON_APPDATA,FALSE);
- sprintf(logFile,"%s\\Team MediaPortal\\MediaPortal\\Log\\TsReader-%04.4d-%02.2d-%02.2d.Log",folder, systemTime.wYear, systemTime.wMonth, systemTime.wDay);
+ _stprintf(logFile, _T("%s\\Team MediaPortal\\MediaPortal\\Log\\TsReader-%04.4d-%02.2d-%02.2d.Log"), folder, systemTime.wYear, systemTime.wMonth, systemTime.wDay);
logFileParsed=systemTime.wDay; // rec
}
- strcpy(pLog, &logFile[0]);
+ _tcscpy (pLog, &logFile[0]);
}
@@ -84,7 +84,7 @@ void LogDebug(const char *fmt, ...)
//#ifdef DONTLOG
TCHAR filename[1024];
GetLogFile(filename);
- FILE* fp = fopen(filename,"a+");
+ FILE* fp = _tfopen(filename, _T("a+"));
if (fp!=NULL)
{
@@ -205,11 +205,11 @@ CTsReaderFilter::CTsReaderFilter(IUnknown *pUnk, HRESULT *phr):
m_bDisableVidSizeRebuildMPEG2 = false;
m_bDisableVidSizeRebuildH264 = false;
m_bDisableAddPMT = false;
- if (ERROR_SUCCESS==RegCreateKeyEx(HKEY_CURRENT_USER, "Software\\Team MediaPortal\\TsReader", 0, NULL,
+ if (ERROR_SUCCESS==RegCreateKeyEx(HKEY_CURRENT_USER, _T("Software\\Team MediaPortal\\TsReader"), 0, NULL,
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &key, NULL))
{
DWORD keyValue = 0;
- LPCTSTR disableVidSizeRebuildMPEG2 = TEXT("DisableVidSizeRebuildMPEG2");
+ LPCTSTR disableVidSizeRebuildMPEG2 = _T("DisableVidSizeRebuildMPEG2");
ReadRegistryKeyDword(key, disableVidSizeRebuildMPEG2, keyValue);
if (keyValue)
{
@@ -218,7 +218,7 @@ CTsReaderFilter::CTsReaderFilter(IUnknown *pUnk, HRESULT *phr):
}
keyValue = 0;
- LPCTSTR disableVidSizeRebuildH264 = TEXT("DisableVidSizeRebuildH264");
+ LPCTSTR disableVidSizeRebuildH264 = _T("DisableVidSizeRebuildH264");
ReadRegistryKeyDword(key, disableVidSizeRebuildH264, keyValue);
if (keyValue)
{
@@ -227,7 +227,7 @@ CTsReaderFilter::CTsReaderFilter(IUnknown *pUnk, HRESULT *phr):
}
keyValue = 0;
- LPCTSTR disableAddPMT = TEXT("DisableAddPMT");
+ LPCTSTR disableAddPMT = _T("DisableAddPMT");
ReadRegistryKeyDword(key, disableAddPMT, keyValue);
if (keyValue)
{
View
4 DirectShowFilters/TsWriter/MPTSWriter.vcxproj
@@ -19,13 +19,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<UseOfAtl>false</UseOfAtl>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
View
8 DirectShowFilters/TsWriter/source/MHWDecoder.cpp
@@ -21,6 +21,7 @@
#pragma warning(disable: 4786)
#pragma warning(disable : 4995)
#include <windows.h>
+#include <atlconv.h>
#include ".\mhwparser.h"
#include "entercriticalSection.h"
@@ -240,6 +241,8 @@ int CMhwDecoder::GetTitleCount()
void CMhwDecoder::GetTitle(int program, UINT* id, UINT* transportId, UINT* networkId, UINT* channelId, ULONG* programId, UINT* themeId, UINT* PPV, BYTE* Summaries, UINT* duration, ULONG* dateStart, ULONG* timeStart,char** title,char** programName)
{
+ USES_CONVERSION;
+
CEnterCriticalSection lock (m_critSection);
*id = 0;
*transportId=0;
@@ -274,7 +277,7 @@ void CMhwDecoder::GetTitle(int program, UINT* id, UINT* transportId, UINT* netwo
*timeStart=prog.timeStart;
*title=(char*)prog.Title.c_str();
char tmp[128];
- sprintf(tmp,"got:prog.id:%lu\n",prog.ID);OutputDebugString(tmp);
+ sprintf(tmp,"got:prog.id:%lu\n",prog.ID);OutputDebugString(A2T(tmp));
//LogDebug("mhw-epg: GetTitle(%d) size:%d chan:%d progid:%x '%s'",
// program,m_vecTitles.size(),
// *channelId, *programId, *title);
@@ -316,8 +319,9 @@ void CMhwDecoder::GetChannel(UINT channelNr, UINT* channelId, UINT* networkId, U
void CMhwDecoder::GetSummary(ULONG programId, char** summary)
{
+ USES_CONVERSION;
char tmp[128];
- sprintf(tmp,"get:prog.id:%lu\n",programId);OutputDebugString(tmp);
+ sprintf(tmp,"get:prog.id:%lu\n",programId);OutputDebugString(A2T(tmp));
CEnterCriticalSection lock (m_critSection);
*summary="";
imapSummaries it=m_mapSummaries.find(programId);
View
2  DirectShowFilters/TsWriter/source/MultiFileWriter.cpp
@@ -567,7 +567,7 @@ void MultiFileWriter::setRegFileName(LPTSTR fileName)
{
// CheckPointer(fileName,E_POINTER);
- if(strlen(fileName) > MAX_PATH)
+ if(_tcslen(fileName) > MAX_PATH)
return;// ERROR_FILENAME_EXCED_RANGE;
// Take a copy of the filename
View
6 DirectShowFilters/shared/DebugSettings.h
@@ -37,7 +37,7 @@
TCHAR folder[MAX_PATH]; \
TCHAR fileName[MAX_PATH]; \
::SHGetSpecialFolderPath(NULL, folder, CSIDL_COMMON_APPDATA, FALSE); \
- _stprintf(fileName, _T("%s\\Team MediaPortal\\" package "\\debug\\" #setting ".txt"), folder); \
+ _stprintf(fileName, _T("%s\\Team MediaPortal\\" package _T("\\debug\\") _T(#setting) _T(".txt")), folder); \
HANDLE hTest=CreateFile(fileName,(DWORD) GENERIC_READ,0,0,(DWORD) OPEN_EXISTING,0,NULL); \
if (hTest==INVALID_HANDLE_VALUE) \
return false; \
@@ -45,5 +45,5 @@
return TRUE; \
} \
-#define DEFINE_MP_DEBUG_SETTING(setting) DEFINE_DEBUG_SETTING(setting, "MediaPortal")
-#define DEFINE_TVE_DEBUG_SETTING(setting) DEFINE_DEBUG_SETTING(setting, "MediaPortal TV Server")
+#define DEFINE_MP_DEBUG_SETTING(setting) DEFINE_DEBUG_SETTING(setting, _T("MediaPortal"))
+#define DEFINE_TVE_DEBUG_SETTING(setting) DEFINE_DEBUG_SETTING(setting, _T("MediaPortal TV Server"))
View
4 mediaportal/Core.cpp/DXUtil/DXUtil.vcxproj
@@ -68,7 +68,7 @@
</ClCompile>
<Link>
<OutputFile>bin\Debug/dxutil.dll</OutputFile>
- <AdditionalLibraryDirectories>$(DSHOW_BASE)Debug_MBCS;$(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(DSHOW_BASE)Debug;$(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>bin\Debug/dxutil.pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
@@ -94,7 +94,7 @@
</ClCompile>
<Link>
<OutputFile>bin\Release/dxutil.dll</OutputFile>
- <AdditionalLibraryDirectories>$(DSHOW_BASE)Release_MBCS; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(DSHOW_BASE)Release; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>false</GenerateDebugInformation>
<ProgramDatabaseFile>bin\Release/dxutil.pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
View
8 mediaportal/Core.cpp/DirectShowHelper/dshowhelper.vcxproj
@@ -21,12 +21,12 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>Dynamic</UseOfMfc>
<UseOfAtl>false</UseOfAtl>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>Dynamic</UseOfMfc>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -70,7 +70,7 @@
<Link>
<AdditionalDependencies>strmbasd.lib;winmm.lib;comsupp.lib;dxguid.lib;d3d9.lib;d3dx9.lib;mfuuid.lib;dxva2.lib;evr.lib;mf.lib;strmiids.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>bin\Debug/dshowhelper.dll</OutputFile>
- <AdditionalLibraryDirectories>$(DSHOW_BASE)Debug_MBCS; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(DSHOW_BASE)Debug; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<ModuleDefinitionFile>./source/dshowhelper.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -103,7 +103,7 @@
<Link>
<AdditionalDependencies>strmbase.lib;winmm.lib;comsupp.lib;dxguid.lib;d3d9.lib;d3dx9.lib;mfuuid.lib;dxva2.lib;evr.lib;mf.lib;strmiids.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>bin\Release/dshowhelper.dll</OutputFile>
- <AdditionalLibraryDirectories>$(DSHOW_BASE)Release_MBCS; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(DSHOW_BASE)Release; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<ModuleDefinitionFile>./source/dshowhelper.def</ModuleDefinitionFile>
View
2  mediaportal/Core.cpp/DirectShowHelper/source/GrabBitmaps.cpp
@@ -95,7 +95,7 @@ class CSampleGrabberCB : public ISampleGrabberCB
// Convert the buffer into a bitmap
//
TCHAR szFilename[MAX_PATH];
- strcpy(szFilename,"temp.bmp");
+ _tcscpy(szFilename, _T("temp.bmp"));
DeleteFile(szFilename);
// Create a file to hold the bitmap
HANDLE hf = CreateFile(szFilename, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, NULL, NULL );
View
20 mediaportal/Core.cpp/DirectShowHelper/source/StatsRenderer.cpp
@@ -195,14 +195,14 @@ void StatsRenderer::DrawStats()
int TextHeight = int(25.0*m_TextScale + 0.5);
int BlankHeight = int(10.0*m_TextScale + 0.5);
- strText.Format("Display: %d x %d @ %.6f Hz | Meas rfsh: %.6f Hz | MaxLine: %d | PCD: %.6f",
+ strText.Format(_T("Display: %d x %d @ %.6f Hz | Meas rfsh: %.6f Hz | MaxLine: %d | PCD: %.6f"),
m_pPresenter->m_displayMode.Width, m_pPresenter->m_displayMode.Height,
m_pPresenter->m_dD3DRefreshRate, 1000.0/m_pPresenter->m_displayParams.dEstRefreshCycle, m_pPresenter->m_displayParams.maxScanLine,
m_pPresenter->m_fPCDMean);
DrawText(rc, strText);
OffsetRect(&rc, 0, TextHeight);
- strText.Format("Video: %d x %d %d:%d | Act FPS: %.4f (red)| Drawn: %d | Drop: %d",
+ strText.Format(_T("Video: %d x %d %d:%d | Act FPS: %.4f (red)| Drawn: %d | Drop: %d"),
m_pPresenter->m_iVideoWidth, m_pPresenter->m_iVideoHeight,
m_pPresenter->m_iARX, m_pPresenter->m_iARY,
10000000.0 / m_pPresenter->m_fJitterMean, m_pPresenter->m_iFramesDrawn, m_pPresenter->m_iFramesDropped);
@@ -211,19 +211,19 @@ void StatsRenderer::DrawStats()
OffsetRect(&rc, 0, BlankHeight); // Extra "line feed"
- strText.Format("Render time (grn): %+5.1f ms | NST: %+3.1f ms | AveRNST: %+3.1f ms | FrRat: %d | Stall: %+3.1f ms",
+ strText.Format(_T("Render time (grn): %+5.1f ms | NST: %+3.1f ms | AveRNST: %+3.1f ms | FrRat: %d | Stall: %+3.1f ms"),
m_pPresenter->m_fSyncOffsetAvr/10000.0, m_pPresenter->m_llLastCFPts/10000.0,
m_pPresenter->m_fCFPMean/10000.0, m_pPresenter->m_frameRateRatio, m_pPresenter->m_stallTime/10000.0);
DrawText(rc, strText);
OffsetRect(&rc, 0, TextHeight);
- strText.Format("Raster offset (ylw): %5.2f ms | SOP: %4d | EOP: %4d | Locked: %d | Derr: %5.2f ms | Q: %d",
+ strText.Format(_T("Raster offset (ylw): %5.2f ms | SOP: %4d | EOP: %4d | Locked: %d | Derr: %5.2f ms | Q: %d"),
m_pPresenter->m_rasterSyncOffset, m_pPresenter->m_LastStartOfPaintScanline, m_pPresenter->m_LastEndOfPaintScanline,
(int)m_pPresenter->m_DetectedLock, m_pPresenter->m_lastDelayErr/10000.0, (m_pPresenter->m_qScheduledSamples.Count()));
DrawText(rc, strText);
OffsetRect(&rc, 0, TextHeight);
- strText.Format("Rptd FPS: %.3f | Detd FPS: %.3f | DetFrT_SD: %+5.3f ms | DetSDur: %+5.3f ms",
+ strText.Format(_T("Rptd FPS: %.3f | Detd FPS: %.3f | DetFrT_SD: %+5.3f ms | DetSDur: %+5.3f ms"),
((m_pPresenter->m_rtTimePerFrame > 0) ? (10000000.0/m_pPresenter->m_rtTimePerFrame) : 0),
((m_pPresenter->m_DetFrameTimeAve > 0) ? (1.0/(m_pPresenter->m_DetFrameTimeAve)) : 0),
(m_pPresenter->m_DetectedFrameTimeStdDev/10000.0), (m_pPresenter->m_SampDuration/10000.0) );
@@ -234,7 +234,7 @@ void StatsRenderer::DrawStats()
{
OffsetRect(&rc, 0, BlankHeight); // Extra "line feed"
- strText.Format("Detd bias: %.7f | BiasAdj: %d | AudAdj: %.6f | AvePhDiff: %.6f | NumAdj: %d",
+ strText.Format(_T("Detd bias: %.7f | BiasAdj: %d | AudAdj: %.6f | AvePhDiff: %.6f | NumAdj: %d"),
m_pPresenter->m_dBias, m_pPresenter->m_bBiasAdjustmentDone, m_pPresenter->m_dVariableFreq,
m_pPresenter->m_avPhaseDiff, m_pPresenter->m_iClockAdjustmentsDone);
DrawText(rc, strText);
@@ -243,7 +243,7 @@ void StatsRenderer::DrawStats()
CLOCKDATA clockData;
m_pPresenter->m_pAVSyncClock->GetClockData(&clockData);
- strText.Format("HW vs system: %.7fx HW vs. sys: %+.3f ms resampling adj.: %.7f Drift: %+.3f ms",
+ strText.Format(_T("HW vs system: %.7fx HW vs. sys: %+.3f ms resampling adj.: %.7f Drift: %+.3f ms"),
clockData.driftMultiplier, clockData.driftHWvsSystem, clockData.resamplingAdjustment, clockData.currentDrift);
DrawText(rc, strText);
OffsetRect(&rc, 0, TextHeight);
@@ -253,7 +253,7 @@ void StatsRenderer::DrawStats()
{
OffsetRect(&rc, 0, BlankHeight); // Extra "line feed"
- strText.Format("");
+ strText.Format(_T(""));
for (int i=0; i < 3 && i < m_pPresenter->m_numFilters; i++)
{
strText += m_pPresenter->m_filterNames[i];
@@ -265,7 +265,7 @@ void StatsRenderer::DrawStats()
if (m_pPresenter->m_numFilters > 3)
{
- strText.Format("");
+ strText.Format(_T(""));
for (int i=3; i < 6 && i < m_pPresenter->m_numFilters; i++)
{
strText += m_pPresenter->m_filterNames[i];
@@ -277,7 +277,7 @@ void StatsRenderer::DrawStats()
if (m_pPresenter->m_numFilters > 6)
{
- strText.Format("");
+ strText.Format(_T(""));
for (int i=6; i < FILTER_LIST_SIZE && i < m_pPresenter->m_numFilters; i++)
{
strText += m_pPresenter->m_filterNames[i];
View
36 mediaportal/Core.cpp/DirectShowHelper/source/dshowhelper.cpp
@@ -59,7 +59,7 @@ TAvRevertMmThreadCharacteristics* m_pAvRevertMmThreadCharacteristics = NULL;
BOOL m_bEVRLoaded = false;
-char* m_RenderPrefix = "vmr9";
+TCHAR* m_RenderPrefix = _T("vmr9");
LPDIRECT3DDEVICE9 m_pDevice = NULL;
CVMR9AllocatorPresenter* m_vmr9Presenter = NULL;
@@ -127,22 +127,22 @@ HRESULT __fastcall UnicodeToAnsi(LPCOLESTR pszW, LPSTR* ppszA)
}
-void LogPath(char* dest, char* name)
+void LogPath(TCHAR* dest, TCHAR* name)
{
TCHAR folder[MAX_PATH];
SHGetSpecialFolderPath(NULL,folder,CSIDL_COMMON_APPDATA,FALSE);
- sprintf(dest,"%s\\Team Mediaportal\\MediaPortal\\log\\%s.%s",folder,m_RenderPrefix,name);
+ _stprintf(dest, _T("%s\\Team Mediaportal\\MediaPortal\\log\\%s.%s"), folder, m_RenderPrefix, name);
}
void LogRotate()
{
TCHAR fileName[MAX_PATH];
- LogPath(fileName, "log");
+ LogPath(fileName, _T("log"));
TCHAR bakFileName[MAX_PATH];
- LogPath(bakFileName, "bak");
- remove(bakFileName);
- rename(fileName, bakFileName);
+ LogPath(bakFileName, _T("bak"));
+ _tremove(bakFileName);
+ _trename(fileName, bakFileName);
}
@@ -167,10 +167,10 @@ string GetLogLine()
UINT CALLBACK LogThread(void* param)
{
TCHAR fileName[MAX_PATH];
- LogPath(fileName, "log");
+ LogPath(fileName, _T("log"));
while ( m_bLoggerRunning ) {
if ( m_logQueue.size() > 0 ) {
- FILE* fp = fopen(fileName,"a+");
+ FILE* fp = _tfopen(fileName, _T("a+"));
if (fp!=NULL)
{
SYSTEMTIME systemTime;
@@ -437,10 +437,10 @@ void UnloadEVR()
bool LoadEVR()
{
Log("Loading EVR libraries");
- char systemFolder[MAX_PATH];
- char DLLFileName[MAX_PATH];
+ TCHAR systemFolder[MAX_PATH];
+ TCHAR DLLFileName[MAX_PATH];
GetSystemDirectory(systemFolder,sizeof(systemFolder));
- sprintf(DLLFileName,"%s\\dxva2.dll", systemFolder);
+ _stprintf(DLLFileName, _T("%s\\dxva2.dll"), systemFolder);
m_hModuleDXVA2=LoadLibrary(DLLFileName);
if (m_hModuleDXVA2 != NULL)
{
@@ -449,7 +449,7 @@ bool LoadEVR()
if (m_pDXVA2CreateDirect3DDeviceManager9 != NULL)
{
Log("Found method DXVA2CreateDirect3DDeviceManager9");
- sprintf(DLLFileName,"%s\\evr.dll", systemFolder);
+ _stprintf(DLLFileName, _T("%s\\evr.dll"), systemFolder);
m_hModuleEVR = LoadLibrary(DLLFileName);
m_pMFCreateVideoSampleFromSurface = (TMFCreateVideoSampleFromSurface*)GetProcAddress(m_hModuleEVR,"MFCreateVideoSampleFromSurface");
@@ -460,7 +460,7 @@ bool LoadEVR()
if(m_pMFCreateVideoMediaType)
{
Log("Found method MFCreateVideoMediaType");
- sprintf(DLLFileName,"%s\\mfplat.dll", systemFolder);
+ _stprintf(DLLFileName, _T("%s\\mfplat.dll"), systemFolder);
m_hModuleMFPLAT = LoadLibrary(DLLFileName);
m_pMFCreateMediaType = (TMFCreateMediaType*)GetProcAddress(m_hModuleMFPLAT,"MFCreateMediaType");
if (m_pMFCreateMediaType)
@@ -468,7 +468,7 @@ bool LoadEVR()
Log("Found method MFCreateMediaType");
Log("Successfully loaded EVR dlls");
- sprintf(DLLFileName,"%s\\dwmapi.dll", systemFolder);
+ _stprintf(DLLFileName, _T("%s\\dwmapi.dll"), systemFolder);
m_hModuleDWMAPI = LoadLibrary(DLLFileName);
// Vista / Windows 7 only, allowed to return NULL. Remember to check agains NULL when using
if (m_hModuleDWMAPI)
@@ -478,7 +478,7 @@ bool LoadEVR()
}
- sprintf(DLLFileName,"%s\\avrt.dll", systemFolder);
+ _stprintf(DLLFileName, _T("%s\\avrt.dll"), systemFolder);
m_hModuleAVRT = LoadLibrary(DLLFileName);
// Vista / Windows 7 only, allowed to return NULL. Remember to check agains NULL when using
if (m_hModuleAVRT)
@@ -493,7 +493,7 @@ bool LoadEVR()
if (IsWin7())
{
- sprintf(DLLFileName,"Win7RefreshRateHelper.dll");
+ _stprintf(DLLFileName, _T("Win7RefreshRateHelper.dll"));
m_hModuleW7Helper = LoadLibrary(DLLFileName);
if (m_hModuleW7Helper)
{
@@ -605,7 +605,7 @@ HRESULT MyGetService(IUnknown* punkObject, REFGUID guidService, REFIID riid, LPV
BOOL EvrInit(IVMR9Callback* callback, DWORD dwD3DDevice, IBaseFilter** evrFilter, DWORD monitor)
{
HRESULT hr;
- m_RenderPrefix = "evr";
+ m_RenderPrefix = _T("evr");
LogRotate();
// Make sure that we aren't trying to load the DLLs for second time
if (!m_bEVRLoaded)
View
8 mediaportal/Core.cpp/Win7RefreshRateHelper/Win7RefreshRateHelper.vcxproj
@@ -20,12 +20,12 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<UseOfAtl>false</UseOfAtl>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -75,7 +75,7 @@
<Link>
<AdditionalDependencies>strmbasd.lib;winmm.lib;comsupp.lib;dxguid.lib;d3d9.lib;d3dx9.lib;mfuuid.lib;dxva2.lib;evr.lib;mf.lib;strmiids.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>bin\Debug/Win7RefreshRateHelper.dll</OutputFile>
- <AdditionalLibraryDirectories>$(DSHOW_BASE)Debug_MBCS; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(DSHOW_BASE)Debug; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<ModuleDefinitionFile>./source/Win7RefreshRateHelper.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -108,7 +108,7 @@
<Link>
<AdditionalDependencies>strmbase.lib;winmm.lib;comsupp.lib;dxguid.lib;d3d9.lib;d3dx9.lib;mfuuid.lib;dxva2.lib;evr.lib;mf.lib;strmiids.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>bin\Release/Win7RefreshRateHelper.dll</OutputFile>
- <AdditionalLibraryDirectories>$(DSHOW_BASE)Release_MBCS; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(DSHOW_BASE)Release; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<ModuleDefinitionFile>./source/Win7RefreshRateHelper.def</ModuleDefinitionFile>
View
8 mediaportal/Core.cpp/fontEngine/fontEngine.vcxproj
@@ -18,11 +18,11 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -70,7 +70,7 @@
<Link>
<AdditionalDependencies>dxguid.lib;d3d9.lib;d3dx9.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>bin\Debug/fontEngine.dll</OutputFile>
- <AdditionalLibraryDirectories>$(DSHOW_BASE)Debug_MBCS; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(DSHOW_BASE)Debug; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ModuleDefinitionFile>.\source\fontEngine.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>bin\Debug/fontEngine.pdb</ProgramDatabaseFile>
@@ -102,7 +102,7 @@
<Link>
<AdditionalDependencies>dxguid.lib;d3d9.lib;d3dx9.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>bin\Release/fontEngine.dll</OutputFile>
- <AdditionalLibraryDirectories>$(DSHOW_BASE)Release_MBCS; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(DSHOW_BASE)Release; $(DXSDK_DIR)lib\x86;$(WINDOWS_SDK)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ModuleDefinitionFile>./source/fontEngine.def</ModuleDefinitionFile>
<GenerateDebugInformation>false</GenerateDebugInformation>
<ProgramDatabaseFile>bin\Release/fontEngine.pdb</ProgramDatabaseFile>
View
14 mediaportal/Core.cpp/fontEngine/source/fontEngine.cpp
@@ -15,12 +15,14 @@
// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
+
+#include <vector>
+#include <shlobj.h>
+
#include "fontEngine.h"
#include "transformmatrix.h"
using namespace std;
-#include <vector>
-#include <shlobj.h>
// For more details for memory leak detection see the alloctracing.h header
#include "..\..\alloctracing.h"
@@ -153,11 +155,11 @@ void Log(char* txt)
{
TCHAR folder[MAX_PATH];
::SHGetSpecialFolderPath(NULL,folder,CSIDL_COMMON_APPDATA,FALSE);
- sprintf(logFile,"%s\\Team MediaPortal\\MediaPortal\\Log\\fontEngine.log",folder);
+ _stprintf(logFile, _T("%s\\Team MediaPortal\\MediaPortal\\Log\\fontEngine.log"), folder);
pathInitialized=true;
}
- FILE* fp = fopen(logFile,"a+");
+ FILE* fp = _tfopen(logFile, _T("a+"));
if (!fp)
{
// failed to open log file, folder missing?
@@ -2114,8 +2116,8 @@ void FontEngineRemoveFont(int fontNumber)
void PrintStatistics()
{
- char log[128];
- sprintf(log,"fontengine: Textures InUse:%d VertexBuffer Updates:%d %d\n",m_iTexturesInUse, m_iVertexBuffersUpdated,m_iFontVertexBuffersUpdated);
+ TCHAR log[256];
+ _stprintf(log, _T("fontengine: Textures InUse:%d VertexBuffer Updates:%d %d\n"), m_iTexturesInUse, m_iVertexBuffersUpdated, m_iFontVertexBuffersUpdated);
OutputDebugString(log);
}
View
1  mediaportal/Core.cpp/fontEngine/source/stdafx.h
@@ -23,6 +23,7 @@
#include <mmsystem.h>
#include <d3d9.h>
#include <d3dx9.h>
+#include <tchar.h>
#include <strsafe.h>
#include <d3d9types.h>
// TODO: reference additional headers your program requires here
Please sign in to comment.
Something went wrong with that request. Please try again.