22#ifndef AVDEVICE_DSHOW_CAPTURE_H
23#define AVDEVICE_DSHOW_CAPTURE_H
31#define NO_DSHOW_STRSAFE
40#define EC_DEVICE_LOST 0x1f
50#define dshowdebug(...) ff_dlog(&ff_dshow_context_class_ptr, __VA_ARGS__)
71#define DECLARE_QUERYINTERFACE(prefix, class, ...) \
73ff_dshow_##prefix##_QueryInterface(class *this, const GUID *riid, void **ppvObject) \
75 struct GUIDoffset ifaces[] = __VA_ARGS__; \
77 dshowdebug("ff_dshow_"AV_STRINGIFY(prefix)"_QueryInterface(%p, %p, %p)\n", this, riid, ppvObject); \
81 for (i = 0; i < sizeof(ifaces)/sizeof(ifaces[0]); i++) { \
82 if (IsEqualGUID(riid, ifaces[i].iid)) { \
83 void *obj = (void *) ((uint8_t *) this + ifaces[i].offset); \
84 ff_dshow_##prefix##_AddRef(this); \
85 dshowdebug("\tfound %d with offset %d\n", i, ifaces[i].offset); \
86 *ppvObject = (void *) obj; \
90 dshowdebug("\tE_NOINTERFACE\n"); \
92 return E_NOINTERFACE; \
94#define DECLARE_ADDREF(prefix, class) \
96ff_dshow_##prefix##_AddRef(class *this) \
98 dshowdebug("ff_dshow_"AV_STRINGIFY(prefix)"_AddRef(%p)\t%ld\n", this, this->ref+1); \
99 return InterlockedIncrement(&this->ref); \
101#define DECLARE_RELEASE(prefix, class) \
102unsigned long WINAPI \
103ff_dshow_##prefix##_Release(class *this) \
105 long ref = InterlockedDecrement(&this->ref); \
106 dshowdebug("ff_dshow_"AV_STRINGIFY(prefix)"_Release(%p)\t%ld\n", this, ref); \
108 ff_dshow_##prefix##_Destroy(this); \
112#define DECLARE_DESTROY(prefix, class, func) \
113void ff_dshow_##prefix##_Destroy(class *this) \
115 dshowdebug("ff_dshow_"AV_STRINGIFY(prefix)"_Destroy(%p)\n", this); \
119 CoTaskMemFree(this->vtbl); \
120 CoTaskMemFree(this); \
123#define DECLARE_CREATE(prefix, class, setup, ...) \
124class *ff_dshow_##prefix##_Create(__VA_ARGS__) \
126 class *this = CoTaskMemAlloc(sizeof(class)); \
127 dshowdebug("ff_dshow_"AV_STRINGIFY(prefix)"_Create(%p)\n", this); \
130 ZeroMemory(this, sizeof(class)); \
131 this->vtbl = CoTaskMemAlloc(sizeof(*this->vtbl)); \
134 ZeroMemory(this->vtbl, sizeof(*this->vtbl)); \
138 dshowdebug("created ff_dshow_"AV_STRINGIFY(prefix)" %p\n", this); \
141 ff_dshow_##prefix##_Destroy(this); \
142 dshowdebug("could not create ff_dshow_"AV_STRINGIFY(prefix)"\n"); \
146#define SETVTBL(vtbl, prefix, fn) \
147 do { (vtbl)->fn = (void *) ff_dshow_##prefix##_##fn; } while(0)
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Main libavdevice API header.
long WINAPI ff_dshow_filter_GetState(DShowFilter *, DWORD, FILTER_STATE *)
void ff_print_VIDEO_STREAM_CONFIG_CAPS(const VIDEO_STREAM_CONFIG_CAPS *caps)
long WINAPI ff_dshow_pin_EnumMediaTypes(DShowPin *, IEnumMediaTypes **)
unsigned long WINAPI ff_dshow_pin_Release(DShowPin *)
DShowPin * ff_dshow_pin_Create(DShowFilter *filter)
long WINAPI ff_dshow_pin_QueryAccept(DShowPin *, const AM_MEDIA_TYPE *)
long WINAPI ff_dshow_filter_GetClassID(DShowFilter *, CLSID *)
const AVClass * ff_dshow_context_class_ptr
long WINAPI ff_dshow_meminputpin_ReceiveMultiple(DShowMemInputPin *, IMediaSample **, long, long *)
void ff_print_AM_MEDIA_TYPE(const AM_MEDIA_TYPE *type)
void ff_dshow_show_filter_properties(IBaseFilter *pFilter, AVFormatContext *avctx)
Pops up a user dialog allowing them to adjust properties for the given filter, if possible.
long WINAPI ff_dshow_pin_QueryDirection(DShowPin *, PIN_DIRECTION *)
DShowFilter * ff_dshow_filter_Create(void *, void *, enum dshowDeviceType)
void ff_dshow_enummediatypes_Destroy(DShowEnumMediaTypes *)
long WINAPI ff_dshow_filter_FindPin(DShowFilter *, const wchar_t *, IPin **)
long WINAPI ff_dshow_enumpins_Clone(DShowEnumPins *, DShowEnumPins **)
void ff_dshow_pin_Destroy(DShowPin *)
long WINAPI ff_dshow_pin_QueryInterface(DShowPin *, const GUID *, void **)
long WINAPI ff_dshow_meminputpin_GetAllocator(DShowMemInputPin *, IMemAllocator **)
long ff_copy_dshow_media_type(AM_MEDIA_TYPE *dst, const AM_MEDIA_TYPE *src)
long WINAPI ff_dshow_meminputpin_Receive(DShowMemInputPin *, IMediaSample *)
long WINAPI ff_dshow_meminputpin_QueryInterface(DShowMemInputPin *, const GUID *, void **)
unsigned long WINAPI ff_dshow_enumpins_AddRef(DShowEnumPins *)
void ff_dshow_enumpins_Destroy(DShowEnumPins *)
unsigned long WINAPI ff_dshow_filter_AddRef(DShowFilter *)
long WINAPI ff_dshow_filter_Run(DShowFilter *, REFERENCE_TIME)
long WINAPI ff_dshow_filter_QueryVendorInfo(DShowFilter *, wchar_t **)
long WINAPI ff_dshow_meminputpin_ReceiveCanBlock(DShowMemInputPin *)
unsigned long WINAPI ff_dshow_meminputpin_Release(DShowMemInputPin *)
long WINAPI ff_dshow_enummediatypes_Next(DShowEnumMediaTypes *, unsigned long, AM_MEDIA_TYPE **, unsigned long *)
long WINAPI ff_dshow_enummediatypes_Clone(DShowEnumMediaTypes *, DShowEnumMediaTypes **)
DShowEnumMediaTypes * ff_dshow_enummediatypes_Create(const AM_MEDIA_TYPE *type)
long WINAPI ff_dshow_enummediatypes_Reset(DShowEnumMediaTypes *)
long WINAPI ff_dshow_enummediatypes_Skip(DShowEnumMediaTypes *, unsigned long)
long WINAPI ff_dshow_filter_Pause(DShowFilter *)
long WINAPI ff_dshow_filter_SetSyncSource(DShowFilter *, IReferenceClock *)
long WINAPI ff_dshow_pin_Disconnect(DShowPin *)
unsigned long WINAPI ff_dshow_enumpins_Release(DShowEnumPins *)
HRESULT ff_dshow_try_setup_crossbar_options(ICaptureGraphBuilder2 *graph_builder2, IBaseFilter *device_filter, enum dshowDeviceType devtype, AVFormatContext *avctx)
Given a fully constructed graph, check if there is a cross bar filter, and configure its pins if so.
long WINAPI ff_dshow_enumpins_Skip(DShowEnumPins *, unsigned long)
long WINAPI ff_dshow_enummediatypes_QueryInterface(DShowEnumMediaTypes *, const GUID *, void **)
long WINAPI ff_dshow_pin_EndFlush(DShowPin *)
DShowEnumPins * ff_dshow_enumpins_Create(DShowPin *pin, DShowFilter *filter)
long WINAPI ff_dshow_filter_EnumPins(DShowFilter *, IEnumPins **)
long WINAPI ff_dshow_enumpins_Reset(DShowEnumPins *)
long WINAPI ff_dshow_enumpins_Next(DShowEnumPins *, unsigned long, IPin **, unsigned long *)
long WINAPI ff_dshow_meminputpin_GetAllocatorRequirements(DShowMemInputPin *, ALLOCATOR_PROPERTIES *)
long WINAPI ff_dshow_filter_GetSyncSource(DShowFilter *, IReferenceClock **)
long WINAPI ff_dshow_filter_Stop(DShowFilter *)
struct DShowMemInputPin DShowMemInputPin
long WINAPI ff_dshow_pin_ConnectedTo(DShowPin *, IPin **)
unsigned long WINAPI ff_dshow_meminputpin_AddRef(DShowMemInputPin *)
long WINAPI ff_dshow_pin_QueryPinInfo(DShowPin *, PIN_INFO *)
long WINAPI ff_dshow_pin_ReceiveConnection(DShowPin *, IPin *, const AM_MEDIA_TYPE *)
long WINAPI ff_dshow_filter_QueryFilterInfo(DShowFilter *, FILTER_INFO *)
static void nothing(void *foo)
unsigned long WINAPI ff_dshow_enummediatypes_Release(DShowEnumMediaTypes *)
long WINAPI ff_dshow_enumpins_QueryInterface(DShowEnumPins *, const GUID *, void **)
long WINAPI ff_dshow_pin_QueryInternalConnections(DShowPin *, IPin **, unsigned long *)
long WINAPI ff_dshow_pin_NewSegment(DShowPin *, REFERENCE_TIME, REFERENCE_TIME, double)
long WINAPI ff_dshow_pin_BeginFlush(DShowPin *)
long WINAPI ff_dshow_pin_Connect(DShowPin *, IPin *, const AM_MEDIA_TYPE *)
void ff_dshow_filter_Destroy(DShowFilter *)
long WINAPI ff_dshow_filter_QueryInterface(DShowFilter *, const GUID *, void **)
long WINAPI ff_dshow_meminputpin_NotifyAllocator(DShowMemInputPin *, IMemAllocator *, BOOL)
long WINAPI ff_dshow_filter_JoinFilterGraph(DShowFilter *, IFilterGraph *, const wchar_t *)
long WINAPI ff_dshow_pin_QueryId(DShowPin *, wchar_t **)
void ff_print_AUDIO_STREAM_CONFIG_CAPS(const AUDIO_STREAM_CONFIG_CAPS *caps)
void ff_dshow_meminputpin_Destroy(DShowMemInputPin *)
unsigned long WINAPI ff_dshow_enummediatypes_AddRef(DShowEnumMediaTypes *)
void ff_printGUID(const GUID *g)
long WINAPI ff_dshow_pin_EndOfStream(DShowPin *)
long WINAPI ff_dshow_pin_ConnectionMediaType(DShowPin *, AM_MEDIA_TYPE *)
unsigned long WINAPI ff_dshow_pin_AddRef(DShowPin *)
unsigned long WINAPI ff_dshow_filter_Release(DShowFilter *)
AVCodecID
Identify the syntax and semantics of the bitstream.
common internal api header.
AVPixelFormat
Pixel format.
Describe the class of an AVClass context structure.
Rational number (pair of numerator and denominator).
void(* callback)(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time, enum dshowDeviceType type)
enum dshowDeviceType type
IMemInputPinVtbl * imemvtbl
IMediaEvent * media_event
int show_video_device_dialog
char * audio_filter_save_file
int crossbar_audio_input_pin_number
int show_analog_tv_tuner_audio_dialog
int show_analog_tv_tuner_dialog
char * audio_filter_load_file
int show_video_crossbar_connection_dialog
AVRational requested_framerate
int show_audio_device_dialog
int show_audio_crossbar_connection_dialog
char * video_filter_load_file
char * video_filter_save_file
int crossbar_video_input_pin_number
DShowPin * capture_pin[2]
enum AVCodecID video_codec_id
char * device_unique_name[2]
enum AVPixelFormat pixel_format
int use_video_device_timestamps
unsigned int video_frame_num
IBaseFilter * device_filter[2]
DShowFilter * capture_filter[2]
void(* filter)(uint8_t *src, ptrdiff_t stride, int qscale)