Commit 911ba841 authored by James Almer's avatar James Almer

avdevice/dshow: Add namespace prefix to the remaining global symbols

Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 56709ca8
......@@ -87,13 +87,13 @@ dshow_read_close(AVFormatContext *s)
}
if (ctx->capture_pin[VideoDevice])
libAVPin_Release(ctx->capture_pin[VideoDevice]);
ff_dshow_pin_Release(ctx->capture_pin[VideoDevice]);
if (ctx->capture_pin[AudioDevice])
libAVPin_Release(ctx->capture_pin[AudioDevice]);
ff_dshow_pin_Release(ctx->capture_pin[AudioDevice]);
if (ctx->capture_filter[VideoDevice])
libAVFilter_Release(ctx->capture_filter[VideoDevice]);
ff_dshow_filter_Release(ctx->capture_filter[VideoDevice]);
if (ctx->capture_filter[AudioDevice])
libAVFilter_Release(ctx->capture_filter[AudioDevice]);
ff_dshow_filter_Release(ctx->capture_filter[AudioDevice]);
if (ctx->device_pin[VideoDevice])
IPin_Release(ctx->device_pin[VideoDevice]);
......@@ -731,8 +731,8 @@ dshow_open_device(AVFormatContext *avctx, ICreateDevEnum *devenum,
char *device_filter_unique_name = NULL;
IGraphBuilder *graph = ctx->graph;
IPin *device_pin = NULL;
libAVPin *capture_pin = NULL;
libAVFilter *capture_filter = NULL;
DShowPin *capture_pin = NULL;
DShowFilter *capture_filter = NULL;
ICaptureGraphBuilder2 *graph_builder2 = NULL;
int ret = AVERROR(EIO);
int r;
......@@ -807,7 +807,7 @@ dshow_open_device(AVFormatContext *avctx, ICreateDevEnum *devenum,
ctx->device_pin[devtype] = device_pin;
capture_filter = libAVFilter_Create(avctx, callback, devtype);
capture_filter = ff_dshow_filter_Create(avctx, callback, devtype);
if (!capture_filter) {
av_log(avctx, AV_LOG_ERROR, "Could not create grabber filter.\n");
goto error;
......@@ -863,7 +863,7 @@ dshow_open_device(AVFormatContext *avctx, ICreateDevEnum *devenum,
goto error;
}
libAVPin_AddRef(capture_filter->pin);
ff_dshow_pin_AddRef(capture_filter->pin);
capture_pin = capture_filter->pin;
ctx->capture_pin[devtype] = capture_pin;
......@@ -953,7 +953,7 @@ dshow_add_device(AVFormatContext *avctx,
ctx->capture_filter[devtype]->stream_index = st->index;
libAVPin_ConnectionMediaType(ctx->capture_pin[devtype], &type);
ff_dshow_pin_ConnectionMediaType(ctx->capture_pin[devtype], &type);
par = st->codecpar;
if (devtype == VideoDevice) {
......
This diff is collapsed.
......@@ -21,17 +21,16 @@
#include "dshow_capture.h"
DECLARE_QUERYINTERFACE(libAVEnumMediaTypes,
DECLARE_QUERYINTERFACE(enummediatypes, DShowEnumMediaTypes,
{ {&IID_IUnknown,0}, {&IID_IEnumMediaTypes,0} })
DECLARE_ADDREF(libAVEnumMediaTypes)
DECLARE_RELEASE(libAVEnumMediaTypes)
DECLARE_ADDREF(enummediatypes, DShowEnumMediaTypes)
DECLARE_RELEASE(enummediatypes, DShowEnumMediaTypes)
long WINAPI
libAVEnumMediaTypes_Next(libAVEnumMediaTypes *this, unsigned long n,
long ff_dshow_enummediatypes_Next(DShowEnumMediaTypes *this, unsigned long n,
AM_MEDIA_TYPE **types, unsigned long *fetched)
{
int count = 0;
dshowdebug("libAVEnumMediaTypes_Next(%p)\n", this);
dshowdebug("ff_dshow_enummediatypes_Next(%p)\n", this);
if (!types)
return E_POINTER;
if (!this->pos && n == 1) {
......@@ -51,29 +50,26 @@ libAVEnumMediaTypes_Next(libAVEnumMediaTypes *this, unsigned long n,
return S_FALSE;
return S_OK;
}
long WINAPI
libAVEnumMediaTypes_Skip(libAVEnumMediaTypes *this, unsigned long n)
long ff_dshow_enummediatypes_Skip(DShowEnumMediaTypes *this, unsigned long n)
{
dshowdebug("libAVEnumMediaTypes_Skip(%p)\n", this);
dshowdebug("ff_dshow_enummediatypes_Skip(%p)\n", this);
if (n) /* Any skip will always fall outside of the only valid type. */
return S_FALSE;
return S_OK;
}
long WINAPI
libAVEnumMediaTypes_Reset(libAVEnumMediaTypes *this)
long ff_dshow_enummediatypes_Reset(DShowEnumMediaTypes *this)
{
dshowdebug("libAVEnumMediaTypes_Reset(%p)\n", this);
dshowdebug("ff_dshow_enummediatypes_Reset(%p)\n", this);
this->pos = 0;
return S_OK;
}
long WINAPI
libAVEnumMediaTypes_Clone(libAVEnumMediaTypes *this, libAVEnumMediaTypes **enums)
long ff_dshow_enummediatypes_Clone(DShowEnumMediaTypes *this, DShowEnumMediaTypes **enums)
{
libAVEnumMediaTypes *new;
dshowdebug("libAVEnumMediaTypes_Clone(%p)\n", this);
DShowEnumMediaTypes *new;
dshowdebug("ff_dshow_enummediatypes_Clone(%p)\n", this);
if (!enums)
return E_POINTER;
new = libAVEnumMediaTypes_Create(&this->type);
new = ff_dshow_enummediatypes_Create(&this->type);
if (!new)
return E_OUTOFMEMORY;
new->pos = this->pos;
......@@ -81,17 +77,16 @@ libAVEnumMediaTypes_Clone(libAVEnumMediaTypes *this, libAVEnumMediaTypes **enums
return S_OK;
}
static int
libAVEnumMediaTypes_Setup(libAVEnumMediaTypes *this, const AM_MEDIA_TYPE *type)
static int ff_dshow_enummediatypes_Setup(DShowEnumMediaTypes *this, const AM_MEDIA_TYPE *type)
{
IEnumMediaTypesVtbl *vtbl = this->vtbl;
SETVTBL(vtbl, libAVEnumMediaTypes, QueryInterface);
SETVTBL(vtbl, libAVEnumMediaTypes, AddRef);
SETVTBL(vtbl, libAVEnumMediaTypes, Release);
SETVTBL(vtbl, libAVEnumMediaTypes, Next);
SETVTBL(vtbl, libAVEnumMediaTypes, Skip);
SETVTBL(vtbl, libAVEnumMediaTypes, Reset);
SETVTBL(vtbl, libAVEnumMediaTypes, Clone);
SETVTBL(vtbl, enummediatypes, QueryInterface);
SETVTBL(vtbl, enummediatypes, AddRef);
SETVTBL(vtbl, enummediatypes, Release);
SETVTBL(vtbl, enummediatypes, Next);
SETVTBL(vtbl, enummediatypes, Skip);
SETVTBL(vtbl, enummediatypes, Reset);
SETVTBL(vtbl, enummediatypes, Clone);
if (!type) {
this->type.majortype = GUID_NULL;
......@@ -101,5 +96,5 @@ libAVEnumMediaTypes_Setup(libAVEnumMediaTypes *this, const AM_MEDIA_TYPE *type)
return 1;
}
DECLARE_CREATE(libAVEnumMediaTypes, libAVEnumMediaTypes_Setup(this, type), const AM_MEDIA_TYPE *type)
DECLARE_DESTROY(libAVEnumMediaTypes, nothing)
DECLARE_CREATE(enummediatypes, DShowEnumMediaTypes, ff_dshow_enummediatypes_Setup(this, type), const AM_MEDIA_TYPE *type)
DECLARE_DESTROY(enummediatypes, DShowEnumMediaTypes, nothing)
......@@ -21,21 +21,20 @@
#include "dshow_capture.h"
DECLARE_QUERYINTERFACE(libAVEnumPins,
DECLARE_QUERYINTERFACE(enumpins, DShowEnumPins,
{ {&IID_IUnknown,0}, {&IID_IEnumPins,0} })
DECLARE_ADDREF(libAVEnumPins)
DECLARE_RELEASE(libAVEnumPins)
DECLARE_ADDREF(enumpins, DShowEnumPins)
DECLARE_RELEASE(enumpins, DShowEnumPins)
long WINAPI
libAVEnumPins_Next(libAVEnumPins *this, unsigned long n, IPin **pins,
long ff_dshow_enumpins_Next(DShowEnumPins *this, unsigned long n, IPin **pins,
unsigned long *fetched)
{
int count = 0;
dshowdebug("libAVEnumPins_Next(%p)\n", this);
dshowdebug("ff_dshow_enumpins_Next(%p)\n", this);
if (!pins)
return E_POINTER;
if (!this->pos && n == 1) {
libAVPin_AddRef(this->pin);
ff_dshow_pin_AddRef(this->pin);
*pins = (IPin *) this->pin;
count = 1;
this->pos = 1;
......@@ -46,29 +45,26 @@ libAVEnumPins_Next(libAVEnumPins *this, unsigned long n, IPin **pins,
return S_FALSE;
return S_OK;
}
long WINAPI
libAVEnumPins_Skip(libAVEnumPins *this, unsigned long n)
long ff_dshow_enumpins_Skip(DShowEnumPins *this, unsigned long n)
{
dshowdebug("libAVEnumPins_Skip(%p)\n", this);
dshowdebug("ff_dshow_enumpins_Skip(%p)\n", this);
if (n) /* Any skip will always fall outside of the only valid pin. */
return S_FALSE;
return S_OK;
}
long WINAPI
libAVEnumPins_Reset(libAVEnumPins *this)
long ff_dshow_enumpins_Reset(DShowEnumPins *this)
{
dshowdebug("libAVEnumPins_Reset(%p)\n", this);
dshowdebug("ff_dshow_enumpins_Reset(%p)\n", this);
this->pos = 0;
return S_OK;
}
long WINAPI
libAVEnumPins_Clone(libAVEnumPins *this, libAVEnumPins **pins)
long ff_dshow_enumpins_Clone(DShowEnumPins *this, DShowEnumPins **pins)
{
libAVEnumPins *new;
dshowdebug("libAVEnumPins_Clone(%p)\n", this);
DShowEnumPins *new;
dshowdebug("ff_dshow_enumpins_Clone(%p)\n", this);
if (!pins)
return E_POINTER;
new = libAVEnumPins_Create(this->pin, this->filter);
new = ff_dshow_enumpins_Create(this->pin, this->filter);
if (!new)
return E_OUTOFMEMORY;
new->pos = this->pos;
......@@ -76,30 +72,28 @@ libAVEnumPins_Clone(libAVEnumPins *this, libAVEnumPins **pins)
return S_OK;
}
static int
libAVEnumPins_Setup(libAVEnumPins *this, libAVPin *pin, libAVFilter *filter)
static int ff_dshow_enumpins_Setup(DShowEnumPins *this, DShowPin *pin, DShowFilter *filter)
{
IEnumPinsVtbl *vtbl = this->vtbl;
SETVTBL(vtbl, libAVEnumPins, QueryInterface);
SETVTBL(vtbl, libAVEnumPins, AddRef);
SETVTBL(vtbl, libAVEnumPins, Release);
SETVTBL(vtbl, libAVEnumPins, Next);
SETVTBL(vtbl, libAVEnumPins, Skip);
SETVTBL(vtbl, libAVEnumPins, Reset);
SETVTBL(vtbl, libAVEnumPins, Clone);
SETVTBL(vtbl, enumpins, QueryInterface);
SETVTBL(vtbl, enumpins, AddRef);
SETVTBL(vtbl, enumpins, Release);
SETVTBL(vtbl, enumpins, Next);
SETVTBL(vtbl, enumpins, Skip);
SETVTBL(vtbl, enumpins, Reset);
SETVTBL(vtbl, enumpins, Clone);
this->pin = pin;
this->filter = filter;
libAVFilter_AddRef(this->filter);
ff_dshow_filter_AddRef(this->filter);
return 1;
}
static int
libAVEnumPins_Cleanup(libAVEnumPins *this)
static int ff_dshow_enumpins_Cleanup(DShowEnumPins *this)
{
libAVFilter_Release(this->filter);
ff_dshow_filter_Release(this->filter);
return 1;
}
DECLARE_CREATE(libAVEnumPins, libAVEnumPins_Setup(this, pin, filter),
libAVPin *pin, libAVFilter *filter)
DECLARE_DESTROY(libAVEnumPins, libAVEnumPins_Cleanup)
DECLARE_CREATE(enumpins, DShowEnumPins, ff_dshow_enumpins_Setup(this, pin, filter),
DShowPin *pin, DShowFilter *filter)
DECLARE_DESTROY(enumpins, DShowEnumPins, ff_dshow_enumpins_Cleanup)
......@@ -21,53 +21,47 @@
#include "dshow_capture.h"
DECLARE_QUERYINTERFACE(libAVFilter,
DECLARE_QUERYINTERFACE(filter, DShowFilter,
{ {&IID_IUnknown,0}, {&IID_IBaseFilter,0} })
DECLARE_ADDREF(libAVFilter)
DECLARE_RELEASE(libAVFilter)
DECLARE_ADDREF(filter, DShowFilter)
DECLARE_RELEASE(filter, DShowFilter)
long WINAPI
libAVFilter_GetClassID(libAVFilter *this, CLSID *id)
long ff_dshow_filter_GetClassID(DShowFilter *this, CLSID *id)
{
dshowdebug("libAVFilter_GetClassID(%p)\n", this);
dshowdebug("ff_dshow_filter_GetClassID(%p)\n", this);
/* I'm not creating a ClassID just for this. */
return E_FAIL;
}
long WINAPI
libAVFilter_Stop(libAVFilter *this)
long ff_dshow_filter_Stop(DShowFilter *this)
{
dshowdebug("libAVFilter_Stop(%p)\n", this);
dshowdebug("ff_dshow_filter_Stop(%p)\n", this);
this->state = State_Stopped;
return S_OK;
}
long WINAPI
libAVFilter_Pause(libAVFilter *this)
long ff_dshow_filter_Pause(DShowFilter *this)
{
dshowdebug("libAVFilter_Pause(%p)\n", this);
dshowdebug("ff_dshow_filter_Pause(%p)\n", this);
this->state = State_Paused;
return S_OK;
}
long WINAPI
libAVFilter_Run(libAVFilter *this, REFERENCE_TIME start)
long ff_dshow_filter_Run(DShowFilter *this, REFERENCE_TIME start)
{
dshowdebug("libAVFilter_Run(%p) %"PRId64"\n", this, start);
dshowdebug("ff_dshow_filter_Run(%p) %"PRId64"\n", this, start);
this->state = State_Running;
this->start_time = start;
return S_OK;
}
long WINAPI
libAVFilter_GetState(libAVFilter *this, DWORD ms, FILTER_STATE *state)
long ff_dshow_filter_GetState(DShowFilter *this, DWORD ms, FILTER_STATE *state)
{
dshowdebug("libAVFilter_GetState(%p)\n", this);
dshowdebug("ff_dshow_filter_GetState(%p)\n", this);
if (!state)
return E_POINTER;
*state = this->state;
return S_OK;
}
long WINAPI
libAVFilter_SetSyncSource(libAVFilter *this, IReferenceClock *clock)
long ff_dshow_filter_SetSyncSource(DShowFilter *this, IReferenceClock *clock)
{
dshowdebug("libAVFilter_SetSyncSource(%p)\n", this);
dshowdebug("ff_dshow_filter_SetSyncSource(%p)\n", this);
if (this->clock != clock) {
if (this->clock)
......@@ -79,10 +73,9 @@ libAVFilter_SetSyncSource(libAVFilter *this, IReferenceClock *clock)
return S_OK;
}
long WINAPI
libAVFilter_GetSyncSource(libAVFilter *this, IReferenceClock **clock)
long ff_dshow_filter_GetSyncSource(DShowFilter *this, IReferenceClock **clock)
{
dshowdebug("libAVFilter_GetSyncSource(%p)\n", this);
dshowdebug("ff_dshow_filter_GetSyncSource(%p)\n", this);
if (!clock)
return E_POINTER;
......@@ -92,32 +85,30 @@ libAVFilter_GetSyncSource(libAVFilter *this, IReferenceClock **clock)
return S_OK;
}
long WINAPI
libAVFilter_EnumPins(libAVFilter *this, IEnumPins **enumpin)
long ff_dshow_filter_EnumPins(DShowFilter *this, IEnumPins **enumpin)
{
libAVEnumPins *new;
dshowdebug("libAVFilter_EnumPins(%p)\n", this);
DShowEnumPins *new;
dshowdebug("ff_dshow_filter_EnumPins(%p)\n", this);
if (!enumpin)
return E_POINTER;
new = libAVEnumPins_Create(this->pin, this);
new = ff_dshow_enumpins_Create(this->pin, this);
if (!new)
return E_OUTOFMEMORY;
*enumpin = (IEnumPins *) new;
return S_OK;
}
long WINAPI
libAVFilter_FindPin(libAVFilter *this, const wchar_t *id, IPin **pin)
long ff_dshow_filter_FindPin(DShowFilter *this, const wchar_t *id, IPin **pin)
{
libAVPin *found = NULL;
dshowdebug("libAVFilter_FindPin(%p)\n", this);
DShowPin *found = NULL;
dshowdebug("ff_dshow_filter_FindPin(%p)\n", this);
if (!id || !pin)
return E_POINTER;
if (!wcscmp(id, L"In")) {
found = this->pin;
libAVPin_AddRef(found);
ff_dshow_pin_AddRef(found);
}
*pin = (IPin *) found;
if (!found)
......@@ -125,10 +116,9 @@ libAVFilter_FindPin(libAVFilter *this, const wchar_t *id, IPin **pin)
return S_OK;
}
long WINAPI
libAVFilter_QueryFilterInfo(libAVFilter *this, FILTER_INFO *info)
long ff_dshow_filter_QueryFilterInfo(DShowFilter *this, FILTER_INFO *info)
{
dshowdebug("libAVFilter_QueryFilterInfo(%p)\n", this);
dshowdebug("ff_dshow_filter_QueryFilterInfo(%p)\n", this);
if (!info)
return E_POINTER;
......@@ -138,11 +128,10 @@ libAVFilter_QueryFilterInfo(libAVFilter *this, FILTER_INFO *info)
return S_OK;
}
long WINAPI
libAVFilter_JoinFilterGraph(libAVFilter *this, IFilterGraph *graph,
long ff_dshow_filter_JoinFilterGraph(DShowFilter *this, IFilterGraph *graph,
const wchar_t *name)
{
dshowdebug("libAVFilter_JoinFilterGraph(%p)\n", this);
dshowdebug("ff_dshow_filter_JoinFilterGraph(%p)\n", this);
this->info.pGraph = graph;
if (name)
......@@ -150,10 +139,9 @@ libAVFilter_JoinFilterGraph(libAVFilter *this, IFilterGraph *graph,
return S_OK;
}
long WINAPI
libAVFilter_QueryVendorInfo(libAVFilter *this, wchar_t **info)
long ff_dshow_filter_QueryVendorInfo(DShowFilter *this, wchar_t **info)
{
dshowdebug("libAVFilter_QueryVendorInfo(%p)\n", this);
dshowdebug("ff_dshow_filter_QueryVendorInfo(%p)\n", this);
if (!info)
return E_POINTER;
......@@ -161,27 +149,27 @@ libAVFilter_QueryVendorInfo(libAVFilter *this, wchar_t **info)
}
static int
libAVFilter_Setup(libAVFilter *this, void *priv_data, void *callback,
ff_dshow_filter_Setup(DShowFilter *this, void *priv_data, void *callback,
enum dshowDeviceType type)
{
IBaseFilterVtbl *vtbl = this->vtbl;
SETVTBL(vtbl, libAVFilter, QueryInterface);
SETVTBL(vtbl, libAVFilter, AddRef);
SETVTBL(vtbl, libAVFilter, Release);
SETVTBL(vtbl, libAVFilter, GetClassID);
SETVTBL(vtbl, libAVFilter, Stop);
SETVTBL(vtbl, libAVFilter, Pause);
SETVTBL(vtbl, libAVFilter, Run);
SETVTBL(vtbl, libAVFilter, GetState);
SETVTBL(vtbl, libAVFilter, SetSyncSource);
SETVTBL(vtbl, libAVFilter, GetSyncSource);
SETVTBL(vtbl, libAVFilter, EnumPins);
SETVTBL(vtbl, libAVFilter, FindPin);
SETVTBL(vtbl, libAVFilter, QueryFilterInfo);
SETVTBL(vtbl, libAVFilter, JoinFilterGraph);
SETVTBL(vtbl, libAVFilter, QueryVendorInfo);
this->pin = libAVPin_Create(this);
SETVTBL(vtbl, filter, QueryInterface);
SETVTBL(vtbl, filter, AddRef);
SETVTBL(vtbl, filter, Release);
SETVTBL(vtbl, filter, GetClassID);
SETVTBL(vtbl, filter, Stop);
SETVTBL(vtbl, filter, Pause);
SETVTBL(vtbl, filter, Run);
SETVTBL(vtbl, filter, GetState);
SETVTBL(vtbl, filter, SetSyncSource);
SETVTBL(vtbl, filter, GetSyncSource);
SETVTBL(vtbl, filter, EnumPins);
SETVTBL(vtbl, filter, FindPin);
SETVTBL(vtbl, filter, QueryFilterInfo);
SETVTBL(vtbl, filter, JoinFilterGraph);
SETVTBL(vtbl, filter, QueryVendorInfo);
this->pin = ff_dshow_pin_Create(this);
this->priv_data = priv_data;
this->callback = callback;
......@@ -189,12 +177,11 @@ libAVFilter_Setup(libAVFilter *this, void *priv_data, void *callback,
return 1;
}
static int
libAVFilter_Cleanup(libAVFilter *this)
static int ff_dshow_filter_Cleanup(DShowFilter *this)
{
libAVPin_Release(this->pin);
ff_dshow_pin_Release(this->pin);
return 1;
}
DECLARE_CREATE(libAVFilter, libAVFilter_Setup(this, priv_data, callback, type),
DECLARE_CREATE(filter, DShowFilter, ff_dshow_filter_Setup(this, priv_data, callback, type),
void *priv_data, void *callback, enum dshowDeviceType type)
DECLARE_DESTROY(libAVFilter, libAVFilter_Cleanup)
DECLARE_DESTROY(filter, DShowFilter, ff_dshow_filter_Cleanup)
This diff is collapsed.
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