diff options
author | Casimir666 <casimir666@users.sourceforge.net> | 2009-03-01 12:49:27 +0300 |
---|---|---|
committer | Casimir666 <casimir666@users.sourceforge.net> | 2009-03-01 12:49:27 +0300 |
commit | 7a7ddcb79fd2de74e1105cd7aebb8acfbd76cb6b (patch) | |
tree | 000c2216c29c6d52701666b4b1388a2a841025eb /src/filters/BaseClasses/seekpt.cpp | |
parent | 3f89e9541a0031cf320bb412855ce9131ef0e4a1 (diff) |
Added: Microsoft BaseClasses to the SVN
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1006 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/BaseClasses/seekpt.cpp')
-rw-r--r-- | src/filters/BaseClasses/seekpt.cpp | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/src/filters/BaseClasses/seekpt.cpp b/src/filters/BaseClasses/seekpt.cpp new file mode 100644 index 000000000..bb13d6f0a --- /dev/null +++ b/src/filters/BaseClasses/seekpt.cpp @@ -0,0 +1,83 @@ +//------------------------------------------------------------------------------
+// File: SeekPT.cpp
+//
+// Desc: DirectShow base classes.
+//
+// Copyright (c) 1992-2001 Microsoft Corporation. All rights reserved.
+//------------------------------------------------------------------------------
+
+
+#include <streams.h>
+#include "seekpt.h"
+
+//==================================================================
+// CreateInstance
+// This goes in the factory template table to create new instances
+// If there is already a mapper instance - return that, else make one
+// and save it in a static variable so that forever after we can return that.
+//==================================================================
+
+CUnknown * CSeekingPassThru::CreateInstance(__inout_opt LPUNKNOWN pUnk, __inout HRESULT *phr)
+{
+ return new CSeekingPassThru(NAME("Seeking PassThru"),pUnk, phr);
+}
+
+
+STDMETHODIMP CSeekingPassThru::NonDelegatingQueryInterface(REFIID riid, __deref_out void ** ppv)
+{
+ if (riid == IID_ISeekingPassThru) {
+ return GetInterface((ISeekingPassThru *) this, ppv);
+ } else {
+ if (m_pPosPassThru &&
+ (riid == IID_IMediaSeeking ||
+ riid == IID_IMediaPosition)) {
+ return m_pPosPassThru->NonDelegatingQueryInterface(riid,ppv);
+ } else {
+ return CUnknown::NonDelegatingQueryInterface(riid, ppv);
+ }
+ }
+}
+
+
+CSeekingPassThru::CSeekingPassThru( __in_opt LPCTSTR pName, __inout_opt LPUNKNOWN pUnk, __inout HRESULT *phr )
+ : CUnknown(pName, pUnk, phr),
+ m_pPosPassThru(NULL)
+{
+}
+
+
+CSeekingPassThru::~CSeekingPassThru()
+{
+ delete m_pPosPassThru;
+}
+
+STDMETHODIMP CSeekingPassThru::Init(BOOL bRendererSeeking, IPin *pPin)
+{
+ HRESULT hr = NOERROR;
+ if (m_pPosPassThru) {
+ hr = E_FAIL;
+ } else {
+ m_pPosPassThru =
+ bRendererSeeking ?
+ new CRendererPosPassThru(
+ NAME("Render Seeking COM object"),
+ (IUnknown *)this,
+ &hr,
+ pPin) :
+ new CPosPassThru(
+ NAME("Render Seeking COM object"),
+ (IUnknown *)this,
+ &hr,
+ pPin);
+ if (!m_pPosPassThru) {
+ hr = E_OUTOFMEMORY;
+ } else {
+ if (FAILED(hr)) {
+ delete m_pPosPassThru;
+ m_pPosPassThru = NULL;
+ }
+ }
+ }
+ return hr;
+}
+
|