libavdevice/dshow.h File Reference

#include "avdevice.h"
#include <windows.h>
#include <dshow.h>
#include <dvdmedia.h>

Go to the source code of this file.

Data Structures

struct  GUIDoffset
struct  libAVPin
struct  libAVEnumPins
struct  libAVEnumMediaTypes
struct  libAVFilter

Defines

#define DSHOWDEBUG   0
#define COBJMACROS
#define dshowdebug(...)
#define DECLARE_QUERYINTERFACE(class,...)
#define DECLARE_ADDREF(class)
#define DECLARE_RELEASE(class)
#define DECLARE_DESTROY(class, func)
#define DECLARE_CREATE(class, setup,...)
#define SETVTBL(vtbl, class, fn)   do { (vtbl)->fn = (void *) class##_##fn; } while(0)

Typedefs

typedef struct libAVPin libAVPin
typedef struct libAVMemInputPin libAVMemInputPin
typedef struct libAVEnumPins libAVEnumPins
typedef struct libAVEnumMediaTypes libAVEnumMediaTypes
typedef struct libAVFilter libAVFilter

Enumerations

enum  dshowDeviceType { VideoDevice = 0, AudioDevice = 1 }

Functions

long ff_copy_dshow_media_type (AM_MEDIA_TYPE *dst, const AM_MEDIA_TYPE *src)
void ff_print_AM_MEDIA_TYPE (const AM_MEDIA_TYPE *type)
void ff_printGUID (const GUID *g)
static void nothing (void *foo)
long WINAPI libAVPin_QueryInterface (libAVPin *, const GUID *, void **)
unsigned long WINAPI libAVPin_AddRef (libAVPin *)
unsigned long WINAPI libAVPin_Release (libAVPin *)
long WINAPI libAVPin_Connect (libAVPin *, IPin *, const AM_MEDIA_TYPE *)
long WINAPI libAVPin_ReceiveConnection (libAVPin *, IPin *, const AM_MEDIA_TYPE *)
long WINAPI libAVPin_Disconnect (libAVPin *)
long WINAPI libAVPin_ConnectedTo (libAVPin *, IPin **)
long WINAPI libAVPin_ConnectionMediaType (libAVPin *, AM_MEDIA_TYPE *)
long WINAPI libAVPin_QueryPinInfo (libAVPin *, PIN_INFO *)
long WINAPI libAVPin_QueryDirection (libAVPin *, PIN_DIRECTION *)
long WINAPI libAVPin_QueryId (libAVPin *, wchar_t **)
long WINAPI libAVPin_QueryAccept (libAVPin *, const AM_MEDIA_TYPE *)
long WINAPI libAVPin_EnumMediaTypes (libAVPin *, IEnumMediaTypes **)
long WINAPI libAVPin_QueryInternalConnections (libAVPin *, IPin **, unsigned long *)
long WINAPI libAVPin_EndOfStream (libAVPin *)
long WINAPI libAVPin_BeginFlush (libAVPin *)
long WINAPI libAVPin_EndFlush (libAVPin *)
long WINAPI libAVPin_NewSegment (libAVPin *, REFERENCE_TIME, REFERENCE_TIME, double)
long WINAPI libAVMemInputPin_QueryInterface (libAVMemInputPin *, const GUID *, void **)
unsigned long WINAPI libAVMemInputPin_AddRef (libAVMemInputPin *)
unsigned long WINAPI libAVMemInputPin_Release (libAVMemInputPin *)
long WINAPI libAVMemInputPin_GetAllocator (libAVMemInputPin *, IMemAllocator **)
long WINAPI libAVMemInputPin_NotifyAllocator (libAVMemInputPin *, IMemAllocator *, WINBOOL)
long WINAPI libAVMemInputPin_GetAllocatorRequirements (libAVMemInputPin *, ALLOCATOR_PROPERTIES *)
long WINAPI libAVMemInputPin_Receive (libAVMemInputPin *, IMediaSample *)
long WINAPI libAVMemInputPin_ReceiveMultiple (libAVMemInputPin *, IMediaSample **, long, long *)
long WINAPI libAVMemInputPin_ReceiveCanBlock (libAVMemInputPin *)
void libAVPin_Destroy (libAVPin *)
libAVPinlibAVPin_Create (libAVFilter *filter)
void libAVMemInputPin_Destroy (libAVMemInputPin *)
long WINAPI libAVEnumPins_QueryInterface (libAVEnumPins *, const GUID *, void **)
unsigned long WINAPI libAVEnumPins_AddRef (libAVEnumPins *)
unsigned long WINAPI libAVEnumPins_Release (libAVEnumPins *)
long WINAPI libAVEnumPins_Next (libAVEnumPins *, unsigned long, IPin **, unsigned long *)
long WINAPI libAVEnumPins_Skip (libAVEnumPins *, unsigned long)
long WINAPI libAVEnumPins_Reset (libAVEnumPins *)
long WINAPI libAVEnumPins_Clone (libAVEnumPins *, libAVEnumPins **)
void libAVEnumPins_Destroy (libAVEnumPins *)
libAVEnumPinslibAVEnumPins_Create (libAVPin *pin, libAVFilter *filter)
long WINAPI libAVEnumMediaTypes_QueryInterface (libAVEnumMediaTypes *, const GUID *, void **)
unsigned long WINAPI libAVEnumMediaTypes_AddRef (libAVEnumMediaTypes *)
unsigned long WINAPI libAVEnumMediaTypes_Release (libAVEnumMediaTypes *)
long WINAPI libAVEnumMediaTypes_Next (libAVEnumMediaTypes *, unsigned long, AM_MEDIA_TYPE **, unsigned long *)
long WINAPI libAVEnumMediaTypes_Skip (libAVEnumMediaTypes *, unsigned long)
long WINAPI libAVEnumMediaTypes_Reset (libAVEnumMediaTypes *)
long WINAPI libAVEnumMediaTypes_Clone (libAVEnumMediaTypes *, libAVEnumMediaTypes **)
void libAVEnumMediaTypes_Destroy (libAVEnumMediaTypes *)
libAVEnumMediaTypeslibAVEnumMediaTypes_Create (const AM_MEDIA_TYPE *type)
long WINAPI libAVFilter_QueryInterface (libAVFilter *, const GUID *, void **)
unsigned long WINAPI libAVFilter_AddRef (libAVFilter *)
unsigned long WINAPI libAVFilter_Release (libAVFilter *)
long WINAPI libAVFilter_GetClassID (libAVFilter *, CLSID *)
long WINAPI libAVFilter_Stop (libAVFilter *)
long WINAPI libAVFilter_Pause (libAVFilter *)
long WINAPI libAVFilter_Run (libAVFilter *, REFERENCE_TIME)
long WINAPI libAVFilter_GetState (libAVFilter *, DWORD, FILTER_STATE *)
long WINAPI libAVFilter_SetSyncSource (libAVFilter *, IReferenceClock *)
long WINAPI libAVFilter_GetSyncSource (libAVFilter *, IReferenceClock **)
long WINAPI libAVFilter_EnumPins (libAVFilter *, IEnumPins **)
long WINAPI libAVFilter_FindPin (libAVFilter *, const wchar_t *, IPin **)
long WINAPI libAVFilter_QueryFilterInfo (libAVFilter *, FILTER_INFO *)
long WINAPI libAVFilter_JoinFilterGraph (libAVFilter *, IFilterGraph *, const wchar_t *)
long WINAPI libAVFilter_QueryVendorInfo (libAVFilter *, wchar_t **)
void libAVFilter_Destroy (libAVFilter *)
libAVFilterlibAVFilter_Create (void *, void *, enum dshowDeviceType)


