qcap: Use BasePinImpl_QueryInterface().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b89ad0a73a
commit
71fdcf3ba8
|
@ -318,11 +318,6 @@ static inline AVICompressor *impl_from_IPin(IPin *iface)
|
||||||
return impl_from_strmbase_filter(CONTAINING_RECORD(iface, struct strmbase_pin, IPin_iface)->filter);
|
return impl_from_strmbase_filter(CONTAINING_RECORD(iface, struct strmbase_pin, IPin_iface)->filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI AVICompressorIn_QueryInterface(IPin *iface, REFIID riid, void **ppv)
|
|
||||||
{
|
|
||||||
return BaseInputPinImpl_QueryInterface(iface, riid, ppv);
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI AVICompressorIn_ReceiveConnection(IPin *iface,
|
static HRESULT WINAPI AVICompressorIn_ReceiveConnection(IPin *iface,
|
||||||
IPin *pConnector, const AM_MEDIA_TYPE *pmt)
|
IPin *pConnector, const AM_MEDIA_TYPE *pmt)
|
||||||
{
|
{
|
||||||
|
@ -359,7 +354,7 @@ static HRESULT WINAPI AVICompressorIn_Disconnect(IPin *iface)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const IPinVtbl AVICompressorInputPinVtbl = {
|
static const IPinVtbl AVICompressorInputPinVtbl = {
|
||||||
AVICompressorIn_QueryInterface,
|
BasePinImpl_QueryInterface,
|
||||||
BasePinImpl_AddRef,
|
BasePinImpl_AddRef,
|
||||||
BasePinImpl_Release,
|
BasePinImpl_Release,
|
||||||
BaseInputPinImpl_Connect,
|
BaseInputPinImpl_Connect,
|
||||||
|
@ -406,6 +401,19 @@ static HRESULT sink_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE
|
||||||
return res == ICERR_OK ? S_OK : S_FALSE;
|
return res == ICERR_OK ? S_OK : S_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static HRESULT sink_query_interface(struct strmbase_pin *iface, REFIID iid, void **out)
|
||||||
|
{
|
||||||
|
AVICompressor *filter = impl_from_strmbase_pin(iface);
|
||||||
|
|
||||||
|
if (IsEqualGUID(iid, &IID_IMemInputPin))
|
||||||
|
*out = &filter->sink.IMemInputPin_iface;
|
||||||
|
else
|
||||||
|
return E_NOINTERFACE;
|
||||||
|
|
||||||
|
IUnknown_AddRef((IUnknown *)*out);
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI AVICompressorIn_Receive(BaseInputPin *base, IMediaSample *pSample)
|
static HRESULT WINAPI AVICompressorIn_Receive(BaseInputPin *base, IMediaSample *pSample)
|
||||||
{
|
{
|
||||||
AVICompressor *This = impl_from_strmbase_pin(&base->pin);
|
AVICompressor *This = impl_from_strmbase_pin(&base->pin);
|
||||||
|
@ -497,16 +505,12 @@ static const BaseInputPinFuncTable AVICompressorBaseInputPinVtbl =
|
||||||
{
|
{
|
||||||
.base.pin_query_accept = sink_query_accept,
|
.base.pin_query_accept = sink_query_accept,
|
||||||
.base.pin_get_media_type = strmbase_pin_get_media_type,
|
.base.pin_get_media_type = strmbase_pin_get_media_type,
|
||||||
|
.base.pin_query_interface = sink_query_interface,
|
||||||
.pfnReceive = AVICompressorIn_Receive,
|
.pfnReceive = AVICompressorIn_Receive,
|
||||||
};
|
};
|
||||||
|
|
||||||
static HRESULT WINAPI AVICompressorOut_QueryInterface(IPin *iface, REFIID riid, void **ppv)
|
|
||||||
{
|
|
||||||
return BaseInputPinImpl_QueryInterface(iface, riid, ppv);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const IPinVtbl AVICompressorOutputPinVtbl = {
|
static const IPinVtbl AVICompressorOutputPinVtbl = {
|
||||||
AVICompressorOut_QueryInterface,
|
BasePinImpl_QueryInterface,
|
||||||
BasePinImpl_AddRef,
|
BasePinImpl_AddRef,
|
||||||
BasePinImpl_Release,
|
BasePinImpl_Release,
|
||||||
BaseOutputPinImpl_Connect,
|
BaseOutputPinImpl_Connect,
|
||||||
|
|
|
@ -142,7 +142,7 @@ static const struct strmbase_filter_ops filter_ops =
|
||||||
};
|
};
|
||||||
|
|
||||||
static const IPinVtbl SmartTeeFilterInputVtbl = {
|
static const IPinVtbl SmartTeeFilterInputVtbl = {
|
||||||
BaseInputPinImpl_QueryInterface,
|
BasePinImpl_QueryInterface,
|
||||||
BasePinImpl_AddRef,
|
BasePinImpl_AddRef,
|
||||||
BasePinImpl_Release,
|
BasePinImpl_Release,
|
||||||
BaseInputPinImpl_Connect,
|
BaseInputPinImpl_Connect,
|
||||||
|
@ -194,6 +194,19 @@ static HRESULT sink_get_media_type(struct strmbase_pin *base,
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static HRESULT sink_query_interface(struct strmbase_pin *iface, REFIID iid, void **out)
|
||||||
|
{
|
||||||
|
SmartTeeFilter *filter = impl_from_strmbase_pin(iface);
|
||||||
|
|
||||||
|
if (IsEqualGUID(iid, &IID_IMemInputPin))
|
||||||
|
*out = &filter->sink.IMemInputPin_iface;
|
||||||
|
else
|
||||||
|
return E_NOINTERFACE;
|
||||||
|
|
||||||
|
IUnknown_AddRef((IUnknown *)*out);
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
static HRESULT copy_sample(IMediaSample *inputSample, IMemAllocator *allocator, IMediaSample **pOutputSample)
|
static HRESULT copy_sample(IMediaSample *inputSample, IMemAllocator *allocator, IMediaSample **pOutputSample)
|
||||||
{
|
{
|
||||||
REFERENCE_TIME startTime, endTime;
|
REFERENCE_TIME startTime, endTime;
|
||||||
|
@ -319,11 +332,12 @@ static const BaseInputPinFuncTable SmartTeeFilterInputFuncs =
|
||||||
{
|
{
|
||||||
.base.pin_query_accept = sink_query_accept,
|
.base.pin_query_accept = sink_query_accept,
|
||||||
.base.pin_get_media_type = sink_get_media_type,
|
.base.pin_get_media_type = sink_get_media_type,
|
||||||
|
.base.pin_query_interface = sink_query_interface,
|
||||||
.pfnReceive = SmartTeeFilterInput_Receive,
|
.pfnReceive = SmartTeeFilterInput_Receive,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const IPinVtbl SmartTeeFilterCaptureVtbl = {
|
static const IPinVtbl SmartTeeFilterCaptureVtbl = {
|
||||||
BaseOutputPinImpl_QueryInterface,
|
BasePinImpl_QueryInterface,
|
||||||
BasePinImpl_AddRef,
|
BasePinImpl_AddRef,
|
||||||
BasePinImpl_Release,
|
BasePinImpl_Release,
|
||||||
BaseOutputPinImpl_Connect,
|
BaseOutputPinImpl_Connect,
|
||||||
|
@ -387,7 +401,7 @@ static const struct strmbase_source_ops capture_ops =
|
||||||
};
|
};
|
||||||
|
|
||||||
static const IPinVtbl SmartTeeFilterPreviewVtbl = {
|
static const IPinVtbl SmartTeeFilterPreviewVtbl = {
|
||||||
BaseOutputPinImpl_QueryInterface,
|
BasePinImpl_QueryInterface,
|
||||||
BasePinImpl_AddRef,
|
BasePinImpl_AddRef,
|
||||||
BasePinImpl_Release,
|
BasePinImpl_Release,
|
||||||
BaseOutputPinImpl_Connect,
|
BaseOutputPinImpl_Connect,
|
||||||
|
|
|
@ -82,11 +82,6 @@ static inline VfwCapture *impl_from_IPersistPropertyBag(IPersistPropertyBag *ifa
|
||||||
return CONTAINING_RECORD(iface, VfwCapture, IPersistPropertyBag_iface);
|
return CONTAINING_RECORD(iface, VfwCapture, IPersistPropertyBag_iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline VfwCapture *impl_from_IPin(IPin *iface)
|
|
||||||
{
|
|
||||||
return CONTAINING_RECORD(iface, VfwCapture, source.pin.IPin_iface);
|
|
||||||
}
|
|
||||||
|
|
||||||
static IPin *vfw_capture_get_pin(struct strmbase_filter *iface, unsigned int index)
|
static IPin *vfw_capture_get_pin(struct strmbase_filter *iface, unsigned int index)
|
||||||
{
|
{
|
||||||
VfwCapture *This = impl_from_strmbase_filter(iface);
|
VfwCapture *This = impl_from_strmbase_filter(iface);
|
||||||
|
@ -536,6 +531,21 @@ static HRESULT source_get_media_type(struct strmbase_pin *pin,
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static HRESULT source_query_interface(struct strmbase_pin *iface, REFIID iid, void **out)
|
||||||
|
{
|
||||||
|
VfwCapture *filter = impl_from_strmbase_pin(iface);
|
||||||
|
|
||||||
|
if (IsEqualGUID(iid, &IID_IKsPropertySet))
|
||||||
|
*out = &filter->IKsPropertySet_iface;
|
||||||
|
else if (IsEqualGUID(iid, &IID_IAMStreamConfig))
|
||||||
|
*out = &filter->IAMStreamConfig_iface;
|
||||||
|
else
|
||||||
|
return E_NOINTERFACE;
|
||||||
|
|
||||||
|
IUnknown_AddRef((IUnknown *)*out);
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI VfwPin_DecideBufferSize(struct strmbase_source *iface,
|
static HRESULT WINAPI VfwPin_DecideBufferSize(struct strmbase_source *iface,
|
||||||
IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest)
|
IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest)
|
||||||
{
|
{
|
||||||
|
@ -557,38 +567,15 @@ static const struct strmbase_source_ops source_ops =
|
||||||
{
|
{
|
||||||
.base.pin_query_accept = source_query_accept,
|
.base.pin_query_accept = source_query_accept,
|
||||||
.base.pin_get_media_type = source_get_media_type,
|
.base.pin_get_media_type = source_get_media_type,
|
||||||
|
.base.pin_query_interface = source_query_interface,
|
||||||
.pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection,
|
.pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection,
|
||||||
.pfnDecideBufferSize = VfwPin_DecideBufferSize,
|
.pfnDecideBufferSize = VfwPin_DecideBufferSize,
|
||||||
.pfnDecideAllocator = BaseOutputPinImpl_DecideAllocator,
|
.pfnDecideAllocator = BaseOutputPinImpl_DecideAllocator,
|
||||||
};
|
};
|
||||||
|
|
||||||
static HRESULT WINAPI VfwPin_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv)
|
|
||||||
{
|
|
||||||
VfwCapture *filter = impl_from_IPin(iface);
|
|
||||||
|
|
||||||
TRACE("%s %p\n", debugstr_guid(riid), ppv);
|
|
||||||
|
|
||||||
*ppv = NULL;
|
|
||||||
if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IPin))
|
|
||||||
*ppv = &filter->source.pin.IPin_iface;
|
|
||||||
else if (IsEqualIID(riid, &IID_IKsPropertySet))
|
|
||||||
*ppv = &filter->IKsPropertySet_iface;
|
|
||||||
else if (IsEqualIID(riid, &IID_IAMStreamConfig))
|
|
||||||
*ppv = &filter->IAMStreamConfig_iface;
|
|
||||||
|
|
||||||
if (*ppv)
|
|
||||||
{
|
|
||||||
IUnknown_AddRef((IUnknown *)(*ppv));
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
FIXME("No interface for %s!\n", debugstr_guid(riid));
|
|
||||||
return E_NOINTERFACE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const IPinVtbl VfwPin_Vtbl =
|
static const IPinVtbl VfwPin_Vtbl =
|
||||||
{
|
{
|
||||||
VfwPin_QueryInterface,
|
BasePinImpl_QueryInterface,
|
||||||
BasePinImpl_AddRef,
|
BasePinImpl_AddRef,
|
||||||
BasePinImpl_Release,
|
BasePinImpl_Release,
|
||||||
BaseOutputPinImpl_Connect,
|
BaseOutputPinImpl_Connect,
|
||||||
|
|
|
@ -362,35 +362,6 @@ static inline struct strmbase_source *impl_source_from_IPin( IPin *iface )
|
||||||
return CONTAINING_RECORD(iface, struct strmbase_source, pin.IPin_iface);
|
return CONTAINING_RECORD(iface, struct strmbase_source, pin.IPin_iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI BaseOutputPinImpl_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv)
|
|
||||||
{
|
|
||||||
struct strmbase_source *This = impl_source_from_IPin(iface);
|
|
||||||
|
|
||||||
TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppv);
|
|
||||||
|
|
||||||
*ppv = NULL;
|
|
||||||
|
|
||||||
if (IsEqualIID(riid, &IID_IUnknown))
|
|
||||||
*ppv = iface;
|
|
||||||
else if (IsEqualIID(riid, &IID_IPin))
|
|
||||||
*ppv = iface;
|
|
||||||
else if (IsEqualIID(riid, &IID_IMediaSeeking) ||
|
|
||||||
IsEqualIID(riid, &IID_IQualityControl))
|
|
||||||
{
|
|
||||||
return IBaseFilter_QueryInterface(&This->pin.filter->IBaseFilter_iface, riid, ppv);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (*ppv)
|
|
||||||
{
|
|
||||||
IUnknown_AddRef((IUnknown *)(*ppv));
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
FIXME("No interface for %s!\n", debugstr_guid(riid));
|
|
||||||
|
|
||||||
return E_NOINTERFACE;
|
|
||||||
}
|
|
||||||
|
|
||||||
HRESULT WINAPI BaseOutputPinImpl_Connect(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt)
|
HRESULT WINAPI BaseOutputPinImpl_Connect(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt)
|
||||||
{
|
{
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
@ -758,36 +729,6 @@ static inline BaseInputPin *impl_BaseInputPin_from_IPin( IPin *iface )
|
||||||
return CONTAINING_RECORD(iface, BaseInputPin, pin.IPin_iface);
|
return CONTAINING_RECORD(iface, BaseInputPin, pin.IPin_iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI BaseInputPinImpl_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv)
|
|
||||||
{
|
|
||||||
BaseInputPin *This = impl_BaseInputPin_from_IPin(iface);
|
|
||||||
|
|
||||||
TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv);
|
|
||||||
|
|
||||||
*ppv = NULL;
|
|
||||||
|
|
||||||
if (IsEqualIID(riid, &IID_IUnknown))
|
|
||||||
*ppv = iface;
|
|
||||||
else if (IsEqualIID(riid, &IID_IPin))
|
|
||||||
*ppv = iface;
|
|
||||||
else if (IsEqualIID(riid, &IID_IMemInputPin))
|
|
||||||
*ppv = &This->IMemInputPin_iface;
|
|
||||||
else if (IsEqualIID(riid, &IID_IMediaSeeking))
|
|
||||||
{
|
|
||||||
return IBaseFilter_QueryInterface(&This->pin.filter->IBaseFilter_iface, &IID_IMediaSeeking, ppv);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (*ppv)
|
|
||||||
{
|
|
||||||
IUnknown_AddRef((IUnknown *)(*ppv));
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
FIXME("No interface for %s!\n", debugstr_guid(riid));
|
|
||||||
|
|
||||||
return E_NOINTERFACE;
|
|
||||||
}
|
|
||||||
|
|
||||||
HRESULT WINAPI BaseInputPinImpl_Connect(IPin *iface, IPin *pin, const AM_MEDIA_TYPE *pmt)
|
HRESULT WINAPI BaseInputPinImpl_Connect(IPin *iface, IPin *pin, const AM_MEDIA_TYPE *pmt)
|
||||||
{
|
{
|
||||||
ERR("(%p)->(%p, %p) outgoing connection on an input pin!\n", iface, pin, pmt);
|
ERR("(%p)->(%p, %p) outgoing connection on an input pin!\n", iface, pin, pmt);
|
||||||
|
|
|
@ -113,7 +113,6 @@ HRESULT WINAPI BasePinImpl_QueryInternalConnections(IPin * iface, IPin ** apPin,
|
||||||
HRESULT WINAPI BasePinImpl_NewSegment(IPin * iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
|
HRESULT WINAPI BasePinImpl_NewSegment(IPin * iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
|
||||||
|
|
||||||
/* Base Output Pin */
|
/* Base Output Pin */
|
||||||
HRESULT WINAPI BaseOutputPinImpl_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv);
|
|
||||||
HRESULT WINAPI BaseOutputPinImpl_Connect(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt);
|
HRESULT WINAPI BaseOutputPinImpl_Connect(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt);
|
||||||
HRESULT WINAPI BaseOutputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt);
|
HRESULT WINAPI BaseOutputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt);
|
||||||
HRESULT WINAPI BaseOutputPinImpl_Disconnect(IPin * iface);
|
HRESULT WINAPI BaseOutputPinImpl_Disconnect(IPin * iface);
|
||||||
|
@ -135,7 +134,6 @@ void strmbase_source_init(struct strmbase_source *pin, const IPinVtbl *vtbl, str
|
||||||
const WCHAR *name, const struct strmbase_source_ops *func_table);
|
const WCHAR *name, const struct strmbase_source_ops *func_table);
|
||||||
|
|
||||||
/* Base Input Pin */
|
/* Base Input Pin */
|
||||||
HRESULT WINAPI BaseInputPinImpl_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv);
|
|
||||||
HRESULT WINAPI BaseInputPinImpl_Connect(IPin * iface, IPin * pConnector, const AM_MEDIA_TYPE * pmt);
|
HRESULT WINAPI BaseInputPinImpl_Connect(IPin * iface, IPin * pConnector, const AM_MEDIA_TYPE * pmt);
|
||||||
HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt);
|
HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt);
|
||||||
HRESULT WINAPI BaseInputPinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt);
|
HRESULT WINAPI BaseInputPinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt);
|
||||||
|
|
Loading…
Reference in New Issue