22 #ifndef AVDEVICE_DSHOW_CAPTURE_H 23 #define AVDEVICE_DSHOW_CAPTURE_H 30 #define WIN32_LEAN_AND_MEAN 32 #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) \ 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) \ 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 void *vtbl = CoTaskMemAlloc(sizeof(*this->vtbl)); \ 128 dshowdebug("ff_dshow_"AV_STRINGIFY(prefix)"_Create(%p)\n", this); \ 129 if (!this || !vtbl) \ 131 ZeroMemory(this, sizeof(class)); \ 132 ZeroMemory(vtbl, sizeof(*this->vtbl)); \ 137 dshowdebug("created ff_dshow_"AV_STRINGIFY(prefix)" %p\n", this); \ 140 ff_dshow_##prefix##_Destroy(this); \ 141 dshowdebug("could not create ff_dshow_"AV_STRINGIFY(prefix)"\n"); \ 145 #define SETVTBL(vtbl, prefix, fn) \ 146 do { (vtbl)->fn = (void *) ff_dshow_##prefix##_##fn; } while(0) 291 char *device_name[2];
292 char *device_unique_name[2];
315 IBaseFilter *device_filter[2];
327 int64_t curbufsize[2];
long ff_dshow_pin_QueryId(DShowPin *, wchar_t **)
unsigned long ff_dshow_enummediatypes_AddRef(DShowEnumMediaTypes *)
void ff_dshow_pin_Destroy(DShowPin *)
char * audio_filter_load_file
void ff_print_VIDEO_STREAM_CONFIG_CAPS(const VIDEO_STREAM_CONFIG_CAPS *caps)
long ff_dshow_filter_Pause(DShowFilter *)
long ff_dshow_enummediatypes_Reset(DShowEnumMediaTypes *)
long ff_dshow_filter_QueryVendorInfo(DShowFilter *, wchar_t **)
IMediaEvent * media_event
char * video_filter_load_file
void ff_dshow_filter_Destroy(DShowFilter *)
unsigned long ff_dshow_pin_AddRef(DShowPin *)
long ff_dshow_pin_EndOfStream(DShowPin *)
long ff_dshow_filter_GetClassID(DShowFilter *, CLSID *)
long ff_dshow_filter_QueryFilterInfo(DShowFilter *, FILTER_INFO *)
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...
int show_analog_tv_tuner_audio_dialog
int show_audio_crossbar_connection_dialog
long ff_dshow_filter_Stop(DShowFilter *)
DShowPin * ff_dshow_pin_Create(DShowFilter *filter)
long ff_dshow_pin_Disconnect(DShowPin *)
long ff_dshow_pin_ConnectionMediaType(DShowPin *, AM_MEDIA_TYPE *)
long ff_dshow_enummediatypes_Clone(DShowEnumMediaTypes *, DShowEnumMediaTypes **)
long ff_dshow_pin_QueryInternalConnections(DShowPin *, IPin **, unsigned long *)
unsigned long ff_dshow_filter_AddRef(DShowFilter *)
char * video_filter_save_file
long ff_dshow_pin_EnumMediaTypes(DShowPin *, IEnumMediaTypes **)
long ff_dshow_pin_QueryPinInfo(DShowPin *, PIN_INFO *)
unsigned long ff_dshow_filter_Release(DShowFilter *)
long ff_dshow_pin_Connect(DShowPin *, IPin *, const AM_MEDIA_TYPE *)
long ff_dshow_filter_GetSyncSource(DShowFilter *, IReferenceClock **)
long ff_dshow_meminputpin_GetAllocatorRequirements(DShowMemInputPin *, ALLOCATOR_PROPERTIES *)
unsigned long ff_dshow_enumpins_Release(DShowEnumPins *)
long ff_dshow_pin_NewSegment(DShowPin *, REFERENCE_TIME, REFERENCE_TIME, double)
long ff_dshow_meminputpin_Receive(DShowMemInputPin *, IMediaSample *)
Main libavdevice API header.
long ff_copy_dshow_media_type(AM_MEDIA_TYPE *dst, const AM_MEDIA_TYPE *src)
AVCodecID
Identify the syntax and semantics of the bitstream.
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
IMemInputPinVtbl * imemvtbl
DShowFilter * ff_dshow_filter_Create(void *, void *, enum dshowDeviceType)
long ff_dshow_enumpins_Next(DShowEnumPins *, unsigned long, IPin **, unsigned long *)
unsigned long ff_dshow_enummediatypes_Release(DShowEnumMediaTypes *)
static void callback(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time, enum dshowDeviceType devtype)
long ff_dshow_pin_EndFlush(DShowPin *)
unsigned long ff_dshow_meminputpin_AddRef(DShowMemInputPin *)
unsigned long ff_dshow_enumpins_AddRef(DShowEnumPins *)
void ff_print_AUDIO_STREAM_CONFIG_CAPS(const AUDIO_STREAM_CONFIG_CAPS *caps)
typedef void(APIENTRY *FF_PFNGLACTIVETEXTUREPROC)(GLenum texture)
AVRational requested_framerate
char * audio_filter_save_file
void ff_dshow_enummediatypes_Destroy(DShowEnumMediaTypes *)
long ff_dshow_enumpins_Clone(DShowEnumPins *, DShowEnumPins **)
long ff_dshow_filter_Run(DShowFilter *, REFERENCE_TIME)
long ff_dshow_filter_EnumPins(DShowFilter *, IEnumPins **)
long ff_dshow_pin_BeginFlush(DShowPin *)
long ff_dshow_filter_JoinFilterGraph(DShowFilter *, IFilterGraph *, const wchar_t *)
long ff_dshow_filter_GetState(DShowFilter *, DWORD, FILTER_STATE *)
long ff_dshow_meminputpin_ReceiveCanBlock(DShowMemInputPin *)
void ff_printGUID(const GUID *g)
long ff_dshow_enumpins_Reset(DShowEnumPins *)
unsigned long ff_dshow_meminputpin_Release(DShowMemInputPin *)
long ff_dshow_pin_ReceiveConnection(DShowPin *, IPin *, const AM_MEDIA_TYPE *)
DShowEnumPins * ff_dshow_enumpins_Create(DShowPin *pin, DShowFilter *filter)
Describe the class of an AVClass context structure.
long ff_dshow_meminputpin_GetAllocator(DShowMemInputPin *, IMemAllocator **)
Rational number (pair of numerator and denominator).
int show_audio_device_dialog
int show_video_device_dialog
long ff_dshow_enummediatypes_QueryInterface(DShowEnumMediaTypes *, const GUID *, void **)
long ff_dshow_pin_QueryInterface(DShowPin *, const GUID *, void **)
static void nothing(void *foo)
int crossbar_audio_input_pin_number
long ff_dshow_meminputpin_NotifyAllocator(DShowMemInputPin *, IMemAllocator *, BOOL)
const AVClass * ff_dshow_context_class_ptr
long ff_dshow_enummediatypes_Skip(DShowEnumMediaTypes *, unsigned long)
common internal api header.
long ff_dshow_enummediatypes_Next(DShowEnumMediaTypes *, unsigned long, AM_MEDIA_TYPE **, unsigned long *)
void ff_dshow_meminputpin_Destroy(DShowMemInputPin *)
long ff_dshow_meminputpin_QueryInterface(DShowMemInputPin *, const GUID *, void **)
long ff_dshow_enumpins_Skip(DShowEnumPins *, unsigned long)
long ff_dshow_meminputpin_ReceiveMultiple(DShowMemInputPin *, IMediaSample **, long, long *)
unsigned long ff_dshow_pin_Release(DShowPin *)
int crossbar_video_input_pin_number
DShowEnumMediaTypes * ff_dshow_enummediatypes_Create(const AM_MEDIA_TYPE *type)
void ff_print_AM_MEDIA_TYPE(const AM_MEDIA_TYPE *type)
long ff_dshow_pin_QueryAccept(DShowPin *, const AM_MEDIA_TYPE *)
struct DShowMemInputPin DShowMemInputPin
long ff_dshow_filter_QueryInterface(DShowFilter *, const GUID *, void **)
int show_video_crossbar_connection_dialog
unsigned int video_frame_num
long ff_dshow_pin_ConnectedTo(DShowPin *, IPin **)
long ff_dshow_pin_QueryDirection(DShowPin *, PIN_DIRECTION *)
AVPixelFormat
Pixel format.
long ff_dshow_filter_FindPin(DShowFilter *, const wchar_t *, IPin **)
int show_analog_tv_tuner_dialog
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 ff_dshow_filter_SetSyncSource(DShowFilter *, IReferenceClock *)
void ff_dshow_enumpins_Destroy(DShowEnumPins *)
long ff_dshow_enumpins_QueryInterface(DShowEnumPins *, const GUID *, void **)