Commit b10a328b authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

strmbase: Rename the "pFuncsTable" member of struct strmbase_pin to "ops".

parent 9642f359
......@@ -57,7 +57,7 @@ static HRESULT enum_media_types_create(struct strmbase_pin *pin, IEnumMediaTypes
object->pin = pin;
IPin_AddRef(&pin->IPin_iface);
while (pin->pFuncsTable->pin_get_media_type(pin, object->count, &mt) == S_OK)
while (pin->ops->pin_get_media_type(pin, object->count, &mt) == S_OK)
{
FreeMediaType(&mt);
++object->count;
......@@ -124,7 +124,7 @@ static HRESULT WINAPI enum_media_types_Next(IEnumMediaTypes *iface, ULONG count,
for (i = 0; i < count; ++i)
{
if ((mts[i] = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE))))
hr = enummt->pin->pFuncsTable->pin_get_media_type(enummt->pin, enummt->index + i, mts[i]);
hr = enummt->pin->ops->pin_get_media_type(enummt->pin, enummt->index + i, mts[i]);
else
hr = E_OUTOFMEMORY;
if (FAILED(hr))
......@@ -169,7 +169,7 @@ static HRESULT WINAPI enum_media_types_Reset(IEnumMediaTypes *iface)
TRACE("enummt %p.\n", enummt);
enummt->count = 0;
while (enummt->pin->pFuncsTable->pin_get_media_type(enummt->pin, enummt->count, &mt) == S_OK)
while (enummt->pin->ops->pin_get_media_type(enummt->pin, enummt->count, &mt) == S_OK)
{
FreeMediaType(&mt);
++enummt->count;
......@@ -267,8 +267,7 @@ static HRESULT WINAPI pin_QueryInterface(IPin *iface, REFIID iid, void **out)
*out = NULL;
if (pin->pFuncsTable->pin_query_interface
&& SUCCEEDED(hr = pin->pFuncsTable->pin_query_interface(pin, iid, out)))
if (pin->ops->pin_query_interface && SUCCEEDED(hr = pin->ops->pin_query_interface(pin, iid, out)))
return hr;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IPin))
......@@ -392,7 +391,7 @@ static HRESULT WINAPI pin_QueryAccept(IPin *iface, const AM_MEDIA_TYPE *mt)
TRACE("pin %p %s:%s, mt %p.\n", pin, debugstr_w(pin->filter->name), debugstr_w(pin->name), mt);
strmbase_dump_media_type(mt);
return (pin->pFuncsTable->pin_query_accept(pin, mt) == S_OK ? S_OK : S_FALSE);
return (pin->ops->pin_query_accept(pin, mt) == S_OK ? S_OK : S_FALSE);
}
static HRESULT WINAPI pin_EnumMediaTypes(IPin *iface, IEnumMediaTypes **enum_media_types)
......@@ -404,7 +403,7 @@ static HRESULT WINAPI pin_EnumMediaTypes(IPin *iface, IEnumMediaTypes **enum_med
TRACE("pin %p %s:%s, enum_media_types %p.\n", pin, debugstr_w(pin->filter->name),
debugstr_w(pin->name), enum_media_types);
if (FAILED(hr = pin->pFuncsTable->pin_get_media_type(pin, 0, &mt)))
if (FAILED(hr = pin->ops->pin_get_media_type(pin, 0, &mt)))
return hr;
if (hr == S_OK)
FreeMediaType(&mt);
......@@ -791,7 +790,7 @@ void strmbase_source_init(struct strmbase_source *pin, struct strmbase_filter *f
pin->pin.filter = filter;
pin->pin.dir = PINDIR_OUTPUT;
lstrcpyW(pin->pin.name, name);
pin->pin.pFuncsTable = &func_table->base;
pin->pin.ops = &func_table->base;
pin->pFuncsTable = func_table;
}
......@@ -844,7 +843,7 @@ static HRESULT WINAPI sink_ReceiveConnection(IPin *iface, IPin *pReceivePin, con
if (This->pin.peer)
hr = VFW_E_ALREADY_CONNECTED;
if (SUCCEEDED(hr) && This->pin.pFuncsTable->pin_query_accept(&This->pin, pmt) != S_OK)
if (SUCCEEDED(hr) && This->pin.ops->pin_query_accept(&This->pin, pmt) != S_OK)
hr = VFW_E_TYPE_NOT_ACCEPTED; /* FIXME: shouldn't we just map common errors onto
* VFW_E_TYPE_NOT_ACCEPTED and pass the value on otherwise? */
......@@ -1171,7 +1170,7 @@ void strmbase_sink_init(struct strmbase_sink *pin, struct strmbase_filter *filte
pin->pin.filter = filter;
pin->pin.dir = PINDIR_INPUT;
lstrcpyW(pin->pin.name, name);
pin->pin.pFuncsTable = &func_table->base;
pin->pin.ops = &func_table->base;
pin->pFuncsTable = func_table;
pin->pAllocator = pin->preferred_allocator = allocator;
if (pin->preferred_allocator)
......
......@@ -39,16 +39,17 @@ struct strmbase_pin
IPin *peer;
AM_MEDIA_TYPE mt;
const struct BasePinFuncTable* pFuncsTable;
const struct strmbase_pin_ops *ops;
};
typedef struct BasePinFuncTable {
struct strmbase_pin_ops
{
/* Required for QueryAccept(), Connect(), ReceiveConnection(). */
HRESULT (*pin_query_accept)(struct strmbase_pin *pin, const AM_MEDIA_TYPE *mt);
/* Required for EnumMediaTypes(). */
HRESULT (*pin_get_media_type)(struct strmbase_pin *pin, unsigned int index, AM_MEDIA_TYPE *mt);
HRESULT (*pin_query_interface)(struct strmbase_pin *pin, REFIID iid, void **out);
} BasePinFuncTable;
};
struct strmbase_source
{
......@@ -65,14 +66,14 @@ typedef HRESULT (WINAPI *BaseOutputPin_DecideAllocator)(struct strmbase_source *
struct strmbase_source_ops
{
BasePinFuncTable base;
/* Required for Connect(). */
BaseOutputPin_AttemptConnection pfnAttemptConnection;
/* Required for BaseOutputPinImpl_DecideAllocator */
BaseOutputPin_DecideBufferSize pfnDecideBufferSize;
/* Required for BaseOutputPinImpl_AttemptConnection */
BaseOutputPin_DecideAllocator pfnDecideAllocator;
struct strmbase_pin_ops base;
/* Required for Connect(). */
BaseOutputPin_AttemptConnection pfnAttemptConnection;
/* Required for BaseOutputPinImpl_DecideAllocator */
BaseOutputPin_DecideBufferSize pfnDecideBufferSize;
/* Required for BaseOutputPinImpl_AttemptConnection */
BaseOutputPin_DecideAllocator pfnDecideAllocator;
};
struct strmbase_sink
......@@ -91,7 +92,7 @@ typedef HRESULT (WINAPI *BaseInputPin_Receive)(struct strmbase_sink *This, IMedi
struct strmbase_sink_ops
{
BasePinFuncTable base;
struct strmbase_pin_ops base;
BaseInputPin_Receive pfnReceive;
HRESULT (*sink_connect)(struct strmbase_sink *pin, IPin *peer, const AM_MEDIA_TYPE *mt);
void (*sink_disconnect)(struct strmbase_sink *pin);
......
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