Define Documentation

#define COBJMACROS

Definition at line 26 of file dshow.h.

#define DECLARE_ADDREF ( class   ) 

Value:

unsigned long WINAPI                                                         \
class##_AddRef(class *this)                                                  \
{                                                                            \
    dshowdebug(AV_STRINGIFY(class)"_AddRef(%p)\t%ld\n", this, this->ref+1);  \
    return InterlockedIncrement(&this->ref);                                 \
}

Definition at line 79 of file dshow.h.

#define DECLARE_CREATE ( class,
setup,
...   ) 

Value:

class *class##_Create(__VA_ARGS__)                                           \
{                                                                            \
    class *this = CoTaskMemAlloc(sizeof(class));                             \
    void  *vtbl = CoTaskMemAlloc(sizeof(*this->vtbl));                       \
    dshowdebug(AV_STRINGIFY(class)"_Create(%p)\n", this);                    \
    if (!this || !vtbl)                                                      \
        goto fail;                                                           \
    ZeroMemory(this, sizeof(class));                                         \
    ZeroMemory(vtbl, sizeof(*this->vtbl));                                   \
    this->ref  = 1;                                                          \
    this->vtbl = vtbl;                                                       \
    if (!setup)                                                              \
        goto fail;                                                           \
    dshowdebug("created "AV_STRINGIFY(class)" %p\n", this);                  \
    return this;                                                             \
fail:                                                                        \
    class##_Destroy(this);                                                   \
    dshowdebug("could not create "AV_STRINGIFY(class)"\n");                  \
    return NULL;                                                             \
}

