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:
Diffstat (limited to 'src/filters/renderer/SyncClock')
-rw-r--r--src/filters/renderer/SyncClock/Interfaces.h4
-rw-r--r--src/filters/renderer/SyncClock/SyncClock.cpp59
-rw-r--r--src/filters/renderer/SyncClock/SyncClock.h31
-rw-r--r--src/filters/renderer/SyncClock/stdafx.cpp8
-rw-r--r--src/filters/renderer/SyncClock/stdafx.h8
5 files changed, 50 insertions, 60 deletions
diff --git a/src/filters/renderer/SyncClock/Interfaces.h b/src/filters/renderer/SyncClock/Interfaces.h
index a4bff0b25..d7be17e73 100644
--- a/src/filters/renderer/SyncClock/Interfaces.h
+++ b/src/filters/renderer/SyncClock/Interfaces.h
@@ -3,8 +3,8 @@
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;
diff --git a/src/filters/renderer/SyncClock/SyncClock.cpp b/src/filters/renderer/SyncClock/SyncClock.cpp
index 51743b592..fcd760db8 100644
--- a/src/filters/renderer/SyncClock/SyncClock.cpp
+++ b/src/filters/renderer/SyncClock/SyncClock.cpp
@@ -8,13 +8,11 @@
#ifdef REGISTER_FILTER
-const AMOVIESETUP_FILTER sudFilter[] =
-{
+const AMOVIESETUP_FILTER sudFilter[] = {
{&__uuidof(CSyncClockFilter), L"SyncClock", MERIT_NORMAL, 0, NULL, CLSID_LegacyAmFilterCategory}
};
-CFactoryTemplate g_Templates[] =
-{
+CFactoryTemplate g_Templates[] = {
{sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CSyncClockFilter>, NULL, &sudFilter[0]}
};
@@ -22,12 +20,12 @@ 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"
@@ -37,8 +35,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)
{
}
@@ -73,49 +71,43 @@ STDMETHODIMP CSyncClockFilter::GetStartTime(REFERENCE_TIME *startTime)
STDMETHODIMP CSyncClockFilter::NonDelegatingQueryInterface( REFIID riid, void ** ppv )
{
- CheckPointer(ppv, E_POINTER);
-
- if(riid == IID_IReferenceClock)
- {
- return GetInterface(static_cast<IReferenceClock*>(&m_Clock), ppv);
- }
- else
- if(riid == IID_ISyncClock)
- {
- return GetInterface(static_cast<ISyncClock*>(this), ppv);
- }
- else
- {
- return CBaseFilter::NonDelegatingQueryInterface(riid, ppv);
- }
+ CheckPointer(ppv, E_POINTER);
+
+ if(riid == IID_IReferenceClock) {
+ return GetInterface(static_cast<IReferenceClock*>(&m_Clock), ppv);
+ } else if(riid == IID_ISyncClock) {
+ return GetInterface(static_cast<ISyncClock*>(this), ppv);
+ } else {
+ return CBaseFilter::NonDelegatingQueryInterface(riid, ppv);
+ }
}
int CSyncClockFilter::GetPinCount()
{
- return 0;
+ return 0;
}
CBasePin *CSyncClockFilter::GetPin(int i)
{
- UNREFERENCED_PARAMETER(i);
- return NULL;
+ UNREFERENCED_PARAMETER(i);
+ return NULL;
}
// 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);
- m_rtPrivateTime = GetTicks100ns();
- m_rtPrevTime = m_rtPrivateTime;
+ m_rtPrivateTime = GetTicks100ns();
+ m_rtPrevTime = m_rtPrivateTime;
adjustment = 1.0;
bias = 1.0;
}
REFERENCE_TIME CSyncClock::GetPrivateTime()
{
- CAutoLock cObjectLock(this);
+ CAutoLock cObjectLock(this);
REFERENCE_TIME rtTime = GetTicks100ns();
@@ -125,14 +117,13 @@ REFERENCE_TIME CSyncClock::GetPrivateTime()
delta = (REFERENCE_TIME)((DOUBLE)delta * adjustment * bias);
m_rtPrivateTime = m_rtPrivateTime + delta;
- return m_rtPrivateTime;
+ return m_rtPrivateTime;
}
REFERENCE_TIME CSyncClock::GetTicks100ns()
{
LONGLONG i64Ticks100ns;
- if (m_llPerfFrequency != 0)
- {
+ if (m_llPerfFrequency != 0) {
QueryPerformanceCounter((LARGE_INTEGER*)&i64Ticks100ns);
i64Ticks100ns = LONGLONG((double(i64Ticks100ns) * 10000000) / double(m_llPerfFrequency) + 0.5);
return (REFERENCE_TIME)i64Ticks100ns;
diff --git a/src/filters/renderer/SyncClock/SyncClock.h b/src/filters/renderer/SyncClock/SyncClock.h
index 110a318f8..fdb90420e 100644
--- a/src/filters/renderer/SyncClock/SyncClock.h
+++ b/src/filters/renderer/SyncClock/SyncClock.h
@@ -8,37 +8,36 @@ class CSyncClockFilter;
class CSyncClock: public CBaseReferenceClock
{
- friend class CSyncClockFilter;
+ friend class CSyncClockFilter;
public:
- CSyncClock(LPUNKNOWN pUnk, HRESULT *phr);
+ CSyncClock(LPUNKNOWN pUnk, HRESULT *phr);
REFERENCE_TIME GetPrivateTime();
- IUnknown * pUnk()
- {
+ IUnknown * pUnk() {
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;
+ REFERENCE_TIME m_rtPrivateTime;
LONGLONG m_llPerfFrequency;
REFERENCE_TIME m_rtPrevTime;
- CCritSec m_csClock;
- IReferenceClock * m_pCurrentRefClock;
- IReferenceClock * m_pPrevRefClock;
+ CCritSec m_csClock;
+ IReferenceClock * m_pCurrentRefClock;
+ IReferenceClock * m_pPrevRefClock;
REFERENCE_TIME GetTicks100ns();
};
class __declspec(uuid("57797fe5-ee9b-4408-98a9-20b134e7e8f0"))
-CSyncClockFilter: public ISyncClock, public CBaseFilter
+ CSyncClockFilter: public ISyncClock, public CBaseFilter
{
public:
- CSyncClockFilter(LPUNKNOWN pUnk, HRESULT *phr);
+ CSyncClockFilter(LPUNKNOWN pUnk, HRESULT *phr);
virtual ~CSyncClockFilter();
DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface( REFIID riid, void ** ppv);
+ STDMETHODIMP NonDelegatingQueryInterface( REFIID riid, void ** ppv);
// ISyncClock
STDMETHODIMP AdjustClock(DOUBLE adjustment);
@@ -46,12 +45,12 @@ public:
STDMETHODIMP GetBias(DOUBLE *bias);
STDMETHODIMP GetStartTime(REFERENCE_TIME *startTime);
- // CBaseFilter methods
- int CSyncClockFilter::GetPinCount();
- CBasePin *CSyncClockFilter::GetPin(int iPin);
+ // CBaseFilter methods
+ int CSyncClockFilter::GetPinCount();
+ CBasePin *CSyncClockFilter::GetPin(int iPin);
private:
- CSyncClock m_Clock;
- CCritSec m_Lock;
+ CSyncClock m_Clock;
+ CCritSec m_Lock;
};
diff --git a/src/filters/renderer/SyncClock/stdafx.cpp b/src/filters/renderer/SyncClock/stdafx.cpp
index 8905f2db5..0385cc615 100644
--- a/src/filters/renderer/SyncClock/stdafx.cpp
+++ b/src/filters/renderer/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/renderer/SyncClock/stdafx.h b/src/filters/renderer/SyncClock/stdafx.h
index c35359c38..a9f666228 100644
--- a/src/filters/renderer/SyncClock/stdafx.h
+++ b/src/filters/renderer/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
*
*/