winegstreamer: Use BasePinImpl_QueryAccept() and BasePinImpl_EnumMediaTypes().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-09-12 14:28:27 -05:00 committed by Alexandre Julliard
parent 765cb748a8
commit 9c92c0bf19
1 changed files with 16 additions and 21 deletions

View File

@ -1211,6 +1211,19 @@ static const struct strmbase_filter_ops filter_ops =
.filter_destroy = gstdemux_destroy, .filter_destroy = gstdemux_destroy,
}; };
static HRESULT WINAPI sink_CheckMediaType(BasePin *iface, const AM_MEDIA_TYPE *mt)
{
if (IsEqualGUID(&mt->majortype, &MEDIATYPE_Stream))
return S_OK;
return S_FALSE;
}
static const BasePinFuncTable sink_ops =
{
.pfnCheckMediaType = sink_CheckMediaType,
.pfnGetMediaType = BasePinImpl_GetMediaType,
};
IUnknown * CALLBACK Gstreamer_Splitter_create(IUnknown *outer, HRESULT *phr) IUnknown * CALLBACK Gstreamer_Splitter_create(IUnknown *outer, HRESULT *phr)
{ {
GSTImpl *object; GSTImpl *object;
@ -1236,6 +1249,7 @@ IUnknown * CALLBACK Gstreamer_Splitter_create(IUnknown *outer, HRESULT *phr)
object->sink.filter = &object->filter; object->sink.filter = &object->filter;
lstrcpynW(object->sink.name, wcsInputPinName, ARRAY_SIZE(object->sink.name)); lstrcpynW(object->sink.name, wcsInputPinName, ARRAY_SIZE(object->sink.name));
object->sink.IPin_iface.lpVtbl = &GST_InputPin_Vtbl; object->sink.IPin_iface.lpVtbl = &GST_InputPin_Vtbl;
object->sink.pFuncsTable = &sink_ops;
*phr = S_OK; *phr = S_OK;
TRACE("Created GStreamer demuxer %p.\n", object); TRACE("Created GStreamer demuxer %p.\n", object);
@ -1916,16 +1930,6 @@ static HRESULT WINAPI GSTInPin_Disconnect(IPin *iface)
return hr; return hr;
} }
static HRESULT WINAPI GSTInPin_QueryAccept(IPin *iface, const AM_MEDIA_TYPE *pmt)
{
TRACE("iface %p, mt %p.\n", iface, pmt);
dump_AM_MEDIA_TYPE(pmt);
if (IsEqualIID(&pmt->majortype, &MEDIATYPE_Stream))
return S_OK;
return S_FALSE;
}
static HRESULT WINAPI GSTInPin_EndOfStream(IPin *iface) static HRESULT WINAPI GSTInPin_EndOfStream(IPin *iface)
{ {
FIXME("iface %p, stub!\n", iface); FIXME("iface %p, stub!\n", iface);
@ -1982,15 +1986,6 @@ static HRESULT WINAPI GSTInPin_QueryInterface(IPin * iface, REFIID riid, LPVOID
return E_NOINTERFACE; return E_NOINTERFACE;
} }
static HRESULT WINAPI GSTInPin_EnumMediaTypes(IPin *iface, IEnumMediaTypes **ppEnum)
{
BasePin *This = (BasePin *)iface;
TRACE("(%p/%p)->(%p)\n", This, iface, ppEnum);
return EnumMediaTypes_Construct(This, BasePinImpl_GetMediaType, BasePinImpl_GetMediaTypeVersion, ppEnum);
}
static const IPinVtbl GST_InputPin_Vtbl = { static const IPinVtbl GST_InputPin_Vtbl = {
GSTInPin_QueryInterface, GSTInPin_QueryInterface,
BasePinImpl_AddRef, BasePinImpl_AddRef,
@ -2003,8 +1998,8 @@ static const IPinVtbl GST_InputPin_Vtbl = {
BasePinImpl_QueryPinInfo, BasePinImpl_QueryPinInfo,
BasePinImpl_QueryDirection, BasePinImpl_QueryDirection,
BasePinImpl_QueryId, BasePinImpl_QueryId,
GSTInPin_QueryAccept, BasePinImpl_QueryAccept,
GSTInPin_EnumMediaTypes, BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections, BasePinImpl_QueryInternalConnections,
GSTInPin_EndOfStream, GSTInPin_EndOfStream,
GSTInPin_BeginFlush, GSTInPin_BeginFlush,