Definition at line 108 of file dshow.h.

#define DECLARE_DESTROY ( class,
func   ) 

Value:

void class##_Destroy(class *this)                                            \
{                                                                            \
    dshowdebug(AV_STRINGIFY(class)"_Destroy(%p)\n", this);                   \
    func(this);                                                              \
    if (this) {                                                              \
        if (this->vtbl)                                                      \
            CoTaskMemFree(this->vtbl);                                       \
        CoTaskMemFree(this);                                                 \
    }                                                                        \
}

Definition at line 97 of file dshow.h.

#define DECLARE_QUERYINTERFACE ( class,
...   ) 

Value:

long WINAPI                                                                  \
class##_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); \
    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);                                            \
            dshowdebug("\tfound %d with offset %d\n", i, ifaces[i].offset);  \
            *ppvObject = (void *) obj;                                       \
            return S_OK;                                                     \
        }                                                                    \
    }                                                                        \
    dshowdebug("\tE_NOINTERFACE\n");                                         \
    *ppvObject = NULL;                                                       \
    return E_NOINTERFACE;                                                    \
}

Definition at line 56 of file dshow.h.

#define DECLARE_RELEASE ( class   ) 

Value:

unsigned long WINAPI                                                         \
class##_Release(class *this)                                                 \
{                                                                            \
    long ref = InterlockedDecrement(&this->ref);                             \
    dshowdebug(AV_STRINGIFY(class)"_Release(%p)\t%ld\n", this, ref);         \
    if (!ref)                                                                \
        class##_Destroy(this);                                               \
    return ref;                                                              \
}

Definition at line 86 of file dshow.h.

#define dshowdebug ( ...   ) 

#define DSHOWDEBUG   0

Definition at line 22 of file dshow.h.

