diff options
author | XhmikosR <xhmikosr@users.sourceforge.net> | 2010-04-09 18:12:59 +0400 |
---|---|---|
committer | XhmikosR <xhmikosr@users.sourceforge.net> | 2010-04-09 18:12:59 +0400 |
commit | efbc9d9043ff8ff92716ddd00a5f61412d535593 (patch) | |
tree | 8f3e621f756cf1f5b4d64d97964c7e7abd8aaf08 /src/filters/misc | |
parent | df6b139a6d9027156f614b68687e039e3a5854db (diff) |
revert r1783
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1785 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/misc')
-rw-r--r-- | src/filters/misc/SyncClock/Interfaces.h | 11 | ||||
-rw-r--r-- | src/filters/misc/SyncClock/SyncClock.cpp | 71 | ||||
-rw-r--r-- | src/filters/misc/SyncClock/SyncClock.h | 34 | ||||
-rw-r--r-- | src/filters/misc/SyncClock/resource.h | 2 | ||||
-rw-r--r-- | src/filters/misc/SyncClock/stdafx.cpp | 8 | ||||
-rw-r--r-- | src/filters/misc/SyncClock/stdafx.h | 8 |
6 files changed, 67 insertions, 67 deletions
diff --git a/src/filters/misc/SyncClock/Interfaces.h b/src/filters/misc/SyncClock/Interfaces.h index 3d23d2075..a4bff0b25 100644 --- a/src/filters/misc/SyncClock/Interfaces.h +++ b/src/filters/misc/SyncClock/Interfaces.h @@ -3,12 +3,11 @@ const IID IID_ISyncClock = {0xa62888fb, 0x8e37, 0x44d2, {0x88, 0x50, 0xb3, 0xe3, 0xf2, 0xc1, 0x16, 0x9f}};
MIDL_INTERFACE("A62888FB-8E37-44d2-8850-B3E3F2C1169F")
-ISyncClock:
-public IUnknown
+ISyncClock: public IUnknown
{
public:
- virtual HRESULT STDMETHODCALLTYPE AdjustClock(DOUBLE adjustment) = 0;
- virtual HRESULT STDMETHODCALLTYPE SetBias(DOUBLE bias) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetBias(DOUBLE *bias) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetStartTime(REFERENCE_TIME *startTime);
+ virtual HRESULT STDMETHODCALLTYPE AdjustClock(DOUBLE adjustment) = 0;
+ virtual HRESULT STDMETHODCALLTYPE SetBias(DOUBLE bias) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetBias(DOUBLE *bias) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetStartTime(REFERENCE_TIME *startTime);
};
diff --git a/src/filters/misc/SyncClock/SyncClock.cpp b/src/filters/misc/SyncClock/SyncClock.cpp index a351a5273..51743b592 100644 --- a/src/filters/misc/SyncClock/SyncClock.cpp +++ b/src/filters/misc/SyncClock/SyncClock.cpp @@ -10,12 +10,12 @@ const AMOVIESETUP_FILTER sudFilter[] =
{
- {&__uuidof(CSyncClockFilter), L"SyncClock", MERIT_NORMAL, 0, NULL, CLSID_LegacyAmFilterCategory}
+ {&__uuidof(CSyncClockFilter), L"SyncClock", MERIT_NORMAL, 0, NULL, CLSID_LegacyAmFilterCategory}
};
CFactoryTemplate g_Templates[] =
{
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CSyncClockFilter>, NULL, &sudFilter[0]}
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CSyncClockFilter>, NULL, &sudFilter[0]}
};
int g_cTemplates = countof(g_Templates);
@@ -37,8 +37,8 @@ CFilterApp theApp; #endif
CSyncClockFilter::CSyncClockFilter(LPUNKNOWN pUnk, HRESULT *phr)
- : CBaseFilter(NAME("SyncClock"), NULL, &m_Lock, CLSID_NULL)
- , m_Clock(static_cast<IBaseFilter*>(this), phr)
+ : CBaseFilter(NAME("SyncClock"), NULL, &m_Lock, CLSID_NULL)
+ , m_Clock(static_cast<IBaseFilter*>(this), phr)
{
}
@@ -48,30 +48,30 @@ CSyncClockFilter::~CSyncClockFilter() STDMETHODIMP CSyncClockFilter::AdjustClock(DOUBLE adjustment)
{
- m_Clock.adjustment = adjustment;
- return S_OK;
+ m_Clock.adjustment = adjustment;
+ return S_OK;
}
STDMETHODIMP CSyncClockFilter::SetBias(DOUBLE bias)
{
- m_Clock.bias = bias;
- return S_OK;
+ m_Clock.bias = bias;
+ return S_OK;
}
STDMETHODIMP CSyncClockFilter::GetBias(DOUBLE *bias)
{
- *bias = m_Clock.bias;
- return S_OK;
+ *bias = m_Clock.bias;
+ return S_OK;
}
STDMETHODIMP CSyncClockFilter::GetStartTime(REFERENCE_TIME *startTime)
{
- *startTime = m_tStart;
- return S_OK;
+ *startTime = m_tStart;
+ return S_OK;
}
-STDMETHODIMP CSyncClockFilter::NonDelegatingQueryInterface(REFIID riid, void ** ppv)
+STDMETHODIMP CSyncClockFilter::NonDelegatingQueryInterface( REFIID riid, void ** ppv )
{
CheckPointer(ppv, E_POINTER);
@@ -79,12 +79,13 @@ STDMETHODIMP CSyncClockFilter::NonDelegatingQueryInterface(REFIID riid, void ** {
return GetInterface(static_cast<IReferenceClock*>(&m_Clock), ppv);
}
- else if(riid == IID_ISyncClock)
+ else
+ if(riid == IID_ISyncClock)
{
return GetInterface(static_cast<ISyncClock*>(this), ppv);
}
- else
- {
+ else
+ {
return CBaseFilter::NonDelegatingQueryInterface(riid, ppv);
}
}
@@ -102,39 +103,39 @@ CBasePin *CSyncClockFilter::GetPin(int i) // CSyncClock methods
CSyncClock::CSyncClock(LPUNKNOWN pUnk, HRESULT *phr)
- : CBaseReferenceClock(NAME("SyncClock"), pUnk, phr)
- , m_pCurrentRefClock(0), m_pPrevRefClock(0)
+ : CBaseReferenceClock(NAME("SyncClock"), pUnk, phr)
+ , m_pCurrentRefClock(0), m_pPrevRefClock(0)
{
- QueryPerformanceFrequency((LARGE_INTEGER*)&m_llPerfFrequency);
+ QueryPerformanceFrequency((LARGE_INTEGER*)&m_llPerfFrequency);
m_rtPrivateTime = GetTicks100ns();
m_rtPrevTime = m_rtPrivateTime;
- adjustment = 1.0;
- bias = 1.0;
+ adjustment = 1.0;
+ bias = 1.0;
}
REFERENCE_TIME CSyncClock::GetPrivateTime()
{
CAutoLock cObjectLock(this);
- REFERENCE_TIME rtTime = GetTicks100ns();
+ REFERENCE_TIME rtTime = GetTicks100ns();
- REFERENCE_TIME delta = rtTime - m_rtPrevTime;
- // We ignore that rtTime may wrap around. Not gonna happen too often
- m_rtPrevTime = rtTime;
+ REFERENCE_TIME delta = rtTime - m_rtPrevTime;
+ // We ignore that rtTime may wrap around. Not gonna happen too often
+ m_rtPrevTime = rtTime;
- delta = (REFERENCE_TIME)((DOUBLE)delta * adjustment * bias);
- m_rtPrivateTime = m_rtPrivateTime + delta;
+ delta = (REFERENCE_TIME)((DOUBLE)delta * adjustment * bias);
+ m_rtPrivateTime = m_rtPrivateTime + delta;
return m_rtPrivateTime;
}
REFERENCE_TIME CSyncClock::GetTicks100ns()
{
- LONGLONG i64Ticks100ns;
- if(m_llPerfFrequency != 0)
- {
- QueryPerformanceCounter((LARGE_INTEGER*)&i64Ticks100ns);
- i64Ticks100ns = LONGLONG((double(i64Ticks100ns) * 10000000) / double(m_llPerfFrequency) + 0.5);
- return (REFERENCE_TIME)i64Ticks100ns;
- }
- return 0;
+ LONGLONG i64Ticks100ns;
+ if (m_llPerfFrequency != 0)
+ {
+ QueryPerformanceCounter((LARGE_INTEGER*)&i64Ticks100ns);
+ i64Ticks100ns = LONGLONG((double(i64Ticks100ns) * 10000000) / double(m_llPerfFrequency) + 0.5);
+ return (REFERENCE_TIME)i64Ticks100ns;
+ }
+ return 0;
}
diff --git a/src/filters/misc/SyncClock/SyncClock.h b/src/filters/misc/SyncClock/SyncClock.h index d6b591bcd..54bef1292 100644 --- a/src/filters/misc/SyncClock/SyncClock.h +++ b/src/filters/misc/SyncClock/SyncClock.h @@ -12,22 +12,22 @@ class CSyncClock: public CBaseReferenceClock public:
CSyncClock(LPUNKNOWN pUnk, HRESULT *phr);
- REFERENCE_TIME GetPrivateTime();
- IUnknown * pUnk()
+ REFERENCE_TIME GetPrivateTime();
+ IUnknown * pUnk()
{
- return static_cast<IUnknown*>(static_cast<IReferenceClock*>(this));
- }
- DOUBLE adjustment; // For adjusting speed temporarily
- DOUBLE bias; // For changing speed permanently
+ return static_cast<IUnknown*>(static_cast<IReferenceClock*>(this));
+ }
+ DOUBLE adjustment; // For adjusting speed temporarily
+ DOUBLE bias; // For changing speed permanently
private:
REFERENCE_TIME m_rtPrivateTime;
- LONGLONG m_llPerfFrequency;
- REFERENCE_TIME m_rtPrevTime;
+ LONGLONG m_llPerfFrequency;
+ REFERENCE_TIME m_rtPrevTime;
CCritSec m_csClock;
IReferenceClock * m_pCurrentRefClock;
IReferenceClock * m_pPrevRefClock;
- REFERENCE_TIME GetTicks100ns();
+ REFERENCE_TIME GetTicks100ns();
};
[uuid("57797fe5-ee9b-4408-98a9-20b134e7e8f0")]
@@ -35,16 +35,16 @@ class CSyncClockFilter: public ISyncClock, public CBaseFilter {
public:
CSyncClockFilter(LPUNKNOWN pUnk, HRESULT *phr);
- virtual ~CSyncClockFilter();
+ virtual ~CSyncClockFilter();
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void ** ppv);
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface( REFIID riid, void ** ppv);
- // ISyncClock
- STDMETHODIMP AdjustClock(DOUBLE adjustment);
- STDMETHODIMP SetBias(DOUBLE bias);
- STDMETHODIMP GetBias(DOUBLE *bias);
- STDMETHODIMP GetStartTime(REFERENCE_TIME *startTime);
+ // ISyncClock
+ STDMETHODIMP AdjustClock(DOUBLE adjustment);
+ STDMETHODIMP SetBias(DOUBLE bias);
+ STDMETHODIMP GetBias(DOUBLE *bias);
+ STDMETHODIMP GetStartTime(REFERENCE_TIME *startTime);
// CBaseFilter methods
int CSyncClockFilter::GetPinCount();
diff --git a/src/filters/misc/SyncClock/resource.h b/src/filters/misc/SyncClock/resource.h index 0747f6fe1..840f23225 100644 --- a/src/filters/misc/SyncClock/resource.h +++ b/src/filters/misc/SyncClock/resource.h @@ -3,7 +3,7 @@ // Used by SyncClock.rc
// Next default values for new objects
-//
+//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
diff --git a/src/filters/misc/SyncClock/stdafx.cpp b/src/filters/misc/SyncClock/stdafx.cpp index 0385cc615..8905f2db5 100644 --- a/src/filters/misc/SyncClock/stdafx.cpp +++ b/src/filters/misc/SyncClock/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/misc/SyncClock/stdafx.h b/src/filters/misc/SyncClock/stdafx.h index a9f666228..c35359c38 100644 --- a/src/filters/misc/SyncClock/stdafx.h +++ b/src/filters/misc/SyncClock/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
*
*/
|