Commit 765cb748 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

strmbase: Get rid of the BaseOutputPinFuncTable typedef.

parent c585931d
......@@ -579,7 +579,8 @@ static HRESULT WINAPI AVICompressorOut_DecideAllocator(struct strmbase_source *b
return BaseOutputPinImpl_DecideAllocator(base, pPin, pAlloc);
}
static const BaseOutputPinFuncTable AVICompressorBaseOutputPinVtbl = {
static const struct strmbase_source_ops source_ops =
{
{
NULL,
AVICompressorOut_GetMediaType
......@@ -608,7 +609,7 @@ IUnknown* WINAPI QCAP_createAVICompressor(IUnknown *outer, HRESULT *phr)
strmbase_sink_init(&compressor->sink, &AVICompressorInputPinVtbl,
&compressor->filter, sink_name, &AVICompressorBaseInputPinVtbl, NULL);
strmbase_source_init(&compressor->source, &AVICompressorOutputPinVtbl,
&compressor->filter, source_name, &AVICompressorBaseOutputPinVtbl);
&compressor->filter, source_name, &source_ops);
*phr = S_OK;
return &compressor->filter.IUnknown_inner;
......
......@@ -1221,7 +1221,8 @@ static HRESULT WINAPI AviMuxOut_DecideAllocator(struct strmbase_source *base,
return IMemInputPin_NotifyAllocator(pPin, *pAlloc, TRUE);
}
static const BaseOutputPinFuncTable AviMuxOut_BaseOutputFuncTable = {
static const struct strmbase_source_ops source_ops =
{
{
AviMuxOut_CheckMediaType,
AviMuxOut_GetMediaType
......@@ -2018,7 +2019,7 @@ IUnknown * WINAPI QCAP_createAVIMux(IUnknown *outer, HRESULT *phr)
info.pFilter = &avimux->filter.IBaseFilter_iface;
lstrcpyW(info.achName, output_name);
strmbase_source_init(&avimux->source, &AviMuxOut_PinVtbl, &avimux->filter,
output_name, &AviMuxOut_BaseOutputFuncTable);
output_name, &source_ops);
avimux->IQualityControl_iface.lpVtbl = &AviMuxOut_QualityControlVtbl;
avimux->cur_stream = 0;
avimux->cur_time = 0;
......
......@@ -389,7 +389,8 @@ static HRESULT WINAPI SmartTeeFilterCapture_DecideAllocator(struct strmbase_sour
return IMemInputPin_NotifyAllocator(pPin, This->sink.pAllocator, TRUE);
}
static const BaseOutputPinFuncTable SmartTeeFilterCaptureFuncs = {
static const struct strmbase_source_ops capture_ops =
{
{
SmartTeeFilterCapture_CheckMediaType,
SmartTeeFilterCapture_GetMediaType
......@@ -461,7 +462,8 @@ static HRESULT WINAPI SmartTeeFilterPreview_DecideAllocator(struct strmbase_sour
return IMemInputPin_NotifyAllocator(pPin, This->sink.pAllocator, TRUE);
}
static const BaseOutputPinFuncTable SmartTeeFilterPreviewFuncs = {
static const struct strmbase_source_ops preview_ops =
{
{
SmartTeeFilterPreview_CheckMediaType,
SmartTeeFilterPreview_GetMediaType
......@@ -498,9 +500,9 @@ IUnknown* WINAPI QCAP_createSmartTeeFilter(IUnknown *outer, HRESULT *phr)
}
strmbase_source_init(&object->capture, &SmartTeeFilterCaptureVtbl,
&object->filter, captureW, &SmartTeeFilterCaptureFuncs);
&object->filter, captureW, &capture_ops);
strmbase_source_init(&object->preview, &SmartTeeFilterPreviewVtbl,
&object->filter, previewW, &SmartTeeFilterPreviewFuncs);
&object->filter, previewW, &preview_ops);
*phr = S_OK;
return &object->filter.IUnknown_inner;
......
......@@ -554,7 +554,8 @@ static HRESULT WINAPI VfwPin_DecideBufferSize(struct strmbase_source *iface,
return IMemAllocator_SetProperties(pAlloc, ppropInputRequest, &actual);
}
static const BaseOutputPinFuncTable output_BaseOutputFuncTable = {
static const struct strmbase_source_ops source_ops =
{
{
VfwPin_CheckMediaType,
VfwPin_GetMediaType
......@@ -651,7 +652,7 @@ IUnknown * WINAPI QCAP_createVFWCaptureFilter(IUnknown *outer, HRESULT *phr)
object->init = FALSE;
strmbase_source_init(&object->source, &VfwPin_Vtbl, &object->filter,
source_name, &output_BaseOutputFuncTable);
source_name, &source_ops);
object->IKsPropertySet_iface.lpVtbl = &IKsPropertySet_VTable;
......
......@@ -79,7 +79,7 @@ typedef struct AsyncReader
} AsyncReader;
static const IPinVtbl FileAsyncReaderPin_Vtbl;
static const BaseOutputPinFuncTable output_BaseOutputFuncTable;
static const struct strmbase_source_ops source_ops;
static inline AsyncReader *impl_from_strmbase_filter(struct strmbase_filter *iface)
{
......@@ -489,7 +489,7 @@ static HRESULT WINAPI FileSource_Load(IFileSourceFilter * iface, LPCOLESTR pszFi
}
strmbase_source_init(&This->source, &FileAsyncReaderPin_Vtbl, &This->filter,
wszOutputPinName, &output_BaseOutputFuncTable);
wszOutputPinName, &source_ops);
BaseFilterImpl_IncrementPinVersion(&This->filter);
This->file = hFile;
......@@ -702,7 +702,8 @@ static HRESULT WINAPI FileAsyncReaderPin_DecideBufferSize(struct strmbase_source
return IMemAllocator_SetProperties(pAlloc, &This->allocProps, &actual);
}
static const BaseOutputPinFuncTable output_BaseOutputFuncTable = {
static const struct strmbase_source_ops source_ops =
{
{
FileAsyncReaderPin_CheckMediaType,
FileAsyncReaderPin_GetMediaType
......
......@@ -334,7 +334,8 @@ HRESULT WINAPI Parser_SetSyncSource(IBaseFilter * iface, IReferenceClock *pClock
return S_OK;
}
static const BaseOutputPinFuncTable output_BaseOutputFuncTable = {
static const struct strmbase_source_ops source_ops =
{
{
Parser_OutputPin_CheckMediaType,
Parser_OutputPin_GetMediaType
......@@ -360,7 +361,7 @@ HRESULT Parser_AddPin(ParserImpl *filter, const WCHAR *name,
filter->sources[filter->cStreams] = object;
strmbase_source_init(&object->pin, &Parser_OutputPin_Vtbl, &filter->filter,
name, &output_BaseOutputFuncTable);
name, &source_ops);
object->pmt = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE));
CopyMediaType(object->pmt, mt);
......
......@@ -708,7 +708,7 @@ HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(struct strmbase_source *This,
}
void strmbase_source_init(struct strmbase_source *pin, const IPinVtbl *vtbl, struct strmbase_filter *filter,
const WCHAR *name, const BaseOutputPinFuncTable *func_table)
const WCHAR *name, const struct strmbase_source_ops *func_table)
{
memset(pin, 0, sizeof(*pin));
pin->pin.IPin_iface.lpVtbl = vtbl;
......
......@@ -171,7 +171,8 @@ static const BaseInputPinFuncTable tf_input_BaseInputFuncTable = {
TransformFilter_Input_Receive
};
static const BaseOutputPinFuncTable tf_output_BaseOutputFuncTable = {
static const struct strmbase_source_ops source_ops =
{
{
TransformFilter_Output_CheckMediaType,
TransformFilter_Output_GetMediaType
......@@ -290,7 +291,7 @@ static HRESULT strmbase_transform_init(IUnknown *outer, const CLSID *clsid,
wcsInputPinName, &tf_input_BaseInputFuncTable, NULL);
strmbase_source_init(&filter->source, &TransformFilter_OutputPin_Vtbl, &filter->filter,
wcsOutputPinName, &tf_output_BaseOutputFuncTable);
wcsOutputPinName, &source_ops);
QualityControlImpl_Create(&filter->sink.pin.IPin_iface,
&filter->filter.IBaseFilter_iface, &filter->qcimpl);
......
......@@ -1745,7 +1745,8 @@ static const IPinVtbl GST_OutputPin_Vtbl = {
BasePinImpl_NewSegment
};
static const BaseOutputPinFuncTable output_BaseOutputFuncTable = {
static const struct strmbase_source_ops source_ops =
{
{
GSTOutPin_CheckMediaType,
GSTOutPin_GetMediaType
......@@ -1767,7 +1768,7 @@ static BOOL create_pin(GSTImpl *filter, const WCHAR *name, const AM_MEDIA_TYPE *
return FALSE;
strmbase_source_init(&pin->pin, &GST_OutputPin_Vtbl, &filter->filter, name,
&output_BaseOutputFuncTable);
&source_ops);
pin->pmt = heap_alloc(sizeof(AM_MEDIA_TYPE));
CopyMediaType(pin->pmt, mt);
pin->caps_event = CreateEventW(NULL, FALSE, FALSE, NULL);
......
......@@ -1408,7 +1408,8 @@ static const IQualityControlVtbl QTOutPin_QualityControl_Vtbl = {
QT_QualityControl_SetSink
};
static const BaseOutputPinFuncTable output_BaseOutputFuncTable = {
static const struct strmbase_source_ops source_ops =
{
{
QTOutPin_CheckMediaType,
QTOutPin_GetMediaType
......@@ -1436,7 +1437,7 @@ static HRESULT QT_AddPin(QTSplitter *filter, const WCHAR *name,
filter->pAudio_Pin = pin;
strmbase_source_init(&pin->pin, &QT_OutputPin_Vtbl, &filter->filter, name,
&output_BaseOutputFuncTable);
&source_ops);
pin->pmt = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE));
CopyMediaType(pin->pmt, mt);
pin->IQualityControl_iface.lpVtbl = &QTOutPin_QualityControl_Vtbl;
......
......@@ -60,14 +60,15 @@ struct strmbase_source
IMemInputPin * pMemInputPin;
IMemAllocator * pAllocator;
const struct BaseOutputPinFuncTable* pFuncsTable;
const struct strmbase_source_ops *pFuncsTable;
};
typedef HRESULT (WINAPI *BaseOutputPin_AttemptConnection)(struct strmbase_source *pin, IPin *peer, const AM_MEDIA_TYPE *mt);
typedef HRESULT (WINAPI *BaseOutputPin_DecideBufferSize)(struct strmbase_source *pin, IMemAllocator *allocator, ALLOCATOR_PROPERTIES *props);
typedef HRESULT (WINAPI *BaseOutputPin_DecideAllocator)(struct strmbase_source *pin, IMemInputPin *peer, IMemAllocator **allocator);
typedef struct BaseOutputPinFuncTable {
struct strmbase_source_ops
{
BasePinFuncTable base;
/* Required for Connect(). */
......@@ -76,7 +77,7 @@ typedef struct BaseOutputPinFuncTable {
BaseOutputPin_DecideBufferSize pfnDecideBufferSize;
/* Required for BaseOutputPinImpl_AttemptConnection */
BaseOutputPin_DecideAllocator pfnDecideAllocator;
} BaseOutputPinFuncTable;
};
typedef struct BaseInputPin
{
......@@ -135,7 +136,7 @@ HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(struct strmbase_source *pin,
void strmbase_source_cleanup(struct strmbase_source *pin);
void strmbase_source_init(struct strmbase_source *pin, const IPinVtbl *vtbl, struct strmbase_filter *filter,
const WCHAR *name, const BaseOutputPinFuncTable *func_table);
const WCHAR *name, const struct strmbase_source_ops *func_table);
/* Base Input Pin */
HRESULT WINAPI BaseInputPinImpl_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment