Go to the documentation of this file.
22 #ifndef AVDEVICE_DSHOW_CAPTURE_H
23 #define AVDEVICE_DSHOW_CAPTURE_H
30 #define WIN32_LEAN_AND_MEAN
32 #define NO_DSHOW_STRSAFE
40 #ifndef EC_DEVICE_LOST
41 #define EC_DEVICE_LOST 0x1f
51 #define dshowdebug(...) ff_dlog(&ff_dshow_context_class_ptr, __VA_ARGS__)
72 #define DECLARE_QUERYINTERFACE(prefix, class, ...) \
74 ff_dshow_##prefix##_QueryInterface(class *this, const GUID *riid, void **ppvObject) \
76 struct GUIDoffset ifaces[] = __VA_ARGS__; \
78 dshowdebug("ff_dshow_"AV_STRINGIFY(prefix)"_QueryInterface(%p, %p, %p)\n", this, riid, ppvObject); \
82 for (i = 0; i < sizeof(ifaces)/sizeof(ifaces[0]); i++) { \
83 if (IsEqualGUID(riid, ifaces[i].iid)) { \
84 void *obj = (void *) ((uint8_t *) this + ifaces[i].offset); \
85 ff_dshow_##prefix##_AddRef(this); \
86 dshowdebug("\tfound %d with offset %d\n", i, ifaces[i].offset); \
87 *ppvObject = (void *) obj; \
91 dshowdebug("\tE_NOINTERFACE\n"); \
93 return E_NOINTERFACE; \
95 #define DECLARE_ADDREF(prefix, class) \
97 ff_dshow_##prefix##_AddRef(class *this) \
99 dshowdebug("ff_dshow_"AV_STRINGIFY(prefix)"_AddRef(%p)\t%ld\n", this, this->ref+1); \
100 return InterlockedIncrement(&this->ref); \
102 #define DECLARE_RELEASE(prefix, class) \
104 ff_dshow_##prefix##_Release(class *this) \
106 long ref = InterlockedDecrement(&this->ref); \
107 dshowdebug("ff_dshow_"AV_STRINGIFY(prefix)"_Release(%p)\t%ld\n", this, ref); \
109 ff_dshow_##prefix##_Destroy(this); \
113 #define DECLARE_DESTROY(prefix, class, func) \
114 void ff_dshow_##prefix##_Destroy(class *this) \
116 dshowdebug("ff_dshow_"AV_STRINGIFY(prefix)"_Destroy(%p)\n", this); \
120 CoTaskMemFree(this->vtbl); \
121 CoTaskMemFree(this); \
124 #define DECLARE_CREATE(prefix, class, setup, ...) \
125 class *ff_dshow_##prefix##_Create(__VA_ARGS__) \
127 class *this = CoTaskMemAlloc(sizeof(class)); \
128 void *vtbl = CoTaskMemAlloc(sizeof(*this->vtbl)); \
129 dshowdebug("ff_dshow_"AV_STRINGIFY(prefix)"_Create(%p)\n", this); \
130 if (!this || !vtbl) \
132 ZeroMemory(this, sizeof(class)); \
133 ZeroMemory(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)
230 IEnumMediaTypesVtbl *
vtbl;
251 IBaseFilterVtbl *
vtbl;
long ff_dshow_meminputpin_GetAllocator(DShowMemInputPin *, IMemAllocator **)
void ff_printGUID(const GUID *g)
long ff_dshow_filter_QueryFilterInfo(DShowFilter *, FILTER_INFO *)
enum AVCodecID video_codec_id
int show_audio_crossbar_connection_dialog
AVPixelFormat
Pixel format.
long ff_dshow_meminputpin_ReceiveMultiple(DShowMemInputPin *, IMediaSample **, long, long *)
long ff_dshow_filter_QueryInterface(DShowFilter *, const GUID *, void **)
static void nothing(void *foo)
long ff_dshow_filter_GetSyncSource(DShowFilter *, IReferenceClock **)
long ff_dshow_pin_QueryId(DShowPin *, wchar_t **)
IMediaEvent * media_event
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.
char * video_filter_save_file
unsigned int video_frame_num
void ff_print_VIDEO_STREAM_CONFIG_CAPS(const VIDEO_STREAM_CONFIG_CAPS *caps)
unsigned long ff_dshow_enumpins_Release(DShowEnumPins *)
long ff_dshow_pin_QueryPinInfo(DShowPin *, PIN_INFO *)
long ff_dshow_meminputpin_NotifyAllocator(DShowMemInputPin *, IMemAllocator *, BOOL)
long ff_dshow_enummediatypes_Skip(DShowEnumMediaTypes *, unsigned long)
long ff_dshow_meminputpin_Receive(DShowMemInputPin *, IMediaSample *)
long ff_dshow_pin_EndOfStream(DShowPin *)
long ff_dshow_filter_Stop(DShowFilter *)
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce then the filter should push the output frames on the output link immediately As an exception to the previous rule if the input frame is enough to produce several output frames then the filter needs output only at least one per link The additional frames can be left buffered in the filter
IBaseFilter * device_filter[2]
long ff_dshow_filter_SetSyncSource(DShowFilter *, IReferenceClock *)
char * video_filter_load_file
long ff_dshow_meminputpin_GetAllocatorRequirements(DShowMemInputPin *, ALLOCATOR_PROPERTIES *)
long ff_dshow_pin_Disconnect(DShowPin *)
long ff_dshow_pin_QueryInternalConnections(DShowPin *, IPin **, unsigned long *)
DShowPin * capture_pin[2]
long ff_dshow_enumpins_Clone(DShowEnumPins *, DShowEnumPins **)
void ff_dshow_pin_Destroy(DShowPin *)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
DShowFilter * ff_dshow_filter_Create(void *, void *, enum dshowDeviceType)
void ff_print_AM_MEDIA_TYPE(const AM_MEDIA_TYPE *type)
long ff_dshow_filter_EnumPins(DShowFilter *, IEnumPins **)
long ff_dshow_pin_QueryAccept(DShowPin *, const AM_MEDIA_TYPE *)
unsigned long ff_dshow_pin_AddRef(DShowPin *)
IMemInputPinVtbl * imemvtbl
int show_analog_tv_tuner_audio_dialog
unsigned long ff_dshow_filter_Release(DShowFilter *)
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.
unsigned long ff_dshow_meminputpin_Release(DShowMemInputPin *)
long ff_copy_dshow_media_type(AM_MEDIA_TYPE *dst, const AM_MEDIA_TYPE *src)
enum dshowDeviceType type
long ff_dshow_pin_QueryInterface(DShowPin *, const GUID *, void **)
void ff_dshow_filter_Destroy(DShowFilter *)
unsigned long ff_dshow_meminputpin_AddRef(DShowMemInputPin *)
long ff_dshow_pin_Connect(DShowPin *, IPin *, const AM_MEDIA_TYPE *)
long ff_dshow_pin_EnumMediaTypes(DShowPin *, IEnumMediaTypes **)
long ff_dshow_pin_ConnectionMediaType(DShowPin *, AM_MEDIA_TYPE *)
long ff_dshow_pin_BeginFlush(DShowPin *)
Describe the class of an AVClass context structure.
void ff_dshow_meminputpin_Destroy(DShowMemInputPin *)
Rational number (pair of numerator and denominator).
long ff_dshow_pin_EndFlush(DShowPin *)
void ff_print_AUDIO_STREAM_CONFIG_CAPS(const AUDIO_STREAM_CONFIG_CAPS *caps)
DShowEnumMediaTypes * ff_dshow_enummediatypes_Create(const AM_MEDIA_TYPE *type)
int show_audio_device_dialog
AVCodecID
Identify the syntax and semantics of the bitstream.
long ff_dshow_filter_Run(DShowFilter *, REFERENCE_TIME)
long ff_dshow_enummediatypes_Clone(DShowEnumMediaTypes *, DShowEnumMediaTypes **)
unsigned long ff_dshow_enummediatypes_Release(DShowEnumMediaTypes *)
long ff_dshow_enummediatypes_QueryInterface(DShowEnumMediaTypes *, const GUID *, void **)
AVRational requested_framerate
long ff_dshow_meminputpin_ReceiveCanBlock(DShowMemInputPin *)
struct DShowMemInputPin DShowMemInputPin
long ff_dshow_enumpins_Reset(DShowEnumPins *)
unsigned long ff_dshow_filter_AddRef(DShowFilter *)
long ff_dshow_pin_NewSegment(DShowPin *, REFERENCE_TIME, REFERENCE_TIME, double)
long ff_dshow_pin_QueryDirection(DShowPin *, PIN_DIRECTION *)
long ff_dshow_enummediatypes_Next(DShowEnumMediaTypes *, unsigned long, AM_MEDIA_TYPE **, unsigned long *)
long ff_dshow_filter_JoinFilterGraph(DShowFilter *, IFilterGraph *, const wchar_t *)
int crossbar_audio_input_pin_number
long ff_dshow_filter_GetState(DShowFilter *, DWORD, FILTER_STATE *)
void ff_dshow_enumpins_Destroy(DShowEnumPins *)
int show_video_device_dialog
long ff_dshow_enumpins_Next(DShowEnumPins *, unsigned long, IPin **, unsigned long *)
unsigned long ff_dshow_enumpins_AddRef(DShowEnumPins *)
long ff_dshow_enumpins_Skip(DShowEnumPins *, unsigned long)
char * audio_filter_save_file
unsigned long ff_dshow_pin_Release(DShowPin *)
DShowEnumPins * ff_dshow_enumpins_Create(DShowPin *pin, DShowFilter *filter)
long ff_dshow_filter_Pause(DShowFilter *)
void ff_dshow_enummediatypes_Destroy(DShowEnumMediaTypes *)
long ff_dshow_pin_ConnectedTo(DShowPin *, IPin **)
enum AVPixelFormat pixel_format
DShowFilter * capture_filter[2]
int crossbar_video_input_pin_number
const AVClass * ff_dshow_context_class_ptr
int show_analog_tv_tuner_dialog
long ff_dshow_pin_ReceiveConnection(DShowPin *, IPin *, const AM_MEDIA_TYPE *)
long ff_dshow_meminputpin_QueryInterface(DShowMemInputPin *, const GUID *, void **)
long ff_dshow_filter_QueryVendorInfo(DShowFilter *, wchar_t **)
long ff_dshow_enumpins_QueryInterface(DShowEnumPins *, const GUID *, void **)
char * audio_filter_load_file
int show_video_crossbar_connection_dialog
DShowPin * ff_dshow_pin_Create(DShowFilter *filter)
long ff_dshow_filter_FindPin(DShowFilter *, const wchar_t *, IPin **)
void(* callback)(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time, enum dshowDeviceType type)
long ff_dshow_filter_GetClassID(DShowFilter *, CLSID *)
unsigned long ff_dshow_enummediatypes_AddRef(DShowEnumMediaTypes *)
long ff_dshow_enummediatypes_Reset(DShowEnumMediaTypes *)
char * device_unique_name[2]