[KSPROXY]
- Stub interfaces for CBasicAudio, CKsClockForwarder, CVPConfig, CVPVBIConfig, CKsDataTypeHandler, CKsInterfaceHandler, CKsProxy, CKsQualityForwarder
- Implement KsSynchronousDeviceControl, KsOpenDefaultDevice, KsGetMultiplePinFactoryItems, KsGetMediaTypeCount, DllGetClassObject
svn path=/trunk/; revision=45608
2010-02-18 15:24:29 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS WDM Streaming ActiveMovie Proxy
|
2015-09-27 14:00:29 +00:00
|
|
|
* FILE: dll/directx/ksproxy/qualityforward.cpp
|
[KSPROXY]
- Stub interfaces for CBasicAudio, CKsClockForwarder, CVPConfig, CVPVBIConfig, CKsDataTypeHandler, CKsInterfaceHandler, CKsProxy, CKsQualityForwarder
- Implement KsSynchronousDeviceControl, KsOpenDefaultDevice, KsGetMultiplePinFactoryItems, KsGetMediaTypeCount, DllGetClassObject
svn path=/trunk/; revision=45608
2010-02-18 15:24:29 +00:00
|
|
|
* PURPOSE: IKsClockForwarder interface
|
|
|
|
*
|
2013-09-15 13:06:05 +00:00
|
|
|
* PROGRAMMERS: Johannes Anderwald (johannes.anderwald@reactos.org)
|
[KSPROXY]
- Stub interfaces for CBasicAudio, CKsClockForwarder, CVPConfig, CVPVBIConfig, CKsDataTypeHandler, CKsInterfaceHandler, CKsProxy, CKsQualityForwarder
- Implement KsSynchronousDeviceControl, KsOpenDefaultDevice, KsGetMultiplePinFactoryItems, KsGetMediaTypeCount, DllGetClassObject
svn path=/trunk/; revision=45608
2010-02-18 15:24:29 +00:00
|
|
|
*/
|
|
|
|
#include "precomp.h"
|
|
|
|
|
[KSPROXY]
- Recreate resource file with visual studio
- Fix compilation with msvc
- Copy extra format buffer in IEnumMediaTypes::Next
- Create the pin handle in IPin::ReceiveConnection
- Implement IPin::Disconnect for the input pin
- Enumerate media formats and pass it to constructor of CEnumMediaTypes
- Check if the passed format is null in CInputPin::CheckFormat
- Copy extra format buffer after KSDATAFORMAT in the pin connection request
- Implement KsGetMediaType function
- Implement ISpecifyPropertyPages, IKsPropertySet, IKsControl, IStreamBuilder, IKsPinFactory for the output pin
- Implement IPin::ReceiveConnection, IPin::EnumMediaTypes for output pin
- Stub interfaces for IReferenceClock, IMediaSeeking, IKsTopology, IKsAggregateControl, IKsClockPropertySet, ISpecifyPropertyPages, IPersistStream for proxy filter
- Implement IAMDeviceRemoval, IKsControl, IAMFilterMiscFlags, IKsPropertySet interface for proxy filter
svn path=/trunk/; revision=46116
2010-03-11 21:38:13 +00:00
|
|
|
#define IID_IKsQualityForwarder KSCATEGORY_QUALITY
|
[KSPROXY]
- Stub interfaces for CBasicAudio, CKsClockForwarder, CVPConfig, CVPVBIConfig, CKsDataTypeHandler, CKsInterfaceHandler, CKsProxy, CKsQualityForwarder
- Implement KsSynchronousDeviceControl, KsOpenDefaultDevice, KsGetMultiplePinFactoryItems, KsGetMediaTypeCount, DllGetClassObject
svn path=/trunk/; revision=45608
2010-02-18 15:24:29 +00:00
|
|
|
|
|
|
|
class CKsQualityForwarder : public IKsQualityForwarder
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface);
|
|
|
|
|
|
|
|
STDMETHODIMP_(ULONG) AddRef()
|
|
|
|
{
|
|
|
|
InterlockedIncrement(&m_Ref);
|
|
|
|
return m_Ref;
|
|
|
|
}
|
|
|
|
STDMETHODIMP_(ULONG) Release()
|
|
|
|
{
|
|
|
|
InterlockedDecrement(&m_Ref);
|
|
|
|
|
|
|
|
if (!m_Ref)
|
|
|
|
{
|
|
|
|
delete this;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return m_Ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
// IKsObject interface
|
|
|
|
HANDLE STDMETHODCALLTYPE KsGetObjectHandle();
|
|
|
|
|
|
|
|
// IKsQualityForwarder
|
|
|
|
VOID STDMETHODCALLTYPE KsFlushClient(IN IKsPin *Pin);
|
|
|
|
|
|
|
|
CKsQualityForwarder(HANDLE handle) : m_Ref(0), m_Handle(handle){}
|
|
|
|
virtual ~CKsQualityForwarder(){ if (m_Handle) CloseHandle(m_Handle);}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
LONG m_Ref;
|
|
|
|
HANDLE m_Handle;
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
HRESULT
|
|
|
|
STDMETHODCALLTYPE
|
|
|
|
CKsQualityForwarder::QueryInterface(
|
|
|
|
IN REFIID refiid,
|
|
|
|
OUT PVOID* Output)
|
|
|
|
{
|
|
|
|
if (IsEqualGUID(refiid, IID_IUnknown) ||
|
|
|
|
IsEqualGUID(refiid, IID_IKsQualityForwarder))
|
|
|
|
{
|
|
|
|
*Output = PVOID(this);
|
|
|
|
reinterpret_cast<IUnknown*>(*Output)->AddRef();
|
|
|
|
return NOERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------
|
|
|
|
// IKsObject interface
|
|
|
|
//
|
|
|
|
|
|
|
|
HANDLE
|
|
|
|
STDMETHODCALLTYPE
|
|
|
|
CKsQualityForwarder::KsGetObjectHandle()
|
|
|
|
{
|
|
|
|
return m_Handle;
|
|
|
|
}
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------
|
|
|
|
// IKsQualityForwarder interface
|
|
|
|
//
|
|
|
|
VOID
|
|
|
|
STDMETHODCALLTYPE
|
|
|
|
CKsQualityForwarder::KsFlushClient(
|
|
|
|
IN IKsPin *Pin)
|
|
|
|
{
|
2010-03-24 17:30:43 +00:00
|
|
|
#ifdef KSPROXY_TRACE
|
[KSPROXY]
- Stub interfaces for CBasicAudio, CKsClockForwarder, CVPConfig, CVPVBIConfig, CKsDataTypeHandler, CKsInterfaceHandler, CKsProxy, CKsQualityForwarder
- Implement KsSynchronousDeviceControl, KsOpenDefaultDevice, KsGetMultiplePinFactoryItems, KsGetMediaTypeCount, DllGetClassObject
svn path=/trunk/; revision=45608
2010-02-18 15:24:29 +00:00
|
|
|
OutputDebugString("UNIMPLEMENTED\n");
|
2010-03-24 17:30:43 +00:00
|
|
|
#endif
|
[KSPROXY]
- Stub interfaces for CBasicAudio, CKsClockForwarder, CVPConfig, CVPVBIConfig, CKsDataTypeHandler, CKsInterfaceHandler, CKsProxy, CKsQualityForwarder
- Implement KsSynchronousDeviceControl, KsOpenDefaultDevice, KsGetMultiplePinFactoryItems, KsGetMediaTypeCount, DllGetClassObject
svn path=/trunk/; revision=45608
2010-02-18 15:24:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT
|
|
|
|
WINAPI
|
|
|
|
CKsQualityForwarder_Constructor(
|
|
|
|
IUnknown * pUnkOuter,
|
|
|
|
REFIID riid,
|
|
|
|
LPVOID * ppv)
|
|
|
|
{
|
|
|
|
HRESULT hr;
|
|
|
|
HANDLE handle;
|
|
|
|
|
2010-03-24 17:30:43 +00:00
|
|
|
#ifdef KSPROXY_TRACE
|
2010-03-02 16:27:50 +00:00
|
|
|
OutputDebugStringW(L"CKsQualityForwarder_Constructor\n");
|
2010-03-24 17:30:43 +00:00
|
|
|
#endif
|
2010-03-02 16:27:50 +00:00
|
|
|
|
[KSPROXY]
- Stub interfaces for CBasicAudio, CKsClockForwarder, CVPConfig, CVPVBIConfig, CKsDataTypeHandler, CKsInterfaceHandler, CKsProxy, CKsQualityForwarder
- Implement KsSynchronousDeviceControl, KsOpenDefaultDevice, KsGetMultiplePinFactoryItems, KsGetMediaTypeCount, DllGetClassObject
svn path=/trunk/; revision=45608
2010-02-18 15:24:29 +00:00
|
|
|
// open default clock
|
|
|
|
hr = KsOpenDefaultDevice(KSCATEGORY_QUALITY, GENERIC_READ | GENERIC_WRITE, &handle);
|
|
|
|
|
|
|
|
if (hr != NOERROR)
|
|
|
|
{
|
2010-03-24 17:30:43 +00:00
|
|
|
#ifdef KSPROXY_TRACE
|
[KSPROXY]
- Stub interfaces for CBasicAudio, CKsClockForwarder, CVPConfig, CVPVBIConfig, CKsDataTypeHandler, CKsInterfaceHandler, CKsProxy, CKsQualityForwarder
- Implement KsSynchronousDeviceControl, KsOpenDefaultDevice, KsGetMultiplePinFactoryItems, KsGetMediaTypeCount, DllGetClassObject
svn path=/trunk/; revision=45608
2010-02-18 15:24:29 +00:00
|
|
|
OutputDebugString("CKsClockForwarder_Constructor failed to open device\n");
|
2010-03-24 17:30:43 +00:00
|
|
|
#endif
|
[KSPROXY]
- Stub interfaces for CBasicAudio, CKsClockForwarder, CVPConfig, CVPVBIConfig, CKsDataTypeHandler, CKsInterfaceHandler, CKsProxy, CKsQualityForwarder
- Implement KsSynchronousDeviceControl, KsOpenDefaultDevice, KsGetMultiplePinFactoryItems, KsGetMediaTypeCount, DllGetClassObject
svn path=/trunk/; revision=45608
2010-02-18 15:24:29 +00:00
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
CKsQualityForwarder * quality = new CKsQualityForwarder(handle);
|
|
|
|
|
|
|
|
if (!quality)
|
|
|
|
{
|
|
|
|
// free clock handle
|
|
|
|
CloseHandle(handle);
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (FAILED(quality->QueryInterface(riid, ppv)))
|
|
|
|
{
|
|
|
|
/* not supported */
|
|
|
|
delete quality;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NOERROR;
|
|
|
|
}
|