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:
authortetsuo55 <tetsuo55@users.sourceforge.net>2010-04-09 01:14:58 +0400
committertetsuo55 <tetsuo55@users.sourceforge.net>2010-04-09 01:14:58 +0400
commita9b7bf3fb3e1334d8defd05ca4cfae870b4912e5 (patch)
tree2dab453d94d5e003379a6cc895eceb84c80e23ec /src/filters/transform/BufferFilter
parentaafd49a91f7c2fa9c7103971c16fa6e1b29e8bfd (diff)
astyle formatting cleanup to make the sourcecode more accessible
switch used: astyle --style=ansi --min-conditional-indent=0 --pad=oper --unpad=paren http://astyle.sourceforge.net/ git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1783 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/transform/BufferFilter')
-rw-r--r--src/filters/transform/BufferFilter/BufferFilter.cpp342
-rw-r--r--src/filters/transform/BufferFilter/BufferFilter.h95
-rw-r--r--src/filters/transform/BufferFilter/stdafx.cpp8
-rw-r--r--src/filters/transform/BufferFilter/stdafx.h8
4 files changed, 232 insertions, 221 deletions
diff --git a/src/filters/transform/BufferFilter/BufferFilter.cpp b/src/filters/transform/BufferFilter/BufferFilter.cpp
index e728bcbc4..b892aabf8 100644
--- a/src/filters/transform/BufferFilter/BufferFilter.cpp
+++ b/src/filters/transform/BufferFilter/BufferFilter.cpp
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2003-2006 Gabest
* http://www.gabest.org
*
@@ -6,15 +6,15 @@
* 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.
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
* http://www.gnu.org/copyleft/gpl.html
*
*/
@@ -27,12 +27,12 @@
const AMOVIESETUP_MEDIATYPE sudPinTypesIn[] =
{
- {&MEDIATYPE_NULL, &MEDIASUBTYPE_NULL},
+ {&MEDIATYPE_NULL, &MEDIASUBTYPE_NULL},
};
const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] =
{
- {&MEDIATYPE_NULL, &MEDIASUBTYPE_NULL},
+ {&MEDIATYPE_NULL, &MEDIASUBTYPE_NULL},
};
const AMOVIESETUP_PIN sudpPins[] =
@@ -43,24 +43,24 @@ const AMOVIESETUP_PIN sudpPins[] =
const AMOVIESETUP_FILTER sudFilter[] =
{
- {&__uuidof(CBufferFilter), L"MPC - Buffer Filter", MERIT_DO_NOT_USE, countof(sudpPins), sudpPins, CLSID_LegacyAmFilterCategory}
+ {&__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]}
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CBufferFilter>, NULL, &sudFilter[0]}
};
int g_cTemplates = countof(g_Templates);
STDAPI DllRegisterServer()
{
- return AMovieDllRegisterServer2(TRUE);
+ return AMovieDllRegisterServer2(TRUE);
}
STDAPI DllUnregisterServer()
{
- return AMovieDllRegisterServer2(FALSE);
+ return AMovieDllRegisterServer2(FALSE);
}
#include "../../FilterApp.h"
@@ -73,23 +73,27 @@ CFilterApp theApp;
// CBufferFilter
//
-CBufferFilter::CBufferFilter(LPUNKNOWN lpunk, HRESULT* phr)
- : CTransformFilter(NAME("CBufferFilter"), lpunk, __uuidof(this))
- , m_nSamplesToBuffer(2)
+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;
+ 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()
@@ -98,188 +102,194 @@ CBufferFilter::~CBufferFilter()
STDMETHODIMP CBufferFilter::NonDelegatingQueryInterface(REFIID riid, void** ppv)
{
- return
- QI(IBufferFilter)
- __super::NonDelegatingQueryInterface(riid, ppv);
+ return
+ QI(IBufferFilter)
+ __super::NonDelegatingQueryInterface(riid, ppv);
}
// IBufferFilter
STDMETHODIMP CBufferFilter::SetBuffers(int nBuffers)
{
- if(!m_pOutput)
- return E_FAIL;
+ if(!m_pOutput)
+ return E_FAIL;
- if(m_pOutput->IsConnected()) // TODO: allow "on-the-fly" changes
- return VFW_E_ALREADY_CONNECTED;
+ if(m_pOutput->IsConnected()) // TODO: allow "on-the-fly" changes
+ return VFW_E_ALREADY_CONNECTED;
- m_nSamplesToBuffer = nBuffers;
+ m_nSamplesToBuffer = nBuffers;
- return S_OK;
+ return S_OK;
}
STDMETHODIMP_(int) CBufferFilter::GetBuffers()
{
- return(m_nSamplesToBuffer);
+ return(m_nSamplesToBuffer);
}
STDMETHODIMP_(int) CBufferFilter::GetFreeBuffers()
{
- CBufferFilterOutputPin* pPin = static_cast<CBufferFilterOutputPin*>(m_pOutput);
- return(pPin && pPin->m_pOutputQueue ? (m_nSamplesToBuffer - pPin->m_pOutputQueue->GetQueueCount()) : 0);
+ CBufferFilterOutputPin* pPin = static_cast<CBufferFilterOutputPin*>(m_pOutput);
+ return(pPin && pPin->m_pOutputQueue ? (m_nSamplesToBuffer - pPin->m_pOutputQueue->GetQueueCount()) : 0);
}
STDMETHODIMP CBufferFilter::SetPriority(DWORD dwPriority)
{
- CBufferFilterOutputPin* pPin = static_cast<CBufferFilterOutputPin*>(m_pOutput);
- return(pPin && pPin->m_pOutputQueue ? (pPin->m_pOutputQueue->SetPriority(dwPriority) ? S_OK : E_FAIL) : E_UNEXPECTED);
+ CBufferFilterOutputPin* pPin = static_cast<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;
+ /* 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;
+ BYTE* pDataIn = NULL;
+ BYTE* pDataOut = NULL;
+
+ pIn->GetPointer(&pDataIn);
+ pOut->GetPointer(&pDataOut);
- pIn->GetPointer(&pDataIn);
- pOut->GetPointer(&pDataOut);
+ long len = pIn->GetActualDataLength();
+ long size = pOut->GetSize();
- long len = pIn->GetActualDataLength();
- long size = pOut->GetSize();
+ if(!pDataIn || !pDataOut || len > size || len <= 0) return S_FALSE;
- if(!pDataIn || !pDataOut || len > size || len <= 0) return S_FALSE;
+ memcpy(pDataOut, pDataIn, min(len, size));
- memcpy(pDataOut, pDataIn, min(len, size));
-
- pOut->SetActualDataLength(min(len, size));
+ pOut->SetActualDataLength(min(len, size));
- return S_OK;
+ return S_OK;
}
HRESULT CBufferFilter::CheckInputType(const CMediaType* mtIn)
{
- return S_OK;
+ return S_OK;
}
HRESULT CBufferFilter::CheckTransform(const CMediaType* mtIn, const CMediaType* mtOut)
{
- return mtIn->MatchesPartial(mtOut) ? S_OK : VFW_E_TYPE_NOT_ACCEPTED;
+ 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;
+ if(m_pInput->IsConnected() == FALSE) return E_UNEXPECTED;
- CComPtr<IMemAllocator> pAllocatorIn;
- m_pInput->GetAllocator(&pAllocatorIn);
- if(!pAllocatorIn) return E_UNEXPECTED;
+ CComPtr<IMemAllocator> pAllocatorIn;
+ m_pInput->GetAllocator(&pAllocatorIn);
+ if(!pAllocatorIn) return E_UNEXPECTED;
- pAllocatorIn->GetProperties(pProperties);
+ pAllocatorIn->GetProperties(pProperties);
- pProperties->cBuffers = max(m_nSamplesToBuffer, pProperties->cBuffers);
+ pProperties->cBuffers = max(m_nSamplesToBuffer, pProperties->cBuffers);
- HRESULT hr;
- ALLOCATOR_PROPERTIES Actual;
- if(FAILED(hr = pAllocator->SetProperties(pProperties, &Actual)))
- return hr;
+ 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);
+ ? 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;
+ // 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());
+ CopyMediaType(pMediaType, &m_pInput->CurrentMediaType());
- return S_OK;
+ return S_OK;
}
HRESULT CBufferFilter::StopStreaming()
{
- CBufferFilterOutputPin* pPin = static_cast<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* pPin = static_cast<CBufferFilterOutputPin*>(m_pOutput);
+ if(m_pInput && pPin && pPin->m_pOutputQueue)
+ {
+ while(!m_pInput->IsFlushing() && pPin->m_pOutputQueue->GetQueueCount() > 0)
+ Sleep(50);
+ }
+
+ return __super::StopStreaming();
}
//
@@ -287,66 +297,66 @@ HRESULT CBufferFilter::StopStreaming()
//
CBufferFilterOutputPin::CBufferFilterOutputPin(CTransformFilter* pFilter, HRESULT* phr)
- : CTransformOutputPin(NAME("CBufferFilterOutputPin"), pFilter, phr, L"Out")
+ : CTransformOutputPin(NAME("CBufferFilterOutputPin"), pFilter, phr, L"Out")
{
}
HRESULT CBufferFilterOutputPin::Active()
{
- CAutoLock lock_it(m_pLock);
+ CAutoLock lock_it(m_pLock);
- if(m_Connected && !m_pOutputQueue)
- {
- HRESULT hr = NOERROR;
+ if(m_Connected && !m_pOutputQueue)
+ {
+ HRESULT hr = NOERROR;
- m_pOutputQueue.Attach(DNew CBufferFilterOutputQueue(m_Connected, &hr));
- if(!m_pOutputQueue) hr = E_OUTOFMEMORY;
+ m_pOutputQueue.Attach(DNew CBufferFilterOutputQueue(m_Connected, &hr));
+ if(!m_pOutputQueue) hr = E_OUTOFMEMORY;
- if(FAILED(hr))
- {
- m_pOutputQueue.Free();
- return hr;
- }
- }
+ if(FAILED(hr))
+ {
+ m_pOutputQueue.Free();
+ return hr;
+ }
+ }
- return __super::Active();
+ return __super::Active();
}
HRESULT CBufferFilterOutputPin::Inactive()
{
- CAutoLock lock_it(m_pLock);
- m_pOutputQueue.Free();
- return __super::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);
+ 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());
+ CallQueue(EOS());
}
HRESULT CBufferFilterOutputPin::DeliverBeginFlush()
{
- CallQueue(BeginFlush());
+ CallQueue(BeginFlush());
}
HRESULT CBufferFilterOutputPin::DeliverEndFlush()
{
- CallQueue(EndFlush());
+ CallQueue(EndFlush());
}
HRESULT CBufferFilterOutputPin::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
{
- CallQueue(NewSegment(tStart, tStop, dRate));
+ CallQueue(NewSegment(tStart, tStop, dRate));
}
diff --git a/src/filters/transform/BufferFilter/BufferFilter.h b/src/filters/transform/BufferFilter/BufferFilter.h
index a65d7a16c..14c7fb587 100644
--- a/src/filters/transform/BufferFilter/BufferFilter.h
+++ b/src/filters/transform/BufferFilter/BufferFilter.h
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2003-2006 Gabest
* http://www.gabest.org
*
@@ -6,15 +6,15 @@
* 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.
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
* http://www.gnu.org/copyleft/gpl.html
*
*/
@@ -24,78 +24,79 @@
#include <atlbase.h>
[uuid("63EF0035-3FFE-4c41-9230-4346E028BE20")]
-interface IBufferFilter : public IUnknown
+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;
+ 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;
+ int m_nSamplesToBuffer;
public:
- CBufferFilter(LPUNKNOWN lpunk, HRESULT* phr);
- virtual ~CBufferFilter();
+ CBufferFilter(LPUNKNOWN lpunk, HRESULT* phr);
+ virtual ~CBufferFilter();
- DECLARE_IUNKNOWN
+ 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);
+ // 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 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();
+ 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)
- {
- }
+ 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;
- }
+ int GetQueueCount()
+ {
+ return m_List ? m_List->GetCount() : -1;
+ }
- bool SetPriority(DWORD dwPriority)
- {
- return m_hThread ? !!::SetThreadPriority(m_hThread, dwPriority) : false;
- }
- };
+ bool SetPriority(DWORD dwPriority)
+ {
+ return m_hThread ? !!::SetThreadPriority(m_hThread, dwPriority) : false;
+ }
+ };
public:
- CBufferFilterOutputPin(CTransformFilter* pFilter, HRESULT* phr);
+ CBufferFilterOutputPin(CTransformFilter* pFilter, HRESULT* phr);
- CAutoPtr<CBufferFilterOutputQueue> m_pOutputQueue;
+ CAutoPtr<CBufferFilterOutputQueue> m_pOutputQueue;
- HRESULT Active();
+ HRESULT Active();
HRESULT Inactive();
- HRESULT Deliver(IMediaSample* pMediaSample);
+ HRESULT Deliver(IMediaSample* pMediaSample);
HRESULT DeliverEndOfStream();
HRESULT DeliverBeginFlush();
- HRESULT DeliverEndFlush();
+ HRESULT DeliverEndFlush();
HRESULT DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
};
diff --git a/src/filters/transform/BufferFilter/stdafx.cpp b/src/filters/transform/BufferFilter/stdafx.cpp
index 280418994..323361b0e 100644
--- a/src/filters/transform/BufferFilter/stdafx.cpp
+++ b/src/filters/transform/BufferFilter/stdafx.cpp
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2003-2006 Gabest
* http://www.gabest.org
*
@@ -6,15 +6,15 @@
* 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.
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
* http://www.gnu.org/copyleft/gpl.html
*
*/
diff --git a/src/filters/transform/BufferFilter/stdafx.h b/src/filters/transform/BufferFilter/stdafx.h
index c35359c38..a9f666228 100644
--- a/src/filters/transform/BufferFilter/stdafx.h
+++ b/src/filters/transform/BufferFilter/stdafx.h
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2003-2006 Gabest
* http://www.gabest.org
*
@@ -6,15 +6,15 @@
* 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.
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
* http://www.gnu.org/copyleft/gpl.html
*
*/