Go to the documentation of this file.
22 #ifndef AVDEVICE_DSHOW_CAPTURE_H
23 #define AVDEVICE_DSHOW_CAPTURE_H
31 #define NO_DSHOW_STRSAFE
39 #ifndef EC_DEVICE_LOST
40 #define EC_DEVICE_LOST 0x1f
50 #define dshowdebug(...) ff_dlog(&ff_dshow_context_class_ptr, __VA_ARGS__)
71 #define DECLARE_QUERYINTERFACE(prefix, class, ...) \
73 ff_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) \
95 unsigned long WINAPI \
96 ff_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) \
102 unsigned long WINAPI \
103 ff_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) \
113 void 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, ...) \
124 class *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)
230 IEnumMediaTypesVtbl *
vtbl;
251 IBaseFilterVtbl *
vtbl;
void ff_printGUID(const GUID *g)
enum AVCodecID video_codec_id
int show_audio_crossbar_connection_dialog
AVPixelFormat
Pixel format.
long WINAPI ff_dshow_enummediatypes_Reset(DShowEnumMediaTypes *)
long WINAPI ff_dshow_pin_QueryId(DShowPin *, wchar_t **)
long WINAPI ff_dshow_meminputpin_GetAllocator(DShowMemInputPin *, IMemAllocator **)
long WINAPI ff_dshow_filter_Run(DShowFilter *, REFERENCE_TIME)
static void nothing(void *foo)
unsigned long WINAPI ff_dshow_meminputpin_AddRef(DShowMemInputPin *)
long WINAPI ff_dshow_pin_QueryInterface(DShowPin *, const GUID *, void **)
unsigned long WINAPI ff_dshow_pin_Release(DShowPin *)
IMediaEvent * media_event
long WINAPI ff_dshow_pin_ReceiveConnection(DShowPin *, IPin *, const AM_MEDIA_TYPE *)
long WINAPI ff_dshow_filter_GetState(DShowFilter *, DWORD, FILTER_STATE *)
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
unsigned long WINAPI ff_dshow_enumpins_AddRef(DShowEnumPins *)
void ff_print_VIDEO_STREAM_CONFIG_CAPS(const VIDEO_STREAM_CONFIG_CAPS *caps)
long WINAPI ff_dshow_pin_EndFlush(DShowPin *)
long WINAPI ff_dshow_meminputpin_ReceiveCanBlock(DShowMemInputPin *)
void(* filter)(uint8_t *src, int stride, int qscale)
long WINAPI ff_dshow_pin_QueryAccept(DShowPin *, const AM_MEDIA_TYPE *)
IBaseFilter * device_filter[2]
unsigned long WINAPI ff_dshow_enummediatypes_Release(DShowEnumMediaTypes *)
char * video_filter_load_file
long WINAPI ff_dshow_filter_Stop(DShowFilter *)
unsigned long WINAPI ff_dshow_enummediatypes_AddRef(DShowEnumMediaTypes *)
long WINAPI ff_dshow_filter_QueryFilterInfo(DShowFilter *, FILTER_INFO *)
DShowPin * capture_pin[2]
void ff_dshow_pin_Destroy(DShowPin *)
long WINAPI ff_dshow_filter_EnumPins(DShowFilter *, IEnumPins **)
long WINAPI ff_dshow_meminputpin_GetAllocatorRequirements(DShowMemInputPin *, ALLOCATOR_PROPERTIES *)
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 WINAPI ff_dshow_filter_Pause(DShowFilter *)
IMemInputPinVtbl * imemvtbl
int show_analog_tv_tuner_audio_dialog
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_enummediatypes_Skip(DShowEnumMediaTypes *, unsigned long)
long WINAPI ff_dshow_enummediatypes_Next(DShowEnumMediaTypes *, unsigned long, AM_MEDIA_TYPE **, unsigned long *)
long ff_copy_dshow_media_type(AM_MEDIA_TYPE *dst, const AM_MEDIA_TYPE *src)
enum dshowDeviceType type
void ff_dshow_filter_Destroy(DShowFilter *)
unsigned long WINAPI ff_dshow_meminputpin_Release(DShowMemInputPin *)
long WINAPI ff_dshow_pin_EndOfStream(DShowPin *)
long WINAPI ff_dshow_enumpins_Skip(DShowEnumPins *, unsigned long)
Describe the class of an AVClass context structure.
void ff_dshow_meminputpin_Destroy(DShowMemInputPin *)
Rational number (pair of numerator and denominator).
long WINAPI ff_dshow_filter_GetSyncSource(DShowFilter *, IReferenceClock **)
long WINAPI ff_dshow_meminputpin_NotifyAllocator(DShowMemInputPin *, IMemAllocator *, BOOL)
long WINAPI ff_dshow_pin_Disconnect(DShowPin *)
long WINAPI ff_dshow_filter_FindPin(DShowFilter *, const wchar_t *, IPin **)
long WINAPI ff_dshow_pin_BeginFlush(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 WINAPI ff_dshow_pin_QueryInternalConnections(DShowPin *, IPin **, unsigned long *)
long WINAPI ff_dshow_pin_QueryPinInfo(DShowPin *, PIN_INFO *)
long WINAPI ff_dshow_filter_QueryInterface(DShowFilter *, const GUID *, void **)
long WINAPI ff_dshow_enumpins_Clone(DShowEnumPins *, DShowEnumPins **)
AVRational requested_framerate
int use_video_device_timestamps
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
struct DShowMemInputPin DShowMemInputPin
long WINAPI ff_dshow_pin_QueryDirection(DShowPin *, PIN_DIRECTION *)
long WINAPI ff_dshow_enumpins_Reset(DShowEnumPins *)
int crossbar_audio_input_pin_number
long WINAPI ff_dshow_pin_NewSegment(DShowPin *, REFERENCE_TIME, REFERENCE_TIME, double)
void ff_dshow_enumpins_Destroy(DShowEnumPins *)
int show_video_device_dialog
long WINAPI ff_dshow_filter_GetClassID(DShowFilter *, CLSID *)
long WINAPI ff_dshow_filter_JoinFilterGraph(DShowFilter *, IFilterGraph *, const wchar_t *)
char * audio_filter_save_file
DShowEnumPins * ff_dshow_enumpins_Create(DShowPin *pin, DShowFilter *filter)
long WINAPI ff_dshow_meminputpin_Receive(DShowMemInputPin *, IMediaSample *)
long WINAPI ff_dshow_pin_EnumMediaTypes(DShowPin *, IEnumMediaTypes **)
void ff_dshow_enummediatypes_Destroy(DShowEnumMediaTypes *)
long WINAPI ff_dshow_meminputpin_QueryInterface(DShowMemInputPin *, const GUID *, void **)
unsigned long WINAPI ff_dshow_filter_AddRef(DShowFilter *)
enum AVPixelFormat pixel_format
DShowFilter * capture_filter[2]
int crossbar_video_input_pin_number
long WINAPI ff_dshow_enumpins_QueryInterface(DShowEnumPins *, const GUID *, void **)
long WINAPI ff_dshow_pin_ConnectedTo(DShowPin *, IPin **)
const AVClass * ff_dshow_context_class_ptr
long WINAPI ff_dshow_filter_SetSyncSource(DShowFilter *, IReferenceClock *)
int show_analog_tv_tuner_dialog
long WINAPI ff_dshow_pin_ConnectionMediaType(DShowPin *, AM_MEDIA_TYPE *)
long WINAPI ff_dshow_meminputpin_ReceiveMultiple(DShowMemInputPin *, IMediaSample **, long, long *)
unsigned long WINAPI ff_dshow_pin_AddRef(DShowPin *)
char * audio_filter_load_file
long WINAPI ff_dshow_pin_Connect(DShowPin *, IPin *, const AM_MEDIA_TYPE *)
int show_video_crossbar_connection_dialog
long WINAPI ff_dshow_enummediatypes_QueryInterface(DShowEnumMediaTypes *, const GUID *, void **)
DShowPin * ff_dshow_pin_Create(DShowFilter *filter)
long WINAPI ff_dshow_enummediatypes_Clone(DShowEnumMediaTypes *, DShowEnumMediaTypes **)
void(* callback)(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time, enum dshowDeviceType type)
unsigned long WINAPI ff_dshow_enumpins_Release(DShowEnumPins *)
long WINAPI ff_dshow_enumpins_Next(DShowEnumPins *, unsigned long, IPin **, unsigned long *)
unsigned long WINAPI ff_dshow_filter_Release(DShowFilter *)
long WINAPI ff_dshow_filter_QueryVendorInfo(DShowFilter *, wchar_t **)
char * device_unique_name[2]