strmbase: Implement QueryAccept() on top of CheckMediaType() for output pins too.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2018-05-03 23:47:13 -05:00 committed by Alexandre Julliard
parent af717f342b
commit 10ff8f3082
11 changed files with 63 additions and 44 deletions

View File

@ -499,7 +499,7 @@ static const IPinVtbl DirectDrawMediaStreamInputPin_IPin_Vtbl =
BasePinImpl_QueryPinInfo,
BasePinImpl_QueryDirection,
BasePinImpl_QueryId,
BaseInputPinImpl_QueryAccept,
BasePinImpl_QueryAccept,
BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections,
BaseInputPinImpl_EndOfStream,
@ -1068,7 +1068,7 @@ static const IPinVtbl AudioMediaStreamInputPin_IPin_Vtbl =
BasePinImpl_QueryPinInfo,
BasePinImpl_QueryDirection,
BasePinImpl_QueryId,
BaseInputPinImpl_QueryAccept,
BasePinImpl_QueryAccept,
BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections,
BaseInputPinImpl_EndOfStream,

View File

@ -1223,6 +1223,12 @@ static const ISpecifyPropertyPagesVtbl SpecifyPropertyPagesVtbl = {
SpecifyPropertyPages_GetPages
};
static HRESULT WINAPI AviMuxOut_CheckMediaType(BasePin *base, const AM_MEDIA_TYPE *amt)
{
FIXME("(%p) stub\n", base);
return S_OK;
}
static HRESULT WINAPI AviMuxOut_AttemptConnection(BasePin *base,
IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
{
@ -1299,7 +1305,7 @@ static HRESULT WINAPI AviMuxOut_BreakConnect(BaseOutputPin *base)
static const BaseOutputPinFuncTable AviMuxOut_BaseOutputFuncTable = {
{
NULL,
AviMuxOut_CheckMediaType,
AviMuxOut_AttemptConnection,
AviMuxOut_GetMediaTypeVersion,
AviMuxOut_GetMediaType

View File

@ -499,6 +499,12 @@ static const IPinVtbl SmartTeeFilterCaptureVtbl = {
BasePinImpl_NewSegment
};
static HRESULT WINAPI SmartTeeFilterCapture_CheckMediaType(BasePin *base, const AM_MEDIA_TYPE *amt)
{
FIXME("(%p) stub\n", base);
return S_OK;
}
static LONG WINAPI SmartTeeFilterCapture_GetMediaTypeVersion(BasePin *base)
{
SmartTeeFilter *This = impl_from_BasePin(base);
@ -535,7 +541,7 @@ static HRESULT WINAPI SmartTeeFilterCapture_BreakConnect(BaseOutputPin *base)
static const BaseOutputPinFuncTable SmartTeeFilterCaptureFuncs = {
{
NULL,
SmartTeeFilterCapture_CheckMediaType,
BaseOutputPinImpl_AttemptConnection,
SmartTeeFilterCapture_GetMediaTypeVersion,
SmartTeeFilterCapture_GetMediaType
@ -592,6 +598,12 @@ static const IPinVtbl SmartTeeFilterPreviewVtbl = {
BasePinImpl_NewSegment
};
static HRESULT WINAPI SmartTeeFilterPreview_CheckMediaType(BasePin *base, const AM_MEDIA_TYPE *amt)
{
FIXME("(%p) stub\n", base);
return S_OK;
}
static LONG WINAPI SmartTeeFilterPreview_GetMediaTypeVersion(BasePin *base)
{
SmartTeeFilter *This = impl_from_BasePin(base);
@ -628,7 +640,7 @@ static HRESULT WINAPI SmartTeeFilterPreview_BreakConnect(BaseOutputPin *base)
static const BaseOutputPinFuncTable SmartTeeFilterPreviewFuncs = {
{
NULL,
SmartTeeFilterPreview_CheckMediaType,
BaseOutputPinImpl_AttemptConnection,
SmartTeeFilterPreview_GetMediaTypeVersion,
SmartTeeFilterPreview_GetMediaType

View File

@ -665,6 +665,12 @@ static inline VfwPinImpl *impl_from_BasePin(BasePin *pin)
return CONTAINING_RECORD(pin, VfwPinImpl, pin.pin);
}
static HRESULT WINAPI VfwPin_CheckMediaType(BasePin *pin, const AM_MEDIA_TYPE *amt)
{
FIXME("(%p) stub\n", pin);
return E_NOTIMPL;
}
static HRESULT WINAPI VfwPin_GetMediaType(BasePin *pin, int iPosition, AM_MEDIA_TYPE *pmt)
{
VfwPinImpl *This = impl_from_BasePin(pin);
@ -707,7 +713,7 @@ static HRESULT WINAPI VfwPin_DecideBufferSize(BaseOutputPin *iface, IMemAllocato
static const BaseOutputPinFuncTable output_BaseOutputFuncTable = {
{
NULL,
VfwPin_CheckMediaType,
BaseOutputPinImpl_AttemptConnection,
VfwPin_GetMediaTypeVersion,
VfwPin_GetMediaType

View File

@ -783,12 +783,11 @@ static inline FileAsyncReader *impl_from_IAsyncReader(IAsyncReader *iface)
return CONTAINING_RECORD(iface, FileAsyncReader, IAsyncReader_iface);
}
static HRESULT WINAPI FileAsyncReaderPin_QueryAccept(IPin *iface, const AM_MEDIA_TYPE *pmt)
static HRESULT WINAPI FileAsyncReaderPin_CheckMediaType(BasePin *pin, const AM_MEDIA_TYPE *pmt)
{
FileAsyncReader *This = impl_from_IPin(iface);
AM_MEDIA_TYPE *pmt_filter = impl_from_IBaseFilter(This->pin.pin.pinInfo.pFilter)->pmt;
AM_MEDIA_TYPE *pmt_filter = impl_from_IBaseFilter(pin->pinInfo.pFilter)->pmt;
FIXME("(%p, %p)\n", iface, pmt);
FIXME("(%p, %p)\n", pin, pmt);
if (IsEqualGUID(&pmt->majortype, &pmt_filter->majortype) &&
IsEqualGUID(&pmt->subtype, &pmt_filter->subtype) &&
@ -874,7 +873,7 @@ static const IPinVtbl FileAsyncReaderPin_Vtbl =
BasePinImpl_QueryPinInfo,
BasePinImpl_QueryDirection,
BasePinImpl_QueryId,
FileAsyncReaderPin_QueryAccept,
BasePinImpl_QueryAccept,
BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections,
BaseOutputPinImpl_EndOfStream,
@ -933,7 +932,7 @@ static HRESULT WINAPI FileAsyncReaderPin_DecideBufferSize(BaseOutputPin *iface,
static const BaseOutputPinFuncTable output_BaseOutputFuncTable = {
{
NULL,
FileAsyncReaderPin_CheckMediaType,
FileAsyncReaderPin_AttemptConnection,
BasePinImpl_GetMediaTypeVersion,
FileAsyncReaderPin_GetMediaType

View File

@ -44,6 +44,7 @@ static HRESULT WINAPI Parser_ChangeStart(IMediaSeeking *iface);
static HRESULT WINAPI Parser_ChangeStop(IMediaSeeking *iface);
static HRESULT WINAPI Parser_ChangeRate(IMediaSeeking *iface);
static HRESULT WINAPI Parser_OutputPin_DecideBufferSize(BaseOutputPin *iface, IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest);
static HRESULT WINAPI Parser_OutputPin_CheckMediaType(BasePin *pin, const AM_MEDIA_TYPE *pmt);
static HRESULT WINAPI Parser_OutputPin_GetMediaType(BasePin *iface, int iPosition, AM_MEDIA_TYPE *pmt);
static HRESULT WINAPI Parser_OutputPin_DecideAllocator(BaseOutputPin *This, IMemInputPin *pPin, IMemAllocator **pAlloc);
static HRESULT WINAPI Parser_OutputPin_BreakConnect(BaseOutputPin *This);
@ -428,7 +429,7 @@ HRESULT WINAPI Parser_QueryVendorInfo(IBaseFilter * iface, LPWSTR *pVendorInfo)
static const BaseOutputPinFuncTable output_BaseOutputFuncTable = {
{
NULL,
Parser_OutputPin_CheckMediaType,
BaseOutputPinImpl_AttemptConnection,
BasePinImpl_GetMediaTypeVersion,
Parser_OutputPin_GetMediaType
@ -695,11 +696,10 @@ static HRESULT WINAPI Parser_OutputPin_Connect(IPin * iface, IPin * pReceivePin,
return BaseOutputPinImpl_Connect(iface, pReceivePin, pmt);
}
static HRESULT WINAPI Parser_OutputPin_QueryAccept(IPin *iface, const AM_MEDIA_TYPE * pmt)
static HRESULT WINAPI Parser_OutputPin_CheckMediaType(BasePin *pin, const AM_MEDIA_TYPE *pmt)
{
Parser_OutputPin *This = unsafe_impl_Parser_OutputPin_from_IPin(iface);
Parser_OutputPin *This = (Parser_OutputPin *)pin;
TRACE("()\n");
dump_AM_MEDIA_TYPE(pmt);
return (memcmp(This->pmt, pmt, sizeof(AM_MEDIA_TYPE)) == 0);
@ -718,7 +718,7 @@ static const IPinVtbl Parser_OutputPin_Vtbl =
BasePinImpl_QueryPinInfo,
BasePinImpl_QueryDirection,
BasePinImpl_QueryId,
Parser_OutputPin_QueryAccept,
BasePinImpl_QueryAccept,
BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections,
BaseOutputPinImpl_EndOfStream,

View File

@ -310,9 +310,11 @@ HRESULT WINAPI BasePinImpl_QueryId(IPin * iface, LPWSTR * Id)
HRESULT WINAPI BasePinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt)
{
BasePin *This = impl_from_IPin(iface);
TRACE("(%p)->(%p)\n", iface, pmt);
return S_OK;
return (This->pFuncsTable->pfnCheckMediaType(This, pmt) == S_OK ? S_OK : S_FALSE);
}
HRESULT WINAPI BasePinImpl_EnumMediaTypes(IPin * iface, IEnumMediaTypes ** ppEnum)
@ -933,15 +935,6 @@ static HRESULT deliver_endofstream(IPin* pin, LPVOID unused)
return IPin_EndOfStream( pin );
}
HRESULT WINAPI BaseInputPinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt)
{
BaseInputPin *This = impl_BaseInputPin_from_IPin(iface);
TRACE("(%p/%p)->(%p)\n", This, iface, pmt);
return (This->pin.pFuncsTable->pfnCheckMediaType(&This->pin, pmt) == S_OK ? S_OK : S_FALSE);
}
HRESULT WINAPI BaseInputPinImpl_EndOfStream(IPin * iface)
{
HRESULT hr = S_OK;

View File

@ -185,7 +185,7 @@ static const IPinVtbl BaseRenderer_InputPin_Vtbl =
BasePinImpl_QueryPinInfo,
BasePinImpl_QueryDirection,
BasePinImpl_QueryId,
BaseInputPinImpl_QueryAccept,
BasePinImpl_QueryAccept,
BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections,
BaseRenderer_InputPin_EndOfStream,

View File

@ -120,12 +120,10 @@ static HRESULT WINAPI TransformFilter_Input_Receive(BaseInputPin *This, IMediaSa
return hr;
}
static HRESULT WINAPI TransformFilter_Output_QueryAccept(IPin *iface, const AM_MEDIA_TYPE * pmt)
static HRESULT WINAPI TransformFilter_Output_CheckMediaType(BasePin *This, const AM_MEDIA_TYPE *pmt)
{
BasePin *This = impl_BasePin_from_IPin(iface);
TransformFilter *pTransformFilter = impl_from_IBaseFilter(This->pinInfo.pFilter);
AM_MEDIA_TYPE* outpmt = &pTransformFilter->pmt;
TRACE("%p\n", iface);
if (IsEqualIID(&pmt->majortype, &outpmt->majortype)
&& (IsEqualIID(&pmt->subtype, &outpmt->subtype) || IsEqualIID(&outpmt->subtype, &GUID_NULL)))
@ -186,7 +184,7 @@ static const BaseInputPinFuncTable tf_input_BaseInputFuncTable = {
static const BaseOutputPinFuncTable tf_output_BaseOutputFuncTable = {
{
NULL,
TransformFilter_Output_CheckMediaType,
BaseOutputPinImpl_AttemptConnection,
BasePinImpl_GetMediaTypeVersion,
TransformFilter_Output_GetMediaType
@ -571,7 +569,7 @@ static const IPinVtbl TransformFilter_InputPin_Vtbl =
BasePinImpl_QueryPinInfo,
BasePinImpl_QueryDirection,
BasePinImpl_QueryId,
BaseInputPinImpl_QueryAccept,
BasePinImpl_QueryAccept,
BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections,
TransformFilter_InputPin_EndOfStream,
@ -593,7 +591,7 @@ static const IPinVtbl TransformFilter_OutputPin_Vtbl =
BasePinImpl_QueryPinInfo,
BasePinImpl_QueryDirection,
BasePinImpl_QueryId,
TransformFilter_Output_QueryAccept,
BasePinImpl_QueryAccept,
BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections,
BaseOutputPinImpl_EndOfStream,

View File

@ -598,13 +598,6 @@ static DWORD CALLBACK push_data(LPVOID iface)
return 0;
}
static HRESULT WINAPI GST_OutPin_QueryAccept(IPin *iface, const AM_MEDIA_TYPE *pmt)
{
GSTOutPin *pin = (GSTOutPin*)iface;
FIXME("stub %p\n", pin);
return S_OK;
}
static GstFlowReturn got_data_sink(GstPad *pad, GstObject *parent, GstBuffer *buf)
{
GSTOutPin *pin = gst_pad_get_element_private(pad);
@ -1787,6 +1780,12 @@ static ULONG WINAPI GSTOutPin_Release(IPin *iface)
return refCount;
}
static HRESULT WINAPI GSTOutPin_CheckMediaType(BasePin *base, const AM_MEDIA_TYPE *amt)
{
FIXME("(%p) stub\n", base);
return S_OK;
}
static HRESULT WINAPI GSTOutPin_GetMediaType(BasePin *iface, int iPosition, AM_MEDIA_TYPE *pmt)
{
GSTOutPin *This = (GSTOutPin *)iface;
@ -1867,7 +1866,7 @@ static const IPinVtbl GST_OutputPin_Vtbl = {
BasePinImpl_QueryPinInfo,
BasePinImpl_QueryDirection,
BasePinImpl_QueryId,
GST_OutPin_QueryAccept,
BasePinImpl_QueryAccept,
BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections,
BaseOutputPinImpl_EndOfStream,
@ -1878,7 +1877,7 @@ static const IPinVtbl GST_OutputPin_Vtbl = {
static const BaseOutputPinFuncTable output_BaseOutputFuncTable = {
{
NULL,
GSTOutPin_CheckMediaType,
BaseOutputPinImpl_AttemptConnection,
BasePinImpl_GetMediaTypeVersion,
GSTOutPin_GetMediaType

View File

@ -1388,6 +1388,12 @@ static ULONG WINAPI QTOutPin_Release(IPin *iface)
return refCount;
}
static HRESULT WINAPI QTOutPin_CheckMediaType(BasePin *base, const AM_MEDIA_TYPE *amt)
{
FIXME("(%p) stub\n", base);
return S_OK;
}
static HRESULT WINAPI QTOutPin_GetMediaType(BasePin *iface, int iPosition, AM_MEDIA_TYPE *pmt)
{
QTOutPin *This = impl_QTOutPin_from_BasePin(iface);
@ -1516,7 +1522,7 @@ static const IQualityControlVtbl QTOutPin_QualityControl_Vtbl = {
static const BaseOutputPinFuncTable output_BaseOutputFuncTable = {
{
NULL,
QTOutPin_CheckMediaType,
BaseOutputPinImpl_AttemptConnection,
BasePinImpl_GetMediaTypeVersion,
QTOutPin_GetMediaType