Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@users.sourceforge.net>2011-05-03 18:00:27 +0400
committerXhmikosR <xhmikosr@users.sourceforge.net>2011-05-03 18:00:27 +0400
commita283669d90fd4766dffe734be5a5998b7e57c52d (patch)
treec06d02db50103d89fbaa7837f0d8c2fc59f829cd /src/filters/renderer
parenta10493b2eedbed40b0ca028d7b512dabca84556a (diff)
legacy branch: merge r2857-r3069 from trunk
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/branches/legacy@3070 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/renderer')
-rw-r--r--src/filters/renderer/MpcAudioRenderer/MpcAudioRenderer.cpp12
-rw-r--r--src/filters/renderer/MpcAudioRenderer/MpcAudioRenderer.rc17
-rw-r--r--src/filters/renderer/MpcAudioRenderer/MpcAudioRendererFilter.vcproj60
-rw-r--r--src/filters/renderer/MpcAudioRenderer/MpcAudioRendererFilter.vcxproj42
-rw-r--r--src/filters/renderer/MpcAudioRenderer/MpcAudioRendererFilter.vcxproj.filters3
-rw-r--r--src/filters/renderer/MpcAudioRenderer/MpcAudioRendererSettingsWnd.cpp2
-rw-r--r--src/filters/renderer/MpcAudioRenderer/SoundTouch/Include/BPMDetect.h17
-rw-r--r--src/filters/renderer/MpcAudioRenderer/SoundTouch/Include/FIFOSampleBuffer.h4
-rw-r--r--src/filters/renderer/MpcAudioRenderer/SoundTouch/Include/FIFOSamplePipe.h4
-rw-r--r--src/filters/renderer/MpcAudioRenderer/SoundTouch/Include/STTypes.h44
-rw-r--r--src/filters/renderer/MpcAudioRenderer/SoundTouch/Include/SoundTouch.h33
-rw-r--r--src/filters/renderer/MpcAudioRenderer/SoundTouch/source/3dnow_win.cpp349
-rw-r--r--src/filters/renderer/MpcAudioRenderer/SoundTouch/source/AAFilter.cpp4
-rw-r--r--src/filters/renderer/MpcAudioRenderer/SoundTouch/source/AAFilter.h4
-rw-r--r--src/filters/renderer/MpcAudioRenderer/SoundTouch/source/BPMDetect.cpp61
-rw-r--r--src/filters/renderer/MpcAudioRenderer/SoundTouch/source/FIFOSampleBuffer.cpp4
-rw-r--r--src/filters/renderer/MpcAudioRenderer/SoundTouch/source/FIRFilter.cpp41
-rw-r--r--src/filters/renderer/MpcAudioRenderer/SoundTouch/source/FIRFilter.h31
-rw-r--r--src/filters/renderer/MpcAudioRenderer/SoundTouch/source/PeakFinder.cpp6
-rw-r--r--src/filters/renderer/MpcAudioRenderer/SoundTouch/source/PeakFinder.h4
-rw-r--r--src/filters/renderer/MpcAudioRenderer/SoundTouch/source/RateTransposer.cpp16
-rw-r--r--src/filters/renderer/MpcAudioRenderer/SoundTouch/source/RateTransposer.h4
-rw-r--r--src/filters/renderer/MpcAudioRenderer/SoundTouch/source/SoundTouch.cpp16
-rw-r--r--src/filters/renderer/MpcAudioRenderer/SoundTouch/source/TDStretch.cpp53
-rw-r--r--src/filters/renderer/MpcAudioRenderer/SoundTouch/source/TDStretch.h34
-rw-r--r--src/filters/renderer/MpcAudioRenderer/SoundTouch/source/cpu_detect.h4
-rw-r--r--src/filters/renderer/MpcAudioRenderer/SoundTouch/source/cpu_detect_x86_win.cpp4
-rw-r--r--src/filters/renderer/MpcAudioRenderer/SoundTouch/source/mmx_optimized.cpp10
-rw-r--r--src/filters/renderer/MpcAudioRenderer/SoundTouch/source/sse_optimized.cpp14
-rw-r--r--src/filters/renderer/MpcAudioRenderer/resource.h15
-rw-r--r--src/filters/renderer/SyncClock/SyncClock.vcproj20
-rw-r--r--src/filters/renderer/SyncClock/SyncClock.vcxproj30
-rw-r--r--src/filters/renderer/VideoRenderers/AllocatorCommon.cpp4
-rw-r--r--src/filters/renderer/VideoRenderers/DX7AllocatorPresenter.cpp7
-rw-r--r--src/filters/renderer/VideoRenderers/DX7AllocatorPresenter.h3
-rw-r--r--src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp90
-rw-r--r--src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.h19
-rw-r--r--src/filters/renderer/VideoRenderers/DX9RenderingEngine.cpp54
-rw-r--r--src/filters/renderer/VideoRenderers/DXRAllocatorPresenter.cpp4
-rw-r--r--src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp429
-rw-r--r--src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.h3
-rw-r--r--src/filters/renderer/VideoRenderers/IPinHook.cpp80
-rw-r--r--src/filters/renderer/VideoRenderers/OuterEVR.cpp195
-rw-r--r--src/filters/renderer/VideoRenderers/OuterEVR.h99
-rw-r--r--src/filters/renderer/VideoRenderers/OuterVMR.cpp160
-rw-r--r--src/filters/renderer/VideoRenderers/OuterVMR.h366
-rw-r--r--src/filters/renderer/VideoRenderers/SyncRenderer.cpp20
-rw-r--r--src/filters/renderer/VideoRenderers/SyncRenderer.h3
-rw-r--r--src/filters/renderer/VideoRenderers/VMR9AllocatorPresenter.cpp442
-rw-r--r--src/filters/renderer/VideoRenderers/VideoRenderers.vcproj40
-rw-r--r--src/filters/renderer/VideoRenderers/VideoRenderers.vcxproj54
-rw-r--r--src/filters/renderer/VideoRenderers/VideoRenderers.vcxproj.filters12
-rw-r--r--src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.cpp32
-rw-r--r--src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.h14
54 files changed, 1510 insertions, 1582 deletions
diff --git a/src/filters/renderer/MpcAudioRenderer/MpcAudioRenderer.cpp b/src/filters/renderer/MpcAudioRenderer/MpcAudioRenderer.cpp
index 4399e77fe..22665477f 100644
--- a/src/filters/renderer/MpcAudioRenderer/MpcAudioRenderer.cpp
+++ b/src/filters/renderer/MpcAudioRenderer/MpcAudioRenderer.cpp
@@ -147,6 +147,7 @@ CMpcAudioRenderer::CMpcAudioRenderer(LPUNKNOWN punk, HRESULT *phr)
{
HMODULE hLib;
+#ifdef REGISTER_FILTER
CRegKey key;
TCHAR buff[256];
ULONG len;
@@ -165,6 +166,11 @@ CMpcAudioRenderer::CMpcAudioRenderer(LPUNKNOWN punk, HRESULT *phr)
m_csSound_Device = CString(buff);
}
}
+#else
+ m_useWASAPI = AfxGetApp()->GetProfileInt(_T("Filters\\MPC Audio Renderer"), _T("UseWasapi"), m_useWASAPI);
+ m_bMuteFastForward = AfxGetApp()->GetProfileInt(_T("Filters\\MPC Audio Renderer"), _T("MuteFastForward"), m_bMuteFastForward);
+ m_csSound_Device = AfxGetApp()->GetProfileString(_T("Filters\\MPC Audio Renderer"), _T("SoundDevice"), _T(""));
+#endif
m_useWASAPIAfterRestart = m_useWASAPI;
@@ -585,12 +591,18 @@ STDMETHODIMP CMpcAudioRenderer::CreatePage(const GUID& guid, IPropertyPage** ppP
// === IMpcAudioRendererFilter
STDMETHODIMP CMpcAudioRenderer::Apply()
{
+#ifdef REGISTER_FILTER
CRegKey key;
if(ERROR_SUCCESS == key.Create(HKEY_CURRENT_USER, _T("Software\\Gabest\\Filters\\MPC Audio Renderer"))) {
key.SetDWORDValue(_T("UseWasapi"), m_useWASAPIAfterRestart);
key.SetDWORDValue(_T("MuteFastForward"), m_bMuteFastForward);
key.SetStringValue(_T("SoundDevice"), m_csSound_Device);
}
+#else
+ AfxGetApp()->WriteProfileInt(_T("Filters\\MPC Audio Renderer"), _T("UseWasapi"), m_useWASAPI);
+ AfxGetApp()->WriteProfileInt(_T("Filters\\MPC Audio Renderer"), _T("MuteFastForward"), m_bMuteFastForward);
+ AfxGetApp()->WriteProfileString(_T("Filters\\MPC Audio Renderer"), _T("SoundDevice"), m_csSound_Device);
+#endif
return S_OK;
}
diff --git a/src/filters/renderer/MpcAudioRenderer/MpcAudioRenderer.rc b/src/filters/renderer/MpcAudioRenderer/MpcAudioRenderer.rc
index 835389da7..4e3f291e4 100644
--- a/src/filters/renderer/MpcAudioRenderer/MpcAudioRenderer.rc
+++ b/src/filters/renderer/MpcAudioRenderer/MpcAudioRenderer.rc
@@ -52,8 +52,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION MPC_VERSION
- PRODUCTVERSION MPC_VERSION
+ FILEVERSION MPC_VERSION_NUM
+ PRODUCTVERSION MPC_VERSION_NUM
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -68,12 +68,12 @@ BEGIN
BEGIN
BLOCK "040904b0"
BEGIN
- VALUE "Comments", "http://sourceforge.net/projects/mpc-hc/"
- VALUE "CompanyName", MPC_COMP_NAME
+ VALUE "Comments", MPC_VERSION_COMMENTS
+ VALUE "CompanyName", MPC_COMP_NAME_STR
VALUE "FileDescription", "Audio Renderer, based on SoundTouch"
VALUE "FileVersion", MPC_VERSION_STR
VALUE "InternalName", "MpcAudioRenderer Filter"
- VALUE "LegalCopyright", MPC_COPYRIGHT
+ VALUE "LegalCopyright", MPC_COPYRIGHT_STR
VALUE "OriginalFilename", "MpcAudioRendererFilter.ax"
VALUE "ProductName", "MpcAudioRenderer Filter"
VALUE "ProductVersion", MPC_VERSION_STR
@@ -85,6 +85,13 @@ BEGIN
END
END
+STRINGTABLE
+BEGIN
+ IDS_ARS_WASAPI_MODE "Use WASAPI (restart playback)"
+ IDS_ARS_MUTE_FAST_FORWARD "Mute on fast forward"
+ IDS_ARS_SOUND_DEVICE "Sound Device:"
+END
+
#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
diff --git a/src/filters/renderer/MpcAudioRenderer/MpcAudioRendererFilter.vcproj b/src/filters/renderer/MpcAudioRenderer/MpcAudioRendererFilter.vcproj
index 15692b85a..18b7b74c2 100644
--- a/src/filters/renderer/MpcAudioRenderer/MpcAudioRendererFilter.vcproj
+++ b/src/filters/renderer/MpcAudioRenderer/MpcAudioRendererFilter.vcproj
@@ -45,13 +45,15 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\..\include;SoundTouch\include;..\..\BaseClasses"
- PreprocessorDefinitions="REGISTER_FILTER;WIN32;_DEBUG;_USRDLL;INTEGER_SAMPLES"
+ PreprocessorDefinitions="REGISTER_FILTER;WIN32;_DEBUG;_USRDLL;SOUNDTOUCH_INTEGER_SAMPLES"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;WIN32"
+ Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -114,7 +116,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\..\include;SoundTouch\include;..\..\BaseClasses"
- PreprocessorDefinitions="REGISTER_FILTER;WIN32;_DEBUG;_USRDLL;INTEGER_SAMPLES"
+ PreprocessorDefinitions="REGISTER_FILTER;WIN32;_DEBUG;_USRDLL;SOUNDTOUCH_INTEGER_SAMPLES"
DebugInformationFormat="3"
/>
<Tool
@@ -122,6 +124,8 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;_WIN64"
+ Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -182,13 +186,15 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\..\include;SoundTouch\include;..\..\BaseClasses"
- PreprocessorDefinitions="REGISTER_FILTER;WIN32;NDEBUG;_USRDLL;INTEGER_SAMPLES"
+ PreprocessorDefinitions="REGISTER_FILTER;WIN32;NDEBUG;_USRDLL;SOUNDTOUCH_INTEGER_SAMPLES"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;WIN32"
+ Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -251,7 +257,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\..\include;SoundTouch\include;..\..\BaseClasses"
- PreprocessorDefinitions="_WIN64;REGISTER_FILTER;WIN32;NDEBUG;_USRDLL;INTEGER_SAMPLES"
+ PreprocessorDefinitions="_WIN64;REGISTER_FILTER;WIN32;NDEBUG;_USRDLL;SOUNDTOUCH_INTEGER_SAMPLES"
EnableEnhancedInstructionSet="0"
/>
<Tool
@@ -259,6 +265,8 @@
/>
<Tool
Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;_WIN64"
+ Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
@@ -319,7 +327,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\..\include;SoundTouch\include;..\..\BaseClasses"
- PreprocessorDefinitions="WIN32;_DEBUG;INTEGER_SAMPLES"
+ PreprocessorDefinitions="WIN32;_DEBUG;SOUNDTOUCH_INTEGER_SAMPLES"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -377,7 +385,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\..\include;SoundTouch\include;..\..\BaseClasses"
- PreprocessorDefinitions="_WIN64;_DEBUG;INTEGER_SAMPLES"
+ PreprocessorDefinitions="_WIN64;_DEBUG;SOUNDTOUCH_INTEGER_SAMPLES"
DebugInformationFormat="3"
/>
<Tool
@@ -435,7 +443,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\..\include;SoundTouch\include;..\..\BaseClasses"
- PreprocessorDefinitions="WIN32;NDEBUG;FLAC__NO_DLL;INTEGER_SAMPLES"
+ PreprocessorDefinitions="WIN32;NDEBUG;FLAC__NO_DLL;SOUNDTOUCH_INTEGER_SAMPLES"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -493,7 +501,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\..\include;SoundTouch\include;..\..\BaseClasses"
- PreprocessorDefinitions="_WIN64;NDEBUG;FLAC__NO_DLL;INTEGER_SAMPLES"
+ PreprocessorDefinitions="_WIN64;NDEBUG;FLAC__NO_DLL;SOUNDTOUCH_INTEGER_SAMPLES"
EnableEnhancedInstructionSet="0"
/>
<Tool
@@ -716,42 +724,6 @@
Name="source"
>
<File
- RelativePath=".\SoundTouch\source\3dnow_win.cpp"
- >
- <FileConfiguration
- Name="Debug Filter|x64"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release Filter|x64"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- </File>
- <File
RelativePath=".\SoundTouch\source\AAFilter.cpp"
>
</File>
diff --git a/src/filters/renderer/MpcAudioRenderer/MpcAudioRendererFilter.vcxproj b/src/filters/renderer/MpcAudioRenderer/MpcAudioRendererFilter.vcxproj
index 4d1166d14..1d5ed0313 100644
--- a/src/filters/renderer/MpcAudioRenderer/MpcAudioRendererFilter.vcxproj
+++ b/src/filters/renderer/MpcAudioRenderer/MpcAudioRendererFilter.vcxproj
@@ -44,49 +44,41 @@
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>Static</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>Static</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Filter|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>Static</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Filter|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>Static</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>Static</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>Static</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Filter|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>Static</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Filter|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>Static</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -138,7 +130,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Filter|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\..\include;SoundTouch\include;..\..\BaseClasses;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>REGISTER_FILTER;WIN32;_DEBUG;_USRDLL;INTEGER_SAMPLES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>REGISTER_FILTER;WIN32;_DEBUG;_USRDLL;SOUNDTOUCH_INTEGER_SAMPLES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies>BaseClasses.lib;DSUtil.lib;dsound.lib;Winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -148,6 +140,9 @@
<ModuleDefinitionFile>MpcAudioRenderer.def</ModuleDefinitionFile>
<TargetMachine>MachineX86</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Filter|x64'">
<Midl>
@@ -155,7 +150,7 @@
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\..\include;SoundTouch\include;..\..\BaseClasses;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>REGISTER_FILTER;WIN32;_DEBUG;_USRDLL;INTEGER_SAMPLES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>REGISTER_FILTER;WIN32;_DEBUG;_USRDLL;SOUNDTOUCH_INTEGER_SAMPLES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
@@ -165,11 +160,14 @@
<ModuleDefinitionFile>MpcAudioRenderer.def</ModuleDefinitionFile>
<TargetMachine>MachineX64</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Filter|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\..\include;SoundTouch\include;..\..\BaseClasses;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>REGISTER_FILTER;WIN32;NDEBUG;_USRDLL;INTEGER_SAMPLES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>REGISTER_FILTER;WIN32;NDEBUG;_USRDLL;SOUNDTOUCH_INTEGER_SAMPLES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies>BaseClasses.lib;DSUtil.lib;dsound.lib;Winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -179,6 +177,9 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<TargetMachine>MachineX86</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Filter|x64'">
<Midl>
@@ -186,7 +187,7 @@
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\..\include;SoundTouch\include;..\..\BaseClasses;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_WIN64;REGISTER_FILTER;WIN32;NDEBUG;_USRDLL;INTEGER_SAMPLES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_WIN64;REGISTER_FILTER;WIN32;NDEBUG;_USRDLL;SOUNDTOUCH_INTEGER_SAMPLES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
@@ -197,11 +198,14 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<TargetMachine>MachineX64</TargetMachine>
</Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_UNICODE;UNICODE;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\..\include;SoundTouch\include;..\..\BaseClasses;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;INTEGER_SAMPLES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>WIN32;_DEBUG;SOUNDTOUCH_INTEGER_SAMPLES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Lib>
<AdditionalDependencies>dsound.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -215,7 +219,7 @@
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\..\include;SoundTouch\include;..\..\BaseClasses;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_WIN64;_DEBUG;INTEGER_SAMPLES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_WIN64;_DEBUG;SOUNDTOUCH_INTEGER_SAMPLES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
@@ -227,7 +231,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\..\include;SoundTouch\include;..\..\BaseClasses;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;FLAC__NO_DLL;INTEGER_SAMPLES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;FLAC__NO_DLL;SOUNDTOUCH_INTEGER_SAMPLES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Lib>
@@ -242,7 +246,7 @@
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\..\include;SoundTouch\include;..\..\BaseClasses;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_WIN64;NDEBUG;FLAC__NO_DLL;INTEGER_SAMPLES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_WIN64;NDEBUG;FLAC__NO_DLL;SOUNDTOUCH_INTEGER_SAMPLES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
</ClCompile>
<Lib>
@@ -265,12 +269,6 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
- <ClCompile Include="SoundTouch\source\3dnow_win.cpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Filter|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Filter|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
- </ClCompile>
<ClCompile Include="SoundTouch\source\AAFilter.cpp" />
<ClCompile Include="SoundTouch\source\BPMDetect.cpp" />
<ClCompile Include="SoundTouch\source\cpu_detect_x86_win.cpp">
diff --git a/src/filters/renderer/MpcAudioRenderer/MpcAudioRendererFilter.vcxproj.filters b/src/filters/renderer/MpcAudioRenderer/MpcAudioRendererFilter.vcxproj.filters
index 675e6c959..8a1a00c93 100644
--- a/src/filters/renderer/MpcAudioRenderer/MpcAudioRendererFilter.vcxproj.filters
+++ b/src/filters/renderer/MpcAudioRenderer/MpcAudioRendererFilter.vcxproj.filters
@@ -33,9 +33,6 @@
<ClCompile Include="stdafx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="SoundTouch\source\3dnow_win.cpp">
- <Filter>SoundTouch\source</Filter>
- </ClCompile>
<ClCompile Include="SoundTouch\source\AAFilter.cpp">
<Filter>SoundTouch\source</Filter>
</ClCompile>
diff --git a/src/filters/renderer/MpcAudioRenderer/MpcAudioRendererSettingsWnd.cpp b/src/filters/renderer/MpcAudioRenderer/MpcAudioRendererSettingsWnd.cpp
index 3459330ed..bf1b5dccf 100644
--- a/src/filters/renderer/MpcAudioRenderer/MpcAudioRendererSettingsWnd.cpp
+++ b/src/filters/renderer/MpcAudioRenderer/MpcAudioRendererSettingsWnd.cpp
@@ -92,7 +92,7 @@ bool CMpcAudioRendererSettingsWnd::OnActivate()
nPosY += VERTICAL_SPACING;
m_cbMuteFastForward.Create (ResStr (IDS_ARS_MUTE_FAST_FORWARD), WS_VISIBLE|WS_CHILD|BS_AUTOCHECKBOX|BS_LEFTTEXT, CRect (LEFT_SPACING, nPosY, 325, nPosY+15), this, IDC_PP_MUTE_FAST_FORWARD);
nPosY += VERTICAL_SPACING + 5;
- m_txtSoundDevice.Create (/*ResStr (IDS_ARS_SOUND_DEVICE)*/_T("Sound Device:"), WS_VISIBLE|WS_CHILD, CRect (LEFT_SPACING, nPosY, 100, nPosY+15), this, (UINT)IDC_STATIC);
+ m_txtSoundDevice.Create (ResStr (IDS_ARS_SOUND_DEVICE), WS_VISIBLE|WS_CHILD, CRect (LEFT_SPACING, nPosY, 100, nPosY+15), this, (UINT)IDC_STATIC);
m_cbSoundDevice.Create (WS_VISIBLE|WS_CHILD|CBS_DROPDOWNLIST|WS_VSCROLL, CRect (110, nPosY-4, 325, nPosY+90), this, IDC_PP_SOUND_DEVICE);
SetClassLongPtr(GetDlgItem(IDC_PP_SOUND_DEVICE)->m_hWnd, GCLP_HCURSOR, (long) AfxGetApp()->LoadStandardCursor(IDC_HAND));
diff --git a/src/filters/renderer/MpcAudioRenderer/SoundTouch/Include/BPMDetect.h b/src/filters/renderer/MpcAudioRenderer/SoundTouch/Include/BPMDetect.h
index 4def43f1e..ff1d3c44f 100644
--- a/src/filters/renderer/MpcAudioRenderer/SoundTouch/Include/BPMDetect.h
+++ b/src/filters/renderer/MpcAudioRenderer/SoundTouch/Include/BPMDetect.h
@@ -26,10 +26,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2009-02-21 18:00:14 +0200 (Sat, 21 Feb 2009) $
+// Last changed : $Date$
// File revision : $Revision: 4 $
//
-// $Id: BPMDetect.h 63 2009-02-21 16:00:14Z oparviai $
+// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -78,10 +78,19 @@ protected:
float *xcorr;
/// Amplitude envelope sliding average approximation level accumulator
- float envelopeAccu;
+ double envelopeAccu;
/// RMS volume sliding average approximation level accumulator
- float RMSVolumeAccu;
+ double RMSVolumeAccu;
+
+ /// Level below which to cut off signals
+ double cutCoeff;
+
+ /// Accumulator for accounting what proportion of samples exceed cutCoeff level
+ double aboveCutAccu;
+
+ /// Accumulator for total samples to calculate proportion of samples that exceed cutCoeff level
+ double totalAccu;
/// Sample average counter.
int decimateCount;
diff --git a/src/filters/renderer/MpcAudioRenderer/SoundTouch/Include/FIFOSampleBuffer.h b/src/filters/renderer/MpcAudioRenderer/SoundTouch/Include/FIFOSampleBuffer.h
index 76cbf9514..e69918ac2 100644
--- a/src/filters/renderer/MpcAudioRenderer/SoundTouch/Include/FIFOSampleBuffer.h
+++ b/src/filters/renderer/MpcAudioRenderer/SoundTouch/Include/FIFOSampleBuffer.h
@@ -15,10 +15,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2009-02-21 18:00:14 +0200 (Sat, 21 Feb 2009) $
+// Last changed : $Date$
// File revision : $Revision: 4 $
//
-// $Id: FIFOSampleBuffer.h 63 2009-02-21 16:00:14Z oparviai $
+// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//
diff --git a/src/filters/renderer/MpcAudioRenderer/SoundTouch/Include/FIFOSamplePipe.h b/src/filters/renderer/MpcAudioRenderer/SoundTouch/Include/FIFOSamplePipe.h
index b5fc3b779..ad982cbba 100644
--- a/src/filters/renderer/MpcAudioRenderer/SoundTouch/Include/FIFOSamplePipe.h
+++ b/src/filters/renderer/MpcAudioRenderer/SoundTouch/Include/FIFOSamplePipe.h
@@ -17,10 +17,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2009-04-13 16:18:48 +0300 (Mon, 13 Apr 2009) $
+// Last changed : $Date$
// File revision : $Revision: 4 $
//
-// $Id: FIFOSamplePipe.h 69 2009-04-13 13:18:48Z oparviai $
+// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//
diff --git a/src/filters/renderer/MpcAudioRenderer/SoundTouch/Include/STTypes.h b/src/filters/renderer/MpcAudioRenderer/SoundTouch/Include/STTypes.h
index cad502ffa..98186a552 100644
--- a/src/filters/renderer/MpcAudioRenderer/SoundTouch/Include/STTypes.h
+++ b/src/filters/renderer/MpcAudioRenderer/SoundTouch/Include/STTypes.h
@@ -8,10 +8,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2009-05-17 14:30:57 +0300 (Sun, 17 May 2009) $
+// Last changed : $Date$
// File revision : $Revision: 3 $
//
-// $Id: STTypes.h 70 2009-05-17 11:30:57Z oparviai $
+// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -63,10 +63,10 @@ namespace soundtouch
/// Activate these undef's to overrule the possible sampletype
/// setting inherited from some other header file:
-//#undef INTEGER_SAMPLES
-//#undef FLOAT_SAMPLES
+//#undef SOUNDTOUCH_INTEGER_SAMPLES
+//#undef SOUNDTOUCH_FLOAT_SAMPLES
-#if !(INTEGER_SAMPLES || FLOAT_SAMPLES)
+#if !(SOUNDTOUCH_INTEGER_SAMPLES || SOUNDTOUCH_FLOAT_SAMPLES)
/// Choose either 32bit floating point or 16bit integer sampletype
/// by choosing one of the following defines, unless this selection
@@ -82,42 +82,42 @@ namespace soundtouch
/// However, if you still prefer to select the sample format here
/// also in GNU environment, then please #undef the INTEGER_SAMPLE
/// and FLOAT_SAMPLE defines first as in comments above.
- //#define INTEGER_SAMPLES 1 //< 16bit integer samples
- #define FLOAT_SAMPLES 1 //< 32bit float samples
+ //#define SOUNDTOUCH_INTEGER_SAMPLES 1 //< 16bit integer samples
+ #define SOUNDTOUCH_FLOAT_SAMPLES 1 //< 32bit float samples
#endif
- #ifndef _WIN64
+ #ifndef _WIN64 //mpc custom code
/// Define this to allow X86-specific assembler/intrinsic optimizations.
/// Notice that library contains also usual C++ versions of each of these
/// these routines, so if you're having difficulties getting the optimized
/// routines compiled for whatever reason, you may disable these optimizations
/// to make the library compile.
- #define ALLOW_X86_OPTIMIZATIONS 1
+ #define SOUNDTOUCH_ALLOW_X86_OPTIMIZATIONS 1
#endif
// If defined, allows the SIMD-optimized routines to take minor shortcuts
// for improved performance. Undefine to require faithfully similar SIMD
// calculations as in normal C implementation.
- #define ALLOW_NONEXACT_SIMD_OPTIMIZATION 1
+ #define SOUNDTOUCH_ALLOW_NONEXACT_SIMD_OPTIMIZATION 1
- #ifdef INTEGER_SAMPLES
+ #ifdef SOUNDTOUCH_INTEGER_SAMPLES
// 16bit integer sample type
typedef short SAMPLETYPE;
// data type for sample accumulation: Use 32bit integer to prevent overflows
typedef long LONG_SAMPLETYPE;
- #ifdef FLOAT_SAMPLES
+ #ifdef SOUNDTOUCH_FLOAT_SAMPLES
// check that only one sample type is defined
#error "conflicting sample types defined"
- #endif // FLOAT_SAMPLES
+ #endif // SOUNDTOUCH_FLOAT_SAMPLES
- #ifdef ALLOW_X86_OPTIMIZATIONS
+ #ifdef SOUNDTOUCH_ALLOW_X86_OPTIMIZATIONS
// Allow MMX optimizations
- #define ALLOW_MMX 1
+ #define SOUNDTOUCH_ALLOW_MMX 1
#endif
#else
@@ -127,16 +127,12 @@ namespace soundtouch
// data type for sample accumulation: Use double to utilize full precision.
typedef double LONG_SAMPLETYPE;
- #ifdef ALLOW_X86_OPTIMIZATIONS
- // Allow 3DNow! and SSE optimizations
- #if WIN32
- #define ALLOW_3DNOW 1
- #endif
-
- #define ALLOW_SSE 1
+ #ifdef SOUNDTOUCH_ALLOW_X86_OPTIMIZATIONS
+ // Allow SSE optimizations
+ #define SOUNDTOUCH_ALLOW_SSE 1
#endif
- #endif // INTEGER_SAMPLES
+ #endif // SOUNDTOUCH_INTEGER_SAMPLES
};
@@ -144,6 +140,6 @@ namespace soundtouch
// parameter setting crosses from value <1 to >=1 or vice versa during processing.
// Default is off as such crossover is untypical case and involves a slight sound
// quality compromise.
-//#define PREVENT_CLICK_AT_RATE_CROSSOVER 1
+//#define SOUNDTOUCH_PREVENT_CLICK_AT_RATE_CROSSOVER 1
#endif
diff --git a/src/filters/renderer/MpcAudioRenderer/SoundTouch/Include/SoundTouch.h b/src/filters/renderer/MpcAudioRenderer/SoundTouch/Include/SoundTouch.h
index 0e042d3c0..203d84fc4 100644
--- a/src/filters/renderer/MpcAudioRenderer/SoundTouch/Include/SoundTouch.h
+++ b/src/filters/renderer/MpcAudioRenderer/SoundTouch/Include/SoundTouch.h
@@ -41,10 +41,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2009-12-28 22:10:14 +0200 (Mon, 28 Dec 2009) $
+// Last changed : $Date$
// File revision : $Revision: 4 $
//
-// $Id: SoundTouch.h 78 2009-12-28 20:10:14Z oparviai $
+// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -79,10 +79,10 @@ namespace soundtouch
{
/// Soundtouch library version string
-#define SOUNDTOUCH_VERSION "1.5.0"
+#define SOUNDTOUCH_VERSION "1.5.1pre"
/// SoundTouch library version id
-#define SOUNDTOUCH_VERSION_ID (10500)
+#define SOUNDTOUCH_VERSION_ID (10509)
//
// Available setting IDs for the 'setSetting' & 'get_setting' functions:
@@ -116,6 +116,31 @@ namespace soundtouch
#define SETTING_OVERLAP_MS 5
+/// Call "getSetting" with this ID to query nominal average processing sequence
+/// size in samples. This value tells approcimate value how many input samples
+/// SoundTouch needs to gather before it does DSP processing run for the sample batch.
+///
+/// Notices:
+/// - This is read-only parameter, i.e. setSetting ignores this parameter
+/// - Returned value is approximate average value, exact processing batch
+/// size may wary from time to time
+/// - This parameter value is not constant but may change depending on
+/// tempo/pitch/rate/samplerate settings.
+#define SETTING_NOMINAL_INPUT_SEQUENCE 6
+
+
+/// Call "getSetting" with this ID to query nominal average processing output
+/// size in samples. This value tells approcimate value how many output samples
+/// SoundTouch outputs once it does DSP processing run for a batch of input samples.
+///
+/// Notices:
+/// - This is read-only parameter, i.e. setSetting ignores this parameter
+/// - Returned value is approximate average value, exact processing batch
+/// size may wary from time to time
+/// - This parameter value is not constant but may change depending on
+/// tempo/pitch/rate/samplerate settings.
+#define SETTING_NOMINAL_OUTPUT_SEQUENCE 7
+
class SoundTouch : public FIFOProcessor
{
private:
diff --git a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/3dnow_win.cpp b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/3dnow_win.cpp
deleted file mode 100644
index f0a9d7ecc..000000000
--- a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/3dnow_win.cpp
+++ /dev/null
@@ -1,349 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-///
-/// Win32 version of the AMD 3DNow! optimized routines for AMD K6-2/Athlon
-/// processors. All 3DNow! optimized functions have been gathered into this
-/// single source code file, regardless to their class or original source code
-/// file, in order to ease porting the library to other compiler and processor
-/// platforms.
-///
-/// By the way; the performance gain depends heavily on the CPU generation: On
-/// K6-2 these routines provided speed-up of even 2.4 times, while on Athlon the
-/// difference to the original routines stayed at unremarkable 8%! Such a small
-/// improvement on Athlon is due to 3DNow can perform only two operations in
-/// parallel, and obviously also the Athlon FPU is doing a very good job with
-/// the standard C floating point routines! Here these routines are anyway,
-/// although it might not be worth the effort to convert these to GCC platform,
-/// for Athlon CPU at least. The situation is different regarding the SSE
-/// optimizations though, thanks to the four parallel operations of SSE that
-/// already make a difference.
-///
-/// This file is to be compiled in Windows platform with Microsoft Visual C++
-/// Compiler. Please see '3dnow_gcc.cpp' for the gcc compiler version for all
-/// GNU platforms (if file supplied).
-///
-/// NOTICE: If using Visual Studio 6.0, you'll need to install the "Visual C++
-/// 6.0 processor pack" update to support 3DNow! instruction set. The update is
-/// available for download at Microsoft Developers Network, see here:
-/// http://msdn.microsoft.com/en-us/vstudio/aa718349.aspx
-///
-/// If the above URL is expired or removed, go to "http://msdn.microsoft.com" and
-/// perform a search with keywords "processor pack".
-///
-/// Author : Copyright (c) Olli Parviainen
-/// Author e-mail : oparviai 'at' iki.fi
-/// SoundTouch WWW: http://www.surina.net/soundtouch
-///
-////////////////////////////////////////////////////////////////////////////////
-//
-// Last changed : $Date: 2009-02-21 18:00:14 +0200 (Sat, 21 Feb 2009) $
-// File revision : $Revision: 4 $
-//
-// $Id: 3dnow_win.cpp 63 2009-02-21 16:00:14Z oparviai $
-//
-////////////////////////////////////////////////////////////////////////////////
-//
-// License :
-//
-// SoundTouch audio processing library
-// Copyright (c) Olli Parviainen
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-////////////////////////////////////////////////////////////////////////////////
-
-#include "cpu_detect.h"
-#include "STTypes.h"
-
-#ifndef WIN32
-#error "wrong platform - this source code file is exclusively for Win32 platform"
-#endif
-
-using namespace soundtouch;
-
-#ifdef ALLOW_3DNOW
-// 3DNow! routines available only with float sample type
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// implementation of 3DNow! optimized functions of class 'TDStretch3DNow'
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#include "TDStretch.h"
-
-
-// Calculates cross correlation of two buffers
-double TDStretch3DNow::calcCrossCorrStereo(const float *pV1, const float *pV2) const
-{
- int overlapLengthLocal = overlapLength;
- float corr = 0;
-
- // Calculates the cross-correlation value between 'pV1' and 'pV2' vectors
- /*
- c-pseudocode:
-
- corr = 0;
- for (i = 0; i < overlapLength / 4; i ++)
- {
- corr += pV1[0] * pV2[0];
- pV1[1] * pV2[1];
- pV1[2] * pV2[2];
- pV1[3] * pV2[3];
- pV1[4] * pV2[4];
- pV1[5] * pV2[5];
- pV1[6] * pV2[6];
- pV1[7] * pV2[7];
-
- pV1 += 8;
- pV2 += 8;
- }
- */
-
- _asm
- {
- // give prefetch hints to CPU of what data are to be needed soonish.
- // give more aggressive hints on pV1 as that changes more between different calls
- // while pV2 stays the same.
- prefetch [pV1]
- prefetch [pV2]
- prefetch [pV1 + 32]
-
- mov eax, dword ptr pV2
- mov ebx, dword ptr pV1
-
- pxor mm0, mm0
-
- mov ecx, overlapLengthLocal
- shr ecx, 2 // div by four
-
- loop1:
- movq mm1, [eax]
- prefetch [eax + 32] // give a prefetch hint to CPU what data are to be needed soonish
- pfmul mm1, [ebx]
- prefetch [ebx + 64] // give a prefetch hint to CPU what data are to be needed soonish
-
- movq mm2, [eax + 8]
- pfadd mm0, mm1
- pfmul mm2, [ebx + 8]
-
- movq mm3, [eax + 16]
- pfadd mm0, mm2
- pfmul mm3, [ebx + 16]
-
- movq mm4, [eax + 24]
- pfadd mm0, mm3
- pfmul mm4, [ebx + 24]
-
- add eax, 32
- pfadd mm0, mm4
- add ebx, 32
-
- dec ecx
- jnz loop1
-
- // add halfs of mm0 together and return the result.
- // note: mm1 is used as a dummy parameter only, we actually don't care about it's value
- pfacc mm0, mm1
- movd corr, mm0
- femms
- }
-
- return corr;
-}
-
-
-
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// implementation of 3DNow! optimized functions of class 'FIRFilter'
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#include "FIRFilter.h"
-
-FIRFilter3DNow::FIRFilter3DNow() : FIRFilter()
-{
- filterCoeffsUnalign = NULL;
- filterCoeffsAlign = NULL;
-}
-
-
-FIRFilter3DNow::~FIRFilter3DNow()
-{
- delete[] filterCoeffsUnalign;
- filterCoeffsUnalign = NULL;
- filterCoeffsAlign = NULL;
-}
-
-
-// (overloaded) Calculates filter coefficients for 3DNow! routine
-void FIRFilter3DNow::setCoefficients(const float *coeffs, uint newLength, uint uResultDivFactor)
-{
- uint i;
- float fDivider;
-
- FIRFilter::setCoefficients(coeffs, newLength, uResultDivFactor);
-
- // Scale the filter coefficients so that it won't be necessary to scale the filtering result
- // also rearrange coefficients suitably for 3DNow!
- // Ensure that filter coeffs array is aligned to 16-byte boundary
- delete[] filterCoeffsUnalign;
- filterCoeffsUnalign = new float[2 * newLength + 4];
- filterCoeffsAlign = (float *)(((uint)filterCoeffsUnalign + 15) & (uint)-16);
-
- fDivider = (float)resultDivider;
-
- // rearrange the filter coefficients for mmx routines
- for (i = 0; i < newLength; i ++)
- {
- filterCoeffsAlign[2 * i + 0] =
- filterCoeffsAlign[2 * i + 1] = coeffs[i + 0] / fDivider;
- }
-}
-
-
-// 3DNow!-optimized version of the filter routine for stereo sound
-uint FIRFilter3DNow::evaluateFilterStereo(float *dest, const float *src, uint numSamples) const
-{
- float *filterCoeffsLocal = filterCoeffsAlign;
- uint count = (numSamples - length) & (uint)-2;
- uint lengthLocal = length / 4;
-
- assert(length != 0);
- assert(count % 2 == 0);
-
- /* original code:
-
- double suml1, suml2;
- double sumr1, sumr2;
- uint i, j;
-
- for (j = 0; j < count; j += 2)
- {
- const float *ptr;
-
- suml1 = sumr1 = 0.0;
- suml2 = sumr2 = 0.0;
- ptr = src;
- filterCoeffsLocal = filterCoeffs;
- for (i = 0; i < lengthLocal; i ++)
- {
- // unroll loop for efficiency.
-
- suml1 += ptr[0] * filterCoeffsLocal[0] +
- ptr[2] * filterCoeffsLocal[2] +
- ptr[4] * filterCoeffsLocal[4] +
- ptr[6] * filterCoeffsLocal[6];
-
- sumr1 += ptr[1] * filterCoeffsLocal[1] +
- ptr[3] * filterCoeffsLocal[3] +
- ptr[5] * filterCoeffsLocal[5] +
- ptr[7] * filterCoeffsLocal[7];
-
- suml2 += ptr[8] * filterCoeffsLocal[0] +
- ptr[10] * filterCoeffsLocal[2] +
- ptr[12] * filterCoeffsLocal[4] +
- ptr[14] * filterCoeffsLocal[6];
-
- sumr2 += ptr[9] * filterCoeffsLocal[1] +
- ptr[11] * filterCoeffsLocal[3] +
- ptr[13] * filterCoeffsLocal[5] +
- ptr[15] * filterCoeffsLocal[7];
-
- ptr += 16;
- filterCoeffsLocal += 8;
- }
- dest[0] = (float)suml1;
- dest[1] = (float)sumr1;
- dest[2] = (float)suml2;
- dest[3] = (float)sumr2;
-
- src += 4;
- dest += 4;
- }
-
- */
- _asm
- {
- mov eax, dword ptr dest
- mov ebx, dword ptr src
- mov edx, count
- shr edx, 1
-
- loop1:
- // "outer loop" : during each round 2*2 output samples are calculated
- prefetch [ebx] // give a prefetch hint to CPU what data are to be needed soonish
- prefetch [filterCoeffsLocal] // give a prefetch hint to CPU what data are to be needed soonish
-
- mov esi, ebx
- mov edi, filterCoeffsLocal
- pxor mm0, mm0
- pxor mm1, mm1
- mov ecx, lengthLocal
-
- loop2:
- // "inner loop" : during each round four FIR filter taps are evaluated for 2*2 output samples
- movq mm2, [edi]
- movq mm3, mm2
- prefetch [edi + 32] // give a prefetch hint to CPU what data are to be needed soonish
- pfmul mm2, [esi]
- prefetch [esi + 32] // give a prefetch hint to CPU what data are to be needed soonish
- pfmul mm3, [esi + 8]
-
- movq mm4, [edi + 8]
- movq mm5, mm4
- pfadd mm0, mm2
- pfmul mm4, [esi + 8]
- pfadd mm1, mm3
- pfmul mm5, [esi + 16]
-
- movq mm2, [edi + 16]
- movq mm6, mm2
- pfadd mm0, mm4
- pfmul mm2, [esi + 16]
- pfadd mm1, mm5
- pfmul mm6, [esi + 24]
-
- movq mm3, [edi + 24]
- movq mm7, mm3
- pfadd mm0, mm2
- pfmul mm3, [esi + 24]
- pfadd mm1, mm6
- pfmul mm7, [esi + 32]
- add esi, 32
- pfadd mm0, mm3
- add edi, 32
- pfadd mm1, mm7
-
- dec ecx
- jnz loop2
-
- movq [eax], mm0
- add ebx, 16
- movq [eax + 8], mm1
- add eax, 16
-
- dec edx
- jnz loop1
-
- femms
- }
-
- return count;
-}
-
-
-#endif // ALLOW_3DNOW
diff --git a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/AAFilter.cpp b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/AAFilter.cpp
index 96abda49c..191b97b13 100644
--- a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/AAFilter.cpp
+++ b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/AAFilter.cpp
@@ -12,10 +12,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2009-01-11 13:34:24 +0200 (Sun, 11 Jan 2009) $
+// Last changed : $Date$
// File revision : $Revision: 4 $
//
-// $Id: AAFilter.cpp 45 2009-01-11 11:34:24Z oparviai $
+// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//
diff --git a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/AAFilter.h b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/AAFilter.h
index d5c8ce4ca..0ab97dde1 100644
--- a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/AAFilter.h
+++ b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/AAFilter.h
@@ -13,10 +13,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2008-02-10 18:26:55 +0200 (Sun, 10 Feb 2008) $
+// Last changed : $Date$
// File revision : $Revision: 4 $
//
-// $Id: AAFilter.h 11 2008-02-10 16:26:55Z oparviai $
+// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//
diff --git a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/BPMDetect.cpp b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/BPMDetect.cpp
index 405f514bf..4faa29409 100644
--- a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/BPMDetect.cpp
+++ b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/BPMDetect.cpp
@@ -26,10 +26,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2009-02-21 18:00:14 +0200 (Sat, 21 Feb 2009) $
+// Last changed : $Date$
// File revision : $Revision: 4 $
//
-// $Id: BPMDetect.cpp 63 2009-02-21 16:00:14Z oparviai $
+// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -88,7 +88,7 @@ BPMDetect::BPMDetect(int numChannels, int aSampleRate)
// Initialize RMS volume accumulator to RMS level of 3000 (out of 32768) that's
// a typical RMS signal level value for song data. This value is then adapted
// to the actual level during processing.
-#ifdef INTEGER_SAMPLES
+#ifdef SOUNDTOUCH_INTEGER_SAMPLES
// integer samples
RMSVolumeAccu = (3000 * 3000) / avgnorm;
#else
@@ -96,6 +96,10 @@ BPMDetect::BPMDetect(int numChannels, int aSampleRate)
RMSVolumeAccu = (0.092f * 0.092f) / avgnorm;
#endif
+ cutCoeff = 1.75;
+ aboveCutAccu = 0;
+ totalAccu = 0;
+
// choose decimation factor so that result is approx. 500 Hz
decimateBy = sampleRate / 500;
assert(decimateBy > 0);
@@ -165,7 +169,7 @@ int BPMDetect::decimate(SAMPLETYPE *dest, const SAMPLETYPE *src, int numsamples)
out = (LONG_SAMPLETYPE)(decimateSum / (decimateBy * channels));
decimateSum = 0;
decimateCount = 0;
-#ifdef INTEGER_SAMPLES
+#ifdef SOUNDTOUCH_INTEGER_SAMPLES
// check ranges for sure (shouldn't actually be necessary)
if (out > 32767)
{
@@ -175,7 +179,7 @@ int BPMDetect::decimate(SAMPLETYPE *dest, const SAMPLETYPE *src, int numsamples)
{
out = -32768;
}
-#endif // INTEGER_SAMPLES
+#endif // SOUNDTOUCH_INTEGER_SAMPLES
dest[outcount] = (SAMPLETYPE)out;
outcount ++;
}
@@ -215,16 +219,15 @@ void BPMDetect::updateXCorr(int process_samples)
}
-
// Calculates envelope of the sample data
void BPMDetect::calcEnvelope(SAMPLETYPE *samples, int numsamples)
{
- const float decay = 0.7f; // decay constant for smoothing the envelope
- const float norm = (1 - decay);
+ const static double decay = 0.7f; // decay constant for smoothing the envelope
+ const static double norm = (1 - decay);
int i;
LONG_SAMPLETYPE out;
- float val;
+ double val;
for (i = 0; i < numsamples; i ++)
{
@@ -233,22 +236,50 @@ void BPMDetect::calcEnvelope(SAMPLETYPE *samples, int numsamples)
val = (float)fabs((float)samples[i]);
RMSVolumeAccu += val * val;
- // cut amplitudes that are below 2 times average RMS volume
+ // cut amplitudes that are below cutoff ~2 times RMS volume
// (we're interested in peak values, not the silent moments)
- val -= 2 * (float)sqrt(RMSVolumeAccu * avgnorm);
- val = (val > 0) ? val : 0;
+ val -= cutCoeff * sqrt(RMSVolumeAccu * avgnorm);
+ if (val > 0)
+ {
+ aboveCutAccu += 1.0; // sample above threshold
+ }
+ else
+ {
+ val = 0;
+ }
+
+ totalAccu += 1.0;
+
+ // maintain sliding statistic what proportion of 'val' samples is
+ // above cutoff threshold
+ aboveCutAccu *= 0.99931; // 2 sec time constant
+ totalAccu *= 0.99931;
+
+ if (totalAccu > 500)
+ {
+ // after initial settling, auto-adjust cutoff level so that ~8% of
+ // values are above the threshold
+ double d = (aboveCutAccu / totalAccu) - 0.08;
+ cutCoeff += 0.001 * d;
+ }
// smooth amplitude envelope
envelopeAccu *= decay;
envelopeAccu += val;
out = (LONG_SAMPLETYPE)(envelopeAccu * norm);
-#ifdef INTEGER_SAMPLES
+#ifdef SOUNDTOUCH_INTEGER_SAMPLES
// cut peaks (shouldn't be necessary though)
if (out > 32767) out = 32767;
-#endif // INTEGER_SAMPLES
+#endif // SOUNDTOUCH_INTEGER_SAMPLES
samples[i] = (SAMPLETYPE)out;
}
+
+ // check that cutoff doesn't get too small - it can be just silent sequence!
+ if (cutCoeff < 1.5)
+ {
+ cutCoeff = 1.5;
+ }
}
@@ -301,7 +332,7 @@ float BPMDetect::getBpm()
peakPos = peakFinder.detectPeak(xcorr, windowStart, windowLen);
assert(decimateBy != 0);
- if (peakPos < 1e-6) return 0.0; // detection failed.
+ if (peakPos < 1e-9) return 0.0; // detection failed.
// calculate BPM
return (float)(60.0 * (((double)sampleRate / (double)decimateBy) / peakPos));
diff --git a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/FIFOSampleBuffer.cpp b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/FIFOSampleBuffer.cpp
index 01f64b083..8393f7b0d 100644
--- a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/FIFOSampleBuffer.cpp
+++ b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/FIFOSampleBuffer.cpp
@@ -15,10 +15,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2009-02-27 19:24:42 +0200 (Fri, 27 Feb 2009) $
+// Last changed : $Date$
// File revision : $Revision: 4 $
//
-// $Id: FIFOSampleBuffer.cpp 68 2009-02-27 17:24:42Z oparviai $
+// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//
diff --git a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/FIRFilter.cpp b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/FIRFilter.cpp
index f17d997ed..161d68516 100644
--- a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/FIRFilter.cpp
+++ b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/FIRFilter.cpp
@@ -11,10 +11,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2009-02-25 19:13:51 +0200 (Wed, 25 Feb 2009) $
+// Last changed : $Date$
// File revision : $Revision: 4 $
//
-// $Id: FIRFilter.cpp 67 2009-02-25 17:13:51Z oparviai $
+// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -75,7 +75,7 @@ uint FIRFilter::evaluateFilterStereo(SAMPLETYPE *dest, const SAMPLETYPE *src, ui
{
uint i, j, end;
LONG_SAMPLETYPE suml, sumr;
-#ifdef FLOAT_SAMPLES
+#ifdef SOUNDTOUCH_FLOAT_SAMPLES
// when using floating point samples, use a scaler instead of a divider
// because division is much slower operation than multiplying.
double dScaler = 1.0 / (double)resultDivider;
@@ -108,7 +108,7 @@ uint FIRFilter::evaluateFilterStereo(SAMPLETYPE *dest, const SAMPLETYPE *src, ui
ptr[2 * i + 7] * filterCoeffs[i + 3];
}
-#ifdef INTEGER_SAMPLES
+#ifdef SOUNDTOUCH_INTEGER_SAMPLES
suml >>= resultDivFactor;
sumr >>= resultDivFactor;
// saturate to 16 bit integer limits
@@ -118,7 +118,7 @@ uint FIRFilter::evaluateFilterStereo(SAMPLETYPE *dest, const SAMPLETYPE *src, ui
#else
suml *= dScaler;
sumr *= dScaler;
-#endif // INTEGER_SAMPLES
+#endif // SOUNDTOUCH_INTEGER_SAMPLES
dest[j] = (SAMPLETYPE)suml;
dest[j + 1] = (SAMPLETYPE)sumr;
}
@@ -133,7 +133,7 @@ uint FIRFilter::evaluateFilterMono(SAMPLETYPE *dest, const SAMPLETYPE *src, uint
{
uint i, j, end;
LONG_SAMPLETYPE sum;
-#ifdef FLOAT_SAMPLES
+#ifdef SOUNDTOUCH_FLOAT_SAMPLES
// when using floating point samples, use a scaler instead of a divider
// because division is much slower operation than multiplying.
double dScaler = 1.0 / (double)resultDivider;
@@ -154,13 +154,13 @@ uint FIRFilter::evaluateFilterMono(SAMPLETYPE *dest, const SAMPLETYPE *src, uint
src[i + 2] * filterCoeffs[i + 2] +
src[i + 3] * filterCoeffs[i + 3];
}
-#ifdef INTEGER_SAMPLES
+#ifdef SOUNDTOUCH_INTEGER_SAMPLES
sum >>= resultDivFactor;
// saturate to 16 bit integer limits
sum = (sum < -32768) ? -32768 : (sum > 32767) ? 32767 : sum;
#else
sum *= dScaler;
-#endif // INTEGER_SAMPLES
+#endif // SOUNDTOUCH_INTEGER_SAMPLES
dest[j] = (SAMPLETYPE)sum;
src ++;
}
@@ -219,7 +219,7 @@ uint FIRFilter::evaluate(SAMPLETYPE *dest, const SAMPLETYPE *src, uint numSample
// Operator 'new' is overloaded so that it automatically creates a suitable instance
// depending on if we've a MMX-capable CPU available or not.
-void * FIRFilter::operator new(size_t /*s*/)
+void * FIRFilter::operator new(size_t s)
{
// Notice! don't use "new FIRFilter" directly, use "newInstance" to create a new instance instead!
throw std::runtime_error("Error in FIRFilter::new: Don't use 'new FIRFilter', use 'newInstance' member instead!");
@@ -229,41 +229,32 @@ void * FIRFilter::operator new(size_t /*s*/)
FIRFilter * FIRFilter::newInstance()
{
-#ifndef _WIN64
+#ifndef _WIN64 //mpc custom code
uint uExtensions;
uExtensions = detectCPUextensions();
- // Check if MMX/SSE/3DNow! instruction set extensions supported by CPU
+ // Check if MMX/SSE instruction set extensions supported by CPU
-#ifdef ALLOW_MMX
+#ifdef SOUNDTOUCH_ALLOW_MMX
// MMX routines available only with integer sample types
if (uExtensions & SUPPORT_MMX)
{
return ::new FIRFilterMMX;
}
else
-#endif // ALLOW_MMX
+#endif // SOUNDTOUCH_ALLOW_MMX
-#ifdef ALLOW_SSE
+#ifdef SOUNDTOUCH_ALLOW_SSE
if (uExtensions & SUPPORT_SSE)
{
// SSE support
return ::new FIRFilterSSE;
}
else
-#endif // ALLOW_SSE
+#endif // SOUNDTOUCH_ALLOW_SSE
-#ifdef ALLOW_3DNOW
- if (uExtensions & SUPPORT_3DNOW)
- {
- // 3DNow! support
- return ::new FIRFilter3DNow;
- }
- else
-#endif // ALLOW_3DNOW
-
-#endif // _WIN64
+#endif // _WIN64 mpc custom code
{
// ISA optimizations not supported, use plain C version
diff --git a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/FIRFilter.h b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/FIRFilter.h
index 5713f7bb2..fcee72ac1 100644
--- a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/FIRFilter.h
+++ b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/FIRFilter.h
@@ -11,10 +11,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2009-02-21 18:00:14 +0200 (Sat, 21 Feb 2009) $
+// Last changed : $Date$
// File revision : $Revision: 4 $
//
-// $Id: FIRFilter.h 63 2009-02-21 16:00:14Z oparviai $
+// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -102,7 +102,7 @@ public:
// Optional subclasses that implement CPU-specific optimizations:
-#ifdef ALLOW_MMX
+#ifdef SOUNDTOUCH_ALLOW_MMX
/// Class that implements MMX optimized functions exclusive for 16bit integer samples type.
class FIRFilterMMX : public FIRFilter
@@ -119,29 +119,10 @@ public:
virtual void setCoefficients(const short *coeffs, uint newLength, uint uResultDivFactor);
};
-#endif // ALLOW_MMX
+#endif // SOUNDTOUCH_ALLOW_MMX
-#ifdef ALLOW_3DNOW
-
- /// Class that implements 3DNow! optimized functions exclusive for floating point samples type.
- class FIRFilter3DNow : public FIRFilter
- {
- protected:
- float *filterCoeffsUnalign;
- float *filterCoeffsAlign;
-
- virtual uint evaluateFilterStereo(float *dest, const float *src, uint numSamples) const;
- public:
- FIRFilter3DNow();
- ~FIRFilter3DNow();
- virtual void setCoefficients(const float *coeffs, uint newLength, uint uResultDivFactor);
- };
-
-#endif // ALLOW_3DNOW
-
-
-#ifdef ALLOW_SSE
+#ifdef SOUNDTOUCH_ALLOW_SSE
/// Class that implements SSE optimized functions exclusive for floating point samples type.
class FIRFilterSSE : public FIRFilter
{
@@ -157,7 +138,7 @@ public:
virtual void setCoefficients(const float *coeffs, uint newLength, uint uResultDivFactor);
};
-#endif // ALLOW_SSE
+#endif // SOUNDTOUCH_ALLOW_SSE
}
diff --git a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/PeakFinder.cpp b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/PeakFinder.cpp
index 03f60bfa9..9ad601cd9 100644
--- a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/PeakFinder.cpp
+++ b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/PeakFinder.cpp
@@ -11,10 +11,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2009-02-21 18:00:14 +0200 (Sat, 21 Feb 2009) $
+// Last changed : $Date$
// File revision : $Revision: 4 $
//
-// $Id: PeakFinder.cpp 63 2009-02-21 16:00:14Z oparviai $
+// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -164,7 +164,7 @@ double PeakFinder::getPeakCenter(const float *data, int peakpos) const
groundLevel = max(data[gp1], data[gp2]);
peakLevel = data[peakpos];
- if (groundLevel < 1e-6) return 0; // ground level too small => detection failed
+ if (groundLevel < 1e-9) return 0; // ground level too small => detection failed
if ((peakLevel / groundLevel) < 1.3) return 0; // peak less than 30% of the ground level => no good peak detected
// calculate 70%-level of the peak
diff --git a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/PeakFinder.h b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/PeakFinder.h
index e3640cc6d..a72b24f28 100644
--- a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/PeakFinder.h
+++ b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/PeakFinder.h
@@ -9,10 +9,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2009-02-21 18:00:14 +0200 (Sat, 21 Feb 2009) $
+// Last changed : $Date$
// File revision : $Revision: 4 $
//
-// $Id: PeakFinder.h 63 2009-02-21 16:00:14Z oparviai $
+// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//
diff --git a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/RateTransposer.cpp b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/RateTransposer.cpp
index 49d71ab9d..2afc18750 100644
--- a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/RateTransposer.cpp
+++ b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/RateTransposer.cpp
@@ -10,10 +10,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2009-10-31 16:37:24 +0200 (Sat, 31 Oct 2009) $
+// Last changed : $Date$
// File revision : $Revision: 4 $
//
-// $Id: RateTransposer.cpp 74 2009-10-31 14:37:24Z oparviai $
+// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -106,7 +106,7 @@ public:
// Operator 'new' is overloaded so that it automatically creates a suitable instance
// depending on if we've a MMX/SSE/etc-capable CPU available or not.
-void * RateTransposer::operator new(size_t /*s*/)
+void * RateTransposer::operator new(size_t s)
{
throw runtime_error("Error in RateTransoser::new: don't use \"new TDStretch\" directly, use \"newInstance\" to create a new instance instead!");
return NULL;
@@ -115,7 +115,7 @@ void * RateTransposer::operator new(size_t /*s*/)
RateTransposer *RateTransposer::newInstance()
{
-#ifdef INTEGER_SAMPLES
+#ifdef SOUNDTOUCH_INTEGER_SAMPLES
return ::new RateTransposerInteger;
#else
return ::new RateTransposerFloat;
@@ -417,7 +417,7 @@ uint RateTransposerInteger::transposeMono(SAMPLETYPE *dest, const SAMPLETYPE *sr
// now always (iSlopeCount > SCALE)
iSlopeCount -= SCALE;
- while (TRUE)
+ while (1)
{
while (iSlopeCount > SCALE)
{
@@ -467,7 +467,7 @@ uint RateTransposerInteger::transposeStereo(SAMPLETYPE *dest, const SAMPLETYPE *
// now always (iSlopeCount > SCALE)
iSlopeCount -= SCALE;
- while (TRUE)
+ while (1)
{
while (iSlopeCount > SCALE)
{
@@ -554,7 +554,7 @@ uint RateTransposerFloat::transposeMono(SAMPLETYPE *dest, const SAMPLETYPE *src,
if (nSamples > 1)
{
- while (TRUE)
+ while (1)
{
while (fSlopeCount > 1.0f)
{
@@ -600,7 +600,7 @@ uint RateTransposerFloat::transposeStereo(SAMPLETYPE *dest, const SAMPLETYPE *sr
if (nSamples > 1)
{
- while (TRUE)
+ while (1)
{
while (fSlopeCount > 1.0f)
{
diff --git a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/RateTransposer.h b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/RateTransposer.h
index f035af2c0..9cd1c6f06 100644
--- a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/RateTransposer.h
+++ b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/RateTransposer.h
@@ -14,10 +14,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2009-02-21 18:00:14 +0200 (Sat, 21 Feb 2009) $
+// Last changed : $Date$
// File revision : $Revision: 4 $
//
-// $Id: RateTransposer.h 63 2009-02-21 16:00:14Z oparviai $
+// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//
diff --git a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/SoundTouch.cpp b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/SoundTouch.cpp
index aa7ac0284..6f7b9a894 100644
--- a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/SoundTouch.cpp
+++ b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/SoundTouch.cpp
@@ -41,10 +41,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2009-05-19 07:57:30 +0300 (Tue, 19 May 2009) $
+// Last changed : $Date$
// File revision : $Revision: 4 $
//
-// $Id: SoundTouch.cpp 73 2009-05-19 04:57:30Z oparviai $
+// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -243,7 +243,7 @@ void SoundTouch::calcEffectiveRateAndTempo()
if (!TEST_FLOAT_EQUAL(rate,oldRate)) pRateTransposer->setRate(rate);
if (!TEST_FLOAT_EQUAL(tempo, oldTempo)) pTDStretch->setTempo(tempo);
-#ifndef PREVENT_CLICK_AT_RATE_CROSSOVER
+#ifndef SOUNDTOUCH_PREVENT_CLICK_AT_RATE_CROSSOVER
if (rate <= 1.0f)
{
if (output != pTDStretch)
@@ -317,7 +317,7 @@ void SoundTouch::putSamples(const SAMPLETYPE *samples, uint nSamples)
pTDStretch->putSamples(samples, nSamples);
}
*/
-#ifndef PREVENT_CLICK_AT_RATE_CROSSOVER
+#ifndef SOUNDTOUCH_PREVENT_CLICK_AT_RATE_CROSSOVER
else if (rate <= 1.0f)
{
// transpose the rate down, output the transposed sound to tempo changer buffer
@@ -448,7 +448,13 @@ int SoundTouch::getSetting(int settingId) const
pTDStretch->getParameters(NULL, NULL, NULL, &temp);
return temp;
- default :
+ case SETTING_NOMINAL_INPUT_SEQUENCE :
+ return pTDStretch->getInputSampleReq();
+
+ case SETTING_NOMINAL_OUTPUT_SEQUENCE :
+ return pTDStretch->getOutputBatchSize();
+
+ default :
return 0;
}
}
diff --git a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/TDStretch.cpp b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/TDStretch.cpp
index 6dea5f516..97109aa70 100644
--- a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/TDStretch.cpp
+++ b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/TDStretch.cpp
@@ -13,10 +13,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2009-12-28 21:27:04 +0200 (Mon, 28 Dec 2009) $
+// Last changed : $Date$
// File revision : $Revision: 1.12 $
//
-// $Id: TDStretch.cpp 77 2009-12-28 19:27:04Z oparviai $
+// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -646,7 +646,6 @@ void TDStretch::processSamples()
// Process samples as long as there are enough samples in 'inputBuffer'
// to form a processing frame.
-// while ((int)inputBuffer.numSamples() >= sampleReq - (outDebt / 4))
while ((int)inputBuffer.numSamples() >= sampleReq)
{
// If tempo differs from the normal ('SCALE'), scan for the best overlapping
@@ -661,16 +660,8 @@ void TDStretch::processSamples()
outputBuffer.putSamples((uint)overlapLength);
// ... then copy sequence samples from 'inputBuffer' to output:
- temp = (seekLength / 2 - offset);
-
- // compensate cumulated output length diff vs. ideal output
-// temp -= outDebt / 4;
-
- // update ideal vs. true output difference
-// outDebt += temp;
// length of sequence
-// temp += (seekWindowLength - 2 * overlapLength);
temp = (seekWindowLength - 2 * overlapLength);
// crosscheck that we don't have buffer overflow...
@@ -737,7 +728,7 @@ void TDStretch::acceptNewOverlapLength(int newOverlapLength)
// Operator 'new' is overloaded so that it automatically creates a suitable instance
// depending on if we've a MMX/SSE/etc-capable CPU available or not.
-void * TDStretch::operator new(size_t /*s*/)
+void * TDStretch::operator new(size_t s)
{
// Notice! don't use "new TDStretch" directly, use "newInstance" to create a new instance instead!
throw std::runtime_error("Error in TDStretch::new: Don't use 'new TDStretch' directly, use 'newInstance' member instead!");
@@ -747,43 +738,33 @@ void * TDStretch::operator new(size_t /*s*/)
TDStretch * TDStretch::newInstance()
{
-#ifndef _WIN64
- uint uExtensions;
+#ifndef _WIN64 //mpc custom code
+ uint uExtensions;
uExtensions = detectCPUextensions();
- // Check if MMX/SSE/3DNow! instruction set extensions supported by CPU
+ // Check if MMX/SSE instruction set extensions supported by CPU
-#ifdef ALLOW_MMX
+#ifdef SOUNDTOUCH_ALLOW_MMX
// MMX routines available only with integer sample types
if (uExtensions & SUPPORT_MMX)
{
return ::new TDStretchMMX;
}
else
-#endif // ALLOW_MMX
+#endif // SOUNDTOUCH_ALLOW_MMX
-#ifdef ALLOW_SSE
+#ifdef SOUNDTOUCH_ALLOW_SSE
if (uExtensions & SUPPORT_SSE)
{
// SSE support
return ::new TDStretchSSE;
}
else
-#endif // ALLOW_SSE
-
-
-#ifdef ALLOW_3DNOW
- if (uExtensions & SUPPORT_3DNOW)
- {
- // 3DNow! support
- return ::new TDStretch3DNow;
- }
- else
-#endif // ALLOW_3DNOW
+#endif // SOUNDTOUCH_ALLOW_SSE
-#endif // _WIN64
+#endif // _WIN64 mpc custom code
{
// ISA optimizations not supported, use plain C version
@@ -798,7 +779,7 @@ TDStretch * TDStretch::newInstance()
//
//////////////////////////////////////////////////////////////////////////////
-#ifdef INTEGER_SAMPLES
+#ifdef SOUNDTOUCH_INTEGER_SAMPLES
// Slopes the amplitude of the 'midBuffer' samples so that cross correlation
// is faster to calculate
@@ -849,8 +830,8 @@ void TDStretch::overlapStereo(short *poutput, const short *input) const
{
temp = (short)(overlapLength - i);
cnt2 = 2 * i;
- poutput[cnt2] = (short)((input[cnt2] * i + pMidBuffer[cnt2] * temp ) / overlapLength);
- poutput[cnt2 + 1] = (short)((input[cnt2 + 1] * i + pMidBuffer[cnt2 + 1] * temp ) / overlapLength);
+ poutput[cnt2] = (input[cnt2] * i + pMidBuffer[cnt2] * temp ) / overlapLength;
+ poutput[cnt2 + 1] = (input[cnt2 + 1] * i + pMidBuffer[cnt2 + 1] * temp ) / overlapLength;
}
}
@@ -927,14 +908,14 @@ long TDStretch::calcCrossCorrStereo(const short *mixingPos, const short *compare
return (long)((double)corr * SHRT_MAX / sqrt((double)norm));
}
-#endif // INTEGER_SAMPLES
+#endif // SOUNDTOUCH_INTEGER_SAMPLES
//////////////////////////////////////////////////////////////////////////////
//
// Floating point arithmetics specific algorithm implementations.
//
-#ifdef FLOAT_SAMPLES
+#ifdef SOUNDTOUCH_FLOAT_SAMPLES
// Slopes the amplitude of the 'midBuffer' samples so that cross correlation
@@ -1045,4 +1026,4 @@ double TDStretch::calcCrossCorrStereo(const float *mixingPos, const float *compa
return corr / sqrt(norm);
}
-#endif // FLOAT_SAMPLES
+#endif // SOUNDTOUCH_FLOAT_SAMPLES
diff --git a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/TDStretch.h b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/TDStretch.h
index 00d1f3e31..c236aa4e7 100644
--- a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/TDStretch.h
+++ b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/TDStretch.h
@@ -13,10 +13,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2009-05-17 14:35:13 +0300 (Sun, 17 May 2009) $
+// Last changed : $Date$
// File revision : $Revision: 4 $
//
-// $Id: TDStretch.h 71 2009-05-17 11:35:13Z oparviai $
+// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -233,13 +233,25 @@ public:
uint numSamples ///< Number of samples in 'samples' so that one sample
///< contains both channels if stereo
);
+
+ /// return nominal input sample requirement for triggering a processing batch
+ int getInputSampleReq() const
+ {
+ return (int)(nominalSkip + 0.5);
+ }
+
+ /// return nominal output sample amount when running a processing batch
+ int getOutputBatchSize() const
+ {
+ return seekWindowLength - overlapLength;
+ }
};
// Implementation-specific class declarations:
-#ifdef ALLOW_MMX
+#ifdef SOUNDTOUCH_ALLOW_MMX
/// Class that implements MMX optimized routines for 16bit integer samples type.
class TDStretchMMX : public TDStretch
{
@@ -248,20 +260,10 @@ public:
virtual void overlapStereo(short *output, const short *input) const;
virtual void clearCrossCorrState();
};
-#endif /// ALLOW_MMX
-
-
-#ifdef ALLOW_3DNOW
- /// Class that implements 3DNow! optimized routines for floating point samples type.
- class TDStretch3DNow : public TDStretch
- {
- protected:
- double calcCrossCorrStereo(const float *mixingPos, const float *compare) const;
- };
-#endif /// ALLOW_3DNOW
+#endif /// SOUNDTOUCH_ALLOW_MMX
-#ifdef ALLOW_SSE
+#ifdef SOUNDTOUCH_ALLOW_SSE
/// Class that implements SSE optimized routines for floating point samples type.
class TDStretchSSE : public TDStretch
{
@@ -269,7 +271,7 @@ public:
double calcCrossCorrStereo(const float *mixingPos, const float *compare) const;
};
-#endif /// ALLOW_SSE
+#endif /// SOUNDTOUCH_ALLOW_SSE
}
#endif /// TDStretch_H
diff --git a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/cpu_detect.h b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/cpu_detect.h
index 025781dae..900eb3ce0 100644
--- a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/cpu_detect.h
+++ b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/cpu_detect.h
@@ -12,10 +12,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2008-02-10 18:26:55 +0200 (Sun, 10 Feb 2008) $
+// Last changed : $Date$
// File revision : $Revision: 4 $
//
-// $Id: cpu_detect.h 11 2008-02-10 16:26:55Z oparviai $
+// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//
diff --git a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/cpu_detect_x86_win.cpp b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/cpu_detect_x86_win.cpp
index c6c542467..98ff02254 100644
--- a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/cpu_detect_x86_win.cpp
+++ b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/cpu_detect_x86_win.cpp
@@ -12,10 +12,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2009-02-13 18:22:48 +0200 (Fri, 13 Feb 2009) $
+// Last changed : $Date$
// File revision : $Revision: 4 $
//
-// $Id: cpu_detect_x86_win.cpp 62 2009-02-13 16:22:48Z oparviai $
+// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//
diff --git a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/mmx_optimized.cpp b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/mmx_optimized.cpp
index 2740617a0..495599c9a 100644
--- a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/mmx_optimized.cpp
+++ b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/mmx_optimized.cpp
@@ -20,10 +20,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2009-10-31 16:53:23 +0200 (Sat, 31 Oct 2009) $
+// Last changed : $Date$
// File revision : $Revision: 4 $
//
-// $Id: mmx_optimized.cpp 75 2009-10-31 14:53:23Z oparviai $
+// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -50,7 +50,7 @@
#include "STTypes.h"
-#ifdef ALLOW_MMX
+#ifdef SOUNDTOUCH_ALLOW_MMX
// MMX routines available only with integer sample type
#if !(WIN32 || __i386__ || __x86_64__)
@@ -162,7 +162,7 @@ void TDStretchMMX::overlapStereo(short *output, const short *input) const
// mix1 = mixer values for 2nd stereo sample
// adder = adder for updating mixer values after each round
- mix1 = _mm_set_pi16(0, (short)overlapLength, 0, (short)overlapLength);
+ mix1 = _mm_set_pi16(0, overlapLength, 0, overlapLength);
adder = _mm_set_pi16(1, -1, 1, -1);
mix2 = _mm_add_pi16(mix1, adder);
adder = _mm_add_pi16(adder, adder);
@@ -317,4 +317,4 @@ uint FIRFilterMMX::evaluateFilterStereo(short *dest, const short *src, uint numS
return (numSamples & 0xfffffffe) - length;
}
-#endif // ALLOW_MMX
+#endif // SOUNDTOUCH_ALLOW_MMX
diff --git a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/sse_optimized.cpp b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/sse_optimized.cpp
index 7659be682..a1f318b5f 100644
--- a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/sse_optimized.cpp
+++ b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/sse_optimized.cpp
@@ -23,10 +23,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2009-12-28 22:32:57 +0200 (Mon, 28 Dec 2009) $
+// Last changed : $Date$
// File revision : $Revision: 4 $
//
-// $Id: sse_optimized.cpp 80 2009-12-28 20:32:57Z oparviai $
+// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -56,7 +56,7 @@
using namespace soundtouch;
-#ifdef ALLOW_SSE
+#ifdef SOUNDTOUCH_ALLOW_SSE
// SSE routines available only with float sample type
@@ -84,10 +84,10 @@ double TDStretchSSE::calcCrossCorrStereo(const float *pV1, const float *pV2) con
// This can mean up to ~ 10-fold difference (incl. part of which is
// due to skipping every second round for stereo sound though).
//
- // Compile-time define ALLOW_NONEXACT_SIMD_OPTIMIZATION is provided
+ // Compile-time define SOUNDTOUCH_ALLOW_NONEXACT_SIMD_OPTIMIZATION is provided
// for choosing if this little cheating is allowed.
-#ifdef ALLOW_NONEXACT_SIMD_OPTIMIZATION
+#ifdef SOUNDTOUCH_ALLOW_NONEXACT_SIMD_OPTIMIZATION
// Little cheating allowed, return valid correlation only for
// aligned locations, meaning every second round for stereo sound.
@@ -281,7 +281,7 @@ void FIRFilterSSE::setCoefficients(const float *coeffs, uint newLength, uint uRe
FIRFilter::setCoefficients(coeffs, newLength, uResultDivFactor);
// Scale the filter coefficients so that it won't be necessary to scale the filtering result
- // also rearrange coefficients suitably for 3DNow!
+ // also rearrange coefficients suitably for SSE
// Ensure that filter coeffs array is aligned to 16-byte boundary
delete[] filterCoeffsUnalign;
filterCoeffsUnalign = new float[2 * newLength + 4];
@@ -507,4 +507,4 @@ uint FIRFilterSSE::evaluateFilterStereo(float *dest, const float *source, uint n
*/
}
-#endif // ALLOW_SSE
+#endif // SOUNDTOUCH_ALLOW_SSE
diff --git a/src/filters/renderer/MpcAudioRenderer/resource.h b/src/filters/renderer/MpcAudioRenderer/resource.h
index 63bead336..a43759518 100644
--- a/src/filters/renderer/MpcAudioRenderer/resource.h
+++ b/src/filters/renderer/MpcAudioRenderer/resource.h
@@ -2,21 +2,6 @@
// Microsoft Visual C++ generated include file.
// Used by MpcAudioRenderer.rc
//
-#define IDS_MPADECSETTINGSWND_0 33135
-#define IDS_MPADECSETTINGSWND_1 33136
-#define IDS_MPA_CHANNEL_1 33137
-#define IDS_MPA_CHANNEL_2 33138
-#define IDS_MPADECSETTINGSWND_5 33139
-#define IDS_MPADECSETTINGSWND_7 33140
-#define IDS_MPADECSETTINGSWND_11 33141
-#define IDS_MPADECSETTINGSWND_12 33142
-#define IDS_AG_SETTINGS 33143
-#define IDS_MPA_3F 33151
-#define IDS_MPA_2F_1R 33152
-#define IDS_MPA_3F_1R 33153
-#define IDS_MPA_2F_2R 33154
-#define IDS_MPA_3F_2R 33155
-#define IDS_MPA_DYNRANGE 33156
#define IDS_ARS_WASAPI_MODE 33436
#define IDS_ARS_MUTE_FAST_FORWARD 33437
#define IDS_ARS_SOUND_DEVICE 33438
diff --git a/src/filters/renderer/SyncClock/SyncClock.vcproj b/src/filters/renderer/SyncClock/SyncClock.vcproj
index 3da0e4f89..4ea292ac7 100644
--- a/src/filters/renderer/SyncClock/SyncClock.vcproj
+++ b/src/filters/renderer/SyncClock/SyncClock.vcproj
@@ -43,13 +43,8 @@
/>
<Tool
Name="VCCLCompilerTool"
- Optimization="2"
AdditionalIncludeDirectories="..\..\..\..\include;..\..\BaseClasses"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
- StringPooling="true"
- UsePrecompiledHeader="0"
- DebugInformationFormat="3"
- CallingConvention="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -105,13 +100,9 @@
/>
<Tool
Name="VCCLCompilerTool"
- Optimization="2"
AdditionalIncludeDirectories="..\..\..\..\include;..\..\BaseClasses"
PreprocessorDefinitions="WIN32;NDEBUG;_USRDLL"
EnableEnhancedInstructionSet="0"
- UsePrecompiledHeader="0"
- DebugInformationFormat="3"
- CallingConvention="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -167,16 +158,8 @@
/>
<Tool
Name="VCCLCompilerTool"
- Optimization="0"
- InlineFunctionExpansion="0"
- EnableIntrinsicFunctions="false"
- FavorSizeOrSpeed="0"
- OmitFramePointers="false"
AdditionalIncludeDirectories="..\..\..\..\include;..\..\BaseClasses"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
- UsePrecompiledHeader="0"
- DebugInformationFormat="4"
- CallingConvention="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -231,12 +214,9 @@
/>
<Tool
Name="VCCLCompilerTool"
- Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\include;..\..\BaseClasses"
PreprocessorDefinitions="WIN32;NDEBUG;_USRDLL"
- UsePrecompiledHeader="0"
DebugInformationFormat="3"
- CallingConvention="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
diff --git a/src/filters/renderer/SyncClock/SyncClock.vcxproj b/src/filters/renderer/SyncClock/SyncClock.vcxproj
index 3f4904b0e..45b760a24 100644
--- a/src/filters/renderer/SyncClock/SyncClock.vcxproj
+++ b/src/filters/renderer/SyncClock/SyncClock.vcxproj
@@ -28,25 +28,21 @@
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>Static</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>Static</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>Static</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>Static</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -73,15 +69,8 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
- <Optimization>MaxSpeed</Optimization>
<AdditionalIncludeDirectories>..\..\..\..\include;..\..\BaseClasses;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <StringPooling>true</StringPooling>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- <CallingConvention>Cdecl</CallingConvention>
- <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Lib>
<AdditionalOptions>/IGNORE:4221 %(AdditionalOptions)</AdditionalOptions>
@@ -93,15 +82,9 @@
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
- <Optimization>MaxSpeed</Optimization>
<AdditionalIncludeDirectories>..\..\..\..\include;..\..\BaseClasses;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- <CallingConvention>Cdecl</CallingConvention>
- <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Lib>
<AdditionalOptions>/IGNORE:4221 %(AdditionalOptions)</AdditionalOptions>
@@ -111,17 +94,8 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
- <Optimization>Disabled</Optimization>
- <InlineFunctionExpansion>Default</InlineFunctionExpansion>
- <IntrinsicFunctions>false</IntrinsicFunctions>
- <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
- <OmitFramePointers>false</OmitFramePointers>
<AdditionalIncludeDirectories>..\..\..\..\include;..\..\BaseClasses;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
- <CallingConvention>Cdecl</CallingConvention>
</ClCompile>
<Lib>
<TargetMachine>MachineX86</TargetMachine>
@@ -132,13 +106,9 @@
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
- <Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\..\..\include;..\..\BaseClasses;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PrecompiledHeader>
- </PrecompiledHeader>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- <CallingConvention>Cdecl</CallingConvention>
</ClCompile>
<Lib>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
diff --git a/src/filters/renderer/VideoRenderers/AllocatorCommon.cpp b/src/filters/renderer/VideoRenderers/AllocatorCommon.cpp
index 47b2e6ec1..15fd3b686 100644
--- a/src/filters/renderer/VideoRenderers/AllocatorCommon.cpp
+++ b/src/filters/renderer/VideoRenderers/AllocatorCommon.cpp
@@ -1,7 +1,7 @@
/*
* $Id$
*
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -58,7 +58,7 @@ HRESULT CreateAP9(const CLSID& clsid, HWND hWnd, bool bFullscreen, ISubPicAlloca
|| clsid == CLSID_RM9AllocatorPresenter && !(*ppAP = DNew CRM9AllocatorPresenter(hWnd, bFullscreen, hr, Error))
|| clsid == CLSID_QT9AllocatorPresenter && !(*ppAP = DNew CQT9AllocatorPresenter(hWnd, bFullscreen, hr, Error))
|| clsid == CLSID_DXRAllocatorPresenter && !(*ppAP = DNew CDXRAllocatorPresenter(hWnd, hr, Error))
- || clsid == CLSID_madVRAllocatorPresenter && !(*ppAP = DNew CmadVRAllocatorPresenter(hWnd, bFullscreen, hr, Error))) {
+ || clsid == CLSID_madVRAllocatorPresenter && !(*ppAP = DNew CmadVRAllocatorPresenter(hWnd, hr, Error))) {
return E_OUTOFMEMORY;
}
diff --git a/src/filters/renderer/VideoRenderers/DX7AllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/DX7AllocatorPresenter.cpp
index c3fed705f..5dcab76af 100644
--- a/src/filters/renderer/VideoRenderers/DX7AllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/DX7AllocatorPresenter.cpp
@@ -2,7 +2,7 @@
* $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -442,6 +442,11 @@ STDMETHODIMP_(bool) CDX7AllocatorPresenter::ResetDevice()
return true;
}
+STDMETHODIMP_(bool) CDX7AllocatorPresenter::DisplayChange()
+{
+ return true;
+}
+
STDMETHODIMP CDX7AllocatorPresenter::GetDIB(BYTE* lpDib, DWORD* size)
{
CheckPointer(size, E_POINTER);
diff --git a/src/filters/renderer/VideoRenderers/DX7AllocatorPresenter.h b/src/filters/renderer/VideoRenderers/DX7AllocatorPresenter.h
index a98438695..96070246c 100644
--- a/src/filters/renderer/VideoRenderers/DX7AllocatorPresenter.h
+++ b/src/filters/renderer/VideoRenderers/DX7AllocatorPresenter.h
@@ -2,7 +2,7 @@
* $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -60,6 +60,7 @@ namespace DSObjects
STDMETHODIMP_(bool) Paint(bool fAll);
STDMETHODIMP GetDIB(BYTE* lpDib, DWORD* size);
STDMETHODIMP_(bool) ResetDevice();
+ STDMETHODIMP_(bool) DisplayChange();
};
}
diff --git a/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp
index b830202dd..63eb726c1 100644
--- a/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp
@@ -70,6 +70,7 @@ CDX9AllocatorPresenter::CDX9AllocatorPresenter(HWND hWnd, bool bFullscreen, HRES
, m_hVSyncThread(NULL)
, m_hEvtQuit(NULL)
, m_bIsFullscreen(bFullscreen)
+ , m_Decoder(_T(""))
{
HINSTANCE hDll;
@@ -79,12 +80,14 @@ CDX9AllocatorPresenter::CDX9AllocatorPresenter(HWND hWnd, bool bFullscreen, HRES
}
m_pD3DXLoadSurfaceFromMemory = NULL;
+ m_pD3DXLoadSurfaceFromSurface = NULL;
m_pD3DXCreateLine = NULL;
m_pD3DXCreateFont = NULL;
m_pD3DXCreateSprite = NULL;
hDll = GetRenderersData()->GetD3X9Dll();
if(hDll) {
(FARPROC&)m_pD3DXLoadSurfaceFromMemory = GetProcAddress(hDll, "D3DXLoadSurfaceFromMemory");
+ (FARPROC&)m_pD3DXLoadSurfaceFromSurface = GetProcAddress(hDll, "D3DXLoadSurfaceFromSurface");
(FARPROC&)m_pD3DXCreateLine = GetProcAddress(hDll, "D3DXCreateLine");
(FARPROC&)m_pD3DXCreateFont = GetProcAddress(hDll, "D3DXCreateFontW");
(FARPROC&)m_pD3DXCreateSprite = GetProcAddress(hDll, "D3DXCreateSprite");
@@ -535,6 +538,9 @@ void CDX9AllocatorPresenter::VSyncThread()
m_DetectedRefreshTime = ThisValue;
m_DetectedRefreshTimePrim = 0;
}
+ if(_isnan(m_DetectedRefreshTime)) {m_DetectedRefreshTime = 0.0;}
+ if(_isnan(m_DetectedRefreshTimePrim)) {m_DetectedRefreshTimePrim = 0.0;}
+
ModerateFloat(m_DetectedRefreshTime, ThisValue, m_DetectedRefreshTimePrim, 1.5);
if (m_DetectedRefreshTime > 0.0) {
m_DetectedRefreshRate = 1.0/m_DetectedRefreshTime;
@@ -764,7 +770,7 @@ HRESULT CDX9AllocatorPresenter::CreateDevice(CString &_Error)
m_pDwmIsCompositionEnabled(&bCompositionEnabled);
}
- m_bCompositionEnabled = bCompositionEnabled != 0;
+ m_bCompositionEnabled = bCompositionEnabled;
m_bAlternativeVSync = s.m_RenderSettings.fVMR9AlterativeVSync;
// detect FP textures support
@@ -779,6 +785,7 @@ HRESULT CDX9AllocatorPresenter::CreateDevice(CString &_Error)
m_bFullFloatingPointProcessing = s.m_RenderSettings.iVMR9FullFloatingPointProcessing && renderersData->m_bFP16Support;
m_bHalfFloatingPointProcessing = s.m_RenderSettings.iVMR9HalfFloatingPointProcessing && renderersData->m_bFP16Support && !m_bFullFloatingPointProcessing;
+
// set color formats
if (m_bFullFloatingPointProcessing) {
m_SurfaceType = D3DFMT_A32B32G32R32F;
@@ -787,13 +794,10 @@ HRESULT CDX9AllocatorPresenter::CreateDevice(CString &_Error)
} else if (m_bForceInputHighColorResolution || m_bHighColorResolution) {
m_SurfaceType = D3DFMT_A2R10G10B10;
} else {
- m_SurfaceType = D3DFMT_A8R8G8B8;
- }
-
- if (m_bHighColorResolution) {
- pp.BackBufferFormat = D3DFMT_A2R10G10B10;
- } else {
- pp.BackBufferFormat = D3DFMT_X8R8G8B8;
+ if(m_nPCIVendor == PCIV_ATI)
+ m_SurfaceType = D3DFMT_X8R8G8B8;
+ else
+ m_SurfaceType = D3DFMT_A8R8G8B8;
}
D3DDISPLAYMODEEX DisplayMode;
@@ -803,13 +807,16 @@ HRESULT CDX9AllocatorPresenter::CreateDevice(CString &_Error)
ZeroMemory(&d3ddm, sizeof(d3ddm));
if (m_bIsFullscreen) {
+ if (m_bHighColorResolution) {
+ pp.BackBufferFormat = D3DFMT_A2R10G10B10;
+ } else {
+ pp.BackBufferFormat = D3DFMT_X8R8G8B8;
+ }
pp.Windowed = false;
pp.BackBufferCount = 3;
pp.SwapEffect = D3DSWAPEFFECT_FLIP;
+ // there's no Desktop composition to take care of alternative vSync in exclusive mode, alternative vSync is therefore unused
pp.hDeviceWindow = m_hWnd;
- if(m_bAlternativeVSync) {
- pp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
- }
pp.Flags = D3DPRESENTFLAG_VIDEO;
if (s.m_RenderSettings.iVMR9FullscreenGUISupport && !m_bHighColorResolution) {
pp.Flags |= D3DPRESENTFLAG_LOCKABLE_BACKBUFFER;
@@ -976,7 +983,7 @@ HRESULT CDX9AllocatorPresenter::CreateDevice(CString &_Error)
if(m_pAllocator) {
m_pAllocator->ChangeDevice(m_pD3DDev);
} else {
- m_pAllocator = DNew CDX9SubPicAllocator(m_pD3DDev, size, GetRenderersSettings().fSPCPow2Tex);
+ m_pAllocator = DNew CDX9SubPicAllocator(m_pD3DDev, size, GetRenderersSettings().fSPCPow2Tex, false);
if(!m_pAllocator) {
_Error += L"CDX9SubPicAllocator failed\n";
@@ -1054,22 +1061,25 @@ void CDX9AllocatorPresenter::DeleteSurfaces()
FreeVideoSurfaces();
}
-UINT CDX9AllocatorPresenter::GetAdapter(IDirect3D9* pD3D, bool bCreateDevice)
+UINT CDX9AllocatorPresenter::GetAdapter(IDirect3D9* pD3D, bool bGetAdapter)
{
if(m_hWnd == NULL || pD3D == NULL) {
return D3DADAPTER_DEFAULT;
}
+ m_D3D9Device = _T("");
+ m_nPCIVendor = 0;
+
CRenderersSettings& s = GetRenderersSettings();
- if(bCreateDevice && (pD3D->GetAdapterCount()>1) && (s.D3D9RenderDevice != _T(""))) {
+ if(bGetAdapter && (pD3D->GetAdapterCount()>1) && (s.D3D9RenderDevice != _T(""))) {
TCHAR strGUID[50];
D3DADAPTER_IDENTIFIER9 adapterIdentifier;
- m_D3D9Device = _T("");
for(UINT adp = 0, num_adp = pD3D->GetAdapterCount(); adp < num_adp; ++adp) {
if (pD3D->GetAdapterIdentifier(adp, 0, &adapterIdentifier) == S_OK) {
if ((::StringFromGUID2(adapterIdentifier.DeviceIdentifier, strGUID, 50) > 0) && (s.D3D9RenderDevice == strGUID)) {
m_D3D9Device = adapterIdentifier.Description;
+ m_nPCIVendor = adapterIdentifier.VendorId;
return adp;
}
}
@@ -1084,10 +1094,11 @@ UINT CDX9AllocatorPresenter::GetAdapter(IDirect3D9* pD3D, bool bCreateDevice)
for(UINT adp = 0, num_adp = pD3D->GetAdapterCount(); adp < num_adp; ++adp) {
HMONITOR hAdpMon = pD3D->GetAdapterMonitor(adp);
if(hAdpMon == hMonitor) {
- if(bCreateDevice) {
+ if(bGetAdapter) {
D3DADAPTER_IDENTIFIER9 adapterIdentifier;
if (pD3D->GetAdapterIdentifier(adp, 0, &adapterIdentifier) == S_OK) {
m_D3D9Device = adapterIdentifier.Description;
+ m_nPCIVendor = adapterIdentifier.VendorId;
}
}
return adp;
@@ -1171,9 +1182,7 @@ bool CDX9AllocatorPresenter::GetVBlank(int &_ScanLine, int &_bInVBlank, bool _bM
int ScanLine = 0;
_ScanLine = 0;
_bInVBlank = 0;
- if (m_bPendingResetDevice) {
- return false;
- }
+
if (m_pDirectDraw) {
DWORD ScanLineGet = 0;
m_pDirectDraw->GetScanLine(&ScanLineGet);
@@ -1873,6 +1882,12 @@ STDMETHODIMP_(bool) CDX9AllocatorPresenter::ResetDevice()
return true;
}
+STDMETHODIMP_(bool) CDX9AllocatorPresenter::DisplayChange()
+{
+ SendResetRequest();
+ return true;
+}
+
void CDX9AllocatorPresenter::DrawText(const RECT &rc, const CString &strText, int _Priority)
{
if (_Priority < 1) {
@@ -2178,15 +2193,21 @@ void CDX9AllocatorPresenter::DrawStats()
DrawText(rc, strText, 1);
OffsetRect (&rc, 0, TextHeight);
+ strText.Format(L"DirectX SDK : %d", GetRenderersData()->GetDXSdkRelease());
+ DrawText(rc, strText, 1);
+ OffsetRect (&rc, 0, TextHeight);
+
if(m_D3D9Device != _T("")) {
strText = "Render device: " + m_D3D9Device;
DrawText(rc, strText, 1);
OffsetRect (&rc, 0, TextHeight);
}
- strText.Format(L"DirectX SDK : %d", GetRenderersData()->GetDXSdkRelease());
- DrawText(rc, strText, 1);
- OffsetRect (&rc, 0, TextHeight);
+ if(m_Decoder != _T("")) {
+ strText = "Decoder : " + m_Decoder;
+ DrawText(rc, strText, 1);
+ OffsetRect (&rc, 0, TextHeight);
+ }
for (int i=0; i<6; i++) {
if (m_strStatsMsg[i][0]) {
@@ -2285,16 +2306,25 @@ STDMETHODIMP CDX9AllocatorPresenter::GetDIB(BYTE* lpDib, DWORD* size)
}
*size = required;
- CComPtr<IDirect3DSurface9> pSurface = m_pVideoSurface[m_nCurSurface];
D3DLOCKED_RECT r;
- if(FAILED(hr = pSurface->LockRect(&r, NULL, D3DLOCK_READONLY))) {
- pSurface = NULL;
- if(FAILED(hr = m_pD3DDev->CreateOffscreenPlainSurface(desc.Width, desc.Height, desc.Format, D3DPOOL_SYSTEMMEM, &pSurface, NULL))
+ CComPtr<IDirect3DSurface9> pSurface;
+ if(m_bFullFloatingPointProcessing || m_bHalfFloatingPointProcessing || m_bHighColorResolution) {
+ CComPtr<IDirect3DSurface9> fSurface = m_pVideoSurface[m_nCurSurface];
+ if(FAILED(hr = m_pD3DDev->CreateOffscreenPlainSurface(desc.Width, desc.Height, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &fSurface, NULL))
+ || FAILED(hr = m_pD3DXLoadSurfaceFromSurface(fSurface, NULL, NULL, m_pVideoSurface[m_nCurSurface], NULL, NULL, D3DX_DEFAULT, 0))) return hr;
+ pSurface = fSurface;
+ if(FAILED(hr = pSurface->LockRect(&r, NULL, D3DLOCK_READONLY))) {
+ pSurface = NULL;
+ if(FAILED(hr = m_pD3DDev->CreateOffscreenPlainSurface(desc.Width, desc.Height, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &pSurface, NULL))
+ || FAILED(hr = m_pD3DDev->GetRenderTargetData(fSurface, pSurface))
+ || FAILED(hr = pSurface->LockRect(&r, NULL, D3DLOCK_READONLY))) return hr;}}
+ else {
+ pSurface = m_pVideoSurface[m_nCurSurface];
+ if(FAILED(hr = pSurface->LockRect(&r, NULL, D3DLOCK_READONLY))) {
+ pSurface = NULL;
+ if(FAILED(hr = m_pD3DDev->CreateOffscreenPlainSurface(desc.Width, desc.Height, desc.Format, D3DPOOL_SYSTEMMEM, &pSurface, NULL))
|| FAILED(hr = m_pD3DDev->GetRenderTargetData(m_pVideoSurface[m_nCurSurface], pSurface))
- || FAILED(hr = pSurface->LockRect(&r, NULL, D3DLOCK_READONLY))) {
- return hr;
- }
- }
+ || FAILED(hr = pSurface->LockRect(&r, NULL, D3DLOCK_READONLY))) return hr;}}
BITMAPINFOHEADER* bih = (BITMAPINFOHEADER*)lpDib;
memset(bih, 0, sizeof(BITMAPINFOHEADER));
diff --git a/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.h b/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.h
index d58d28567..cd72b83ac 100644
--- a/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.h
+++ b/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.h
@@ -29,6 +29,8 @@
#define NB_JITTER 126
+#define PCIV_ATI 0x1002
+
extern bool g_bNoDuration;
extern bool g_bExternalSubtitleTime;
@@ -116,7 +118,7 @@ namespace DSObjects
void StopWorkerThreads();
LONGLONG m_LastAdapterCheck;
- UINT GetAdapter(IDirect3D9 *pD3D, bool GetAdapter = false);
+ UINT GetAdapter(IDirect3D9 *pD3D, bool bGetAdapter = true);
DWORD GetVertexProcessing();
bool GetVBlank(int &_ScanLine, int &_bInVBlank, bool _bMeasureTime);
@@ -139,6 +141,16 @@ namespace DSObjects
DWORD Filter,
D3DCOLOR ColorKey);
+ typedef HRESULT (WINAPI * D3DXLoadSurfaceFromSurfacePtr)(
+ LPDIRECT3DSURFACE9 pDestSurface,
+ CONST PALETTEENTRY* pDestPalette,
+ CONST RECT* pDestRect,
+ LPDIRECT3DSURFACE9 pSrcSurface,
+ CONST PALETTEENTRY* pSrcPalette,
+ CONST RECT* pSrcRect,
+ DWORD Filter,
+ D3DCOLOR ColorKey);
+
typedef HRESULT (WINAPI* D3DXCreateLinePtr) (LPDIRECT3DDEVICE9 pDevice, LPD3DXLINE* ppLine);
typedef HRESULT (WINAPI* D3DXCreateFontPtr)(
@@ -172,6 +184,7 @@ namespace DSObjects
int m_VMR9AlphaBitmapWidthBytes;
D3DXLoadSurfaceFromMemoryPtr m_pD3DXLoadSurfaceFromMemory;
+ D3DXLoadSurfaceFromSurfacePtr m_pD3DXLoadSurfaceFromSurface;
D3DXCreateLinePtr m_pD3DXCreateLine;
D3DXCreateFontPtr m_pD3DXCreateFont;
HRESULT (__stdcall *m_pD3DXCreateSprite)(LPDIRECT3DDEVICE9 pDevice, LPD3DXSPRITE * ppSprite);
@@ -281,6 +294,9 @@ namespace DSObjects
CString m_strStatsMsg[10];
CString m_D3D9Device;
+ int m_nPCIVendor;
+
+ CString m_Decoder;
public:
CDX9AllocatorPresenter(HWND hWnd, bool bFullscreen, HRESULT& hr, bool bIsEVR, CString &_Error);
@@ -293,5 +309,6 @@ namespace DSObjects
STDMETHODIMP SetPixelShader(LPCSTR pSrcData, LPCSTR pTarget);
STDMETHODIMP SetPixelShader2(LPCSTR pSrcData, LPCSTR pTarget, bool bScreenSpace);
STDMETHODIMP_(bool) ResetDevice();
+ STDMETHODIMP_(bool) DisplayChange();
};
}
diff --git a/src/filters/renderer/VideoRenderers/DX9RenderingEngine.cpp b/src/filters/renderer/VideoRenderers/DX9RenderingEngine.cpp
index 7450e7e09..950fe4cb3 100644
--- a/src/filters/renderer/VideoRenderers/DX9RenderingEngine.cpp
+++ b/src/filters/renderer/VideoRenderers/DX9RenderingEngine.cpp
@@ -168,9 +168,6 @@ void CDX9RenderingEngine::InitRenderingEngine()
// Initialize settings
m_BicubicA = 0;
-
- m_bFinalPass = false;
- m_bColorManagement = false;
}
void CDX9RenderingEngine::CleanupRenderingEngine()
@@ -249,7 +246,7 @@ HRESULT CDX9RenderingEngine::CreateVideoSurfaces()
}
}
- hr = m_pD3DDev->ColorFill(m_pVideoSurface[m_nCurSurface], NULL, 0);
+ hr = m_pD3DDev->Clear(0, NULL, D3DCLEAR_TARGET, 0, 1, 0);
return S_OK;
}
@@ -942,13 +939,14 @@ HRESULT CDX9RenderingEngine::InitFinalPass()
}
}
+ if (!m_bFinalPass) {
+ bInitRequired = true;
+ }
+
if (!bInitRequired) {
return S_OK;
}
- // Cleanup
- CleanupFinalPass();
-
// Check whether the final pass is supported by the hardware
m_bFinalPass = data->m_bFP16Support;
if (!m_bFinalPass) {
@@ -962,12 +960,17 @@ HRESULT CDX9RenderingEngine::InitFinalPass()
m_RenderingIntent = renderingIntent;
// Check whether the final pass is required
- m_bFinalPass = bColorManagement || (m_bForceInputHighColorResolution && !m_bHighColorResolution);
+ m_bFinalPass = bColorManagement || m_bFullFloatingPointProcessing || m_bHalfFloatingPointProcessing || ((m_bForceInputHighColorResolution || m_bHighColorResolution) && (m_DisplayType != D3DFMT_A2R10G10B10));
if (!m_bFinalPass) {
return S_OK;
}
+ // Initial cleanup
+ m_pLut3DTexture = NULL;
+ m_pFinalPixelShader = NULL;
+
+ if (!m_pDitherTexture) {
// Create the dither texture
hr = m_pD3DDev->CreateTexture(DITHER_MATRIX_SIZE, DITHER_MATRIX_SIZE,
1,
@@ -1006,6 +1009,7 @@ HRESULT CDX9RenderingEngine::InitFinalPass()
CleanupFinalPass();
return hr;
}
+ }
// Initialize the color management if necessary
if (bColorManagement) {
@@ -1101,11 +1105,6 @@ HRESULT CDX9RenderingEngine::InitFinalPass()
}
// Compile the final pixel shader
- if (m_Caps.PixelShaderVersion < D3DPS_VERSION(2, 0)) {
- CleanupFinalPass();
- return E_FAIL;
- }
-
LPCSTR pProfile = m_Caps.PixelShaderVersion >= D3DPS_VERSION(3, 0) ? "ps_3_0" : "ps_2_0";
CStringA shaderSourceCode;
@@ -1122,7 +1121,7 @@ HRESULT CDX9RenderingEngine::InitFinalPass()
}
CStringA quantizationString;
- quantizationString.Format("%d.0f", quantization);
+ quantizationString.Format("%d.", quantization);
shaderSourceCode.Replace("_QUANTIZATION_VALUE_", quantizationString);
CStringA lut3DEnabledString;
@@ -1131,7 +1130,7 @@ HRESULT CDX9RenderingEngine::InitFinalPass()
if (bColorManagement) {
CStringA lut3DSizeString;
- lut3DSizeString.Format("%d.0f", m_Lut3DSize);
+ lut3DSizeString.Format("%d.", m_Lut3DSize);
shaderSourceCode.Replace("_LUT3D_SIZE_VALUE_", lut3DSizeString);
}
@@ -1229,8 +1228,8 @@ HRESULT CDX9RenderingEngine::CreateIccProfileLut(TCHAR* profilePath, float* lut3
// Set the input white point. It's D65 in all cases.
cmsCIExyY whitePoint;
- whitePoint.x = 0.31271;
- whitePoint.y = 0.32902;
+ whitePoint.x = 0.312713;
+ whitePoint.y = 0.329016;
whitePoint.Y = 1.0;
// Set the input primaries
@@ -1577,20 +1576,23 @@ HRESULT CDX9RenderingEngine::AlphaBlt(RECT* pSrc, RECT* pDst, IDirect3DTexture9*
{(float)dst.left, (float)dst.bottom, 0.5f, 2.0f, (float)src.left / w, (float)src.bottom / h},
{(float)dst.right, (float)dst.bottom, 0.5f, 2.0f, (float)src.right / w, (float)src.bottom / h},
};
- /*
- for(int i = 0; i < countof(pVertices); i++)
- {
- pVertices[i].x -= 0.5;
- pVertices[i].y -= 0.5;
+
+ for(int i = 0; i < countof(pVertices); i++) {
+ pVertices[i].x -= 0.5;
+ pVertices[i].y -= 0.5;
}
- */
hr = m_pD3DDev->SetTexture(0, pTexture);
+ // GetRenderState fails for devices created with D3DCREATE_PUREDEVICE
+ // so we need to provide default values in case GetRenderState fails
DWORD abe, sb, db;
- hr = m_pD3DDev->GetRenderState(D3DRS_ALPHABLENDENABLE, &abe);
- hr = m_pD3DDev->GetRenderState(D3DRS_SRCBLEND, &sb);
- hr = m_pD3DDev->GetRenderState(D3DRS_DESTBLEND, &db);
+ if (FAILED(m_pD3DDev->GetRenderState(D3DRS_ALPHABLENDENABLE, &abe)))
+ abe = FALSE;
+ if (FAILED(m_pD3DDev->GetRenderState(D3DRS_SRCBLEND, &sb)))
+ sb = D3DBLEND_ONE;
+ if (FAILED(m_pD3DDev->GetRenderState(D3DRS_DESTBLEND, &db)))
+ db = D3DBLEND_ZERO;
hr = m_pD3DDev->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
hr = m_pD3DDev->SetRenderState(D3DRS_LIGHTING, FALSE);
diff --git a/src/filters/renderer/VideoRenderers/DXRAllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/DXRAllocatorPresenter.cpp
index 20e4dbb18..da927616e 100644
--- a/src/filters/renderer/VideoRenderers/DXRAllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/DXRAllocatorPresenter.cpp
@@ -1,7 +1,7 @@
/*
* $Id$
*
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -124,7 +124,7 @@ HRESULT CDXRAllocatorPresenter::SetDevice(IDirect3DDevice9* pD3DDev)
if(m_pAllocator) {
m_pAllocator->ChangeDevice(pD3DDev);
} else {
- m_pAllocator = DNew CDX9SubPicAllocator(pD3DDev, size, GetRenderersSettings().fSPCPow2Tex);
+ m_pAllocator = DNew CDX9SubPicAllocator(pD3DDev, size, GetRenderersSettings().fSPCPow2Tex, true);
if(!m_pAllocator) {
return E_FAIL;
}
diff --git a/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp
index 10cb71e1c..08ef1bd3f 100644
--- a/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp
@@ -23,6 +23,7 @@
#include "stdafx.h"
#include "EVRAllocatorPresenter.h"
+#include "OuterEVR.h"
#include <Mferror.h>
#include "IPinHook.h"
#include "MacrovisionKicker.h"
@@ -63,247 +64,8 @@ MFVideoArea MakeArea(float x, float y, DWORD width, DWORD height)
return area;
}
-
-/// === Outer EVR
-
-namespace DSObjects
-{
- class COuterEVR
- : public CUnknown
- , public IVMRffdshow9
- , public IVMRMixerBitmap9
- , public IBaseFilter
- {
- CComPtr<IUnknown> m_pEVR;
- VMR9AlphaBitmap* m_pVMR9AlphaBitmap;
- CEVRAllocatorPresenter *m_pAllocatorPresenter;
-
- public:
-
- // IBaseFilter
- virtual HRESULT STDMETHODCALLTYPE EnumPins(__out IEnumPins **ppEnum) {
- CComPtr<IBaseFilter> pEVRBase;
- if (m_pEVR) {
- m_pEVR->QueryInterface(&pEVRBase);
- }
- if (pEVRBase) {
- return pEVRBase->EnumPins(ppEnum);
- }
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE FindPin(LPCWSTR Id, __out IPin **ppPin) {
- CComPtr<IBaseFilter> pEVRBase;
- if (m_pEVR) {
- m_pEVR->QueryInterface(&pEVRBase);
- }
- if (pEVRBase) {
- return pEVRBase->FindPin(Id, ppPin);
- }
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE QueryFilterInfo(__out FILTER_INFO *pInfo) {
- CComPtr<IBaseFilter> pEVRBase;
- if (m_pEVR) {
- m_pEVR->QueryInterface(&pEVRBase);
- }
- if (pEVRBase) {
- return pEVRBase->QueryFilterInfo(pInfo);
- }
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE JoinFilterGraph(__in_opt IFilterGraph *pGraph, __in_opt LPCWSTR pName) {
- CComPtr<IBaseFilter> pEVRBase;
- if (m_pEVR) {
- m_pEVR->QueryInterface(&pEVRBase);
- }
- if (pEVRBase) {
- return pEVRBase->JoinFilterGraph(pGraph, pName);
- }
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE QueryVendorInfo(__out LPWSTR *pVendorInfo) {
- CComPtr<IBaseFilter> pEVRBase;
- if (m_pEVR) {
- m_pEVR->QueryInterface(&pEVRBase);
- }
- if (pEVRBase) {
- return pEVRBase->QueryVendorInfo(pVendorInfo);
- }
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE Stop( void) {
- CComPtr<IBaseFilter> pEVRBase;
- if (m_pEVR) {
- m_pEVR->QueryInterface(&pEVRBase);
- }
- if (pEVRBase) {
- return pEVRBase->Stop();
- }
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE Pause( void) {
- CComPtr<IBaseFilter> pEVRBase;
- if (m_pEVR) {
- m_pEVR->QueryInterface(&pEVRBase);
- }
- if (pEVRBase) {
- return pEVRBase->Pause();
- }
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE Run( REFERENCE_TIME tStart) {
- CComPtr<IBaseFilter> pEVRBase;
- if (m_pEVR) {
- m_pEVR->QueryInterface(&pEVRBase);
- }
- if (pEVRBase) {
- return pEVRBase->Run(tStart);
- }
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE GetState( DWORD dwMilliSecsTimeout, __out FILTER_STATE *State);
-
- virtual HRESULT STDMETHODCALLTYPE SetSyncSource(__in_opt IReferenceClock *pClock) {
- CComPtr<IBaseFilter> pEVRBase;
- if (m_pEVR) {
- m_pEVR->QueryInterface(&pEVRBase);
- }
- if (pEVRBase) {
- return pEVRBase->SetSyncSource(pClock);
- }
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE GetSyncSource(__deref_out_opt IReferenceClock **pClock) {
- CComPtr<IBaseFilter> pEVRBase;
- if (m_pEVR) {
- m_pEVR->QueryInterface(&pEVRBase);
- }
- if (pEVRBase) {
- return pEVRBase->GetSyncSource(pClock);
- }
- return E_NOTIMPL;
- }
-
- virtual HRESULT STDMETHODCALLTYPE GetClassID(__RPC__out CLSID *pClassID) {
- CComPtr<IBaseFilter> pEVRBase;
- if (m_pEVR) {
- m_pEVR->QueryInterface(&pEVRBase);
- }
- if (pEVRBase) {
- return pEVRBase->GetClassID(pClassID);
- }
- return E_NOTIMPL;
- }
-
- COuterEVR(const TCHAR* pName, LPUNKNOWN pUnk, HRESULT& hr, VMR9AlphaBitmap* pVMR9AlphaBitmap, CEVRAllocatorPresenter *pAllocatorPresenter) : CUnknown(pName, pUnk) {
- hr = m_pEVR.CoCreateInstance(CLSID_EnhancedVideoRenderer, GetOwner());
- m_pVMR9AlphaBitmap = pVMR9AlphaBitmap;
- m_pAllocatorPresenter = pAllocatorPresenter;
- }
-
- ~COuterEVR();
-
- DECLARE_IUNKNOWN;
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv) {
- HRESULT hr;
-
- if(riid == __uuidof(IVMRMixerBitmap9)) {
- return GetInterface((IVMRMixerBitmap9*)this, ppv);
- }
- if (riid == __uuidof(IMediaFilter)) {
- return GetInterface((IMediaFilter*)this, ppv);
- }
- if (riid == __uuidof(IPersist)) {
- return GetInterface((IPersist*)this, ppv);
- }
- if (riid == __uuidof(IBaseFilter)) {
- return GetInterface((IBaseFilter*)this, ppv);
- }
-
- hr = m_pEVR ? m_pEVR->QueryInterface(riid, ppv) : E_NOINTERFACE;
- if(m_pEVR && FAILED(hr)) {
- if(riid == __uuidof(IVMRffdshow9)) { // Support ffdshow queueing. We show ffdshow that this is patched Media Player Classic.
- return GetInterface((IVMRffdshow9*)this, ppv);
- }
- }
-
- return SUCCEEDED(hr) ? hr : __super::NonDelegatingQueryInterface(riid, ppv);
- }
-
- // IVMRffdshow9
- STDMETHODIMP support_ffdshow() {
- queue_ffdshow_support = true;
- return S_OK;
- }
-
- // IVMRMixerBitmap9
- STDMETHODIMP GetAlphaBitmapParameters(VMR9AlphaBitmap* pBmpParms);
-
- STDMETHODIMP SetAlphaBitmap(const VMR9AlphaBitmap* pBmpParms);
-
- STDMETHODIMP UpdateAlphaBitmapParameters(const VMR9AlphaBitmap* pBmpParms);
- };
-}
-
using namespace DSObjects;
-HRESULT STDMETHODCALLTYPE COuterEVR::GetState( DWORD dwMilliSecsTimeout, __out FILTER_STATE *State)
-{
- HRESULT ReturnValue;
- if (m_pAllocatorPresenter->GetState(dwMilliSecsTimeout, State, ReturnValue)) {
- return ReturnValue;
- }
- CComPtr<IBaseFilter> pEVRBase;
- if (m_pEVR) {
- m_pEVR->QueryInterface(&pEVRBase);
- }
- if (pEVRBase) {
- return pEVRBase->GetState(dwMilliSecsTimeout, State);
- }
- return E_NOTIMPL;
-}
-
-STDMETHODIMP COuterEVR::GetAlphaBitmapParameters(VMR9AlphaBitmap* pBmpParms)
-{
- CheckPointer(pBmpParms, E_POINTER);
- CAutoLock BitMapLock(&m_pAllocatorPresenter->m_VMR9AlphaBitmapLock);
- memcpy (pBmpParms, m_pVMR9AlphaBitmap, sizeof(VMR9AlphaBitmap));
- return S_OK;
-}
-
-STDMETHODIMP COuterEVR::SetAlphaBitmap(const VMR9AlphaBitmap* pBmpParms)
-{
- CheckPointer(pBmpParms, E_POINTER);
- CAutoLock BitMapLock(&m_pAllocatorPresenter->m_VMR9AlphaBitmapLock);
- memcpy (m_pVMR9AlphaBitmap, pBmpParms, sizeof(VMR9AlphaBitmap));
- m_pVMR9AlphaBitmap->dwFlags |= VMRBITMAP_UPDATE;
- m_pAllocatorPresenter->UpdateAlphaBitmap();
- return S_OK;
-}
-
-STDMETHODIMP COuterEVR::UpdateAlphaBitmapParameters(const VMR9AlphaBitmap* pBmpParms)
-{
- CheckPointer(pBmpParms, E_POINTER);
- CAutoLock BitMapLock(&m_pAllocatorPresenter->m_VMR9AlphaBitmapLock);
- memcpy (m_pVMR9AlphaBitmap, pBmpParms, sizeof(VMR9AlphaBitmap));
- m_pVMR9AlphaBitmap->dwFlags |= VMRBITMAP_UPDATE;
- m_pAllocatorPresenter->UpdateAlphaBitmap();
- return S_OK;
-}
-
-COuterEVR::~COuterEVR()
-{
-}
-
CEVRAllocatorPresenter::CEVRAllocatorPresenter(HWND hWnd, bool bFullscreen, HRESULT& hr, CString &_Error)
: CDX9AllocatorPresenter(hWnd, bFullscreen, hr, true, _Error)
{
@@ -1036,7 +798,7 @@ HRESULT CEVRAllocatorPresenter::SetMediaType(IMFMediaType* pType)
{
HRESULT hr;
AM_MEDIA_TYPE* pAMMedia = NULL;
- CString strTemp;
+ CString strTemp, strTemp1;
CheckPointer (pType, E_POINTER);
CheckHR (pType->GetRepresentation(FORMAT_VideoInfo2, (void**)&pAMMedia));
@@ -1045,7 +807,9 @@ HRESULT CEVRAllocatorPresenter::SetMediaType(IMFMediaType* pType)
if (SUCCEEDED(hr)) {
strTemp = GetMediaTypeName (pAMMedia->subtype);
strTemp.Replace (L"MEDIASUBTYPE_", L"");
- m_strStatsMsg[MSG_MIXEROUT].Format (L"Mixer output : %s", strTemp);
+ strTemp1 = GetMediaTypeFormatDesc(pType);
+ strTemp1.Replace (L"D3DFMT_", L"");
+ m_strStatsMsg[MSG_MIXEROUT].Format (L"Mixer output : %-10s Type %-10s", strTemp, strTemp1);
}
pType->FreeRepresentation (FORMAT_VideoInfo2, (void*)pAMMedia);
@@ -1079,39 +843,119 @@ HRESULT CEVRAllocatorPresenter::GetMediaTypeMerit(IMFMediaType* pType, int* pMer
HRESULT hr = GetMediaTypeFourCC(pType, (DWORD*)&Format);
if (SUCCEEDED(hr)) {
- // We only support RGB mixer output surface formats
switch (Format) {
- case D3DFMT_A2R10G10B10:
- if (m_bHighColorResolution || m_bForceInputHighColorResolution || m_bHalfFloatingPointProcessing || m_bFullFloatingPointProcessing) {
- *pMerit = 950;
- } else {
- *pMerit = 650;
- }
-
+ case FCC('AI44'):// Palettized, 4:4:4
+ *pMerit = 31;
break;
-
- case D3DFMT_X8R8G8B8:
- if (m_bForceInputHighColorResolution) {
- *pMerit = 800;
- } else {
- *pMerit = 850;
- }
-
+ case FCC('YVU9'):// 8-bit, 16:1:1
+ *pMerit = 30;
break;
-
- case D3DFMT_A8R8G8B8:
- if (m_bForceInputHighColorResolution) {
- *pMerit = 850;
- } else {
- *pMerit = 800;
- }
-
+ case FCC('NV11'):// 8-bit, 4:1:1
+ *pMerit = 29;
break;
-
- default:
- // Unsupported format
+ case FCC('Y41P'):
+ *pMerit = 28;
+ break;
+ case FCC('Y41T'):
+ *pMerit = 27;
+ break;
+ case FCC('P016'):// 4:2:0
+ *pMerit = 26;
+ break;
+ case FCC('P010'):
+ *pMerit = 25;
+ break;
+ case FCC('IMC1'):
+ *pMerit = 24;
+ break;
+ case FCC('IMC3'):
+ *pMerit = 23;
+ break;
+ case FCC('IMC2'):
+ *pMerit = 22;
+ break;
+ case FCC('IMC4'):
+ *pMerit = 21;
+ break;
+ case FCC('YV12'):
+ *pMerit = 20;
+ break;
+ case FCC('NV12'):
+ *pMerit = 19;
+ break;
+ case FCC('I420'):
+ *pMerit = 18;
+ break;
+ case FCC('IYUV'):
+ *pMerit = 17;
+ break;
+ case FCC('Y216'):// 4:2:2
+ *pMerit = 16;
+ break;
+ case FCC('v216'):
+ *pMerit = 15;
+ break;
+ case FCC('P216'):
+ *pMerit = 14;
+ break;
+ case FCC('Y210'):
+ *pMerit = 13;
+ break;
+ case FCC('v210'):
+ *pMerit = 12;
+ break;
+ case FCC('P210'):
+ *pMerit = 11;
+ break;
+ case FCC('YUY2'):
+ *pMerit = 0;// bug: the internal software codecs will always select this, for safety this item is ranked below X8R8G8B8 until the problem is solved
+ break;
+ case FCC('UYVY'):
+ *pMerit = 9;
+ break;
+ case FCC('Y42T'):
+ *pMerit = 8;
+ break;
+ case FCC('YVYU'):
+ *pMerit = 7;
+ break;
+ case FCC('Y416'):// 4:4:4
+ *pMerit = 6;
+ break;
+ case FCC('Y410'):
+ *pMerit = 5;
+ break;
+ case FCC('v410'):
+ *pMerit = 4;
+ break;
+ case FCC('AYUV'):
+ *pMerit = 3;
+ break;
+ case D3DFMT_X8R8G8B8:
+ if (m_bForceInputHighColorResolution) {
+ *pMerit = 63;
+ } else {
+ *pMerit = 1;
+ }
+ break;
+ case D3DFMT_A8R8G8B8:// an accepted format, but fails on most surface types
+ case D3DFMT_A8B8G8R8:
+ case D3DFMT_X8B8G8R8:
+ case D3DFMT_R8G8B8:
+ case D3DFMT_R5G6B5:
+ case D3DFMT_X1R5G5B5:
+ case D3DFMT_A1R5G5B5:
+ case D3DFMT_A4R4G4B4:
+ case D3DFMT_R3G3B2:
+ case D3DFMT_A8R3G3B2:
+ case D3DFMT_X4R4G4B4:
+ case D3DFMT_A8P8:
+ case D3DFMT_P8:
*pMerit = 0;
break;
+ default:
+ *pMerit = 2;
+ break;
}
}
@@ -1193,12 +1037,13 @@ HRESULT CEVRAllocatorPresenter::RenegotiateMediaType()
int nValidTypes = ValidMixerTypes.GetCount();
+#ifdef _DEBUG
for (int i = 0; i < nValidTypes; ++i) {
// Step 3. Adjust the mixer's type to match our requirements.
pType = ValidMixerTypes[i];
TRACE_EVR("EVR: Valid mixer output type: %ws\n", GetMediaTypeFormatDesc(pType));
}
-
+#endif
for (int i = 0; i < nValidTypes; ++i) {
// Step 3. Adjust the mixer's type to match our requirements.
pType = ValidMixerTypes[i];
@@ -1731,10 +1576,15 @@ void CEVRAllocatorPresenter::GetMixerThread()
if (
SUCCEEDED (m_pOuterEVR->FindPin(L"EVR Input0", &pPin)) &&
SUCCEEDED (pPin->ConnectionMediaType(&mt)) ) {
+
ExtractAvgTimePerFrame (&mt, m_rtTimePerFrame);
m_bInterlaced = ExtractInterlaced(&mt);
-
+
+ CComPtr<IPin> pPinTo;
+ if(SUCCEEDED(pPin->ConnectedTo(&pPinTo)) && pPinTo) {
+ m_Decoder = GetFilterName(GetFilterFromPin(pPinTo));
+ }
}
// If framerate not set by Video Decoder choose 23.97...
if (m_rtTimePerFrame == 0) {
@@ -2018,6 +1868,45 @@ STDMETHODIMP_(bool) CEVRAllocatorPresenter::ResetDevice()
return bResult;
}
+STDMETHODIMP_(bool) CEVRAllocatorPresenter::DisplayChange()
+{
+ CAutoLock lock(this);
+ CAutoLock lock2(&m_ImageProcessingLock);
+ CAutoLock cRenderLock(&m_RenderLock);
+
+ m_DetectedFrameRate = 0.0;
+ m_DetectedFrameTime = 0.0;
+ m_DetectedFrameTimeStdDev = 0.0;
+ m_DetectedLock = false;
+ ZeroMemory(m_DetectedFrameTimeHistory, sizeof(m_DetectedFrameTimeHistory));
+ ZeroMemory(m_DetectedFrameTimeHistoryHistory, sizeof(m_DetectedFrameTimeHistoryHistory));
+ m_DetectedFrameTimePos = 0;
+ ZeroMemory(&m_VMR9AlphaBitmap, sizeof(m_VMR9AlphaBitmap));
+
+ ZeroMemory(m_ldDetectedRefreshRateList, sizeof(m_ldDetectedRefreshRateList));
+ ZeroMemory(m_ldDetectedScanlineRateList, sizeof(m_ldDetectedScanlineRateList));
+ m_DetectedRefreshRatePos = 0;
+ m_DetectedRefreshTimePrim = 0;
+ m_DetectedScanlineTime = 0;
+ m_DetectedScanlineTimePrim = 0;
+ m_DetectedRefreshRate = 0;
+
+ memset (m_pllJitter, 0, sizeof(m_pllJitter));
+ memset (m_pllSyncOffset, 0, sizeof(m_pllSyncOffset));
+ m_nNextJitter = 0;
+ m_nNextSyncOffset = 0;
+ m_llLastPerf = 0;
+ m_fAvrFps = 0.0;
+ m_fJitterStdDev = 0.0;
+ m_fSyncOffsetStdDev = 0.0;
+ m_fSyncOffsetAvr = 0.0;
+ m_bSyncStatsAvailable = false;
+
+ bool bResult = __super::DisplayChange();
+
+ return bResult;
+}
+
void CEVRAllocatorPresenter::RenderThread()
{
HANDLE hEvts[] = { m_hEvtQuit, m_hEvtFlush};
diff --git a/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.h b/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.h
index 56d67639c..fd9136b93 100644
--- a/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.h
+++ b/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.h
@@ -1,7 +1,7 @@
/*
* $Id$
*
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -74,6 +74,7 @@ namespace DSObjects
STDMETHODIMP GetNativeVideoSize(LONG* lpWidth, LONG* lpHeight, LONG* lpARWidth, LONG* lpARHeight);
STDMETHODIMP InitializeDevice(IMFMediaType* pMediaType);
STDMETHODIMP_(bool) ResetDevice();
+ STDMETHODIMP_(bool) DisplayChange();
// IMFClockStateSink
STDMETHODIMP OnClockStart(/* [in] */ MFTIME hnsSystemTime, /* [in] */ LONGLONG llClockStartOffset);
diff --git a/src/filters/renderer/VideoRenderers/IPinHook.cpp b/src/filters/renderer/VideoRenderers/IPinHook.cpp
index 82be6e783..b4eb482d6 100644
--- a/src/filters/renderer/VideoRenderers/IPinHook.cpp
+++ b/src/filters/renderer/VideoRenderers/IPinHook.cpp
@@ -2,7 +2,7 @@
* $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -31,7 +31,9 @@
#include "IPinHook.h"
#include "AllocatorCommon.h"
+#ifdef _DEBUG
#define LOG_FILE _T("dxva.log")
+#endif
//#define LOG_BITSTREAM
//#define LOG_MATRIX
@@ -240,7 +242,7 @@ bool HookNewSegmentAndReceive(IPinC* pPinC, IMemInputPinC* pMemInputPinC)
if(NewSegmentOrg == NULL) {
NewSegmentOrg = pPinC->lpVtbl->NewSegment;
}
- pPinC->lpVtbl->NewSegment = NewSegmentMine;
+ pPinC->lpVtbl->NewSegment = NewSegmentMine; // Function sets global variable(s)
res = VirtualProtect(pPinC->lpVtbl, sizeof(IPinCVtbl), flOldProtect, &flOldProtect);
// Casimir666 : change sizeof(IMemInputPinC) to sizeof(IMemInputPinCVtbl) to fix crash with EVR hack on Vista!
@@ -248,7 +250,7 @@ bool HookNewSegmentAndReceive(IPinC* pPinC, IMemInputPinC* pMemInputPinC)
if(ReceiveOrg == NULL) {
ReceiveOrg = pMemInputPinC->lpVtbl->Receive;
}
- pMemInputPinC->lpVtbl->Receive = ReceiveMine;
+ pMemInputPinC->lpVtbl->Receive = ReceiveMine; // Function sets global variable(s)
res = VirtualProtect(pMemInputPinC->lpVtbl, sizeof(IMemInputPinCVtbl), flOldProtect, &flOldProtect);
g_pPinCVtbl = pPinC->lpVtbl;
@@ -260,14 +262,18 @@ bool HookNewSegmentAndReceive(IPinC* pPinC, IMemInputPinC* pMemInputPinC)
// === DXVA1 hooks
+#ifdef _DEBUG
#define MAX_BUFFER_TYPE 15
-BYTE* g_ppBuffer[MAX_BUFFER_TYPE];
-
+BYTE* g_ppBuffer[MAX_BUFFER_TYPE]; // Only used for debug logging
static HRESULT ( STDMETHODCALLTYPE *GetVideoAcceleratorGUIDsOrg )( IAMVideoAcceleratorC * This,/* [out][in] */ LPDWORD pdwNumGuidsSupported,/* [out][in] */ LPGUID pGuidsSupported) = NULL;
static HRESULT ( STDMETHODCALLTYPE *GetUncompFormatsSupportedOrg )( IAMVideoAcceleratorC * This,/* [in] */ const GUID *pGuid,/* [out][in] */ LPDWORD pdwNumFormatsSupported,/* [out][in] */ LPDDPIXELFORMAT pFormatsSupported) = NULL;
static HRESULT ( STDMETHODCALLTYPE *GetInternalMemInfoOrg )( IAMVideoAcceleratorC * This,/* [in] */ const GUID *pGuid,/* [in] */ const AMVAUncompDataInfo *pamvaUncompDataInfo,/* [out][in] */ LPAMVAInternalMemInfo pamvaInternalMemInfo) = NULL;
+#endif
+
static HRESULT ( STDMETHODCALLTYPE *GetCompBufferInfoOrg )( IAMVideoAcceleratorC * This,/* [in] */ const GUID *pGuid,/* [in] */ const AMVAUncompDataInfo *pamvaUncompDataInfo,/* [out][in] */ LPDWORD pdwNumTypesCompBuffers,/* [out] */ LPAMVACompBufferInfo pamvaCompBufferInfo) = NULL;
+
+#ifdef _DEBUG
static HRESULT ( STDMETHODCALLTYPE *GetInternalCompBufferInfoOrg )( IAMVideoAcceleratorC * This,/* [out][in] */ LPDWORD pdwNumTypesCompBuffers,/* [out] */ LPAMVACompBufferInfo pamvaCompBufferInfo) = NULL;
static HRESULT ( STDMETHODCALLTYPE *BeginFrameOrg )( IAMVideoAcceleratorC * This,/* [in] */ const AMVABeginFrameInfo *amvaBeginFrameInfo) = NULL;
static HRESULT ( STDMETHODCALLTYPE *EndFrameOrg )( IAMVideoAcceleratorC * This,/* [in] */ const AMVAEndFrameInfo *pEndFrameInfo) = NULL;
@@ -295,7 +301,6 @@ static void LOG_TOFILE(LPCTSTR FileName, LPCTSTR fmt, ...)
va_end(args);
}
-#ifdef _DEBUG
static void LOG(LPCTSTR fmt, ...)
{
va_list args;
@@ -689,6 +694,7 @@ inline static void LogDXVA_Bitstream(BYTE* pBuffer, int nSize) {}
+#ifdef _DEBUG
static HRESULT STDMETHODCALLTYPE GetVideoAcceleratorGUIDsMine(IAMVideoAcceleratorC * This, LPDWORD pdwNumGuidsSupported, LPGUID pGuidsSupported)
{
LOG(_T("\nGetVideoAcceleratorGUIDs"));
@@ -751,6 +757,7 @@ static HRESULT STDMETHODCALLTYPE GetInternalMemInfoMine(IAMVideoAcceleratorC * T
return hr;
}
+#endif
static HRESULT STDMETHODCALLTYPE GetCompBufferInfoMine(IAMVideoAcceleratorC * This, const GUID *pGuid, const AMVAUncompDataInfo *pamvaUncompDataInfo, LPDWORD pdwNumTypesCompBuffers, LPAMVACompBufferInfo pamvaCompBufferInfo)
{
@@ -759,11 +766,14 @@ static HRESULT STDMETHODCALLTYPE GetCompBufferInfoMine(IAMVideoAcceleratorC * Th
if(pGuid) {
g_guidDXVADecoder = *pGuid;
g_nDXVAVersion = 1;
+
+#ifdef _DEBUG
LOG(_T("[in] *pGuid = %s"), CStringFromGUID(*pGuid));
if(pdwNumTypesCompBuffers) {
LOG(_T("[in] *pdwNumTypesCompBuffers = %d"), *pdwNumTypesCompBuffers);
}
+#endif
}
HRESULT hr = GetCompBufferInfoOrg(This, pGuid, pamvaUncompDataInfo, pdwNumTypesCompBuffers, pamvaCompBufferInfo);
@@ -782,7 +792,7 @@ static HRESULT STDMETHODCALLTYPE GetCompBufferInfoMine(IAMVideoAcceleratorC * Th
return hr;
}
-
+#ifdef _DEBUG
static HRESULT STDMETHODCALLTYPE GetInternalCompBufferInfoMine(IAMVideoAcceleratorC * This, LPDWORD pdwNumTypesCompBuffers, LPAMVACompBufferInfo pamvaCompBufferInfo)
{
LOG(_T("\nGetInternalCompBufferInfo"));
@@ -957,7 +967,7 @@ static HRESULT STDMETHODCALLTYPE ExecuteMine(IAMVideoAcceleratorC* This, DWORD d
} else if (pamvaBufferInfo[i].dwTypeIndex == DXVA_BITSTREAM_DATA_BUFFER) {
LogDXVA_Bitstream(g_ppBuffer[pamvaBufferInfo[i].dwTypeIndex], pamvaBufferInfo[i].dwDataSize);
-#if defined(LOG_BITSTREAM) && defined(_DEBUG)
+#if defined(LOG_BITSTREAM)
char strFile[_MAX_PATH];
static int nNb = 1;
sprintf (strFile, "BitStream%d.bin", nNb++);
@@ -1004,16 +1014,18 @@ static HRESULT STDMETHODCALLTYPE DisplayFrameMine(IAMVideoAcceleratorC * This, D
return hr;
}
+#endif
void HookAMVideoAccelerator(IAMVideoAcceleratorC* pAMVideoAcceleratorC)
{
+ g_guidDXVADecoder = GUID_NULL;
+ g_nDXVAVersion = 0;
+
BOOL res;
DWORD flOldProtect = 0;
res = VirtualProtect(pAMVideoAcceleratorC->lpVtbl, sizeof(IAMVideoAcceleratorC), PAGE_WRITECOPY, &flOldProtect);
- g_guidDXVADecoder = GUID_NULL;
- g_nDXVAVersion = 0;
-
+#ifdef _DEBUG
if(GetVideoAcceleratorGUIDsOrg == NULL) {
GetVideoAcceleratorGUIDsOrg = pAMVideoAcceleratorC->lpVtbl->GetVideoAcceleratorGUIDs;
}
@@ -1023,9 +1035,11 @@ void HookAMVideoAccelerator(IAMVideoAcceleratorC* pAMVideoAcceleratorC)
if(GetInternalMemInfoOrg == NULL) {
GetInternalMemInfoOrg = pAMVideoAcceleratorC->lpVtbl->GetInternalMemInfo;
}
+#endif
if(GetCompBufferInfoOrg == NULL) {
GetCompBufferInfoOrg = pAMVideoAcceleratorC->lpVtbl->GetCompBufferInfo;
}
+#ifdef _DEBUG
if(GetInternalCompBufferInfoOrg == NULL) {
GetInternalCompBufferInfoOrg = pAMVideoAcceleratorC->lpVtbl->GetInternalCompBufferInfo;
}
@@ -1054,7 +1068,9 @@ void HookAMVideoAccelerator(IAMVideoAcceleratorC* pAMVideoAcceleratorC)
pAMVideoAcceleratorC->lpVtbl->GetVideoAcceleratorGUIDs = GetVideoAcceleratorGUIDsMine;
pAMVideoAcceleratorC->lpVtbl->GetUncompFormatsSupported = GetUncompFormatsSupportedMine;
pAMVideoAcceleratorC->lpVtbl->GetInternalMemInfo = GetInternalMemInfoMine;
- pAMVideoAcceleratorC->lpVtbl->GetCompBufferInfo = GetCompBufferInfoMine;
+#endif
+ pAMVideoAcceleratorC->lpVtbl->GetCompBufferInfo = GetCompBufferInfoMine; // Function sets global variable(s)
+#ifdef _DEBUG
pAMVideoAcceleratorC->lpVtbl->GetInternalCompBufferInfo = GetInternalCompBufferInfoMine;
pAMVideoAcceleratorC->lpVtbl->BeginFrame = BeginFrameMine;
pAMVideoAcceleratorC->lpVtbl->EndFrame = EndFrameMine;
@@ -1066,7 +1082,6 @@ void HookAMVideoAccelerator(IAMVideoAcceleratorC* pAMVideoAcceleratorC)
res = VirtualProtect(pAMVideoAcceleratorC->lpVtbl, sizeof(IAMVideoAcceleratorC), PAGE_EXECUTE, &flOldProtect);
-#ifdef _DEBUG
::DeleteFile (LOG_FILE);
::DeleteFile (_T("picture.log"));
::DeleteFile (_T("slicelong.log"));
@@ -1080,6 +1095,7 @@ void HookAMVideoAccelerator(IAMVideoAcceleratorC* pAMVideoAcceleratorC)
// === Hook for DXVA2
+#ifdef _DEBUG
static void LogDecodeBufferDesc(DXVA2_DecodeBufferDesc* pDecodeBuff)
{
LOG(_T("DecodeBufferDesc type : %d Size=%d NumMBsInBuffer=%d"), pDecodeBuff->CompressedBufferType, pDecodeBuff->DataSize, pDecodeBuff->NumMBsInBuffer);
@@ -1166,6 +1182,7 @@ public :
}
virtual HRESULT STDMETHODCALLTYPE Execute(const DXVA2_DecodeExecuteParams *pExecuteParams) {
+#ifdef _DEBUG
for (DWORD i=0; i<pExecuteParams->NumCompBuffers; i++) {
CString strBuffer;
@@ -1189,7 +1206,6 @@ public :
}
}
-#if defined(_DEBUG)
if (g_guidDXVADecoder == DXVA2_ModeH264_E || g_guidDXVADecoder == DXVA_Intel_H264_ClearVideo) {
if (pExecuteParams->pCompressedBuffers[i].CompressedBufferType == DXVA2_SliceControlBufferType) {
if (pExecuteParams->pCompressedBuffers[i].DataSize % sizeof(DXVA_Slice_H264_Long) == 0) {
@@ -1206,9 +1222,8 @@ public :
LogSliceInfo (pSlice, pExecuteParams->pCompressedBuffers[i].DataSize / sizeof(DXVA_SliceInfo));
}
}
-#endif
-#if defined(LOG_MATRIX) && defined(_DEBUG)
+#if defined(LOG_MATRIX)
if (pExecuteParams->pCompressedBuffers[i].CompressedBufferType == DXVA2_InverseQuantizationMatrixBufferType) {
char strFile[_MAX_PATH];
static int nNb = 1;
@@ -1224,7 +1239,6 @@ public :
}
#endif
-#if defined(_DEBUG)
if (pExecuteParams->pCompressedBuffers[i].CompressedBufferType == DXVA2_BitStreamDateBufferType) {
LogDXVA_Bitstream(m_ppBuffer[pExecuteParams->pCompressedBuffers[i].CompressedBufferType], pExecuteParams->pCompressedBuffers[i].DataSize);
#if defined(LOG_BITSTREAM)
@@ -1241,26 +1255,33 @@ public :
}
#endif
}
-#endif
}
+#endif
HRESULT hr = m_pDec->Execute (pExecuteParams);
+#ifdef _DEBUG
if (pExecuteParams->pExtensionData)
+ {
LOG(_T("IDirectXVideoDecoder::Execute %d buffer, fct = %d (in=%d, out=%d), hr = %08x"),
pExecuteParams->NumCompBuffers,
pExecuteParams->pExtensionData->Function,
pExecuteParams->pExtensionData->PrivateInputDataSize,
pExecuteParams->pExtensionData->PrivateOutputDataSize,
hr);
+ }
else {
LOG(_T("IDirectXVideoDecoder::Execute %d buffer, hr = %08x"), pExecuteParams->NumCompBuffers, hr);
}
+#endif
return hr;
}
};
+#endif
+// Both IDirectXVideoDecoderServiceCVtbl and IDirectXVideoDecoderServiceC already exists in file \Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include\dxva2api.h
+// Why was the code duplicated ?
interface IDirectXVideoDecoderServiceC;
struct IDirectXVideoDecoderServiceCVtbl {
BEGIN_INTERFACE
@@ -1307,11 +1328,12 @@ interface IDirectXVideoDecoderServiceC {
IDirectXVideoDecoderServiceCVtbl* g_pIDirectXVideoDecoderServiceCVtbl = NULL;
static HRESULT (STDMETHODCALLTYPE* CreateVideoDecoderOrg ) (IDirectXVideoDecoderServiceC* pThis, __in REFGUID Guid, __in const DXVA2_VideoDesc* pVideoDesc, __in const DXVA2_ConfigPictureDecode* pConfig, __in_ecount(NumRenderTargets) IDirect3DSurface9 **ppDecoderRenderTargets, __in UINT NumRenderTargets, __deref_out IDirectXVideoDecoder** ppDecode) = NULL;
+#ifdef _DEBUG
static HRESULT (STDMETHODCALLTYPE* GetDecoderDeviceGuidsOrg)(IDirectXVideoDecoderServiceC* pThis, __out UINT* pCount, __deref_out_ecount_opt(*pCount) GUID** pGuids) = NULL;
static HRESULT (STDMETHODCALLTYPE* GetDecoderConfigurationsOrg) (IDirectXVideoDecoderServiceC* pThis, __in REFGUID Guid, __in const DXVA2_VideoDesc* pVideoDesc, __reserved void* pReserved, __out UINT* pCount, __deref_out_ecount_opt(*pCount) DXVA2_ConfigPictureDecode **ppConfigs) = NULL;
+#endif
-
-
+#ifdef _DEBUG
static void LogDXVA2Config (const DXVA2_ConfigPictureDecode* pConfig)
{
LOG(_T("Config"));
@@ -1345,7 +1367,10 @@ static void LogDXVA2VideoDesc (const DXVA2_VideoDesc* pVideoDesc)
LOG(_T(" - SampleWidth %d"), pVideoDesc->SampleWidth);
LOG(_T(" - UABProtectionLevel %d"), pVideoDesc->UABProtectionLevel);
}
+#endif
+#if 0
+// Function not used yet
static void LogVideoCardCaps(IDirectXVideoDecoderService* pDecoderService)
{
HRESULT hr;
@@ -1397,6 +1422,7 @@ static void LogVideoCardCaps(IDirectXVideoDecoderService* pDecoderService)
}
}
}
+#endif
static HRESULT STDMETHODCALLTYPE CreateVideoDecoderMine(
IDirectXVideoDecoderServiceC* pThis,
@@ -1423,8 +1449,9 @@ static HRESULT STDMETHODCALLTYPE CreateVideoDecoderMine(
if (FAILED (hr)) {
g_guidDXVADecoder = GUID_NULL;
- } else {
+ }
#ifdef _DEBUG
+ else {
if ((Guid == DXVA2_ModeH264_E) ||
(Guid == DXVA2_ModeVC1_D) ||
(Guid == DXVA_Intel_H264_ClearVideo) ||
@@ -1436,17 +1463,17 @@ static HRESULT STDMETHODCALLTYPE CreateVideoDecoderMine(
for (DWORD i=0; i<NumRenderTargets; i++) {
LOG(_T(" - Surf %d : %08x"), i, ppDecoderRenderTargets[i]);
}
-#endif
}
+#endif
TRACE(_T("DXVA Decoder : %s\n"), GetDXVADecoderDescription());
+#ifdef _DEBUG
LOG(_T("IDirectXVideoDecoderService::CreateVideoDecoder %s (%d render targets) hr = %08x"), GetDXVAMode(&g_guidDXVADecoder), NumRenderTargets, hr);
-
+#endif
return hr;
}
-
-
+#ifdef _DEBUG
static HRESULT STDMETHODCALLTYPE GetDecoderDeviceGuidsMine (IDirectXVideoDecoderServiceC* pThis,
__out UINT* pCount,
__deref_out_ecount_opt(*pCount) GUID** pGuids)
@@ -1471,6 +1498,7 @@ static HRESULT STDMETHODCALLTYPE GetDecoderConfigurationsMine (IDirectXVideoDeco
return hr;
}
+#endif
void HookDirectXVideoDecoderService(void* pIDirectXVideoDecoderService)
{
@@ -1499,7 +1527,9 @@ void HookDirectXVideoDecoderService(void* pIDirectXVideoDecoderService)
g_pIDirectXVideoDecoderServiceCVtbl = NULL;
CreateVideoDecoderOrg = NULL;
+#ifdef _DEBUG
GetDecoderConfigurationsOrg = NULL;
+#endif
g_guidDXVADecoder = GUID_NULL;
g_nDXVAVersion = 0;
}
diff --git a/src/filters/renderer/VideoRenderers/OuterEVR.cpp b/src/filters/renderer/VideoRenderers/OuterEVR.cpp
new file mode 100644
index 000000000..ecfb8041c
--- /dev/null
+++ b/src/filters/renderer/VideoRenderers/OuterEVR.cpp
@@ -0,0 +1,195 @@
+/*
+ * $Id$
+ *
+ * (C) 2006-2011 see AUTHORS
+ *
+ * This file is part of mplayerc.
+ *
+ * Mplayerc is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Mplayerc is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "stdafx.h"
+#include "AllocatorCommon.h"
+#include "EVRAllocatorPresenter.h"
+#include "OuterEVR.h"
+
+using namespace DSObjects;
+
+STDMETHODIMP COuterEVR::EnumPins(__out IEnumPins **ppEnum) {
+ CComPtr<IBaseFilter> pEVRBase;
+ if (m_pEVR) {
+ m_pEVR->QueryInterface(&pEVRBase);
+ }
+ if (pEVRBase) {
+ return pEVRBase->EnumPins(ppEnum);
+ }
+ return E_NOTIMPL;
+}
+
+STDMETHODIMP COuterEVR::FindPin(LPCWSTR Id, __out IPin **ppPin) {
+ CComPtr<IBaseFilter> pEVRBase;
+ if (m_pEVR) {
+ m_pEVR->QueryInterface(&pEVRBase);
+ }
+ if (pEVRBase) {
+ return pEVRBase->FindPin(Id, ppPin);
+ }
+ return E_NOTIMPL;
+}
+
+STDMETHODIMP COuterEVR::QueryFilterInfo(__out FILTER_INFO *pInfo) {
+ CComPtr<IBaseFilter> pEVRBase;
+ if (m_pEVR) {
+ m_pEVR->QueryInterface(&pEVRBase);
+ }
+ if (pEVRBase) {
+ return pEVRBase->QueryFilterInfo(pInfo);
+ }
+ return E_NOTIMPL;
+}
+
+STDMETHODIMP COuterEVR::JoinFilterGraph(__in_opt IFilterGraph *pGraph, __in_opt LPCWSTR pName) {
+ CComPtr<IBaseFilter> pEVRBase;
+ if (m_pEVR) {
+ m_pEVR->QueryInterface(&pEVRBase);
+ }
+ if (pEVRBase) {
+ return pEVRBase->JoinFilterGraph(pGraph, pName);
+ }
+ return E_NOTIMPL;
+}
+
+STDMETHODIMP COuterEVR::QueryVendorInfo(__out LPWSTR *pVendorInfo) {
+ CComPtr<IBaseFilter> pEVRBase;
+ if (m_pEVR) {
+ m_pEVR->QueryInterface(&pEVRBase);
+ }
+ if (pEVRBase) {
+ return pEVRBase->QueryVendorInfo(pVendorInfo);
+ }
+ return E_NOTIMPL;
+}
+
+STDMETHODIMP COuterEVR::Stop() {
+ CComPtr<IBaseFilter> pEVRBase;
+ if (m_pEVR) {
+ m_pEVR->QueryInterface(&pEVRBase);
+ }
+ if (pEVRBase) {
+ return pEVRBase->Stop();
+ }
+ return E_NOTIMPL;
+}
+
+STDMETHODIMP COuterEVR::Pause() {
+ CComPtr<IBaseFilter> pEVRBase;
+ if (m_pEVR) {
+ m_pEVR->QueryInterface(&pEVRBase);
+ }
+ if (pEVRBase) {
+ return pEVRBase->Pause();
+ }
+ return E_NOTIMPL;
+}
+
+STDMETHODIMP COuterEVR::Run(REFERENCE_TIME tStart) {
+ CComPtr<IBaseFilter> pEVRBase;
+ if (m_pEVR) {
+ m_pEVR->QueryInterface(&pEVRBase);
+ }
+ if (pEVRBase) {
+ return pEVRBase->Run(tStart);
+ }
+ return E_NOTIMPL;
+}
+
+STDMETHODIMP COuterEVR::GetState(DWORD dwMilliSecsTimeout, __out FILTER_STATE *State)
+{
+ HRESULT ReturnValue;
+ if (m_pAllocatorPresenter->GetState(dwMilliSecsTimeout, State, ReturnValue)) {
+ return ReturnValue;
+ }
+ CComPtr<IBaseFilter> pEVRBase;
+ if (m_pEVR) {
+ m_pEVR->QueryInterface(&pEVRBase);
+ }
+ if (pEVRBase) {
+ return pEVRBase->GetState(dwMilliSecsTimeout, State);
+ }
+ return E_NOTIMPL;
+}
+
+
+STDMETHODIMP COuterEVR::SetSyncSource(__in_opt IReferenceClock *pClock) {
+ CComPtr<IBaseFilter> pEVRBase;
+ if (m_pEVR) {
+ m_pEVR->QueryInterface(&pEVRBase);
+ }
+ if (pEVRBase) {
+ return pEVRBase->SetSyncSource(pClock);
+ }
+ return E_NOTIMPL;
+}
+
+STDMETHODIMP COuterEVR::GetSyncSource(__deref_out_opt IReferenceClock **pClock) {
+ CComPtr<IBaseFilter> pEVRBase;
+ if (m_pEVR) {
+ m_pEVR->QueryInterface(&pEVRBase);
+ }
+ if (pEVRBase) {
+ return pEVRBase->GetSyncSource(pClock);
+ }
+ return E_NOTIMPL;
+}
+
+STDMETHODIMP COuterEVR::GetClassID(__RPC__out CLSID *pClassID) {
+ CComPtr<IBaseFilter> pEVRBase;
+ if (m_pEVR) {
+ m_pEVR->QueryInterface(&pEVRBase);
+ }
+ if (pEVRBase) {
+ return pEVRBase->GetClassID(pClassID);
+ }
+ return E_NOTIMPL;
+}
+
+
+STDMETHODIMP COuterEVR::GetAlphaBitmapParameters(VMR9AlphaBitmap* pBmpParms)
+{
+ CheckPointer(pBmpParms, E_POINTER);
+ CAutoLock BitMapLock(&m_pAllocatorPresenter->m_VMR9AlphaBitmapLock);
+ memcpy (pBmpParms, m_pVMR9AlphaBitmap, sizeof(VMR9AlphaBitmap));
+ return S_OK;
+}
+
+STDMETHODIMP COuterEVR::SetAlphaBitmap(const VMR9AlphaBitmap* pBmpParms)
+{
+ CheckPointer(pBmpParms, E_POINTER);
+ CAutoLock BitMapLock(&m_pAllocatorPresenter->m_VMR9AlphaBitmapLock);
+ memcpy (m_pVMR9AlphaBitmap, pBmpParms, sizeof(VMR9AlphaBitmap));
+ m_pVMR9AlphaBitmap->dwFlags |= VMRBITMAP_UPDATE;
+ m_pAllocatorPresenter->UpdateAlphaBitmap();
+ return S_OK;
+}
+
+STDMETHODIMP COuterEVR::UpdateAlphaBitmapParameters(const VMR9AlphaBitmap* pBmpParms)
+{
+ CheckPointer(pBmpParms, E_POINTER);
+ CAutoLock BitMapLock(&m_pAllocatorPresenter->m_VMR9AlphaBitmapLock);
+ memcpy (m_pVMR9AlphaBitmap, pBmpParms, sizeof(VMR9AlphaBitmap));
+ m_pVMR9AlphaBitmap->dwFlags |= VMRBITMAP_UPDATE;
+ m_pAllocatorPresenter->UpdateAlphaBitmap();
+ return S_OK;
+}
diff --git a/src/filters/renderer/VideoRenderers/OuterEVR.h b/src/filters/renderer/VideoRenderers/OuterEVR.h
new file mode 100644
index 000000000..ac941c75e
--- /dev/null
+++ b/src/filters/renderer/VideoRenderers/OuterEVR.h
@@ -0,0 +1,99 @@
+/*
+ * $Id$
+ *
+ * (C) 2006-2011 see AUTHORS
+ *
+ * This file is part of mplayerc.
+ *
+ * Mplayerc is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Mplayerc is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#pragma once
+
+/// === Outer EVR
+namespace DSObjects
+{
+ class COuterEVR
+ : public CUnknown
+ , public IVMRffdshow9
+ , public IVMRMixerBitmap9
+ , public IBaseFilter
+ {
+ CComPtr<IUnknown> m_pEVR;
+ VMR9AlphaBitmap* m_pVMR9AlphaBitmap;
+ CEVRAllocatorPresenter *m_pAllocatorPresenter;
+
+ public:
+ COuterEVR(const TCHAR* pName, LPUNKNOWN pUnk, HRESULT& hr, VMR9AlphaBitmap* pVMR9AlphaBitmap, CEVRAllocatorPresenter *pAllocatorPresenter) : CUnknown(pName, pUnk) {
+ hr = m_pEVR.CoCreateInstance(CLSID_EnhancedVideoRenderer, GetOwner());
+ m_pVMR9AlphaBitmap = pVMR9AlphaBitmap;
+ m_pAllocatorPresenter = pAllocatorPresenter;
+ }
+
+ ~COuterEVR() {}
+
+ DECLARE_IUNKNOWN;
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv) {
+ HRESULT hr;
+
+ if(riid == __uuidof(IVMRMixerBitmap9)) {
+ return GetInterface((IVMRMixerBitmap9*)this, ppv);
+ }
+ if (riid == __uuidof(IMediaFilter)) {
+ return GetInterface((IMediaFilter*)this, ppv);
+ }
+ if (riid == __uuidof(IPersist)) {
+ return GetInterface((IPersist*)this, ppv);
+ }
+ if (riid == __uuidof(IBaseFilter)) {
+ return GetInterface((IBaseFilter*)this, ppv);
+ }
+
+ hr = m_pEVR ? m_pEVR->QueryInterface(riid, ppv) : E_NOINTERFACE;
+ if(m_pEVR && FAILED(hr)) {
+ if(riid == __uuidof(IVMRffdshow9)) { // Support ffdshow queueing. We show ffdshow that this is patched Media Player Classic.
+ return GetInterface((IVMRffdshow9*)this, ppv);
+ }
+ }
+
+ return SUCCEEDED(hr) ? hr : __super::NonDelegatingQueryInterface(riid, ppv);
+ }
+
+ // IBaseFilter
+ STDMETHODIMP EnumPins(__out IEnumPins **ppEnum);
+ STDMETHODIMP FindPin(LPCWSTR Id, __out IPin **ppPin);
+ STDMETHODIMP QueryFilterInfo(__out FILTER_INFO *pInfo);
+ STDMETHODIMP JoinFilterGraph(__in_opt IFilterGraph *pGraph, __in_opt LPCWSTR pName);
+ STDMETHODIMP QueryVendorInfo(__out LPWSTR *pVendorInfo);
+ STDMETHODIMP Stop();
+ STDMETHODIMP Pause();
+ STDMETHODIMP Run(REFERENCE_TIME tStart);
+ STDMETHODIMP GetState( DWORD dwMilliSecsTimeout, __out FILTER_STATE *State);
+ STDMETHODIMP SetSyncSource(__in_opt IReferenceClock *pClock);
+ STDMETHODIMP GetSyncSource(__deref_out_opt IReferenceClock **pClock);
+ STDMETHODIMP GetClassID(__RPC__out CLSID *pClassID);
+
+ // IVMRffdshow9
+ STDMETHODIMP support_ffdshow() {
+ queue_ffdshow_support = true;
+ return S_OK;
+ }
+
+ // IVMRMixerBitmap9
+ STDMETHODIMP GetAlphaBitmapParameters(VMR9AlphaBitmap* pBmpParms);
+ STDMETHODIMP SetAlphaBitmap(const VMR9AlphaBitmap* pBmpParms);
+ STDMETHODIMP UpdateAlphaBitmapParameters(const VMR9AlphaBitmap* pBmpParms);
+ };
+}
diff --git a/src/filters/renderer/VideoRenderers/OuterVMR.cpp b/src/filters/renderer/VideoRenderers/OuterVMR.cpp
new file mode 100644
index 000000000..a243cccf1
--- /dev/null
+++ b/src/filters/renderer/VideoRenderers/OuterVMR.cpp
@@ -0,0 +1,160 @@
+/*
+ * $Id$
+ *
+ * (C) 2006-2011 see AUTHORS
+ *
+ * This file is part of mplayerc.
+ *
+ * Mplayerc is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Mplayerc is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "stdafx.h"
+#include "AllocatorCommon.h"
+#include "VMR9AllocatorPresenter.h"
+#include "OuterVMR.h"
+
+using namespace DSObjects;
+
+STDMETHODIMP COuterVMR9::GetNativeVideoSize(LONG* lpWidth, LONG* lpHeight, LONG* lpARWidth, LONG* lpARHeight) {
+ if(CComQIPtr<IVMRWindowlessControl9> pWC9 = m_pVMR) {
+ return pWC9->GetNativeVideoSize(lpWidth, lpHeight, lpARWidth, lpARHeight);
+ }
+
+ return E_NOTIMPL;
+}
+
+STDMETHODIMP COuterVMR9::GetVideoPosition(LPRECT lpSRCRect, LPRECT lpDSTRect) {
+ if(CComQIPtr<IVMRWindowlessControl9> pWC9 = m_pVMR) {
+ return pWC9->GetVideoPosition(lpSRCRect, lpDSTRect);
+ }
+
+ return E_NOTIMPL;
+}
+
+STDMETHODIMP COuterVMR9::GetAspectRatioMode(DWORD* lpAspectRatioMode) {
+ if(CComQIPtr<IVMRWindowlessControl9> pWC9 = m_pVMR) {
+ *lpAspectRatioMode = VMR_ARMODE_NONE;
+ return S_OK;
+ }
+
+ return E_NOTIMPL;
+}
+
+// IVideoWindow
+STDMETHODIMP COuterVMR9::get_Width(long* pWidth) {
+ if(CComQIPtr<IVMRWindowlessControl9> pWC9 = m_pVMR) {
+ CRect s, d;
+ HRESULT hr = pWC9->GetVideoPosition(&s, &d);
+ *pWidth = d.Width();
+ return hr;
+ }
+
+ return E_NOTIMPL;
+}
+
+STDMETHODIMP COuterVMR9::get_Height(long* pHeight) {
+ if(CComQIPtr<IVMRWindowlessControl9> pWC9 = m_pVMR) {
+ CRect s, d;
+ HRESULT hr = pWC9->GetVideoPosition(&s, &d);
+ *pHeight = d.Height();
+ return hr;
+ }
+
+ return E_NOTIMPL;
+}
+
+// IBasicVideo2
+STDMETHODIMP COuterVMR9::GetSourcePosition(long* pLeft, long* pTop, long* pWidth, long* pHeight) {
+ // DVD Nav. bug workaround fix
+ {
+ *pLeft = *pTop = 0;
+ return GetVideoSize(pWidth, pHeight);
+ }
+ /*
+ if(CComQIPtr<IVMRWindowlessControl9> pWC9 = m_pVMR)
+ {
+ CRect s, d;
+ HRESULT hr = pWC9->GetVideoPosition(&s, &d);
+ *pLeft = s.left;
+ *pTop = s.top;
+ *pWidth = s.Width();
+ *pHeight = s.Height();
+ return hr;
+ }
+ return E_NOTIMPL;
+ */
+}
+
+STDMETHODIMP COuterVMR9::GetDestinationPosition(long* pLeft, long* pTop, long* pWidth, long* pHeight) {
+ if(CComQIPtr<IVMRWindowlessControl9> pWC9 = m_pVMR) {
+ CRect s, d;
+ HRESULT hr = pWC9->GetVideoPosition(&s, &d);
+ *pLeft = d.left;
+ *pTop = d.top;
+ *pWidth = d.Width();
+ *pHeight = d.Height();
+ return hr;
+ }
+
+ return E_NOTIMPL;
+}
+
+STDMETHODIMP COuterVMR9::GetVideoSize(long* pWidth, long* pHeight) {
+ if(CComQIPtr<IVMRWindowlessControl9> pWC9 = m_pVMR) {
+ LONG aw, ah;
+ // return pWC9->GetNativeVideoSize(pWidth, pHeight, &aw, &ah);
+ // DVD Nav. bug workaround fix
+ HRESULT hr = pWC9->GetNativeVideoSize(pWidth, pHeight, &aw, &ah);
+ *pWidth = *pHeight * aw / ah;
+ return hr;
+ }
+
+ return E_NOTIMPL;
+}
+
+STDMETHODIMP COuterVMR9::GetPreferredAspectRatio(long* plAspectX, long* plAspectY) {
+ if(CComQIPtr<IVMRWindowlessControl9> pWC9 = m_pVMR) {
+ LONG w, h;
+ return pWC9->GetNativeVideoSize(&w, &h, plAspectX, plAspectY);
+ }
+
+ return E_NOTIMPL;
+}
+
+// IVMRMixerBitmap9
+STDMETHODIMP COuterVMR9::GetAlphaBitmapParameters(VMR9AlphaBitmap* pBmpParms) {
+ CheckPointer(pBmpParms, E_POINTER);
+ CAutoLock BitMapLock(&m_pAllocatorPresenter->m_VMR9AlphaBitmapLock);
+ memcpy (pBmpParms, m_pVMR9AlphaBitmap, sizeof(VMR9AlphaBitmap));
+ return S_OK;
+}
+
+STDMETHODIMP COuterVMR9::SetAlphaBitmap(const VMR9AlphaBitmap* pBmpParms) {
+ CheckPointer(pBmpParms, E_POINTER);
+ CAutoLock BitMapLock(&m_pAllocatorPresenter->m_VMR9AlphaBitmapLock);
+ memcpy (m_pVMR9AlphaBitmap, pBmpParms, sizeof(VMR9AlphaBitmap));
+ m_pVMR9AlphaBitmap->dwFlags |= VMRBITMAP_UPDATE;
+ m_pAllocatorPresenter->UpdateAlphaBitmap();
+ return S_OK;
+}
+
+STDMETHODIMP COuterVMR9::UpdateAlphaBitmapParameters(const VMR9AlphaBitmap* pBmpParms) {
+ CheckPointer(pBmpParms, E_POINTER);
+ CAutoLock BitMapLock(&m_pAllocatorPresenter->m_VMR9AlphaBitmapLock);
+ memcpy (m_pVMR9AlphaBitmap, pBmpParms, sizeof(VMR9AlphaBitmap));
+ m_pVMR9AlphaBitmap->dwFlags |= VMRBITMAP_UPDATE;
+ m_pAllocatorPresenter->UpdateAlphaBitmap();
+ return S_OK;
+}
diff --git a/src/filters/renderer/VideoRenderers/OuterVMR.h b/src/filters/renderer/VideoRenderers/OuterVMR.h
new file mode 100644
index 000000000..ec7650f65
--- /dev/null
+++ b/src/filters/renderer/VideoRenderers/OuterVMR.h
@@ -0,0 +1,366 @@
+/*
+ * $Id$
+ *
+ * (C) 2006-2011 see AUTHORS
+ *
+ * This file is part of mplayerc.
+ *
+ * Mplayerc is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Mplayerc is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#pragma once
+
+namespace DSObjects
+{
+ class COuterVMR9
+ : public CUnknown
+ , public IVideoWindow
+ , public IBasicVideo2
+ , public IVMRWindowlessControl
+ , public IVMRffdshow9
+ , public IVMRMixerBitmap9
+ {
+ CComPtr<IUnknown> m_pVMR;
+ VMR9AlphaBitmap* m_pVMR9AlphaBitmap;
+ CDX9AllocatorPresenter *m_pAllocatorPresenter;
+
+ public:
+
+ COuterVMR9(const TCHAR* pName, LPUNKNOWN pUnk, VMR9AlphaBitmap* pVMR9AlphaBitmap, CDX9AllocatorPresenter *_pAllocatorPresenter) : CUnknown(pName, pUnk) {
+ m_pVMR.CoCreateInstance(CLSID_VideoMixingRenderer9, GetOwner());
+ m_pVMR9AlphaBitmap = pVMR9AlphaBitmap;
+ m_pAllocatorPresenter = _pAllocatorPresenter;
+ }
+
+ ~COuterVMR9() {
+ m_pVMR = NULL;
+ }
+
+ DECLARE_IUNKNOWN;
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv) {
+ HRESULT hr;
+
+ // Casimir666 : in renderless mode, do the inlaying in place of VMR
+ if(riid == __uuidof(IVMRMixerBitmap9)) {
+ return GetInterface((IVMRMixerBitmap9*)this, ppv);
+ }
+
+ hr = m_pVMR ? m_pVMR->QueryInterface(riid, ppv) : E_NOINTERFACE;
+ if(m_pVMR && FAILED(hr)) {
+ if(riid == __uuidof(IVideoWindow)) {
+ return GetInterface((IVideoWindow*)this, ppv);
+ }
+ if(riid == __uuidof(IBasicVideo)) {
+ return GetInterface((IBasicVideo*)this, ppv);
+ }
+ if(riid == __uuidof(IBasicVideo2)) {
+ return GetInterface((IBasicVideo2*)this, ppv);
+ }
+ if(riid == __uuidof(IVMRffdshow9)) { // Support ffdshow queueing. We show ffdshow that this is patched Media Player Classic.
+ return GetInterface((IVMRffdshow9*)this, ppv);
+ }
+ /* if(riid == __uuidof(IVMRWindowlessControl))
+ return GetInterface((IVMRWindowlessControl*)this, ppv);
+ */
+ }
+
+ return SUCCEEDED(hr) ? hr : __super::NonDelegatingQueryInterface(riid, ppv);
+ }
+
+ // IVMRWindowlessControl
+
+ STDMETHODIMP GetNativeVideoSize(LONG* lpWidth, LONG* lpHeight, LONG* lpARWidth, LONG* lpARHeight);
+
+ STDMETHODIMP GetMinIdealVideoSize(LONG* lpWidth, LONG* lpHeight) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP GetMaxIdealVideoSize(LONG* lpWidth, LONG* lpHeight) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP SetVideoPosition(const LPRECT lpSRCRect, const LPRECT lpDSTRect) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP GetVideoPosition(LPRECT lpSRCRect, LPRECT lpDSTRect);
+
+ STDMETHODIMP GetAspectRatioMode(DWORD* lpAspectRatioMode);
+
+ STDMETHODIMP SetAspectRatioMode(DWORD AspectRatioMode) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP SetVideoClippingWindow(HWND hwnd) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP RepaintVideo(HWND hwnd, HDC hdc) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP DisplayModeChanged() {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP GetCurrentImage(BYTE** lpDib) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP SetBorderColor(COLORREF Clr) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP GetBorderColor(COLORREF* lpClr) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP SetColorKey(COLORREF Clr) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP GetColorKey(COLORREF* lpClr) {
+ return E_NOTIMPL;
+ }
+
+ // IVideoWindow
+ STDMETHODIMP GetTypeInfoCount(UINT* pctinfo) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgDispId) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP put_Caption(BSTR strCaption) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP get_Caption(BSTR* strCaption) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP put_WindowStyle(long WindowStyle) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP get_WindowStyle(long* WindowStyle) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP put_WindowStyleEx(long WindowStyleEx) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP get_WindowStyleEx(long* WindowStyleEx) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP put_AutoShow(long AutoShow) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP get_AutoShow(long* AutoShow) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP put_WindowState(long WindowState) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP get_WindowState(long* WindowState) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP put_BackgroundPalette(long BackgroundPalette) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP get_BackgroundPalette(long* pBackgroundPalette) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP put_Visible(long Visible) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP get_Visible(long* pVisible) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP put_Left(long Left) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP get_Left(long* pLeft) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP put_Width(long Width) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP get_Width(long* pWidth);
+
+ STDMETHODIMP put_Top(long Top) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP get_Top(long* pTop) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP put_Height(long Height) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP get_Height(long* pHeight);
+
+ STDMETHODIMP put_Owner(OAHWND Owner) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP get_Owner(OAHWND* Owner) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP put_MessageDrain(OAHWND Drain) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP get_MessageDrain(OAHWND* Drain) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP get_BorderColor(long* Color) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP put_BorderColor(long Color) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP get_FullScreenMode(long* FullScreenMode) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP put_FullScreenMode(long FullScreenMode) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP SetWindowForeground(long Focus) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP NotifyOwnerMessage(OAHWND hwnd, long uMsg, LONG_PTR wParam, LONG_PTR lParam) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP SetWindowPosition(long Left, long Top, long Width, long Height) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP GetWindowPosition(long* pLeft, long* pTop, long* pWidth, long* pHeight) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP GetMinIdealImageSize(long* pWidth, long* pHeight) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP GetMaxIdealImageSize(long* pWidth, long* pHeight) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP GetRestorePosition(long* pLeft, long* pTop, long* pWidth, long* pHeight) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP HideCursor(long HideCursor) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP IsCursorHidden(long* CursorHidden) {
+ return E_NOTIMPL;
+ }
+
+ // IBasicVideo2
+ STDMETHODIMP get_AvgTimePerFrame(REFTIME* pAvgTimePerFrame) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP get_BitRate(long* pBitRate) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP get_BitErrorRate(long* pBitErrorRate) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP get_VideoWidth(long* pVideoWidth) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP get_VideoHeight(long* pVideoHeight) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP put_SourceLeft(long SourceLeft) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP get_SourceLeft(long* pSourceLeft) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP put_SourceWidth(long SourceWidth) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP get_SourceWidth(long* pSourceWidth) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP put_SourceTop(long SourceTop) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP get_SourceTop(long* pSourceTop) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP put_SourceHeight(long SourceHeight) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP get_SourceHeight(long* pSourceHeight) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP put_DestinationLeft(long DestinationLeft) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP get_DestinationLeft(long* pDestinationLeft) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP put_DestinationWidth(long DestinationWidth) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP get_DestinationWidth(long* pDestinationWidth) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP put_DestinationTop(long DestinationTop) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP get_DestinationTop(long* pDestinationTop) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP put_DestinationHeight(long DestinationHeight) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP get_DestinationHeight(long* pDestinationHeight) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP SetSourcePosition(long Left, long Top, long Width, long Height) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP GetSourcePosition(long* pLeft, long* pTop, long* pWidth, long* pHeight);
+
+ STDMETHODIMP SetDefaultSourcePosition() {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP SetDestinationPosition(long Left, long Top, long Width, long Height) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP GetDestinationPosition(long* pLeft, long* pTop, long* pWidth, long* pHeight);
+
+ STDMETHODIMP SetDefaultDestinationPosition() {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP GetVideoSize(long* pWidth, long* pHeight);
+
+ // IVMRffdshow9
+ STDMETHODIMP support_ffdshow() {
+ queue_ffdshow_support = true;
+ return S_OK;
+ }
+
+ STDMETHODIMP GetVideoPaletteEntries(long StartIndex, long Entries, long* pRetrieved, long* pPalette) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP GetCurrentImage(long* pBufferSize, long* pDIBImage) {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP IsUsingDefaultSource() {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP IsUsingDefaultDestination() {
+ return E_NOTIMPL;
+ }
+
+ STDMETHODIMP GetPreferredAspectRatio(long* plAspectX, long* plAspectY);
+
+ // IVMRMixerBitmap9
+ STDMETHODIMP GetAlphaBitmapParameters(VMR9AlphaBitmap* pBmpParms);
+
+ STDMETHODIMP SetAlphaBitmap(const VMR9AlphaBitmap* pBmpParms);
+
+ STDMETHODIMP UpdateAlphaBitmapParameters(const VMR9AlphaBitmap* pBmpParms);
+ };
+}
diff --git a/src/filters/renderer/VideoRenderers/SyncRenderer.cpp b/src/filters/renderer/VideoRenderers/SyncRenderer.cpp
index 64047b160..b772fd8b7 100644
--- a/src/filters/renderer/VideoRenderers/SyncRenderer.cpp
+++ b/src/filters/renderer/VideoRenderers/SyncRenderer.cpp
@@ -609,7 +609,7 @@ HRESULT CBaseAP::CreateDXDevice(CString &_Error)
if(m_pAllocator) {
m_pAllocator->ChangeDevice(m_pD3DDev);
} else {
- m_pAllocator = DNew CDX9SubPicAllocator(m_pD3DDev, size, GetRenderersSettings().fSPCPow2Tex);
+ m_pAllocator = DNew CDX9SubPicAllocator(m_pD3DDev, size, GetRenderersSettings().fSPCPow2Tex, false);
if(!m_pAllocator) {
_Error += L"CDX9SubPicAllocator failed\n";
return E_FAIL;
@@ -879,7 +879,7 @@ HRESULT CBaseAP::ResetDXDevice(CString &_Error)
if(m_pAllocator) {
m_pAllocator->ChangeDevice(m_pD3DDev);
} else {
- m_pAllocator = DNew CDX9SubPicAllocator(m_pD3DDev, size, GetRenderersSettings().fSPCPow2Tex);
+ m_pAllocator = DNew CDX9SubPicAllocator(m_pD3DDev, size, GetRenderersSettings().fSPCPow2Tex, false);
if(!m_pAllocator) {
_Error += L"CDX9SubPicAllocator failed\n";
@@ -1393,10 +1393,15 @@ HRESULT CBaseAP::AlphaBlt(RECT* pSrc, RECT* pDst, IDirect3DTexture9* pTexture)
hr = m_pD3DDev->SetTexture(0, pTexture);
+ // GetRenderState fails for devices created with D3DCREATE_PUREDEVICE
+ // so we need to provide default values in case GetRenderState fails
DWORD abe, sb, db;
- hr = m_pD3DDev->GetRenderState(D3DRS_ALPHABLENDENABLE, &abe);
- hr = m_pD3DDev->GetRenderState(D3DRS_SRCBLEND, &sb);
- hr = m_pD3DDev->GetRenderState(D3DRS_DESTBLEND, &db);
+ if (FAILED(m_pD3DDev->GetRenderState(D3DRS_ALPHABLENDENABLE, &abe)))
+ abe = FALSE;
+ if (FAILED(m_pD3DDev->GetRenderState(D3DRS_SRCBLEND, &sb)))
+ sb = D3DBLEND_ONE;
+ if (FAILED(m_pD3DDev->GetRenderState(D3DRS_DESTBLEND, &db)))
+ db = D3DBLEND_ZERO;
hr = m_pD3DDev->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
hr = m_pD3DDev->SetRenderState(D3DRS_LIGHTING, FALSE);
@@ -1899,6 +1904,11 @@ STDMETHODIMP_(bool) CBaseAP::ResetDevice()
return true;
}
+STDMETHODIMP_(bool) CBaseAP::DisplayChange()
+{
+ return true;
+}
+
void CBaseAP::DrawText(const RECT &rc, const CString &strText, int _Priority)
{
if (_Priority < 1) {
diff --git a/src/filters/renderer/VideoRenderers/SyncRenderer.h b/src/filters/renderer/VideoRenderers/SyncRenderer.h
index 8e9f87c79..d4ff8acd0 100644
--- a/src/filters/renderer/VideoRenderers/SyncRenderer.h
+++ b/src/filters/renderer/VideoRenderers/SyncRenderer.h
@@ -2,7 +2,7 @@
* $Id$
*
* (C) 2003-2006 Gabest
-* (C) 2006-2010 see AUTHORS
+* (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -337,6 +337,7 @@ namespace GothSync
STDMETHODIMP SetPixelShader(LPCSTR pSrcData, LPCSTR pTarget);
STDMETHODIMP SetPixelShader2(LPCSTR pSrcData, LPCSTR pTarget, bool bScreenSpace);
STDMETHODIMP_(bool) ResetDevice();
+ STDMETHODIMP_(bool) DisplayChange();
};
class CSyncAP:
diff --git a/src/filters/renderer/VideoRenderers/VMR9AllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/VMR9AllocatorPresenter.cpp
index 4b0691b52..7d7ecc5ab 100644
--- a/src/filters/renderer/VideoRenderers/VMR9AllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/VMR9AllocatorPresenter.cpp
@@ -1,7 +1,7 @@
/*
* $Id$
*
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -22,450 +22,12 @@
#include "stdafx.h"
#include "VMR9AllocatorPresenter.h"
+#include "OuterVMR.h"
#include "IPinHook.h"
#include "MacrovisionKicker.h"
// ISubPicAllocatorPresenter
-namespace DSObjects
-{
- class COuterVMR9
- : public CUnknown
- , public IVideoWindow
- , public IBasicVideo2
- , public IVMRWindowlessControl
- , public IVMRffdshow9
- , public IVMRMixerBitmap9
- {
- CComPtr<IUnknown> m_pVMR;
- VMR9AlphaBitmap* m_pVMR9AlphaBitmap;
- CDX9AllocatorPresenter *m_pAllocatorPresenter;
-
- public:
-
- COuterVMR9(const TCHAR* pName, LPUNKNOWN pUnk, VMR9AlphaBitmap* pVMR9AlphaBitmap, CDX9AllocatorPresenter *_pAllocatorPresenter) : CUnknown(pName, pUnk) {
- m_pVMR.CoCreateInstance(CLSID_VideoMixingRenderer9, GetOwner());
- m_pVMR9AlphaBitmap = pVMR9AlphaBitmap;
- m_pAllocatorPresenter = _pAllocatorPresenter;
- }
-
- ~COuterVMR9() {
- m_pVMR = NULL;
- }
-
- DECLARE_IUNKNOWN;
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv) {
- HRESULT hr;
-
- // Casimir666 : in renderless mode, do the inlaying in place of VMR
- if(riid == __uuidof(IVMRMixerBitmap9)) {
- return GetInterface((IVMRMixerBitmap9*)this, ppv);
- }
-
- hr = m_pVMR ? m_pVMR->QueryInterface(riid, ppv) : E_NOINTERFACE;
- if(m_pVMR && FAILED(hr)) {
- if(riid == __uuidof(IVideoWindow)) {
- return GetInterface((IVideoWindow*)this, ppv);
- }
- if(riid == __uuidof(IBasicVideo)) {
- return GetInterface((IBasicVideo*)this, ppv);
- }
- if(riid == __uuidof(IBasicVideo2)) {
- return GetInterface((IBasicVideo2*)this, ppv);
- }
- if(riid == __uuidof(IVMRffdshow9)) { // Support ffdshow queueing. We show ffdshow that this is patched Media Player Classic.
- return GetInterface((IVMRffdshow9*)this, ppv);
- }
- /* if(riid == __uuidof(IVMRWindowlessControl))
- return GetInterface((IVMRWindowlessControl*)this, ppv);
- */
- }
-
- return SUCCEEDED(hr) ? hr : __super::NonDelegatingQueryInterface(riid, ppv);
- }
-
- // IVMRWindowlessControl
-
- STDMETHODIMP GetNativeVideoSize(LONG* lpWidth, LONG* lpHeight, LONG* lpARWidth, LONG* lpARHeight) {
- if(CComQIPtr<IVMRWindowlessControl9> pWC9 = m_pVMR) {
- return pWC9->GetNativeVideoSize(lpWidth, lpHeight, lpARWidth, lpARHeight);
- }
-
- return E_NOTIMPL;
- }
- STDMETHODIMP GetMinIdealVideoSize(LONG* lpWidth, LONG* lpHeight) {
- return E_NOTIMPL;
- }
- STDMETHODIMP GetMaxIdealVideoSize(LONG* lpWidth, LONG* lpHeight) {
- return E_NOTIMPL;
- }
- STDMETHODIMP SetVideoPosition(const LPRECT lpSRCRect, const LPRECT lpDSTRect) {
- return E_NOTIMPL;
- }
- STDMETHODIMP GetVideoPosition(LPRECT lpSRCRect, LPRECT lpDSTRect) {
- if(CComQIPtr<IVMRWindowlessControl9> pWC9 = m_pVMR) {
- return pWC9->GetVideoPosition(lpSRCRect, lpDSTRect);
- }
-
- return E_NOTIMPL;
- }
- STDMETHODIMP GetAspectRatioMode(DWORD* lpAspectRatioMode) {
- if(CComQIPtr<IVMRWindowlessControl9> pWC9 = m_pVMR) {
- *lpAspectRatioMode = VMR_ARMODE_NONE;
- return S_OK;
- }
-
- return E_NOTIMPL;
- }
- STDMETHODIMP SetAspectRatioMode(DWORD AspectRatioMode) {
- return E_NOTIMPL;
- }
- STDMETHODIMP SetVideoClippingWindow(HWND hwnd) {
- return E_NOTIMPL;
- }
- STDMETHODIMP RepaintVideo(HWND hwnd, HDC hdc) {
- return E_NOTIMPL;
- }
- STDMETHODIMP DisplayModeChanged() {
- return E_NOTIMPL;
- }
- STDMETHODIMP GetCurrentImage(BYTE** lpDib) {
- return E_NOTIMPL;
- }
- STDMETHODIMP SetBorderColor(COLORREF Clr) {
- return E_NOTIMPL;
- }
- STDMETHODIMP GetBorderColor(COLORREF* lpClr) {
- return E_NOTIMPL;
- }
- STDMETHODIMP SetColorKey(COLORREF Clr) {
- return E_NOTIMPL;
- }
- STDMETHODIMP GetColorKey(COLORREF* lpClr) {
- return E_NOTIMPL;
- }
-
- // IVideoWindow
- STDMETHODIMP GetTypeInfoCount(UINT* pctinfo) {
- return E_NOTIMPL;
- }
- STDMETHODIMP GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo) {
- return E_NOTIMPL;
- }
- STDMETHODIMP GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgDispId) {
- return E_NOTIMPL;
- }
- STDMETHODIMP Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr) {
- return E_NOTIMPL;
- }
- STDMETHODIMP put_Caption(BSTR strCaption) {
- return E_NOTIMPL;
- }
- STDMETHODIMP get_Caption(BSTR* strCaption) {
- return E_NOTIMPL;
- }
- STDMETHODIMP put_WindowStyle(long WindowStyle) {
- return E_NOTIMPL;
- }
- STDMETHODIMP get_WindowStyle(long* WindowStyle) {
- return E_NOTIMPL;
- }
- STDMETHODIMP put_WindowStyleEx(long WindowStyleEx) {
- return E_NOTIMPL;
- }
- STDMETHODIMP get_WindowStyleEx(long* WindowStyleEx) {
- return E_NOTIMPL;
- }
- STDMETHODIMP put_AutoShow(long AutoShow) {
- return E_NOTIMPL;
- }
- STDMETHODIMP get_AutoShow(long* AutoShow) {
- return E_NOTIMPL;
- }
- STDMETHODIMP put_WindowState(long WindowState) {
- return E_NOTIMPL;
- }
- STDMETHODIMP get_WindowState(long* WindowState) {
- return E_NOTIMPL;
- }
- STDMETHODIMP put_BackgroundPalette(long BackgroundPalette) {
- return E_NOTIMPL;
- }
- STDMETHODIMP get_BackgroundPalette(long* pBackgroundPalette) {
- return E_NOTIMPL;
- }
- STDMETHODIMP put_Visible(long Visible) {
- return E_NOTIMPL;
- }
- STDMETHODIMP get_Visible(long* pVisible) {
- return E_NOTIMPL;
- }
- STDMETHODIMP put_Left(long Left) {
- return E_NOTIMPL;
- }
- STDMETHODIMP get_Left(long* pLeft) {
- return E_NOTIMPL;
- }
- STDMETHODIMP put_Width(long Width) {
- return E_NOTIMPL;
- }
- STDMETHODIMP get_Width(long* pWidth) {
- if(CComQIPtr<IVMRWindowlessControl9> pWC9 = m_pVMR) {
- CRect s, d;
- HRESULT hr = pWC9->GetVideoPosition(&s, &d);
- *pWidth = d.Width();
- return hr;
- }
-
- return E_NOTIMPL;
- }
- STDMETHODIMP put_Top(long Top) {
- return E_NOTIMPL;
- }
- STDMETHODIMP get_Top(long* pTop) {
- return E_NOTIMPL;
- }
- STDMETHODIMP put_Height(long Height) {
- return E_NOTIMPL;
- }
- STDMETHODIMP get_Height(long* pHeight) {
- if(CComQIPtr<IVMRWindowlessControl9> pWC9 = m_pVMR) {
- CRect s, d;
- HRESULT hr = pWC9->GetVideoPosition(&s, &d);
- *pHeight = d.Height();
- return hr;
- }
-
- return E_NOTIMPL;
- }
- STDMETHODIMP put_Owner(OAHWND Owner) {
- return E_NOTIMPL;
- }
- STDMETHODIMP get_Owner(OAHWND* Owner) {
- return E_NOTIMPL;
- }
- STDMETHODIMP put_MessageDrain(OAHWND Drain) {
- return E_NOTIMPL;
- }
- STDMETHODIMP get_MessageDrain(OAHWND* Drain) {
- return E_NOTIMPL;
- }
- STDMETHODIMP get_BorderColor(long* Color) {
- return E_NOTIMPL;
- }
- STDMETHODIMP put_BorderColor(long Color) {
- return E_NOTIMPL;
- }
- STDMETHODIMP get_FullScreenMode(long* FullScreenMode) {
- return E_NOTIMPL;
- }
- STDMETHODIMP put_FullScreenMode(long FullScreenMode) {
- return E_NOTIMPL;
- }
- STDMETHODIMP SetWindowForeground(long Focus) {
- return E_NOTIMPL;
- }
- STDMETHODIMP NotifyOwnerMessage(OAHWND hwnd, long uMsg, LONG_PTR wParam, LONG_PTR lParam) {
- return E_NOTIMPL;
- }
- STDMETHODIMP SetWindowPosition(long Left, long Top, long Width, long Height) {
- return E_NOTIMPL;
- }
- STDMETHODIMP GetWindowPosition(long* pLeft, long* pTop, long* pWidth, long* pHeight) {
- return E_NOTIMPL;
- }
- STDMETHODIMP GetMinIdealImageSize(long* pWidth, long* pHeight) {
- return E_NOTIMPL;
- }
- STDMETHODIMP GetMaxIdealImageSize(long* pWidth, long* pHeight) {
- return E_NOTIMPL;
- }
- STDMETHODIMP GetRestorePosition(long* pLeft, long* pTop, long* pWidth, long* pHeight) {
- return E_NOTIMPL;
- }
- STDMETHODIMP HideCursor(long HideCursor) {
- return E_NOTIMPL;
- }
- STDMETHODIMP IsCursorHidden(long* CursorHidden) {
- return E_NOTIMPL;
- }
-
- // IBasicVideo2
- STDMETHODIMP get_AvgTimePerFrame(REFTIME* pAvgTimePerFrame) {
- return E_NOTIMPL;
- }
- STDMETHODIMP get_BitRate(long* pBitRate) {
- return E_NOTIMPL;
- }
- STDMETHODIMP get_BitErrorRate(long* pBitErrorRate) {
- return E_NOTIMPL;
- }
- STDMETHODIMP get_VideoWidth(long* pVideoWidth) {
- return E_NOTIMPL;
- }
- STDMETHODIMP get_VideoHeight(long* pVideoHeight) {
- return E_NOTIMPL;
- }
- STDMETHODIMP put_SourceLeft(long SourceLeft) {
- return E_NOTIMPL;
- }
- STDMETHODIMP get_SourceLeft(long* pSourceLeft) {
- return E_NOTIMPL;
- }
- STDMETHODIMP put_SourceWidth(long SourceWidth) {
- return E_NOTIMPL;
- }
- STDMETHODIMP get_SourceWidth(long* pSourceWidth) {
- return E_NOTIMPL;
- }
- STDMETHODIMP put_SourceTop(long SourceTop) {
- return E_NOTIMPL;
- }
- STDMETHODIMP get_SourceTop(long* pSourceTop) {
- return E_NOTIMPL;
- }
- STDMETHODIMP put_SourceHeight(long SourceHeight) {
- return E_NOTIMPL;
- }
- STDMETHODIMP get_SourceHeight(long* pSourceHeight) {
- return E_NOTIMPL;
- }
- STDMETHODIMP put_DestinationLeft(long DestinationLeft) {
- return E_NOTIMPL;
- }
- STDMETHODIMP get_DestinationLeft(long* pDestinationLeft) {
- return E_NOTIMPL;
- }
- STDMETHODIMP put_DestinationWidth(long DestinationWidth) {
- return E_NOTIMPL;
- }
- STDMETHODIMP get_DestinationWidth(long* pDestinationWidth) {
- return E_NOTIMPL;
- }
- STDMETHODIMP put_DestinationTop(long DestinationTop) {
- return E_NOTIMPL;
- }
- STDMETHODIMP get_DestinationTop(long* pDestinationTop) {
- return E_NOTIMPL;
- }
- STDMETHODIMP put_DestinationHeight(long DestinationHeight) {
- return E_NOTIMPL;
- }
- STDMETHODIMP get_DestinationHeight(long* pDestinationHeight) {
- return E_NOTIMPL;
- }
- STDMETHODIMP SetSourcePosition(long Left, long Top, long Width, long Height) {
- return E_NOTIMPL;
- }
- STDMETHODIMP GetSourcePosition(long* pLeft, long* pTop, long* pWidth, long* pHeight) {
- // DVD Nav. bug workaround fix
- {
- *pLeft = *pTop = 0;
- return GetVideoSize(pWidth, pHeight);
- }
- /*
- if(CComQIPtr<IVMRWindowlessControl9> pWC9 = m_pVMR)
- {
- CRect s, d;
- HRESULT hr = pWC9->GetVideoPosition(&s, &d);
- *pLeft = s.left;
- *pTop = s.top;
- *pWidth = s.Width();
- *pHeight = s.Height();
- return hr;
- }
- return E_NOTIMPL;
- */
- }
- STDMETHODIMP SetDefaultSourcePosition() {
- return E_NOTIMPL;
- }
- STDMETHODIMP SetDestinationPosition(long Left, long Top, long Width, long Height) {
- return E_NOTIMPL;
- }
- STDMETHODIMP GetDestinationPosition(long* pLeft, long* pTop, long* pWidth, long* pHeight) {
- if(CComQIPtr<IVMRWindowlessControl9> pWC9 = m_pVMR) {
- CRect s, d;
- HRESULT hr = pWC9->GetVideoPosition(&s, &d);
- *pLeft = d.left;
- *pTop = d.top;
- *pWidth = d.Width();
- *pHeight = d.Height();
- return hr;
- }
-
- return E_NOTIMPL;
- }
- STDMETHODIMP SetDefaultDestinationPosition() {
- return E_NOTIMPL;
- }
- STDMETHODIMP GetVideoSize(long* pWidth, long* pHeight) {
- if(CComQIPtr<IVMRWindowlessControl9> pWC9 = m_pVMR) {
- LONG aw, ah;
- // return pWC9->GetNativeVideoSize(pWidth, pHeight, &aw, &ah);
- // DVD Nav. bug workaround fix
- HRESULT hr = pWC9->GetNativeVideoSize(pWidth, pHeight, &aw, &ah);
- *pWidth = *pHeight * aw / ah;
- return hr;
- }
-
- return E_NOTIMPL;
- }
- // IVMRffdshow9
- STDMETHODIMP support_ffdshow() {
- queue_ffdshow_support = true;
- return S_OK;
- }
-
- STDMETHODIMP GetVideoPaletteEntries(long StartIndex, long Entries, long* pRetrieved, long* pPalette) {
- return E_NOTIMPL;
- }
- STDMETHODIMP GetCurrentImage(long* pBufferSize, long* pDIBImage) {
- return E_NOTIMPL;
- }
- STDMETHODIMP IsUsingDefaultSource() {
- return E_NOTIMPL;
- }
- STDMETHODIMP IsUsingDefaultDestination() {
- return E_NOTIMPL;
- }
-
- STDMETHODIMP GetPreferredAspectRatio(long* plAspectX, long* plAspectY) {
- if(CComQIPtr<IVMRWindowlessControl9> pWC9 = m_pVMR) {
- LONG w, h;
- return pWC9->GetNativeVideoSize(&w, &h, plAspectX, plAspectY);
- }
-
- return E_NOTIMPL;
- }
-
- // IVMRMixerBitmap9
- STDMETHODIMP GetAlphaBitmapParameters(VMR9AlphaBitmap* pBmpParms) {
- CheckPointer(pBmpParms, E_POINTER);
- CAutoLock BitMapLock(&m_pAllocatorPresenter->m_VMR9AlphaBitmapLock);
- memcpy (pBmpParms, m_pVMR9AlphaBitmap, sizeof(VMR9AlphaBitmap));
- return S_OK;
- }
-
- STDMETHODIMP SetAlphaBitmap(const VMR9AlphaBitmap* pBmpParms) {
- CheckPointer(pBmpParms, E_POINTER);
- CAutoLock BitMapLock(&m_pAllocatorPresenter->m_VMR9AlphaBitmapLock);
- memcpy (m_pVMR9AlphaBitmap, pBmpParms, sizeof(VMR9AlphaBitmap));
- m_pVMR9AlphaBitmap->dwFlags |= VMRBITMAP_UPDATE;
- m_pAllocatorPresenter->UpdateAlphaBitmap();
- return S_OK;
- }
-
- STDMETHODIMP UpdateAlphaBitmapParameters(const VMR9AlphaBitmap* pBmpParms) {
- CheckPointer(pBmpParms, E_POINTER);
- CAutoLock BitMapLock(&m_pAllocatorPresenter->m_VMR9AlphaBitmapLock);
- memcpy (m_pVMR9AlphaBitmap, pBmpParms, sizeof(VMR9AlphaBitmap));
- m_pVMR9AlphaBitmap->dwFlags |= VMRBITMAP_UPDATE;
- m_pAllocatorPresenter->UpdateAlphaBitmap();
- return S_OK;
- }
- };
-}
using namespace DSObjects;
diff --git a/src/filters/renderer/VideoRenderers/VideoRenderers.vcproj b/src/filters/renderer/VideoRenderers/VideoRenderers.vcproj
index 63b62cc7d..297ae9266 100644
--- a/src/filters/renderer/VideoRenderers/VideoRenderers.vcproj
+++ b/src/filters/renderer/VideoRenderers/VideoRenderers.vcproj
@@ -60,7 +60,6 @@
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
- AdditionalIncludeDirectories=""
/>
<Tool
Name="VCPreLinkEventTool"
@@ -68,7 +67,6 @@
<Tool
Name="VCLibrarianTool"
AdditionalOptions="/IGNORE:4221"
- AdditionalLibraryDirectories=""
/>
<Tool
Name="VCALinkTool"
@@ -99,7 +97,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
@@ -112,10 +109,6 @@
/>
<Tool
Name="VCMIDLTool"
- PreprocessorDefinitions="NDEBUG"
- MkTypLibCompatible="true"
- TargetEnvironment="3"
- TypeLibraryName=".\Release_unicode/mplayerc.tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -130,7 +123,6 @@
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
- AdditionalIncludeDirectories=""
/>
<Tool
Name="VCPreLinkEventTool"
@@ -138,7 +130,6 @@
<Tool
Name="VCLibrarianTool"
AdditionalOptions="/IGNORE:4221"
- AdditionalLibraryDirectories=""
/>
<Tool
Name="VCALinkTool"
@@ -154,8 +145,6 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine=""
- ExcludedFromBuild="false"
/>
</Configuration>
<Configuration
@@ -169,7 +158,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
@@ -182,16 +170,11 @@
/>
<Tool
Name="VCMIDLTool"
- PreprocessorDefinitions="_DEBUG"
- MkTypLibCompatible="true"
- TargetEnvironment="1"
- TypeLibraryName="$(OutDir)\$(ProjectName).tlb"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\..\include;..\..\..\..\include\dx;..\..\..\..\include\atl;..\..\BaseClasses;..\..\..\zlib;..\..\..\thirdparty\lcms2\include;&quot;$(DXSDK_DIR)Include&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;DETOURS_X32;NO_VERSION_REV_NEEDED"
- ShowIncludes="false"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -206,7 +189,6 @@
/>
<Tool
Name="VCLibrarianTool"
- AdditionalLibraryDirectories=""
/>
<Tool
Name="VCALinkTool"
@@ -234,7 +216,6 @@
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
@@ -247,10 +228,6 @@
/>
<Tool
Name="VCMIDLTool"
- PreprocessorDefinitions="_DEBUG"
- MkTypLibCompatible="true"
- TargetEnvironment="3"
- TypeLibraryName="$(OutDir)\$(ProjectName).tlb"
/>
<Tool
Name="VCCLCompilerTool"
@@ -271,7 +248,6 @@
/>
<Tool
Name="VCLibrarianTool"
- AdditionalLibraryDirectories=""
/>
<Tool
Name="VCALinkTool"
@@ -346,6 +322,14 @@
>
</File>
<File
+ RelativePath=".\OuterEVR.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\OuterVMR.cpp"
+ >
+ </File>
+ <File
RelativePath=".\PixelShaderCompiler.cpp"
>
</File>
@@ -471,6 +455,14 @@
>
</File>
<File
+ RelativePath=".\OuterEVR.h"
+ >
+ </File>
+ <File
+ RelativePath=".\OuterVMR.h"
+ >
+ </File>
+ <File
RelativePath=".\PixelShaderCompiler.h"
>
</File>
diff --git a/src/filters/renderer/VideoRenderers/VideoRenderers.vcxproj b/src/filters/renderer/VideoRenderers/VideoRenderers.vcxproj
index 3967123e4..5d45b3cec 100644
--- a/src/filters/renderer/VideoRenderers/VideoRenderers.vcxproj
+++ b/src/filters/renderer/VideoRenderers/VideoRenderers.vcxproj
@@ -28,25 +28,21 @@
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>Static</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>Static</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>Static</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>Static</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -78,12 +74,6 @@
<Command>
</Command>
</PreBuildEvent>
- <Midl>
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MkTypLibCompatible>true</MkTypLibCompatible>
- <TargetEnvironment>Win32</TargetEnvironment>
- <TypeLibraryName>.\Release_unicode/mplayerc.tlb</TypeLibraryName>
- </Midl>
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\include\dx;..\..\..\..\include\atl;..\..\BaseClasses;..\..\..\zlib;..\..\..\thirdparty\lcms2\include;$(DXSDK_DIR)Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;DETOURS_X32;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -91,28 +81,13 @@
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Lib>
<AdditionalOptions>/IGNORE:4221 %(AdditionalOptions)</AdditionalOptions>
<TargetMachine>MachineX86</TargetMachine>
</Lib>
- <PostBuildEvent>
- <Command>
- </Command>
- </PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <PreBuildEvent>
- <Command>
- </Command>
- </PreBuildEvent>
- <Midl>
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MkTypLibCompatible>true</MkTypLibCompatible>
- <TargetEnvironment>X64</TargetEnvironment>
- <TypeLibraryName>.\Release_unicode/mplayerc.tlb</TypeLibraryName>
- </Midl>
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\include\dx;..\..\..\..\include\atl;..\..\BaseClasses;..\..\..\zlib;..\..\..\thirdparty\lcms2\include;$(DXSDK_DIR)Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WIN64;NDEBUG;_WINDOWS;DETOURS_X64;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -121,28 +96,13 @@
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Lib>
<AdditionalOptions>/IGNORE:4221 %(AdditionalOptions)</AdditionalOptions>
<TargetMachine>MachineX64</TargetMachine>
</Lib>
- <PostBuildEvent>
- <Command>
- </Command>
- </PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <PreBuildEvent>
- <Command>
- </Command>
- </PreBuildEvent>
- <Midl>
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MkTypLibCompatible>true</MkTypLibCompatible>
- <TargetEnvironment>Win32</TargetEnvironment>
- <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>
- </Midl>
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\include\dx;..\..\..\..\include\atl;..\..\BaseClasses;..\..\..\zlib;..\..\..\thirdparty\lcms2\include;$(DXSDK_DIR)Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;DETOURS_X32;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -157,16 +117,6 @@
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <PreBuildEvent>
- <Command>
- </Command>
- </PreBuildEvent>
- <Midl>
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MkTypLibCompatible>true</MkTypLibCompatible>
- <TargetEnvironment>X64</TargetEnvironment>
- <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>
- </Midl>
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\include\dx;..\..\..\..\include\atl;..\..\BaseClasses;..\..\..\zlib;..\..\..\thirdparty\lcms2\include;$(DXSDK_DIR)Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WIN64;_DEBUG;_WINDOWS;DETOURS_X64;NO_VERSION_REV_NEEDED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -193,6 +143,8 @@
<ClCompile Include="IPinHook.cpp" />
<ClCompile Include="MacrovisionKicker.cpp" />
<ClCompile Include="madVRAllocatorPresenter.cpp" />
+ <ClCompile Include="OuterEVR.cpp" />
+ <ClCompile Include="OuterVMR.cpp" />
<ClCompile Include="PixelShaderCompiler.cpp" />
<ClCompile Include="QT7AllocatorPresenter.cpp" />
<ClCompile Include="QT9AllocatorPresenter.cpp" />
@@ -222,6 +174,8 @@
<ClInclude Include="IPinHook.h" />
<ClInclude Include="MacrovisionKicker.h" />
<ClInclude Include="madVRAllocatorPresenter.h" />
+ <ClInclude Include="OuterEVR.h" />
+ <ClInclude Include="OuterVMR.h" />
<ClInclude Include="PixelShaderCompiler.h" />
<ClInclude Include="QT7AllocatorPresenter.h" />
<ClInclude Include="QT9AllocatorPresenter.h" />
diff --git a/src/filters/renderer/VideoRenderers/VideoRenderers.vcxproj.filters b/src/filters/renderer/VideoRenderers/VideoRenderers.vcxproj.filters
index ea67d07c5..230acf4fb 100644
--- a/src/filters/renderer/VideoRenderers/VideoRenderers.vcxproj.filters
+++ b/src/filters/renderer/VideoRenderers/VideoRenderers.vcxproj.filters
@@ -77,6 +77,12 @@
<ClCompile Include="DX9RenderingEngine.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="OuterEVR.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="OuterVMR.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="AllocatorCommon.h">
@@ -148,5 +154,11 @@
<ClInclude Include="DX9RenderingEngine.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="OuterEVR.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="OuterVMR.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
</Project> \ No newline at end of file
diff --git a/src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.cpp
index dd49f718a..a9d8f9313 100644
--- a/src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.cpp
@@ -1,7 +1,7 @@
/*
* $Id$
*
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -30,20 +30,21 @@
using namespace DSObjects;
-interface __declspec(uuid("51FA8F61-1444-4597-996E-7495405753E6"))
-IMadVRFullscreen :
+interface __declspec(uuid("D6EE8031-214E-4E9E-A3A7-458925F933AB"))
+IMadVRExclusiveModeInfo :
public IUnknown {
- STDMETHOD(ActivateFullscreenMode)(void) = 0;
+ STDMETHOD_(BOOL, IsExclusiveModeActive)(void) = 0;
+ STDMETHOD_(BOOL, IsMadVRSeekbarEnabled)(void) = 0;
};
+
//
// CmadVRAllocatorPresenter
//
-CmadVRAllocatorPresenter::CmadVRAllocatorPresenter(HWND hWnd, bool bFullscreen, HRESULT& hr, CString &_Error)
+CmadVRAllocatorPresenter::CmadVRAllocatorPresenter(HWND hWnd, HRESULT& hr, CString &_Error)
: CSubPicAllocatorPresenterImpl(hWnd, hr, &_Error)
, m_ScreenSize(0, 0)
- , m_bIsFullscreen(bFullscreen)
{
if(FAILED(hr)) {
_Error += L"ISubPicAllocatorPresenterImpl failed\n";
@@ -57,7 +58,7 @@ CmadVRAllocatorPresenter::~CmadVRAllocatorPresenter()
{
if(m_pSRCB) {
// nasty, but we have to let it know about our death somehow
- ((CSubRenderCallback*)(ISubRenderCallback*)m_pSRCB)->SetDXRAP(NULL);
+ ((CSubRenderCallback*)(ISubRenderCallback2*)m_pSRCB)->SetDXRAP(NULL);
}
// the order is important here
@@ -92,7 +93,13 @@ STDMETHODIMP CmadVRAllocatorPresenter::NonDelegatingQueryInterface(REFIID riid,
HRESULT CmadVRAllocatorPresenter::SetDevice(IDirect3DDevice9* pD3DDev)
{
- CheckPointer(pD3DDev, E_POINTER);
+ if (!pD3DDev)
+ {
+ // release all resources
+ m_pSubPicQueue = NULL;
+ m_pAllocator = NULL;
+ return S_OK;
+ }
CSize size;
switch(GetRenderersSettings().nSPCMaxRes) {
@@ -132,7 +139,7 @@ HRESULT CmadVRAllocatorPresenter::SetDevice(IDirect3DDevice9* pD3DDev)
if(m_pAllocator) {
m_pAllocator->ChangeDevice(pD3DDev);
} else {
- m_pAllocator = DNew CDX9SubPicAllocator(pD3DDev, size, GetRenderersSettings().fSPCPow2Tex);
+ m_pAllocator = DNew CDX9SubPicAllocator(pD3DDev, size, GetRenderersSettings().fSPCPow2Tex, true);
if(!m_pAllocator) {
return E_FAIL;
}
@@ -181,13 +188,6 @@ STDMETHODIMP CmadVRAllocatorPresenter::CreateRenderer(IUnknown** ppRenderer)
return E_FAIL;
}
- if (m_bIsFullscreen) {
- CComQIPtr<IMadVRFullscreen> pVRF = m_pDXR;
- if (pVRF != NULL) {
- pVRF->ActivateFullscreenMode();
- }
- }
-
CComQIPtr<ISubRender> pSR = m_pDXR;
if(!pSR) {
m_pDXR = NULL;
diff --git a/src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.h b/src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.h
index 8b9542f96..eb7fe682a 100644
--- a/src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.h
+++ b/src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.h
@@ -26,12 +26,19 @@
#include "../../../SubPic/SubPicAllocatorPresenterImpl.h"
#include "../../../SubPic/ISubRender.h"
+interface __declspec(uuid("ABA34FDA-DD22-4E00-9AB4-4ABF927D0B0C"))
+IMadVRTextOsd :
+public IUnknown {
+ STDMETHOD(OsdDisplayMessage)(LPCWSTR text, DWORD milliseconds) = 0;
+ STDMETHOD(OsdClearMessage)(void) = 0;
+};
+
namespace DSObjects
{
class CmadVRAllocatorPresenter
: public CSubPicAllocatorPresenterImpl
{
- class CSubRenderCallback : public CUnknown, public ISubRenderCallback, public CCritSec
+ class CSubRenderCallback : public CUnknown, public ISubRenderCallback2, public CCritSec
{
CmadVRAllocatorPresenter* m_pDXRAP;
@@ -45,6 +52,7 @@ namespace DSObjects
STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv) {
return
QI(ISubRenderCallback)
+ QI(ISubRenderCallback2)
__super::NonDelegatingQueryInterface(riid, ppv);
}
@@ -74,12 +82,12 @@ namespace DSObjects
};
CComPtr<IUnknown> m_pDXR;
- CComPtr<ISubRenderCallback> m_pSRCB;
+ CComPtr<ISubRenderCallback2> m_pSRCB;
CSize m_ScreenSize;
bool m_bIsFullscreen;
public:
- CmadVRAllocatorPresenter(HWND hWnd, bool bFullscreen, HRESULT& hr, CString &_Error);
+ CmadVRAllocatorPresenter(HWND hWnd, HRESULT& hr, CString &_Error);
virtual ~CmadVRAllocatorPresenter();
DECLARE_IUNKNOWN