Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
911ba841
Commit
911ba841
authored
Jan 21, 2021
by
James Almer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avdevice/dshow: Add namespace prefix to the remaining global symbols
Signed-off-by:
James Almer
<
jamrial@gmail.com
>
parent
56709ca8
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
325 additions
and
376 deletions
+325
-376
dshow.c
libavdevice/dshow.c
+9
-9
dshow_capture.h
libavdevice/dshow_capture.h
+113
-113
dshow_enummediatypes.c
libavdevice/dshow_enummediatypes.c
+23
-28
dshow_enumpins.c
libavdevice/dshow_enumpins.c
+28
-34
dshow_filter.c
libavdevice/dshow_filter.c
+53
-66
dshow_pin.c
libavdevice/dshow_pin.c
+99
-126
No files found.
libavdevice/dshow.c
View file @
911ba841
...
...
@@ -87,13 +87,13 @@ dshow_read_close(AVFormatContext *s)
}
if
(
ctx
->
capture_pin
[
VideoDevice
])
libAVP
in_Release
(
ctx
->
capture_pin
[
VideoDevice
]);
ff_dshow_p
in_Release
(
ctx
->
capture_pin
[
VideoDevice
]);
if
(
ctx
->
capture_pin
[
AudioDevice
])
libAVP
in_Release
(
ctx
->
capture_pin
[
AudioDevice
]);
ff_dshow_p
in_Release
(
ctx
->
capture_pin
[
AudioDevice
]);
if
(
ctx
->
capture_filter
[
VideoDevice
])
libAVF
ilter_Release
(
ctx
->
capture_filter
[
VideoDevice
]);
ff_dshow_f
ilter_Release
(
ctx
->
capture_filter
[
VideoDevice
]);
if
(
ctx
->
capture_filter
[
AudioDevice
])
libAVF
ilter_Release
(
ctx
->
capture_filter
[
AudioDevice
]);
ff_dshow_f
ilter_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
;
libAV
Pin
*
capture_pin
=
NULL
;
libAV
Filter
*
capture_filter
=
NULL
;
DShow
Pin
*
capture_pin
=
NULL
;
DShow
Filter
*
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
=
libAVF
ilter_Create
(
avctx
,
callback
,
devtype
);
capture_filter
=
ff_dshow_f
ilter_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
;
}
libAVP
in_AddRef
(
capture_filter
->
pin
);
ff_dshow_p
in_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
;
libAVP
in_ConnectionMediaType
(
ctx
->
capture_pin
[
devtype
],
&
type
);
ff_dshow_p
in_ConnectionMediaType
(
ctx
->
capture_pin
[
devtype
],
&
type
);
par
=
st
->
codecpar
;
if
(
devtype
==
VideoDevice
)
{
...
...
libavdevice/dshow_capture.h
View file @
911ba841
...
...
@@ -68,20 +68,20 @@ enum dshowSourceFilterType {
AudioSourceDevice
=
1
,
};
#define DECLARE_QUERYINTERFACE(
class, ...)
\
long
WINAPI
\
class##_QueryInterface(class *this, const GUID *riid, void **ppvObject)
\
#define DECLARE_QUERYINTERFACE(
prefix, class, ...)
\
long
\
ff_dshow_##prefix##_QueryInterface(class *this, const GUID *riid, void **ppvObject)
\
{ \
struct GUIDoffset ifaces[] = __VA_ARGS__; \
int i; \
dshowdebug(
AV_STRINGIFY(class
)"_QueryInterface(%p, %p, %p)\n", this, riid, ppvObject); \
dshowdebug(
"ff_dshow_"AV_STRINGIFY(prefix
)"_QueryInterface(%p, %p, %p)\n", this, riid, ppvObject); \
ff_printGUID(riid); \
if (!ppvObject) \
return E_POINTER; \
for (i = 0; i < sizeof(ifaces)/sizeof(ifaces[0]); i++) { \
if (IsEqualGUID(riid, ifaces[i].iid)) { \
void *obj = (void *) ((uint8_t *) this + ifaces[i].offset); \
class##_AddRef(this);
\
ff_dshow_##prefix##_AddRef(this);
\
dshowdebug("\tfound %d with offset %d\n", i, ifaces[i].offset); \
*ppvObject = (void *) obj; \
return S_OK; \
...
...
@@ -91,28 +91,28 @@ class##_QueryInterface(class *this, const GUID *riid, void **ppvObject) \
*ppvObject = NULL; \
return E_NOINTERFACE; \
}
#define DECLARE_ADDREF(
class)
\
unsigned long
WINAPI
\
class##_AddRef(class *this)
\
#define DECLARE_ADDREF(
prefix, class)
\
unsigned long
\
ff_dshow_##prefix##_AddRef(class *this)
\
{ \
dshowdebug(
AV_STRINGIFY(class)"_AddRef(%p)\t%ld\n", this, this->ref+1);
\
dshowdebug(
"ff_dshow_"AV_STRINGIFY(prefix)"_AddRef(%p)\t%ld\n", this, this->ref+1);
\
return InterlockedIncrement(&this->ref); \
}
#define DECLARE_RELEASE(
class)
\
unsigned long
WINAPI
\
class##_Release(class *this)
\
#define DECLARE_RELEASE(
prefix, class)
\
unsigned long
\
ff_dshow_##prefix##_Release(class *this)
\
{ \
long ref = InterlockedDecrement(&this->ref); \
dshowdebug(
AV_STRINGIFY(class)"_Release(%p)\t%ld\n", this, ref);
\
dshowdebug(
"ff_dshow_"AV_STRINGIFY(prefix)"_Release(%p)\t%ld\n", this, ref);
\
if (!ref) \
class##_Destroy(this);
\
ff_dshow_##prefix##_Destroy(this);
\
return ref; \
}
#define DECLARE_DESTROY(
class, func)
\
void
class##_Destroy(class *this)
\
#define DECLARE_DESTROY(
prefix, class, func)
\
void
ff_dshow_##prefix##_Destroy(class *this)
\
{ \
dshowdebug(
AV_STRINGIFY(class)"_Destroy(%p)\n", this);
\
dshowdebug(
"ff_dshow_"AV_STRINGIFY(prefix)"_Destroy(%p)\n", this);
\
func(this); \
if (this) { \
if (this->vtbl) \
...
...
@@ -120,12 +120,12 @@ void class##_Destroy(class *this) \
CoTaskMemFree(this); \
} \
}
#define DECLARE_CREATE(
class, setup, ...)
\
class *
class##_Create(__VA_ARGS__)
\
#define DECLARE_CREATE(
prefix, class, setup, ...)
\
class *
ff_dshow_##prefix##_Create(__VA_ARGS__)
\
{ \
class *this = CoTaskMemAlloc(sizeof(class)); \
void *vtbl = CoTaskMemAlloc(sizeof(*this->vtbl)); \
dshowdebug(
AV_STRINGIFY(class)"_Create(%p)\n", this);
\
dshowdebug(
"ff_dshow_"AV_STRINGIFY(prefix)"_Create(%p)\n", this);
\
if (!this || !vtbl) \
goto fail; \
ZeroMemory(this, sizeof(class)); \
...
...
@@ -134,123 +134,123 @@ class *class##_Create(__VA_ARGS__) \
this->vtbl = vtbl; \
if (!setup) \
goto fail; \
dshowdebug("created
"AV_STRINGIFY(class)" %p\n", this);
\
dshowdebug("created
ff_dshow_"AV_STRINGIFY(prefix)" %p\n", this);
\
return this; \
fail: \
class##_Destroy(this);
\
dshowdebug("could not create
"AV_STRINGIFY(class)"\n");
\
ff_dshow_##prefix##_Destroy(this);
\
dshowdebug("could not create
ff_dshow_"AV_STRINGIFY(prefix)"\n");
\
return NULL; \
}
#define SETVTBL(vtbl,
class
, fn) \
do { (vtbl)->fn = (void *)
class
##_##fn; } while(0)
#define SETVTBL(vtbl,
prefix
, fn) \
do { (vtbl)->fn = (void *)
ff_dshow_##prefix
##_##fn; } while(0)
/*****************************************************************************
* Forward Declarations
****************************************************************************/
typedef
struct
libAVPin
libAV
Pin
;
typedef
struct
libAVMemInputPin
libAV
MemInputPin
;
typedef
struct
libAVEnumPins
libAV
EnumPins
;
typedef
struct
libAVEnumMediaTypes
libAV
EnumMediaTypes
;
typedef
struct
libAVFilter
libAV
Filter
;
typedef
struct
DShowPin
DShow
Pin
;
typedef
struct
DShowMemInputPin
DShow
MemInputPin
;
typedef
struct
DShowEnumPins
DShow
EnumPins
;
typedef
struct
DShowEnumMediaTypes
DShow
EnumMediaTypes
;
typedef
struct
DShowFilter
DShow
Filter
;
/*****************************************************************************
*
libAV
Pin
*
DShow
Pin
****************************************************************************/
struct
libAV
Pin
{
struct
DShow
Pin
{
IPinVtbl
*
vtbl
;
long
ref
;
libAV
Filter
*
filter
;
DShow
Filter
*
filter
;
IPin
*
connectedto
;
AM_MEDIA_TYPE
type
;
IMemInputPinVtbl
*
imemvtbl
;
};
long
WINAPI
libAVPin_QueryInterface
(
libAV
Pin
*
,
const
GUID
*
,
void
**
);
unsigned
long
WINAPI
libAVPin_AddRef
(
libAV
Pin
*
);
unsigned
long
WINAPI
libAVPin_Release
(
libAV
Pin
*
);
long
WINAPI
libAVPin_Connect
(
libAV
Pin
*
,
IPin
*
,
const
AM_MEDIA_TYPE
*
);
long
WINAPI
libAVPin_ReceiveConnection
(
libAV
Pin
*
,
IPin
*
,
const
AM_MEDIA_TYPE
*
);
long
WINAPI
libAVPin_Disconnect
(
libAV
Pin
*
);
long
WINAPI
libAVPin_ConnectedTo
(
libAV
Pin
*
,
IPin
**
);
long
WINAPI
libAVPin_ConnectionMediaType
(
libAV
Pin
*
,
AM_MEDIA_TYPE
*
);
long
WINAPI
libAVPin_QueryPinInfo
(
libAV
Pin
*
,
PIN_INFO
*
);
long
WINAPI
libAVPin_QueryDirection
(
libAV
Pin
*
,
PIN_DIRECTION
*
);
long
WINAPI
libAVPin_QueryId
(
libAV
Pin
*
,
wchar_t
**
);
long
WINAPI
libAVPin_QueryAccept
(
libAV
Pin
*
,
const
AM_MEDIA_TYPE
*
);
long
WINAPI
libAVPin_EnumMediaTypes
(
libAV
Pin
*
,
IEnumMediaTypes
**
);
long
WINAPI
libAVPin_QueryInternalConnections
(
libAV
Pin
*
,
IPin
**
,
unsigned
long
*
);
long
WINAPI
libAVPin_EndOfStream
(
libAV
Pin
*
);
long
WINAPI
libAVPin_BeginFlush
(
libAV
Pin
*
);
long
WINAPI
libAVPin_EndFlush
(
libAV
Pin
*
);
long
WINAPI
libAVPin_NewSegment
(
libAV
Pin
*
,
REFERENCE_TIME
,
REFERENCE_TIME
,
double
);
long
WINAPI
libAVMemInputPin_QueryInterface
(
libAV
MemInputPin
*
,
const
GUID
*
,
void
**
);
unsigned
long
WINAPI
libAVMemInputPin_AddRef
(
libAV
MemInputPin
*
);
unsigned
long
WINAPI
libAVMemInputPin_Release
(
libAV
MemInputPin
*
);
long
WINAPI
libAVMemInputPin_GetAllocator
(
libAV
MemInputPin
*
,
IMemAllocator
**
);
long
WINAPI
libAVMemInputPin_NotifyAllocator
(
libAV
MemInputPin
*
,
IMemAllocator
*
,
BOOL
);
long
WINAPI
libAVMemInputPin_GetAllocatorRequirements
(
libAV
MemInputPin
*
,
ALLOCATOR_PROPERTIES
*
);
long
WINAPI
libAVMemInputPin_Receive
(
libAV
MemInputPin
*
,
IMediaSample
*
);
long
WINAPI
libAVMemInputPin_ReceiveMultiple
(
libAV
MemInputPin
*
,
IMediaSample
**
,
long
,
long
*
);
long
WINAPI
libAVMemInputPin_ReceiveCanBlock
(
libAV
MemInputPin
*
);
void
libAVPin_Destroy
(
libAV
Pin
*
);
libAVPin
*
libAVPin_Create
(
libAV
Filter
*
filter
);
void
libAVMemInputPin_Destroy
(
libAV
MemInputPin
*
);
long
ff_dshow_pin_QueryInterface
(
DShow
Pin
*
,
const
GUID
*
,
void
**
);
unsigned
long
ff_dshow_pin_AddRef
(
DShow
Pin
*
);
unsigned
long
ff_dshow_pin_Release
(
DShow
Pin
*
);
long
ff_dshow_pin_Connect
(
DShow
Pin
*
,
IPin
*
,
const
AM_MEDIA_TYPE
*
);
long
ff_dshow_pin_ReceiveConnection
(
DShow
Pin
*
,
IPin
*
,
const
AM_MEDIA_TYPE
*
);
long
ff_dshow_pin_Disconnect
(
DShow
Pin
*
);
long
ff_dshow_pin_ConnectedTo
(
DShow
Pin
*
,
IPin
**
);
long
ff_dshow_pin_ConnectionMediaType
(
DShow
Pin
*
,
AM_MEDIA_TYPE
*
);
long
ff_dshow_pin_QueryPinInfo
(
DShow
Pin
*
,
PIN_INFO
*
);
long
ff_dshow_pin_QueryDirection
(
DShow
Pin
*
,
PIN_DIRECTION
*
);
long
ff_dshow_pin_QueryId
(
DShow
Pin
*
,
wchar_t
**
);
long
ff_dshow_pin_QueryAccept
(
DShow
Pin
*
,
const
AM_MEDIA_TYPE
*
);
long
ff_dshow_pin_EnumMediaTypes
(
DShow
Pin
*
,
IEnumMediaTypes
**
);
long
ff_dshow_pin_QueryInternalConnections
(
DShow
Pin
*
,
IPin
**
,
unsigned
long
*
);
long
ff_dshow_pin_EndOfStream
(
DShow
Pin
*
);
long
ff_dshow_pin_BeginFlush
(
DShow
Pin
*
);
long
ff_dshow_pin_EndFlush
(
DShow
Pin
*
);
long
ff_dshow_pin_NewSegment
(
DShow
Pin
*
,
REFERENCE_TIME
,
REFERENCE_TIME
,
double
);
long
ff_dshow_meminputpin_QueryInterface
(
DShow
MemInputPin
*
,
const
GUID
*
,
void
**
);
unsigned
long
ff_dshow_meminputpin_AddRef
(
DShow
MemInputPin
*
);
unsigned
long
ff_dshow_meminputpin_Release
(
DShow
MemInputPin
*
);
long
ff_dshow_meminputpin_GetAllocator
(
DShow
MemInputPin
*
,
IMemAllocator
**
);
long
ff_dshow_meminputpin_NotifyAllocator
(
DShow
MemInputPin
*
,
IMemAllocator
*
,
BOOL
);
long
ff_dshow_meminputpin_GetAllocatorRequirements
(
DShow
MemInputPin
*
,
ALLOCATOR_PROPERTIES
*
);
long
ff_dshow_meminputpin_Receive
(
DShow
MemInputPin
*
,
IMediaSample
*
);
long
ff_dshow_meminputpin_ReceiveMultiple
(
DShow
MemInputPin
*
,
IMediaSample
**
,
long
,
long
*
);
long
ff_dshow_meminputpin_ReceiveCanBlock
(
DShow
MemInputPin
*
);
void
ff_dshow_pin_Destroy
(
DShow
Pin
*
);
DShowPin
*
ff_dshow_pin_Create
(
DShow
Filter
*
filter
);
void
ff_dshow_meminputpin_Destroy
(
DShow
MemInputPin
*
);
/*****************************************************************************
*
libAV
EnumPins
*
DShow
EnumPins
****************************************************************************/
struct
libAV
EnumPins
{
struct
DShow
EnumPins
{
IEnumPinsVtbl
*
vtbl
;
long
ref
;
int
pos
;
libAV
Pin
*
pin
;
libAV
Filter
*
filter
;
DShow
Pin
*
pin
;
DShow
Filter
*
filter
;
};
long
WINAPI
libAVEnumPins_QueryInterface
(
libAV
EnumPins
*
,
const
GUID
*
,
void
**
);
unsigned
long
WINAPI
libAVEnumPins_AddRef
(
libAV
EnumPins
*
);
unsigned
long
WINAPI
libAVEnumPins_Release
(
libAV
EnumPins
*
);
long
WINAPI
libAVEnumPins_Next
(
libAV
EnumPins
*
,
unsigned
long
,
IPin
**
,
unsigned
long
*
);
long
WINAPI
libAVEnumPins_Skip
(
libAV
EnumPins
*
,
unsigned
long
);
long
WINAPI
libAVEnumPins_Reset
(
libAV
EnumPins
*
);
long
WINAPI
libAVEnumPins_Clone
(
libAVEnumPins
*
,
libAV
EnumPins
**
);
long
ff_dshow_enumpins_QueryInterface
(
DShow
EnumPins
*
,
const
GUID
*
,
void
**
);
unsigned
long
ff_dshow_enumpins_AddRef
(
DShow
EnumPins
*
);
unsigned
long
ff_dshow_enumpins_Release
(
DShow
EnumPins
*
);
long
ff_dshow_enumpins_Next
(
DShow
EnumPins
*
,
unsigned
long
,
IPin
**
,
unsigned
long
*
);
long
ff_dshow_enumpins_Skip
(
DShow
EnumPins
*
,
unsigned
long
);
long
ff_dshow_enumpins_Reset
(
DShow
EnumPins
*
);
long
ff_dshow_enumpins_Clone
(
DShowEnumPins
*
,
DShow
EnumPins
**
);
void
libAVEnumPins_Destroy
(
libAV
EnumPins
*
);
libAVEnumPins
*
libAVEnumPins_Create
(
libAVPin
*
pin
,
libAV
Filter
*
filter
);
void
ff_dshow_enumpins_Destroy
(
DShow
EnumPins
*
);
DShowEnumPins
*
ff_dshow_enumpins_Create
(
DShowPin
*
pin
,
DShow
Filter
*
filter
);
/*****************************************************************************
*
libAV
EnumMediaTypes
*
DShow
EnumMediaTypes
****************************************************************************/
struct
libAV
EnumMediaTypes
{
struct
DShow
EnumMediaTypes
{
IEnumMediaTypesVtbl
*
vtbl
;
long
ref
;
int
pos
;
AM_MEDIA_TYPE
type
;
};
long
WINAPI
libAVEnumMediaTypes_QueryInterface
(
libAV
EnumMediaTypes
*
,
const
GUID
*
,
void
**
);
unsigned
long
WINAPI
libAVEnumMediaTypes_AddRef
(
libAV
EnumMediaTypes
*
);
unsigned
long
WINAPI
libAVEnumMediaTypes_Release
(
libAV
EnumMediaTypes
*
);
long
WINAPI
libAVEnumMediaTypes_Next
(
libAV
EnumMediaTypes
*
,
unsigned
long
,
AM_MEDIA_TYPE
**
,
unsigned
long
*
);
long
WINAPI
libAVEnumMediaTypes_Skip
(
libAV
EnumMediaTypes
*
,
unsigned
long
);
long
WINAPI
libAVEnumMediaTypes_Reset
(
libAV
EnumMediaTypes
*
);
long
WINAPI
libAVEnumMediaTypes_Clone
(
libAVEnumMediaTypes
*
,
libAV
EnumMediaTypes
**
);
long
ff_dshow_enummediatypes_QueryInterface
(
DShow
EnumMediaTypes
*
,
const
GUID
*
,
void
**
);
unsigned
long
ff_dshow_enummediatypes_AddRef
(
DShow
EnumMediaTypes
*
);
unsigned
long
ff_dshow_enummediatypes_Release
(
DShow
EnumMediaTypes
*
);
long
ff_dshow_enummediatypes_Next
(
DShow
EnumMediaTypes
*
,
unsigned
long
,
AM_MEDIA_TYPE
**
,
unsigned
long
*
);
long
ff_dshow_enummediatypes_Skip
(
DShow
EnumMediaTypes
*
,
unsigned
long
);
long
ff_dshow_enummediatypes_Reset
(
DShow
EnumMediaTypes
*
);
long
ff_dshow_enummediatypes_Clone
(
DShowEnumMediaTypes
*
,
DShow
EnumMediaTypes
**
);
void
libAVEnumMediaTypes_Destroy
(
libAV
EnumMediaTypes
*
);
libAVEnumMediaTypes
*
libAVEnumMediaT
ypes_Create
(
const
AM_MEDIA_TYPE
*
type
);
void
ff_dshow_enummediatypes_Destroy
(
DShow
EnumMediaTypes
*
);
DShowEnumMediaTypes
*
ff_dshow_enummediat
ypes_Create
(
const
AM_MEDIA_TYPE
*
type
);
/*****************************************************************************
*
libAV
Filter
*
DShow
Filter
****************************************************************************/
struct
libAV
Filter
{
struct
DShow
Filter
{
IBaseFilterVtbl
*
vtbl
;
long
ref
;
const
wchar_t
*
name
;
libAV
Pin
*
pin
;
DShow
Pin
*
pin
;
FILTER_INFO
info
;
FILTER_STATE
state
;
IReferenceClock
*
clock
;
...
...
@@ -261,24 +261,24 @@ struct libAVFilter {
void
(
*
callback
)(
void
*
priv_data
,
int
index
,
uint8_t
*
buf
,
int
buf_size
,
int64_t
time
,
enum
dshowDeviceType
type
);
};
long
WINAPI
libAVFilter_QueryInterface
(
libAV
Filter
*
,
const
GUID
*
,
void
**
);
unsigned
long
WINAPI
libAVFilter_AddRef
(
libAV
Filter
*
);
unsigned
long
WINAPI
libAVFilter_Release
(
libAV
Filter
*
);
long
WINAPI
libAVFilter_GetClassID
(
libAV
Filter
*
,
CLSID
*
);
long
WINAPI
libAVFilter_Stop
(
libAV
Filter
*
);
long
WINAPI
libAVFilter_Pause
(
libAV
Filter
*
);
long
WINAPI
libAVFilter_Run
(
libAV
Filter
*
,
REFERENCE_TIME
);
long
WINAPI
libAVFilter_GetState
(
libAV
Filter
*
,
DWORD
,
FILTER_STATE
*
);
long
WINAPI
libAVFilter_SetSyncSource
(
libAV
Filter
*
,
IReferenceClock
*
);
long
WINAPI
libAVFilter_GetSyncSource
(
libAV
Filter
*
,
IReferenceClock
**
);
long
WINAPI
libAVFilter_EnumPins
(
libAV
Filter
*
,
IEnumPins
**
);
long
WINAPI
libAVFilter_FindPin
(
libAV
Filter
*
,
const
wchar_t
*
,
IPin
**
);
long
WINAPI
libAVFilter_QueryFilterInfo
(
libAV
Filter
*
,
FILTER_INFO
*
);
long
WINAPI
libAVFilter_JoinFilterGraph
(
libAV
Filter
*
,
IFilterGraph
*
,
const
wchar_t
*
);
long
WINAPI
libAVFilter_QueryVendorInfo
(
libAV
Filter
*
,
wchar_t
**
);
void
libAVFilter_Destroy
(
libAV
Filter
*
);
libAVFilter
*
libAVF
ilter_Create
(
void
*
,
void
*
,
enum
dshowDeviceType
);
long
ff_dshow_filter_QueryInterface
(
DShow
Filter
*
,
const
GUID
*
,
void
**
);
unsigned
long
ff_dshow_filter_AddRef
(
DShow
Filter
*
);
unsigned
long
ff_dshow_filter_Release
(
DShow
Filter
*
);
long
ff_dshow_filter_GetClassID
(
DShow
Filter
*
,
CLSID
*
);
long
ff_dshow_filter_Stop
(
DShow
Filter
*
);
long
ff_dshow_filter_Pause
(
DShow
Filter
*
);
long
ff_dshow_filter_Run
(
DShow
Filter
*
,
REFERENCE_TIME
);
long
ff_dshow_filter_GetState
(
DShow
Filter
*
,
DWORD
,
FILTER_STATE
*
);
long
ff_dshow_filter_SetSyncSource
(
DShow
Filter
*
,
IReferenceClock
*
);
long
ff_dshow_filter_GetSyncSource
(
DShow
Filter
*
,
IReferenceClock
**
);
long
ff_dshow_filter_EnumPins
(
DShow
Filter
*
,
IEnumPins
**
);
long
ff_dshow_filter_FindPin
(
DShow
Filter
*
,
const
wchar_t
*
,
IPin
**
);
long
ff_dshow_filter_QueryFilterInfo
(
DShow
Filter
*
,
FILTER_INFO
*
);
long
ff_dshow_filter_JoinFilterGraph
(
DShow
Filter
*
,
IFilterGraph
*
,
const
wchar_t
*
);
long
ff_dshow_filter_QueryVendorInfo
(
DShow
Filter
*
,
wchar_t
**
);
void
ff_dshow_filter_Destroy
(
DShow
Filter
*
);
DShowFilter
*
ff_dshow_f
ilter_Create
(
void
*
,
void
*
,
enum
dshowDeviceType
);
/*****************************************************************************
* dshow_ctx
...
...
@@ -314,8 +314,8 @@ struct dshow_ctx {
IBaseFilter
*
device_filter
[
2
];
IPin
*
device_pin
[
2
];
libAV
Filter
*
capture_filter
[
2
];
libAV
Pin
*
capture_pin
[
2
];
DShow
Filter
*
capture_filter
[
2
];
DShow
Pin
*
capture_pin
[
2
];
HANDLE
mutex
;
HANDLE
event
[
2
];
/* event[0] is set by DirectShow
...
...
libavdevice/dshow_enummediatypes.c
View file @
911ba841
...
...
@@ -21,17 +21,16 @@
#include "dshow_capture.h"
DECLARE_QUERYINTERFACE
(
libAV
EnumMediaTypes
,
DECLARE_QUERYINTERFACE
(
enummediatypes
,
DShow
EnumMediaTypes
,
{
{
&
IID_IUnknown
,
0
},
{
&
IID_IEnumMediaTypes
,
0
}
})
DECLARE_ADDREF
(
libAV
EnumMediaTypes
)
DECLARE_RELEASE
(
libAV
EnumMediaTypes
)
DECLARE_ADDREF
(
enummediatypes
,
DShow
EnumMediaTypes
)
DECLARE_RELEASE
(
enummediatypes
,
DShow
EnumMediaTypes
)
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
(
"
libAVEnumMediaT
ypes_Next(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_enummediat
ypes_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
(
"
libAVEnumMediaT
ypes_Skip(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_enummediat
ypes_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
(
"
libAVEnumMediaT
ypes_Reset(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_enummediat
ypes_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
)
{
libAV
EnumMediaTypes
*
new
;
dshowdebug
(
"
libAVEnumMediaT
ypes_Clone(%p)
\n
"
,
this
);
DShow
EnumMediaTypes
*
new
;
dshowdebug
(
"
ff_dshow_enummediat
ypes_Clone(%p)
\n
"
,
this
);
if
(
!
enums
)
return
E_POINTER
;
new
=
libAVEnumMediaT
ypes_Create
(
&
this
->
type
);
new
=
ff_dshow_enummediat
ypes_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
,
libAVEnumMediaT
ypes
,
QueryInterface
);
SETVTBL
(
vtbl
,
libAVEnumMediaT
ypes
,
AddRef
);
SETVTBL
(
vtbl
,
libAVEnumMediaT
ypes
,
Release
);
SETVTBL
(
vtbl
,
libAVEnumMediaT
ypes
,
Next
);
SETVTBL
(
vtbl
,
libAVEnumMediaT
ypes
,
Skip
);
SETVTBL
(
vtbl
,
libAVEnumMediaT
ypes
,
Reset
);
SETVTBL
(
vtbl
,
libAVEnumMediaT
ypes
,
Clone
);
SETVTBL
(
vtbl
,
enummediat
ypes
,
QueryInterface
);
SETVTBL
(
vtbl
,
enummediat
ypes
,
AddRef
);
SETVTBL
(
vtbl
,
enummediat
ypes
,
Release
);
SETVTBL
(
vtbl
,
enummediat
ypes
,
Next
);
SETVTBL
(
vtbl
,
enummediat
ypes
,
Skip
);
SETVTBL
(
vtbl
,
enummediat
ypes
,
Reset
);
SETVTBL
(
vtbl
,
enummediat
ypes
,
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
,
libAVEnumMediaT
ypes_Setup
(
this
,
type
),
const
AM_MEDIA_TYPE
*
type
)
DECLARE_DESTROY
(
libAV
EnumMediaTypes
,
nothing
)
DECLARE_CREATE
(
enummediatypes
,
DShowEnumMediaTypes
,
ff_dshow_enummediat
ypes_Setup
(
this
,
type
),
const
AM_MEDIA_TYPE
*
type
)
DECLARE_DESTROY
(
enummediatypes
,
DShow
EnumMediaTypes
,
nothing
)
libavdevice/dshow_enumpins.c
View file @
911ba841
...
...
@@ -21,21 +21,20 @@
#include "dshow_capture.h"
DECLARE_QUERYINTERFACE
(
libAV
EnumPins
,
DECLARE_QUERYINTERFACE
(
enumpins
,
DShow
EnumPins
,
{
{
&
IID_IUnknown
,
0
},
{
&
IID_IEnumPins
,
0
}
})
DECLARE_ADDREF
(
libAV
EnumPins
)
DECLARE_RELEASE
(
libAV
EnumPins
)
DECLARE_ADDREF
(
enumpins
,
DShow
EnumPins
)
DECLARE_RELEASE
(
enumpins
,
DShow
EnumPins
)
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
(
"
libAVEnumP
ins_Next(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_enump
ins_Next(%p)
\n
"
,
this
);
if
(
!
pins
)
return
E_POINTER
;
if
(
!
this
->
pos
&&
n
==
1
)
{
libAVP
in_AddRef
(
this
->
pin
);
ff_dshow_p
in_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
(
"
libAVEnumP
ins_Skip(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_enump
ins_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
(
"
libAVEnumP
ins_Reset(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_enump
ins_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
)
{
libAV
EnumPins
*
new
;
dshowdebug
(
"
libAVEnumP
ins_Clone(%p)
\n
"
,
this
);
DShow
EnumPins
*
new
;
dshowdebug
(
"
ff_dshow_enump
ins_Clone(%p)
\n
"
,
this
);
if
(
!
pins
)
return
E_POINTER
;
new
=
libAVEnumP
ins_Create
(
this
->
pin
,
this
->
filter
);
new
=
ff_dshow_enump
ins_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
,
libAVEnumP
ins
,
QueryInterface
);
SETVTBL
(
vtbl
,
libAVEnumP
ins
,
AddRef
);
SETVTBL
(
vtbl
,
libAVEnumP
ins
,
Release
);
SETVTBL
(
vtbl
,
libAVEnumP
ins
,
Next
);
SETVTBL
(
vtbl
,
libAVEnumP
ins
,
Skip
);
SETVTBL
(
vtbl
,
libAVEnumP
ins
,
Reset
);
SETVTBL
(
vtbl
,
libAVEnumP
ins
,
Clone
);
SETVTBL
(
vtbl
,
enump
ins
,
QueryInterface
);
SETVTBL
(
vtbl
,
enump
ins
,
AddRef
);
SETVTBL
(
vtbl
,
enump
ins
,
Release
);
SETVTBL
(
vtbl
,
enump
ins
,
Next
);
SETVTBL
(
vtbl
,
enump
ins
,
Skip
);
SETVTBL
(
vtbl
,
enump
ins
,
Reset
);
SETVTBL
(
vtbl
,
enump
ins
,
Clone
);
this
->
pin
=
pin
;
this
->
filter
=
filter
;
libAVF
ilter_AddRef
(
this
->
filter
);
ff_dshow_f
ilter_AddRef
(
this
->
filter
);
return
1
;
}
static
int
libAVEnumPins_Cleanup
(
libAVEnumPins
*
this
)
static
int
ff_dshow_enumpins_Cleanup
(
DShowEnumPins
*
this
)
{
libAVF
ilter_Release
(
this
->
filter
);
ff_dshow_f
ilter_Release
(
this
->
filter
);
return
1
;
}
DECLARE_CREATE
(
libAVEnumPins
,
libAVEnumP
ins_Setup
(
this
,
pin
,
filter
),
libAVPin
*
pin
,
libAV
Filter
*
filter
)
DECLARE_DESTROY
(
libAVEnumPins
,
libAVEnumP
ins_Cleanup
)
DECLARE_CREATE
(
enumpins
,
DShowEnumPins
,
ff_dshow_enump
ins_Setup
(
this
,
pin
,
filter
),
DShowPin
*
pin
,
DShow
Filter
*
filter
)
DECLARE_DESTROY
(
enumpins
,
DShowEnumPins
,
ff_dshow_enump
ins_Cleanup
)
libavdevice/dshow_filter.c
View file @
911ba841
...
...
@@ -21,53 +21,47 @@
#include "dshow_capture.h"
DECLARE_QUERYINTERFACE
(
libAV
Filter
,
DECLARE_QUERYINTERFACE
(
filter
,
DShow
Filter
,
{
{
&
IID_IUnknown
,
0
},
{
&
IID_IBaseFilter
,
0
}
})
DECLARE_ADDREF
(
libAV
Filter
)
DECLARE_RELEASE
(
libAV
Filter
)
DECLARE_ADDREF
(
filter
,
DShow
Filter
)
DECLARE_RELEASE
(
filter
,
DShow
Filter
)
long
WINAPI
libAVFilter_GetClassID
(
libAVFilter
*
this
,
CLSID
*
id
)
long
ff_dshow_filter_GetClassID
(
DShowFilter
*
this
,
CLSID
*
id
)
{
dshowdebug
(
"
libAVF
ilter_GetClassID(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_f
ilter_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
(
"
libAVF
ilter_Stop(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_f
ilter_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
(
"
libAVF
ilter_Pause(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_f
ilter_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
(
"
libAVF
ilter_Run(%p) %"
PRId64
"
\n
"
,
this
,
start
);
dshowdebug
(
"
ff_dshow_f
ilter_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
(
"
libAVF
ilter_GetState(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_f
ilter_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
(
"
libAVF
ilter_SetSyncSource(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_f
ilter_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
(
"
libAVF
ilter_GetSyncSource(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_f
ilter_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
)
{
libAV
EnumPins
*
new
;
dshowdebug
(
"
libAVF
ilter_EnumPins(%p)
\n
"
,
this
);
DShow
EnumPins
*
new
;
dshowdebug
(
"
ff_dshow_f
ilter_EnumPins(%p)
\n
"
,
this
);
if
(
!
enumpin
)
return
E_POINTER
;
new
=
libAVEnumP
ins_Create
(
this
->
pin
,
this
);
new
=
ff_dshow_enump
ins_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
)
{
libAV
Pin
*
found
=
NULL
;
dshowdebug
(
"
libAVF
ilter_FindPin(%p)
\n
"
,
this
);
DShow
Pin
*
found
=
NULL
;
dshowdebug
(
"
ff_dshow_f
ilter_FindPin(%p)
\n
"
,
this
);
if
(
!
id
||
!
pin
)
return
E_POINTER
;
if
(
!
wcscmp
(
id
,
L"In"
))
{
found
=
this
->
pin
;
libAVP
in_AddRef
(
found
);
ff_dshow_p
in_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
(
"
libAVF
ilter_QueryFilterInfo(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_f
ilter_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
(
"
libAVF
ilter_JoinFilterGraph(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_f
ilter_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
(
"
libAVF
ilter_QueryVendorInfo(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_f
ilter_QueryVendorInfo(%p)
\n
"
,
this
);
if
(
!
info
)
return
E_POINTER
;
...
...
@@ -161,27 +149,27 @@ libAVFilter_QueryVendorInfo(libAVFilter *this, wchar_t **info)
}
static
int
libAVFilter_Setup
(
libAV
Filter
*
this
,
void
*
priv_data
,
void
*
callback
,
ff_dshow_filter_Setup
(
DShow
Filter
*
this
,
void
*
priv_data
,
void
*
callback
,
enum
dshowDeviceType
type
)
{
IBaseFilterVtbl
*
vtbl
=
this
->
vtbl
;
SETVTBL
(
vtbl
,
libAVF
ilter
,
QueryInterface
);
SETVTBL
(
vtbl
,
libAVF
ilter
,
AddRef
);
SETVTBL
(
vtbl
,
libAVF
ilter
,
Release
);
SETVTBL
(
vtbl
,
libAVF
ilter
,
GetClassID
);
SETVTBL
(
vtbl
,
libAVF
ilter
,
Stop
);
SETVTBL
(
vtbl
,
libAVF
ilter
,
Pause
);
SETVTBL
(
vtbl
,
libAVF
ilter
,
Run
);
SETVTBL
(
vtbl
,
libAVF
ilter
,
GetState
);
SETVTBL
(
vtbl
,
libAVF
ilter
,
SetSyncSource
);
SETVTBL
(
vtbl
,
libAVF
ilter
,
GetSyncSource
);
SETVTBL
(
vtbl
,
libAVF
ilter
,
EnumPins
);
SETVTBL
(
vtbl
,
libAVF
ilter
,
FindPin
);
SETVTBL
(
vtbl
,
libAVF
ilter
,
QueryFilterInfo
);
SETVTBL
(
vtbl
,
libAVF
ilter
,
JoinFilterGraph
);
SETVTBL
(
vtbl
,
libAVF
ilter
,
QueryVendorInfo
);
this
->
pin
=
libAVP
in_Create
(
this
);
SETVTBL
(
vtbl
,
f
ilter
,
QueryInterface
);
SETVTBL
(
vtbl
,
f
ilter
,
AddRef
);
SETVTBL
(
vtbl
,
f
ilter
,
Release
);
SETVTBL
(
vtbl
,
f
ilter
,
GetClassID
);
SETVTBL
(
vtbl
,
f
ilter
,
Stop
);
SETVTBL
(
vtbl
,
f
ilter
,
Pause
);
SETVTBL
(
vtbl
,
f
ilter
,
Run
);
SETVTBL
(
vtbl
,
f
ilter
,
GetState
);
SETVTBL
(
vtbl
,
f
ilter
,
SetSyncSource
);
SETVTBL
(
vtbl
,
f
ilter
,
GetSyncSource
);
SETVTBL
(
vtbl
,
f
ilter
,
EnumPins
);
SETVTBL
(
vtbl
,
f
ilter
,
FindPin
);
SETVTBL
(
vtbl
,
f
ilter
,
QueryFilterInfo
);
SETVTBL
(
vtbl
,
f
ilter
,
JoinFilterGraph
);
SETVTBL
(
vtbl
,
f
ilter
,
QueryVendorInfo
);
this
->
pin
=
ff_dshow_p
in_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
)
{
libAVP
in_Release
(
this
->
pin
);
ff_dshow_p
in_Release
(
this
->
pin
);
return
1
;
}
DECLARE_CREATE
(
libAVFilter
,
libAVF
ilter_Setup
(
this
,
priv_data
,
callback
,
type
),
DECLARE_CREATE
(
filter
,
DShowFilter
,
ff_dshow_f
ilter_Setup
(
this
,
priv_data
,
callback
,
type
),
void
*
priv_data
,
void
*
callback
,
enum
dshowDeviceType
type
)
DECLARE_DESTROY
(
libAVFilter
,
libAVF
ilter_Cleanup
)
DECLARE_DESTROY
(
filter
,
DShowFilter
,
ff_dshow_f
ilter_Cleanup
)
libavdevice/dshow_pin.c
View file @
911ba841
...
...
@@ -22,26 +22,24 @@
#include "dshow_capture.h"
#include <stddef.h>
#define imemoffset offsetof(
libAV
Pin, imemvtbl)
#define imemoffset offsetof(
DShow
Pin, imemvtbl)
DECLARE_QUERYINTERFACE
(
libAV
Pin
,
DECLARE_QUERYINTERFACE
(
pin
,
DShow
Pin
,
{
{
&
IID_IUnknown
,
0
},
{
&
IID_IPin
,
0
},
{
&
IID_IMemInputPin
,
imemoffset
}
})
DECLARE_ADDREF
(
libAV
Pin
)
DECLARE_RELEASE
(
libAV
Pin
)
DECLARE_ADDREF
(
pin
,
DShow
Pin
)
DECLARE_RELEASE
(
pin
,
DShow
Pin
)
long
WINAPI
libAVPin_Connect
(
libAVPin
*
this
,
IPin
*
pin
,
const
AM_MEDIA_TYPE
*
type
)
long
ff_dshow_pin_Connect
(
DShowPin
*
this
,
IPin
*
pin
,
const
AM_MEDIA_TYPE
*
type
)
{
dshowdebug
(
"
libAVP
in_Connect(%p, %p, %p)
\n
"
,
this
,
pin
,
type
);
dshowdebug
(
"
ff_dshow_p
in_Connect(%p, %p, %p)
\n
"
,
this
,
pin
,
type
);
/* Input pins receive connections. */
return
S_FALSE
;
}
long
WINAPI
libAVPin_ReceiveConnection
(
libAVPin
*
this
,
IPin
*
pin
,
long
ff_dshow_pin_ReceiveConnection
(
DShowPin
*
this
,
IPin
*
pin
,
const
AM_MEDIA_TYPE
*
type
)
{
enum
dshowDeviceType
devtype
=
this
->
filter
->
type
;
dshowdebug
(
"
libAVP
in_ReceiveConnection(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_p
in_ReceiveConnection(%p)
\n
"
,
this
);
if
(
!
pin
)
return
E_POINTER
;
...
...
@@ -64,10 +62,9 @@ libAVPin_ReceiveConnection(libAVPin *this, IPin *pin,
return
S_OK
;
}
long
WINAPI
libAVPin_Disconnect
(
libAVPin
*
this
)
long
ff_dshow_pin_Disconnect
(
DShowPin
*
this
)
{
dshowdebug
(
"
libAVP
in_Disconnect(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_p
in_Disconnect(%p)
\n
"
,
this
);
if
(
this
->
filter
->
state
!=
State_Stopped
)
return
VFW_E_NOT_STOPPED
;
...
...
@@ -78,10 +75,9 @@ libAVPin_Disconnect(libAVPin *this)
return
S_OK
;
}
long
WINAPI
libAVPin_ConnectedTo
(
libAVPin
*
this
,
IPin
**
pin
)
long
ff_dshow_pin_ConnectedTo
(
DShowPin
*
this
,
IPin
**
pin
)
{
dshowdebug
(
"
libAVP
in_ConnectedTo(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_p
in_ConnectedTo(%p)
\n
"
,
this
);
if
(
!
pin
)
return
E_POINTER
;
...
...
@@ -92,10 +88,9 @@ libAVPin_ConnectedTo(libAVPin *this, IPin **pin)
return
S_OK
;
}
long
WINAPI
libAVPin_ConnectionMediaType
(
libAVPin
*
this
,
AM_MEDIA_TYPE
*
type
)
long
ff_dshow_pin_ConnectionMediaType
(
DShowPin
*
this
,
AM_MEDIA_TYPE
*
type
)
{
dshowdebug
(
"
libAVP
in_ConnectionMediaType(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_p
in_ConnectionMediaType(%p)
\n
"
,
this
);
if
(
!
type
)
return
E_POINTER
;
...
...
@@ -104,16 +99,15 @@ libAVPin_ConnectionMediaType(libAVPin *this, AM_MEDIA_TYPE *type)
return
ff_copy_dshow_media_type
(
type
,
&
this
->
type
);
}
long
WINAPI
libAVPin_QueryPinInfo
(
libAVPin
*
this
,
PIN_INFO
*
info
)
long
ff_dshow_pin_QueryPinInfo
(
DShowPin
*
this
,
PIN_INFO
*
info
)
{
dshowdebug
(
"
libAVP
in_QueryPinInfo(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_p
in_QueryPinInfo(%p)
\n
"
,
this
);
if
(
!
info
)
return
E_POINTER
;
if
(
this
->
filter
)
libAVF
ilter_AddRef
(
this
->
filter
);
ff_dshow_f
ilter_AddRef
(
this
->
filter
);
info
->
pFilter
=
(
IBaseFilter
*
)
this
->
filter
;
info
->
dir
=
PINDIR_INPUT
;
...
...
@@ -121,19 +115,17 @@ libAVPin_QueryPinInfo(libAVPin *this, PIN_INFO *info)
return
S_OK
;
}
long
WINAPI
libAVPin_QueryDirection
(
libAVPin
*
this
,
PIN_DIRECTION
*
dir
)
long
ff_dshow_pin_QueryDirection
(
DShowPin
*
this
,
PIN_DIRECTION
*
dir
)
{
dshowdebug
(
"
libAVP
in_QueryDirection(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_p
in_QueryDirection(%p)
\n
"
,
this
);
if
(
!
dir
)
return
E_POINTER
;
*
dir
=
PINDIR_INPUT
;
return
S_OK
;
}
long
WINAPI
libAVPin_QueryId
(
libAVPin
*
this
,
wchar_t
**
id
)
long
ff_dshow_pin_QueryId
(
DShowPin
*
this
,
wchar_t
**
id
)
{
dshowdebug
(
"
libAVP
in_QueryId(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_p
in_QueryId(%p)
\n
"
,
this
);
if
(
!
id
)
return
E_POINTER
;
...
...
@@ -142,67 +134,59 @@ libAVPin_QueryId(libAVPin *this, wchar_t **id)
return
S_OK
;
}
long
WINAPI
libAVPin_QueryAccept
(
libAVPin
*
this
,
const
AM_MEDIA_TYPE
*
type
)
long
ff_dshow_pin_QueryAccept
(
DShowPin
*
this
,
const
AM_MEDIA_TYPE
*
type
)
{
dshowdebug
(
"
libAVP
in_QueryAccept(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_p
in_QueryAccept(%p)
\n
"
,
this
);
return
S_FALSE
;
}
long
WINAPI
libAVPin_EnumMediaTypes
(
libAVPin
*
this
,
IEnumMediaTypes
**
enumtypes
)
long
ff_dshow_pin_EnumMediaTypes
(
DShowPin
*
this
,
IEnumMediaTypes
**
enumtypes
)
{
const
AM_MEDIA_TYPE
*
type
=
NULL
;
libAV
EnumMediaTypes
*
new
;
dshowdebug
(
"
libAVP
in_EnumMediaTypes(%p)
\n
"
,
this
);
DShow
EnumMediaTypes
*
new
;
dshowdebug
(
"
ff_dshow_p
in_EnumMediaTypes(%p)
\n
"
,
this
);
if
(
!
enumtypes
)
return
E_POINTER
;
new
=
libAVEnumMediaT
ypes_Create
(
type
);
new
=
ff_dshow_enummediat
ypes_Create
(
type
);
if
(
!
new
)
return
E_OUTOFMEMORY
;
*
enumtypes
=
(
IEnumMediaTypes
*
)
new
;
return
S_OK
;
}
long
WINAPI
libAVPin_QueryInternalConnections
(
libAVPin
*
this
,
IPin
**
pin
,
long
ff_dshow_pin_QueryInternalConnections
(
DShowPin
*
this
,
IPin
**
pin
,
unsigned
long
*
npin
)
{
dshowdebug
(
"
libAVP
in_QueryInternalConnections(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_p
in_QueryInternalConnections(%p)
\n
"
,
this
);
return
E_NOTIMPL
;
}
long
WINAPI
libAVPin_EndOfStream
(
libAVPin
*
this
)
long
ff_dshow_pin_EndOfStream
(
DShowPin
*
this
)
{
dshowdebug
(
"
libAVP
in_EndOfStream(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_p
in_EndOfStream(%p)
\n
"
,
this
);
/* I don't care. */
return
S_OK
;
}
long
WINAPI
libAVPin_BeginFlush
(
libAVPin
*
this
)
long
ff_dshow_pin_BeginFlush
(
DShowPin
*
this
)
{
dshowdebug
(
"
libAVP
in_BeginFlush(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_p
in_BeginFlush(%p)
\n
"
,
this
);
/* I don't care. */
return
S_OK
;
}
long
WINAPI
libAVPin_EndFlush
(
libAVPin
*
this
)
long
ff_dshow_pin_EndFlush
(
DShowPin
*
this
)
{
dshowdebug
(
"
libAVP
in_EndFlush(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_p
in_EndFlush(%p)
\n
"
,
this
);
/* I don't care. */
return
S_OK
;
}
long
WINAPI
libAVPin_NewSegment
(
libAVPin
*
this
,
REFERENCE_TIME
start
,
REFERENCE_TIME
stop
,
long
ff_dshow_pin_NewSegment
(
DShowPin
*
this
,
REFERENCE_TIME
start
,
REFERENCE_TIME
stop
,
double
rate
)
{
dshowdebug
(
"
libAVP
in_NewSegment(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_p
in_NewSegment(%p)
\n
"
,
this
);
/* I don't care. */
return
S_OK
;
}
static
int
libAVPin_Setup
(
libAVPin
*
this
,
libAVFilter
*
filter
)
static
int
ff_dshow_pin_Setup
(
DShowPin
*
this
,
DShowFilter
*
filter
)
{
IPinVtbl
*
vtbl
=
this
->
vtbl
;
IMemInputPinVtbl
*
imemvtbl
;
...
...
@@ -214,44 +198,43 @@ libAVPin_Setup(libAVPin *this, libAVFilter *filter)
if
(
!
imemvtbl
)
return
0
;
SETVTBL
(
imemvtbl
,
libAVMemInputP
in
,
QueryInterface
);
SETVTBL
(
imemvtbl
,
libAVMemInputP
in
,
AddRef
);
SETVTBL
(
imemvtbl
,
libAVMemInputP
in
,
Release
);
SETVTBL
(
imemvtbl
,
libAVMemInputP
in
,
GetAllocator
);
SETVTBL
(
imemvtbl
,
libAVMemInputP
in
,
NotifyAllocator
);
SETVTBL
(
imemvtbl
,
libAVMemInputP
in
,
GetAllocatorRequirements
);
SETVTBL
(
imemvtbl
,
libAVMemInputP
in
,
Receive
);
SETVTBL
(
imemvtbl
,
libAVMemInputP
in
,
ReceiveMultiple
);
SETVTBL
(
imemvtbl
,
libAVMemInputP
in
,
ReceiveCanBlock
);
SETVTBL
(
imemvtbl
,
meminputp
in
,
QueryInterface
);
SETVTBL
(
imemvtbl
,
meminputp
in
,
AddRef
);
SETVTBL
(
imemvtbl
,
meminputp
in
,
Release
);
SETVTBL
(
imemvtbl
,
meminputp
in
,
GetAllocator
);
SETVTBL
(
imemvtbl
,
meminputp
in
,
NotifyAllocator
);
SETVTBL
(
imemvtbl
,
meminputp
in
,
GetAllocatorRequirements
);
SETVTBL
(
imemvtbl
,
meminputp
in
,
Receive
);
SETVTBL
(
imemvtbl
,
meminputp
in
,
ReceiveMultiple
);
SETVTBL
(
imemvtbl
,
meminputp
in
,
ReceiveCanBlock
);
this
->
imemvtbl
=
imemvtbl
;
SETVTBL
(
vtbl
,
libAVP
in
,
QueryInterface
);
SETVTBL
(
vtbl
,
libAVP
in
,
AddRef
);
SETVTBL
(
vtbl
,
libAVP
in
,
Release
);
SETVTBL
(
vtbl
,
libAVP
in
,
Connect
);
SETVTBL
(
vtbl
,
libAVP
in
,
ReceiveConnection
);
SETVTBL
(
vtbl
,
libAVP
in
,
Disconnect
);
SETVTBL
(
vtbl
,
libAVP
in
,
ConnectedTo
);
SETVTBL
(
vtbl
,
libAVP
in
,
ConnectionMediaType
);
SETVTBL
(
vtbl
,
libAVP
in
,
QueryPinInfo
);
SETVTBL
(
vtbl
,
libAVP
in
,
QueryDirection
);
SETVTBL
(
vtbl
,
libAVP
in
,
QueryId
);
SETVTBL
(
vtbl
,
libAVP
in
,
QueryAccept
);
SETVTBL
(
vtbl
,
libAVP
in
,
EnumMediaTypes
);
SETVTBL
(
vtbl
,
libAVP
in
,
QueryInternalConnections
);
SETVTBL
(
vtbl
,
libAVP
in
,
EndOfStream
);
SETVTBL
(
vtbl
,
libAVP
in
,
BeginFlush
);
SETVTBL
(
vtbl
,
libAVP
in
,
EndFlush
);
SETVTBL
(
vtbl
,
libAVP
in
,
NewSegment
);
SETVTBL
(
vtbl
,
p
in
,
QueryInterface
);
SETVTBL
(
vtbl
,
p
in
,
AddRef
);
SETVTBL
(
vtbl
,
p
in
,
Release
);
SETVTBL
(
vtbl
,
p
in
,
Connect
);
SETVTBL
(
vtbl
,
p
in
,
ReceiveConnection
);
SETVTBL
(
vtbl
,
p
in
,
Disconnect
);
SETVTBL
(
vtbl
,
p
in
,
ConnectedTo
);
SETVTBL
(
vtbl
,
p
in
,
ConnectionMediaType
);
SETVTBL
(
vtbl
,
p
in
,
QueryPinInfo
);
SETVTBL
(
vtbl
,
p
in
,
QueryDirection
);
SETVTBL
(
vtbl
,
p
in
,
QueryId
);
SETVTBL
(
vtbl
,
p
in
,
QueryAccept
);
SETVTBL
(
vtbl
,
p
in
,
EnumMediaTypes
);
SETVTBL
(
vtbl
,
p
in
,
QueryInternalConnections
);
SETVTBL
(
vtbl
,
p
in
,
EndOfStream
);
SETVTBL
(
vtbl
,
p
in
,
BeginFlush
);
SETVTBL
(
vtbl
,
p
in
,
EndFlush
);
SETVTBL
(
vtbl
,
p
in
,
NewSegment
);
this
->
filter
=
filter
;
return
1
;
}
static
void
libAVPin_Free
(
libAVPin
*
this
)
static
void
ff_dshow_pin_Free
(
DShowPin
*
this
)
{
if
(
!
this
)
return
;
...
...
@@ -261,58 +244,51 @@ libAVPin_Free(libAVPin *this)
this
->
type
.
pbFormat
=
NULL
;
}
}
DECLARE_CREATE
(
libAVPin
,
libAVPin_Setup
(
this
,
filter
),
libAV
Filter
*
filter
)
DECLARE_DESTROY
(
libAVPin
,
libAVP
in_Free
)
DECLARE_CREATE
(
pin
,
DShowPin
,
ff_dshow_pin_Setup
(
this
,
filter
),
DShow
Filter
*
filter
)
DECLARE_DESTROY
(
pin
,
DShowPin
,
ff_dshow_p
in_Free
)
/*****************************************************************************
*
libAV
MemInputPin
*
DShow
MemInputPin
****************************************************************************/
long
WINAPI
libAVMemInputPin_QueryInterface
(
libAVMemInputPin
*
this
,
const
GUID
*
riid
,
long
ff_dshow_meminputpin_QueryInterface
(
DShowMemInputPin
*
this
,
const
GUID
*
riid
,
void
**
ppvObject
)
{
libAVPin
*
pin
=
(
libAV
Pin
*
)
((
uint8_t
*
)
this
-
imemoffset
);
dshowdebug
(
"
libAVMemInputP
in_QueryInterface(%p)
\n
"
,
this
);
return
libAVP
in_QueryInterface
(
pin
,
riid
,
ppvObject
);
DShowPin
*
pin
=
(
DShow
Pin
*
)
((
uint8_t
*
)
this
-
imemoffset
);
dshowdebug
(
"
ff_dshow_meminputp
in_QueryInterface(%p)
\n
"
,
this
);
return
ff_dshow_p
in_QueryInterface
(
pin
,
riid
,
ppvObject
);
}
unsigned
long
WINAPI
libAVMemInputPin_AddRef
(
libAVMemInputPin
*
this
)
unsigned
long
ff_dshow_meminputpin_AddRef
(
DShowMemInputPin
*
this
)
{
libAVPin
*
pin
=
(
libAV
Pin
*
)
((
uint8_t
*
)
this
-
imemoffset
);
dshowdebug
(
"
libAVMemInputP
in_AddRef(%p)
\n
"
,
this
);
return
libAVP
in_AddRef
(
pin
);
DShowPin
*
pin
=
(
DShow
Pin
*
)
((
uint8_t
*
)
this
-
imemoffset
);
dshowdebug
(
"
ff_dshow_meminputp
in_AddRef(%p)
\n
"
,
this
);
return
ff_dshow_p
in_AddRef
(
pin
);
}
unsigned
long
WINAPI
libAVMemInputPin_Release
(
libAVMemInputPin
*
this
)
unsigned
long
ff_dshow_meminputpin_Release
(
DShowMemInputPin
*
this
)
{
libAVPin
*
pin
=
(
libAV
Pin
*
)
((
uint8_t
*
)
this
-
imemoffset
);
dshowdebug
(
"
libAVMemInputP
in_Release(%p)
\n
"
,
this
);
return
libAVP
in_Release
(
pin
);
DShowPin
*
pin
=
(
DShow
Pin
*
)
((
uint8_t
*
)
this
-
imemoffset
);
dshowdebug
(
"
ff_dshow_meminputp
in_Release(%p)
\n
"
,
this
);
return
ff_dshow_p
in_Release
(
pin
);
}
long
WINAPI
libAVMemInputPin_GetAllocator
(
libAVMemInputPin
*
this
,
IMemAllocator
**
alloc
)
long
ff_dshow_meminputpin_GetAllocator
(
DShowMemInputPin
*
this
,
IMemAllocator
**
alloc
)
{
dshowdebug
(
"
libAVMemInputP
in_GetAllocator(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_meminputp
in_GetAllocator(%p)
\n
"
,
this
);
return
VFW_E_NO_ALLOCATOR
;
}
long
WINAPI
libAVMemInputPin_NotifyAllocator
(
libAVMemInputPin
*
this
,
IMemAllocator
*
alloc
,
long
ff_dshow_meminputpin_NotifyAllocator
(
DShowMemInputPin
*
this
,
IMemAllocator
*
alloc
,
BOOL
rdwr
)
{
dshowdebug
(
"
libAVMemInputP
in_NotifyAllocator(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_meminputp
in_NotifyAllocator(%p)
\n
"
,
this
);
return
S_OK
;
}
long
WINAPI
libAVMemInputPin_GetAllocatorRequirements
(
libAVMemInputPin
*
this
,
long
ff_dshow_meminputpin_GetAllocatorRequirements
(
DShowMemInputPin
*
this
,
ALLOCATOR_PROPERTIES
*
props
)
{
dshowdebug
(
"
libAVMemInputP
in_GetAllocatorRequirements(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_meminputp
in_GetAllocatorRequirements(%p)
\n
"
,
this
);
return
E_NOTIMPL
;
}
long
WINAPI
libAVMemInputPin_Receive
(
libAVMemInputPin
*
this
,
IMediaSample
*
sample
)
long
ff_dshow_meminputpin_Receive
(
DShowMemInputPin
*
this
,
IMediaSample
*
sample
)
{
libAVPin
*
pin
=
(
libAV
Pin
*
)
((
uint8_t
*
)
this
-
imemoffset
);
DShowPin
*
pin
=
(
DShow
Pin
*
)
((
uint8_t
*
)
this
-
imemoffset
);
enum
dshowDeviceType
devtype
=
pin
->
filter
->
type
;
void
*
priv_data
;
AVFormatContext
*
s
;
...
...
@@ -328,7 +304,7 @@ libAVMemInputPin_Receive(libAVMemInputPin *this, IMediaSample *sample)
struct
dshow_ctx
*
ctx
;
dshowdebug
(
"
libAVMemInputP
in_Receive(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_meminputp
in_Receive(%p)
\n
"
,
this
);
if
(
!
sample
)
return
E_POINTER
;
...
...
@@ -366,31 +342,28 @@ libAVMemInputPin_Receive(libAVMemInputPin *this, IMediaSample *sample)
return
S_OK
;
}
long
WINAPI
libAVMemInputPin_ReceiveMultiple
(
libAVMemInputPin
*
this
,
long
ff_dshow_meminputpin_ReceiveMultiple
(
DShowMemInputPin
*
this
,
IMediaSample
**
samples
,
long
n
,
long
*
nproc
)
{
int
i
;
dshowdebug
(
"
libAVMemInputP
in_ReceiveMultiple(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_meminputp
in_ReceiveMultiple(%p)
\n
"
,
this
);
for
(
i
=
0
;
i
<
n
;
i
++
)
libAVMemInputP
in_Receive
(
this
,
samples
[
i
]);
ff_dshow_meminputp
in_Receive
(
this
,
samples
[
i
]);
*
nproc
=
n
;
return
S_OK
;
}
long
WINAPI
libAVMemInputPin_ReceiveCanBlock
(
libAVMemInputPin
*
this
)
long
ff_dshow_meminputpin_ReceiveCanBlock
(
DShowMemInputPin
*
this
)
{
dshowdebug
(
"
libAVMemInputP
in_ReceiveCanBlock(%p)
\n
"
,
this
);
dshowdebug
(
"
ff_dshow_meminputp
in_ReceiveCanBlock(%p)
\n
"
,
this
);
/* I swear I will not block. */
return
S_FALSE
;
}
void
libAVMemInputPin_Destroy
(
libAVMemInputPin
*
this
)
void
ff_dshow_meminputpin_Destroy
(
DShowMemInputPin
*
this
)
{
libAVPin
*
pin
=
(
libAV
Pin
*
)
((
uint8_t
*
)
this
-
imemoffset
);
dshowdebug
(
"
libAVMemInputP
in_Destroy(%p)
\n
"
,
this
);
libAVP
in_Destroy
(
pin
);
DShowPin
*
pin
=
(
DShow
Pin
*
)
((
uint8_t
*
)
this
-
imemoffset
);
dshowdebug
(
"
ff_dshow_meminputp
in_Destroy(%p)
\n
"
,
this
);
ff_dshow_p
in_Destroy
(
pin
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment