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:
authorpovaddict <povaddict@users.sourceforge.net>2010-02-10 02:16:44 +0300
committerpovaddict <povaddict@users.sourceforge.net>2010-02-10 02:16:44 +0300
commit726a91b12a7524e45e7a901c9e4883af5b1bffe6 (patch)
treef5d25e3b2e84c92f4901280c73d5d3d7e6c3cd19 /src/filters/transform/BufferFilter
parent02183f6e47ad4ea1057de9950482f291f2ae4290 (diff)
Rename several directories to use MixedCase instead of lowercase.
They now mostly match the case used in #includes, and they're consistent with the names of the .h files they contain. git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1648 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/transform/BufferFilter')
-rw-r--r--src/filters/transform/BufferFilter/BufferFilter.cpp352
-rw-r--r--src/filters/transform/BufferFilter/BufferFilter.def7
-rw-r--r--src/filters/transform/BufferFilter/BufferFilter.h101
-rw-r--r--src/filters/transform/BufferFilter/bufferfilter.vcproj664
-rw-r--r--src/filters/transform/BufferFilter/stdafx.cpp29
-rw-r--r--src/filters/transform/BufferFilter/stdafx.h43
6 files changed, 1196 insertions, 0 deletions
diff --git a/src/filters/transform/BufferFilter/BufferFilter.cpp b/src/filters/transform/BufferFilter/BufferFilter.cpp
new file mode 100644
index 000000000..0e8ba715f
--- /dev/null
+++ b/src/filters/transform/BufferFilter/BufferFilter.cpp
@@ -0,0 +1,352 @@
+/*
+ * Copyright (C) 2003-2006 Gabest
+ * http://www.gabest.org
+ *
+ * This Program 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 2, or (at your option)
+ * any later version.
+ *
+ * This Program 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 GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#include "stdafx.h"
+#include "bufferfilter.h"
+#include "../../../DSUtil/DSUtil.h"
+
+#ifdef REGISTER_FILTER
+
+const AMOVIESETUP_MEDIATYPE sudPinTypesIn[] =
+{
+ {&MEDIATYPE_NULL, &MEDIASUBTYPE_NULL},
+};
+
+const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] =
+{
+ {&MEDIATYPE_NULL, &MEDIASUBTYPE_NULL},
+};
+
+const AMOVIESETUP_PIN sudpPins[] =
+{
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, countof(sudPinTypesIn), sudPinTypesIn},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, countof(sudPinTypesOut), sudPinTypesOut}
+};
+
+const AMOVIESETUP_FILTER sudFilter[] =
+{
+ {&__uuidof(CBufferFilter), L"MPC - Buffer Filter", MERIT_DO_NOT_USE, countof(sudpPins), sudpPins, CLSID_LegacyAmFilterCategory}
+};
+
+CFactoryTemplate g_Templates[] =
+{
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CBufferFilter>, NULL, &sudFilter[0]}
+};
+
+int g_cTemplates = countof(g_Templates);
+
+STDAPI DllRegisterServer()
+{
+ return AMovieDllRegisterServer2(TRUE);
+}
+
+STDAPI DllUnregisterServer()
+{
+ return AMovieDllRegisterServer2(FALSE);
+}
+
+#include "../../FilterApp.h"
+
+CFilterApp theApp;
+
+#endif
+
+//
+// CBufferFilter
+//
+
+CBufferFilter::CBufferFilter(LPUNKNOWN lpunk, HRESULT* phr)
+ : CTransformFilter(NAME("CBufferFilter"), lpunk, __uuidof(this))
+ , m_nSamplesToBuffer(2)
+{
+ HRESULT hr = S_OK;
+
+ do
+ {
+ if(!(m_pInput = DNew CTransformInputPin(NAME("Transform input pin"), this, &hr, L"In"))) hr = E_OUTOFMEMORY;
+ if(FAILED(hr)) break;
+
+ if(!(m_pOutput = DNew CBufferFilterOutputPin(this, &hr))) hr = E_OUTOFMEMORY;
+ if(FAILED(hr)) {delete m_pInput, m_pInput = NULL; break;}
+ }
+ while(false);
+
+ if(phr) *phr = hr;
+}
+
+CBufferFilter::~CBufferFilter()
+{
+}
+
+STDMETHODIMP CBufferFilter::NonDelegatingQueryInterface(REFIID riid, void** ppv)
+{
+ return
+ QI(IBufferFilter)
+ __super::NonDelegatingQueryInterface(riid, ppv);
+}
+
+// IBufferFilter
+
+STDMETHODIMP CBufferFilter::SetBuffers(int nBuffers)
+{
+ if(!m_pOutput)
+ return E_FAIL;
+
+ if(m_pOutput->IsConnected()) // TODO: allow "on-the-fly" changes
+ return VFW_E_ALREADY_CONNECTED;
+
+ m_nSamplesToBuffer = nBuffers;
+
+ return S_OK;
+}
+
+STDMETHODIMP_(int) CBufferFilter::GetBuffers()
+{
+ return(m_nSamplesToBuffer);
+}
+
+STDMETHODIMP_(int) CBufferFilter::GetFreeBuffers()
+{
+ CBufferFilterOutputPin* pPin = (CBufferFilterOutputPin*)m_pOutput;
+ return(pPin && pPin->m_pOutputQueue ? (m_nSamplesToBuffer - pPin->m_pOutputQueue->GetQueueCount()) : 0);
+}
+
+STDMETHODIMP CBufferFilter::SetPriority(DWORD dwPriority)
+{
+ CBufferFilterOutputPin* pPin = (CBufferFilterOutputPin*)m_pOutput;
+ return(pPin && pPin->m_pOutputQueue ? (pPin->m_pOutputQueue->SetPriority(dwPriority) ? S_OK : E_FAIL) : E_UNEXPECTED);
+}
+
+//
+
+HRESULT CBufferFilter::Receive(IMediaSample* pSample)
+{
+ /* Check for other streams and pass them on */
+ AM_SAMPLE2_PROPERTIES* const pProps = m_pInput->SampleProps();
+ if(pProps->dwStreamId != AM_STREAM_MEDIA)
+ return m_pOutput->Deliver(pSample);
+
+ HRESULT hr;
+ ASSERT(pSample);
+ IMediaSample* pOutSample;
+
+ ASSERT(m_pOutput != NULL);
+
+ // Set up the output sample
+ hr = InitializeOutputSample(pSample, &pOutSample);
+
+ if(FAILED(hr))
+ return hr;
+
+ // Start timing the transform (if PERF is defined)
+ MSR_START(m_idTransform);
+
+ // have the derived class transform the data
+
+ hr = Transform(pSample, pOutSample);
+
+ // Stop the clock and log it (if PERF is defined)
+ MSR_STOP(m_idTransform);
+
+ if(FAILED(hr)) {
+ DbgLog((LOG_TRACE,1,TEXT("Error from transform")));
+ }
+ else {
+ // the Transform() function can return S_FALSE to indicate that the
+ // sample should not be delivered; we only deliver the sample if it's
+ // really S_OK (same as NOERROR, of course.)
+ if(hr == NOERROR) {
+ hr = m_pOutput->Deliver(pOutSample);
+ m_bSampleSkipped = FALSE; // last thing no longer dropped
+ }
+ else {
+ // S_FALSE returned from Transform is a PRIVATE agreement
+ // We should return NOERROR from Receive() in this cause because returning S_FALSE
+ // from Receive() means that this is the end of the stream and no more data should
+ // be sent.
+ if(S_FALSE == hr) {
+
+ // Release the sample before calling notify to avoid
+ // deadlocks if the sample holds a lock on the system
+ // such as DirectDraw buffers do
+ pOutSample->Release();
+ m_bSampleSkipped = TRUE;
+ if(!m_bQualityChanged) {
+ NotifyEvent(EC_QUALITY_CHANGE,0,0);
+ m_bQualityChanged = TRUE;
+ }
+ return NOERROR;
+ }
+ }
+ }
+
+ // release the output buffer. If the connected pin still needs it,
+ // it will have addrefed it itself.
+ pOutSample->Release();
+
+ return hr;
+}
+
+HRESULT CBufferFilter::Transform(IMediaSample* pIn, IMediaSample* pOut)
+{
+ BYTE* pDataIn = NULL;
+ BYTE* pDataOut = NULL;
+
+ pIn->GetPointer(&pDataIn);
+ pOut->GetPointer(&pDataOut);
+
+ long len = pIn->GetActualDataLength();
+ long size = pOut->GetSize();
+
+ if(!pDataIn || !pDataOut || len > size || len <= 0) return S_FALSE;
+
+ memcpy(pDataOut, pDataIn, min(len, size));
+
+ pOut->SetActualDataLength(min(len, size));
+
+ return S_OK;
+}
+
+HRESULT CBufferFilter::CheckInputType(const CMediaType* mtIn)
+{
+ return S_OK;
+}
+
+HRESULT CBufferFilter::CheckTransform(const CMediaType* mtIn, const CMediaType* mtOut)
+{
+ return mtIn->MatchesPartial(mtOut) ? S_OK : VFW_E_TYPE_NOT_ACCEPTED;
+}
+
+HRESULT CBufferFilter::DecideBufferSize(IMemAllocator* pAllocator, ALLOCATOR_PROPERTIES* pProperties)
+{
+ if(m_pInput->IsConnected() == FALSE) return E_UNEXPECTED;
+
+ CComPtr<IMemAllocator> pAllocatorIn;
+ m_pInput->GetAllocator(&pAllocatorIn);
+ if(!pAllocatorIn) return E_UNEXPECTED;
+
+ pAllocatorIn->GetProperties(pProperties);
+
+ pProperties->cBuffers = max(m_nSamplesToBuffer, pProperties->cBuffers);
+
+ HRESULT hr;
+ ALLOCATOR_PROPERTIES Actual;
+ if(FAILED(hr = pAllocator->SetProperties(pProperties, &Actual)))
+ return hr;
+
+ return(pProperties->cBuffers > Actual.cBuffers || pProperties->cbBuffer > Actual.cbBuffer
+ ? E_FAIL
+ : NOERROR);
+}
+
+HRESULT CBufferFilter::GetMediaType(int iPosition, CMediaType* pMediaType)
+{
+ if(m_pInput->IsConnected() == FALSE) return E_UNEXPECTED;
+
+ // TODO: offer all input types from upstream and allow reconnection at least in stopped state
+ if(iPosition < 0) return E_INVALIDARG;
+ if(iPosition > 0) return VFW_S_NO_MORE_ITEMS;
+
+ CopyMediaType(pMediaType, &m_pInput->CurrentMediaType());
+
+ return S_OK;
+}
+
+HRESULT CBufferFilter::StopStreaming()
+{
+ CBufferFilterOutputPin* pPin = (CBufferFilterOutputPin*)m_pOutput;
+ if(m_pInput && pPin && pPin->m_pOutputQueue)
+ {
+ while(!m_pInput->IsFlushing() && pPin->m_pOutputQueue->GetQueueCount() > 0)
+ Sleep(50);
+ }
+
+ return __super::StopStreaming();
+}
+
+//
+// CBufferFilterOutputPin
+//
+
+CBufferFilterOutputPin::CBufferFilterOutputPin(CTransformFilter* pFilter, HRESULT* phr)
+ : CTransformOutputPin(NAME("CBufferFilterOutputPin"), pFilter, phr, L"Out")
+{
+}
+
+HRESULT CBufferFilterOutputPin::Active()
+{
+ CAutoLock lock_it(m_pLock);
+
+ if(m_Connected && !m_pOutputQueue)
+ {
+ HRESULT hr = NOERROR;
+
+ m_pOutputQueue.Attach(DNew CBufferFilterOutputQueue(m_Connected, &hr));
+ if(!m_pOutputQueue) hr = E_OUTOFMEMORY;
+
+ if(FAILED(hr))
+ {
+ m_pOutputQueue.Free();
+ return hr;
+ }
+ }
+
+ return __super::Active();
+}
+
+HRESULT CBufferFilterOutputPin::Inactive()
+{
+ CAutoLock lock_it(m_pLock);
+ m_pOutputQueue.Free();
+ return __super::Inactive();
+}
+
+HRESULT CBufferFilterOutputPin::Deliver(IMediaSample* pMediaSample)
+{
+ if(!m_pOutputQueue) return NOERROR;
+ pMediaSample->AddRef();
+ return m_pOutputQueue->Receive(pMediaSample);
+}
+
+#define CallQueue(call) \
+ if(!m_pOutputQueue) return NOERROR; \
+ m_pOutputQueue->##call; \
+ return NOERROR; \
+
+HRESULT CBufferFilterOutputPin::DeliverEndOfStream()
+{
+ CallQueue(EOS());
+}
+
+HRESULT CBufferFilterOutputPin::DeliverBeginFlush()
+{
+ CallQueue(BeginFlush());
+}
+
+HRESULT CBufferFilterOutputPin::DeliverEndFlush()
+{
+ CallQueue(EndFlush());
+}
+
+HRESULT CBufferFilterOutputPin::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
+{
+ CallQueue(NewSegment(tStart, tStop, dRate));
+}
diff --git a/src/filters/transform/BufferFilter/BufferFilter.def b/src/filters/transform/BufferFilter/BufferFilter.def
new file mode 100644
index 000000000..90ebb5445
--- /dev/null
+++ b/src/filters/transform/BufferFilter/BufferFilter.def
@@ -0,0 +1,7 @@
+LIBRARY "BufferFilter.ax"
+
+EXPORTS
+ DllCanUnloadNow PRIVATE
+ DllGetClassObject PRIVATE
+ DllRegisterServer PRIVATE
+ DllUnregisterServer PRIVATE
diff --git a/src/filters/transform/BufferFilter/BufferFilter.h b/src/filters/transform/BufferFilter/BufferFilter.h
new file mode 100644
index 000000000..a65d7a16c
--- /dev/null
+++ b/src/filters/transform/BufferFilter/BufferFilter.h
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2003-2006 Gabest
+ * http://www.gabest.org
+ *
+ * This Program 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 2, or (at your option)
+ * any later version.
+ *
+ * This Program 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 GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#pragma once
+
+#include <atlbase.h>
+
+[uuid("63EF0035-3FFE-4c41-9230-4346E028BE20")]
+interface IBufferFilter : public IUnknown
+{
+ STDMETHOD(SetBuffers) (int nBuffers) = 0;
+ STDMETHOD_(int, GetBuffers) () = 0;
+ STDMETHOD_(int, GetFreeBuffers) () = 0;
+ STDMETHOD(SetPriority) (DWORD dwPriority = THREAD_PRIORITY_NORMAL) = 0;
+};
+
+[uuid("DA2B3D77-2F29-4fd2-AC99-DEE4A8A13BF0")]
+class CBufferFilter : public CTransformFilter, public IBufferFilter
+{
+ int m_nSamplesToBuffer;
+
+public:
+ CBufferFilter(LPUNKNOWN lpunk, HRESULT* phr);
+ virtual ~CBufferFilter();
+
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);
+
+ // IBufferFilter
+ STDMETHODIMP SetBuffers(int nBuffers);
+ STDMETHODIMP_(int) GetBuffers();
+ STDMETHODIMP_(int) GetFreeBuffers();
+ STDMETHODIMP SetPriority(DWORD dwPriority = THREAD_PRIORITY_NORMAL);
+
+ HRESULT Receive(IMediaSample* pSample);
+ HRESULT Transform(IMediaSample* pIn, IMediaSample* pOut);
+ HRESULT CheckInputType(const CMediaType* mtIn);
+ HRESULT CheckTransform(const CMediaType* mtIn, const CMediaType* mtOut);
+ HRESULT DecideBufferSize(IMemAllocator* pAllocator, ALLOCATOR_PROPERTIES* pProperties);
+ HRESULT GetMediaType(int iPosition, CMediaType* pMediaType);
+ HRESULT StopStreaming();
+};
+
+class CBufferFilterOutputPin : public CTransformOutputPin
+{
+ class CBufferFilterOutputQueue : public COutputQueue
+ {
+ public:
+ CBufferFilterOutputQueue(IPin* pInputPin, HRESULT* phr,
+ DWORD dwPriority = THREAD_PRIORITY_NORMAL,
+ BOOL bAuto = FALSE, BOOL bQueue = TRUE,
+ LONG lBatchSize = 1, BOOL bBatchExact = FALSE,
+ LONG lListSize = DEFAULTCACHE,
+ bool bFlushingOpt = false)
+ : COutputQueue(pInputPin, phr, bAuto, bQueue, lBatchSize, bBatchExact, lListSize, dwPriority, bFlushingOpt)
+ {
+ }
+
+ int GetQueueCount()
+ {
+ return m_List ? m_List->GetCount() : -1;
+ }
+
+ bool SetPriority(DWORD dwPriority)
+ {
+ return m_hThread ? !!::SetThreadPriority(m_hThread, dwPriority) : false;
+ }
+ };
+
+public:
+ CBufferFilterOutputPin(CTransformFilter* pFilter, HRESULT* phr);
+
+ CAutoPtr<CBufferFilterOutputQueue> m_pOutputQueue;
+
+ HRESULT Active();
+ HRESULT Inactive();
+
+ HRESULT Deliver(IMediaSample* pMediaSample);
+ HRESULT DeliverEndOfStream();
+ HRESULT DeliverBeginFlush();
+ HRESULT DeliverEndFlush();
+ HRESULT DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
+};
diff --git a/src/filters/transform/BufferFilter/bufferfilter.vcproj b/src/filters/transform/BufferFilter/bufferfilter.vcproj
new file mode 100644
index 000000000..56fc7168a
--- /dev/null
+++ b/src/filters/transform/BufferFilter/bufferfilter.vcproj
@@ -0,0 +1,664 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="bufferfilter"
+ ProjectGUID="{9DCFD02A-16A0-4766-BC18-66163E21929D}"
+ RootNamespace="bufferfilter"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug Unicode|Win32"
+ ConfigurationType="2"
+ InheritedPropertySheets="..\..\..\common.vsprops;..\..\..\debug.vsprops"
+ UseOfMFC="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\..\..\include;..\..\BaseClasses"
+ PreprocessorDefinitions="REGISTER_FILTER;WIN32;_DEBUG;_USRDLL"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ RegisterOutput="true"
+ AdditionalDependencies="strmbaseDU.lib Winmm.lib"
+ OutputFile="$(OutDir)\$(ProjectName).ax"
+ AdditionalLibraryDirectories="..\..\..\..\lib"
+ ModuleDefinitionFile="BufferFilter.def"
+ SubSystem="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug Unicode|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="..\..\..\common.vsprops;..\..\..\debug.vsprops"
+ UseOfMFC="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\..\..\include;..\..\BaseClasses"
+ PreprocessorDefinitions="REGISTER_FILTER;WIN32;_DEBUG;_USRDLL"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="strmbaseDU.lib Winmm.lib"
+ OutputFile="$(OutDir)\$(ProjectName).ax"
+ AdditionalLibraryDirectories="..\..\..\..\lib64"
+ ModuleDefinitionFile="BufferFilter.def"
+ SubSystem="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release Unicode|Win32"
+ ConfigurationType="2"
+ InheritedPropertySheets="..\..\..\common.vsprops;..\..\..\release.vsprops"
+ UseOfMFC="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\..\..\include;..\..\BaseClasses"
+ PreprocessorDefinitions="REGISTER_FILTER;WIN32;NDEBUG;_USRDLL"
+ BufferSecurityCheck="true"
+ EnableEnhancedInstructionSet="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ RegisterOutput="true"
+ AdditionalDependencies="strmbaseRU.lib Winmm.lib"
+ OutputFile="..\..\..\..\bin\x86\$(ProjectName).ax"
+ AdditionalLibraryDirectories="..\..\..\..\lib"
+ ModuleDefinitionFile="BufferFilter.def"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ LargeAddressAware="2"
+ RandomizedBaseAddress="2"
+ DataExecutionPrevention="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release Unicode|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="..\..\..\common.vsprops;..\..\..\release.vsprops"
+ UseOfMFC="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\..\..\include;..\..\BaseClasses"
+ PreprocessorDefinitions="REGISTER_FILTER;WIN32;NDEBUG;_USRDLL"
+ BufferSecurityCheck="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="strmbaseRU.lib Winmm.lib"
+ OutputFile="..\..\..\..\bin\x64\$(ProjectName).ax"
+ AdditionalLibraryDirectories="..\..\..\..\lib64"
+ ModuleDefinitionFile="BufferFilter.def"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ LargeAddressAware="2"
+ RandomizedBaseAddress="2"
+ DataExecutionPrevention="2"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug Unicode lib|Win32"
+ ConfigurationType="4"
+ InheritedPropertySheets="..\..\..\common.vsprops;..\..\..\debug.vsprops"
+ UseOfMFC="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/MP"
+ AdditionalIncludeDirectories="..\..\..\..\include;..\..\BaseClasses"
+ PreprocessorDefinitions="WIN32;_DEBUG"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\lib\$(ProjectName)DU.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug Unicode lib|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="4"
+ InheritedPropertySheets="..\..\..\common.vsprops;..\..\..\debug.vsprops"
+ UseOfMFC="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/MP"
+ AdditionalIncludeDirectories="..\..\..\..\include;..\..\BaseClasses"
+ PreprocessorDefinitions="_WIN64;_DEBUG"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\lib64\$(ProjectName)DU.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release Unicode lib|Win32"
+ ConfigurationType="4"
+ InheritedPropertySheets="..\..\..\common.vsprops;..\..\..\release.vsprops"
+ UseOfMFC="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/MP"
+ AdditionalIncludeDirectories="..\..\..\..\include;..\..\BaseClasses"
+ PreprocessorDefinitions="WIN32;NDEBUG"
+ BufferSecurityCheck="true"
+ EnableEnhancedInstructionSet="1"
+ DisableSpecificWarnings="4244"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\lib\$(ProjectName)RU.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release Unicode lib|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="4"
+ InheritedPropertySheets="..\..\..\common.vsprops;..\..\..\release.vsprops"
+ UseOfMFC="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/MP"
+ AdditionalIncludeDirectories="..\..\..\..\include;..\..\BaseClasses"
+ PreprocessorDefinitions="_WIN64;NDEBUG"
+ BufferSecurityCheck="true"
+ EnableEnhancedInstructionSet="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\lib64\$(ProjectName)RU.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+ >
+ <File
+ RelativePath="BufferFilter.cpp"
+ >
+ </File>
+ <File
+ RelativePath="BufferFilter.def"
+ >
+ </File>
+ <File
+ RelativePath="stdafx.cpp"
+ >
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode lib|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode lib|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode lib|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode lib|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc"
+ >
+ <File
+ RelativePath="BufferFilter.h"
+ >
+ </File>
+ <File
+ RelativePath="stdafx.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ <Global
+ Name="DevPartner_IsInstrumented"
+ Value="0"
+ />
+ </Globals>
+</VisualStudioProject>
diff --git a/src/filters/transform/BufferFilter/stdafx.cpp b/src/filters/transform/BufferFilter/stdafx.cpp
new file mode 100644
index 000000000..280418994
--- /dev/null
+++ b/src/filters/transform/BufferFilter/stdafx.cpp
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2003-2006 Gabest
+ * http://www.gabest.org
+ *
+ * This Program 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 2, or (at your option)
+ * any later version.
+ *
+ * This Program 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 GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+// stdafx.cpp : source file that includes just the standard includes
+// bufferfilter.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
diff --git a/src/filters/transform/BufferFilter/stdafx.h b/src/filters/transform/BufferFilter/stdafx.h
new file mode 100644
index 000000000..c35359c38
--- /dev/null
+++ b/src/filters/transform/BufferFilter/stdafx.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2003-2006 Gabest
+ * http://www.gabest.org
+ *
+ * This Program 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 2, or (at your option)
+ * any later version.
+ *
+ * This Program 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 GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+#include "../../../DSUtil/SharedInclude.h"
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
+
+#ifndef VC_EXTRALEAN
+#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
+#endif
+
+#include <afx.h>
+#include <afxwin.h> // MFC core and standard components
+
+// TODO: reference additional headers your program requires here
+
+#include <streams.h>
+#include <dvdmedia.h>