#define SETVTBL ( vtbl,
class,
fn   )     do { (vtbl)->fn = (void *) class##_##fn; } while(0)


Typedef Documentation

Definition at line 139 of file dshow.h.

typedef struct libAVEnumPins libAVEnumPins

Definition at line 138 of file dshow.h.

typedef struct libAVFilter libAVFilter

Definition at line 140 of file dshow.h.

Definition at line 137 of file dshow.h.

typedef struct libAVPin libAVPin

Definition at line 136 of file dshow.h.


Enumeration Type Documentation

Enumerator:
VideoDevice 
AudioDevice 

Definition at line 51 of file dshow.h.


Function Documentation

long ff_copy_dshow_media_type ( AM_MEDIA_TYPE *  dst,
const AM_MEDIA_TYPE *  src 
)

void ff_print_AM_MEDIA_TYPE ( const AM_MEDIA_TYPE *  type  ) 

Definition at line 85 of file dshow_common.c.

Referenced by libAVPin_ReceiveConnection().

void ff_printGUID ( const GUID *  g  ) 

Definition at line 42 of file dshow_common.c.

Referenced by ff_print_AM_MEDIA_TYPE().

unsigned long WINAPI libAVEnumMediaTypes_AddRef ( libAVEnumMediaTypes  ) 

long WINAPI libAVEnumMediaTypes_Clone ( libAVEnumMediaTypes ,
libAVEnumMediaTypes **   
)

Definition at line 68 of file dshow_enummediatypes.c.

libAVEnumMediaTypes* libAVEnumMediaTypes_Create ( const AM_MEDIA_TYPE *  type  ) 

void libAVEnumMediaTypes_Destroy ( libAVEnumMediaTypes  ) 

long WINAPI libAVEnumMediaTypes_Next ( libAVEnumMediaTypes ,
unsigned  long,
AM_MEDIA_TYPE **  ,
unsigned long *   
)

long WINAPI libAVEnumMediaTypes_QueryInterface ( libAVEnumMediaTypes ,
const GUID *  ,
void **   
)

unsigned long WINAPI libAVEnumMediaTypes_Release ( libAVEnumMediaTypes  ) 

long WINAPI libAVEnumMediaTypes_Reset ( libAVEnumMediaTypes  ) 

Definition at line 61 of file dshow_enummediatypes.c.

long WINAPI libAVEnumMediaTypes_Skip ( libAVEnumMediaTypes ,
unsigned  long 
)

Definition at line 53 of file dshow_enummediatypes.c.

unsigned long WINAPI libAVEnumPins_AddRef ( libAVEnumPins  ) 

long WINAPI libAVEnumPins_Clone ( libAVEnumPins ,
libAVEnumPins **   
)

Definition at line 65 of file dshow_enumpins.c.

libAVEnumPins* libAVEnumPins_Create ( libAVPin pin,
libAVFilter filter 
)

void libAVEnumPins_Destroy ( libAVEnumPins  ) 

long WINAPI libAVEnumPins_Next ( libAVEnumPins ,
unsigned  long,
IPin **  ,
unsigned long *   
)

long WINAPI libAVEnumPins_QueryInterface ( libAVEnumPins ,
const GUID *  ,
void **   
)

unsigned long WINAPI libAVEnumPins_Release ( libAVEnumPins  ) 

long WINAPI libAVEnumPins_Reset ( libAVEnumPins  ) 

Definition at line 58 of file dshow_enumpins.c.

long WINAPI libAVEnumPins_Skip ( libAVEnumPins ,
unsigned  long 
)

Definition at line 50 of file dshow_enumpins.c.

unsigned long WINAPI libAVFilter_AddRef ( libAVFilter  ) 

libAVFilter* libAVFilter_Create ( void *  ,
void *  ,
enum  dshowDeviceType 
)

Referenced by dshow_open_device().

void libAVFilter_Destroy ( libAVFilter  ) 

long WINAPI libAVFilter_EnumPins ( libAVFilter ,
IEnumPins **   
)

Definition at line 96 of file dshow_filter.c.

long WINAPI libAVFilter_FindPin ( libAVFilter ,
const wchar_t *  ,
IPin **   
)

Definition at line 111 of file dshow_filter.c.

long WINAPI libAVFilter_GetClassID ( libAVFilter ,
CLSID *   
)

long WINAPI libAVFilter_GetState ( libAVFilter ,
DWORD  ,
FILTER_STATE *   
)

Definition at line 59 of file dshow_filter.c.

long WINAPI libAVFilter_GetSyncSource ( libAVFilter ,
IReferenceClock **   
)

Definition at line 83 of file dshow_filter.c.

long WINAPI libAVFilter_JoinFilterGraph ( libAVFilter ,
IFilterGraph *  ,
const wchar_t *   
)

Definition at line 142 of file dshow_filter.c.

long WINAPI libAVFilter_Pause ( libAVFilter  ) 

Definition at line 44 of file dshow_filter.c.

long WINAPI libAVFilter_QueryFilterInfo ( libAVFilter ,
FILTER_INFO *   
)

Definition at line 129 of file dshow_filter.c.

long WINAPI libAVFilter_QueryInterface ( libAVFilter ,
const GUID *  ,
void **   
)

long WINAPI libAVFilter_QueryVendorInfo ( libAVFilter ,
wchar_t **   
)

Definition at line 154 of file dshow_filter.c.

unsigned long WINAPI libAVFilter_Release ( libAVFilter  ) 

Referenced by dshow_read_close().

long WINAPI libAVFilter_Run ( libAVFilter ,
REFERENCE_TIME   
)

Definition at line 51 of file dshow_filter.c.

long WINAPI libAVFilter_SetSyncSource ( libAVFilter ,
IReferenceClock *   
)

Definition at line 68 of file dshow_filter.c.

long WINAPI libAVFilter_Stop ( libAVFilter  ) 

Definition at line 37 of file dshow_filter.c.

unsigned long WINAPI libAVMemInputPin_AddRef ( libAVMemInputPin  ) 

void libAVMemInputPin_Destroy ( libAVMemInputPin  ) 

long WINAPI libAVMemInputPin_GetAllocator ( libAVMemInputPin ,
IMemAllocator **   
)

long WINAPI libAVMemInputPin_GetAllocatorRequirements ( libAVMemInputPin ,
ALLOCATOR_PROPERTIES *   
)

long WINAPI libAVMemInputPin_NotifyAllocator ( libAVMemInputPin ,
IMemAllocator *  ,
WINBOOL   
)

long WINAPI libAVMemInputPin_QueryInterface ( libAVMemInputPin ,
const GUID *  ,
void **   
)

long WINAPI libAVMemInputPin_Receive ( libAVMemInputPin ,
IMediaSample *   
)

long WINAPI libAVMemInputPin_ReceiveCanBlock ( libAVMemInputPin  ) 

long WINAPI libAVMemInputPin_ReceiveMultiple ( libAVMemInputPin ,
IMediaSample **  ,
long  ,
long *   
)

unsigned long WINAPI libAVMemInputPin_Release ( libAVMemInputPin  ) 

unsigned long WINAPI libAVPin_AddRef ( libAVPin  ) 

long WINAPI libAVPin_BeginFlush ( libAVPin  ) 

Definition at line 181 of file dshow_pin.c.

long WINAPI libAVPin_Connect ( libAVPin ,
IPin *  ,
const AM_MEDIA_TYPE *   
)

long WINAPI libAVPin_ConnectedTo ( libAVPin ,
IPin **   
)

Definition at line 81 of file dshow_pin.c.

long WINAPI libAVPin_ConnectionMediaType ( libAVPin ,
AM_MEDIA_TYPE *   
)

Definition at line 95 of file dshow_pin.c.

Referenced by dshow_add_device().

libAVPin* libAVPin_Create ( libAVFilter filter  ) 

Referenced by libAVFilter_Setup().

void libAVPin_Destroy ( libAVPin  ) 

long WINAPI libAVPin_Disconnect ( libAVPin  ) 

Definition at line 68 of file dshow_pin.c.

long WINAPI libAVPin_EndFlush ( libAVPin  ) 

Definition at line 188 of file dshow_pin.c.

long WINAPI libAVPin_EndOfStream ( libAVPin  ) 

Definition at line 174 of file dshow_pin.c.

long WINAPI libAVPin_EnumMediaTypes ( libAVPin ,
IEnumMediaTypes **   
)

Definition at line 151 of file dshow_pin.c.

long WINAPI libAVPin_NewSegment ( libAVPin ,
REFERENCE_TIME  ,
REFERENCE_TIME  ,
double   
)

Definition at line 195 of file dshow_pin.c.

long WINAPI libAVPin_QueryAccept ( libAVPin ,
const AM_MEDIA_TYPE *   
)

Definition at line 145 of file dshow_pin.c.

long WINAPI libAVPin_QueryDirection ( libAVPin ,
PIN_DIRECTION *   
)

Definition at line 124 of file dshow_pin.c.

long WINAPI libAVPin_QueryId ( libAVPin ,
wchar_t **   
)

Definition at line 133 of file dshow_pin.c.

long WINAPI libAVPin_QueryInterface ( libAVPin ,
const GUID *  ,
void **   
)

long WINAPI libAVPin_QueryInternalConnections ( libAVPin ,
IPin **  ,
unsigned long *   
)

Definition at line 167 of file dshow_pin.c.

long WINAPI libAVPin_QueryPinInfo ( libAVPin ,
PIN_INFO *   
)

Definition at line 107 of file dshow_pin.c.

long WINAPI libAVPin_ReceiveConnection ( libAVPin ,
IPin *  ,
const AM_MEDIA_TYPE *   
)

Definition at line 40 of file dshow_pin.c.

unsigned long WINAPI libAVPin_Release ( libAVPin  ) 

Referenced by dshow_read_close().

static void nothing ( void *  foo  )  [inline, static]

Definition at line 42 of file dshow.h.


Generated on Fri Oct 26 02:38:19 2012 for FFmpeg by  doxygen 1.5.8