Skip to content

Commit

Permalink
strmbase: Implement QueryAccept() on top of CheckMediaType() for outp…
Browse files Browse the repository at this point in the history
…ut pins too.

Signed-off-by: Zebediah Figura <[email protected]>
Signed-off-by: Alexandre Julliard <[email protected]>
  • Loading branch information
zfigura authored and julliard committed May 4, 2018
1 parent af717f3 commit 10ff8f3
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 44 deletions.
4 changes: 2 additions & 2 deletions dlls/amstream/mediastream.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 7 additions & 1 deletion dlls/qcap/avimux.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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
Expand Down
16 changes: 14 additions & 2 deletions dlls/qcap/smartteefilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -535,7 +541,7 @@ static HRESULT WINAPI SmartTeeFilterCapture_BreakConnect(BaseOutputPin *base)

static const BaseOutputPinFuncTable SmartTeeFilterCaptureFuncs = {
{
NULL,
SmartTeeFilterCapture_CheckMediaType,
BaseOutputPinImpl_AttemptConnection,
SmartTeeFilterCapture_GetMediaTypeVersion,
SmartTeeFilterCapture_GetMediaType
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -628,7 +640,7 @@ static HRESULT WINAPI SmartTeeFilterPreview_BreakConnect(BaseOutputPin *base)

static const BaseOutputPinFuncTable SmartTeeFilterPreviewFuncs = {
{
NULL,
SmartTeeFilterPreview_CheckMediaType,
BaseOutputPinImpl_AttemptConnection,
SmartTeeFilterPreview_GetMediaTypeVersion,
SmartTeeFilterPreview_GetMediaType
Expand Down
8 changes: 7 additions & 1 deletion dlls/qcap/vfwcapture.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down
11 changes: 5 additions & 6 deletions dlls/quartz/filesource.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions dlls/quartz/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand All @@ -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,
Expand Down
13 changes: 3 additions & 10 deletions dlls/strmbase/pin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion dlls/strmbase/renderer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 4 additions & 6 deletions dlls/strmbase/transform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
17 changes: 8 additions & 9 deletions dlls/winegstreamer/gstdemux.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand All @@ -1878,7 +1877,7 @@ static const IPinVtbl GST_OutputPin_Vtbl = {

static const BaseOutputPinFuncTable output_BaseOutputFuncTable = {
{
NULL,
GSTOutPin_CheckMediaType,
BaseOutputPinImpl_AttemptConnection,
BasePinImpl_GetMediaTypeVersion,
GSTOutPin_GetMediaType
Expand Down
8 changes: 7 additions & 1 deletion dlls/wineqtdecoder/qtsplitter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -1516,7 +1522,7 @@ static const IQualityControlVtbl QTOutPin_QualityControl_Vtbl = {

static const BaseOutputPinFuncTable output_BaseOutputFuncTable = {
{
NULL,
QTOutPin_CheckMediaType,
BaseOutputPinImpl_AttemptConnection,
BasePinImpl_GetMediaTypeVersion,
QTOutPin_GetMediaType
Expand Down

0 comments on commit 10ff8f3

Please sign in to comment.