libavdevice/dshow.c File Reference

#include "libavutil/parseutils.h"
#include "libavutil/opt.h"
#include "libavformat/internal.h"
#include "avdevice.h"
#include "dshow.h"

Go to the source code of this file.

Data Structures

struct  dshow_ctx

Defines

#define OFFSET(x)   offsetof(struct dshow_ctx, x)
#define DEC   AV_OPT_FLAG_DECODING_PARAM

Functions

static enum PixelFormat dshow_pixfmt (DWORD biCompression, WORD biBitCount)
static enum CodecID dshow_codecid (DWORD biCompression)
static int dshow_read_close (AVFormatContext *s)
static char * dup_wchar_to_utf8 (wchar_t *w)
static int shall_we_drop (AVFormatContext *s)
static void callback (void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time)
static int dshow_cycle_devices (AVFormatContext *avctx, ICreateDevEnum *devenum, enum dshowDeviceType devtype, IBaseFilter **pfilter)
 Cycle through available devices using the device enumerator devenum, retrieve the device with type specified by devtype and return the pointer to the object found in *pfilter.
static void dshow_cycle_formats (AVFormatContext *avctx, enum dshowDeviceType devtype, IPin *pin, int *pformat_set)
 Cycle through available formats using the specified pin, try to set parameters specified through AVOptions and if successful return 1 in *pformat_set.
static int dshow_cycle_pins (AVFormatContext *avctx, enum dshowDeviceType devtype, IBaseFilter *device_filter, IPin **ppin)
 Cycle through available pins using the device_filter device, of type devtype, retrieve the first output pin and return the pointer to the object found in *ppin.
static int dshow_list_device_options (AVFormatContext *avctx, ICreateDevEnum *devenum, enum dshowDeviceType devtype)
 List options for device with type devtype.
static int dshow_open_device (AVFormatContext *avctx, ICreateDevEnum *devenum, enum dshowDeviceType devtype)
static enum CodecID waveform_codec_id (enum AVSampleFormat sample_fmt)
static enum SampleFormat sample_fmt_bits_per_sample (int bits)
static int dshow_add_device (AVFormatContext *avctx, AVFormatParameters *ap, enum dshowDeviceType devtype)
static int parse_device_name (AVFormatContext *avctx)
static int dshow_read_header (AVFormatContext *avctx, AVFormatParameters *ap)
static int dshow_read_packet (AVFormatContext *s, AVPacket *pkt)

Variables

static const AVOption options []
static const AVClass dshow_class
AVInputFormat ff_dshow_demuxer


Define Documentation

#define DEC   AV_OPT_FLAG_DECODING_PARAM

Definition at line 938 of file dshow.c.

#define OFFSET (  )     offsetof(struct dshow_ctx, x)

Definition at line 937 of file dshow.c.


Function Documentation

static void callback ( void *  priv_data,
int  index,
uint8_t *  buf,
int  buf_size,
int64_t  time 
) [static]

Definition at line 202 of file dshow.c.

Referenced by av_log_set_callback(), dshow_open_device(), and libspeex_decode_init().

static int dshow_add_device ( AVFormatContext avctx,
AVFormatParameters ap,
enum dshowDeviceType  devtype 
) [static]

Definition at line 663 of file dshow.c.

Referenced by dshow_read_header().

static enum CodecID dshow_codecid ( DWORD  biCompression  )  [static]

Definition at line 95 of file dshow.c.

Referenced by dshow_add_device().

static int dshow_cycle_devices ( AVFormatContext avctx,
ICreateDevEnum *  devenum,
enum dshowDeviceType  devtype,
IBaseFilter **  pfilter 
) [static]

Cycle through available devices using the device enumerator devenum, retrieve the device with type specified by devtype and return the pointer to the object found in *pfilter.

If pfilter is NULL, list all device names.

Definition at line 249 of file dshow.c.

Referenced by dshow_list_device_options(), dshow_open_device(), and dshow_read_header().

static void dshow_cycle_formats ( AVFormatContext avctx,
enum dshowDeviceType  devtype,
IPin *  pin,
int *  pformat_set 
) [static]

Cycle through available formats using the specified pin, try to set parameters specified through AVOptions and if successful return 1 in *pformat_set.

If pformat_set is NULL, list all pin capabilities.

Definition at line 328 of file dshow.c.

Referenced by dshow_cycle_pins().

static int dshow_cycle_pins ( AVFormatContext avctx,
enum dshowDeviceType  devtype,
IBaseFilter *  device_filter,
IPin **  ppin 
) [static]

Cycle through available pins using the device_filter device, of type devtype, retrieve the first output pin and return the pointer to the object found in *ppin.

If ppin is NULL, cycle through all pins listing audio/video capabilities.

Definition at line 456 of file dshow.c.

Referenced by dshow_list_device_options(), and dshow_open_device().

static int dshow_list_device_options ( AVFormatContext avctx,
ICreateDevEnum *  devenum,
enum dshowDeviceType  devtype 
) [static]

List options for device with type devtype.

Parameters:
devenum device enumerator used for accessing the device

Definition at line 562 of file dshow.c.

Referenced by dshow_read_header().

static int dshow_open_device ( AVFormatContext avctx,
ICreateDevEnum *  devenum,
enum dshowDeviceType  devtype 
) [static]

Definition at line 579 of file dshow.c.

Referenced by dshow_read_header().

static enum PixelFormat dshow_pixfmt ( DWORD  biCompression,
WORD  biBitCount 
) [static]

Definition at line 66 of file dshow.c.

Referenced by dshow_add_device().

static int dshow_read_close ( AVFormatContext s  )  [static]

Definition at line 108 of file dshow.c.

Referenced by dshow_add_device(), and dshow_read_header().

static int dshow_read_header ( AVFormatContext avctx,
AVFormatParameters ap 
) [static]

Definition at line 787 of file dshow.c.

static int dshow_read_packet ( AVFormatContext s,
AVPacket pkt 
) [static]

Definition at line 908 of file dshow.c.

static char* dup_wchar_to_utf8 ( wchar_t *  w  )  [static]

Definition at line 175 of file dshow.c.

Referenced by dshow_cycle_pins().

static int parse_device_name ( AVFormatContext avctx  )  [static]

Definition at line 750 of file dshow.c.

Referenced by dshow_read_header().

static enum SampleFormat sample_fmt_bits_per_sample ( int  bits  )  [static]

Definition at line 652 of file dshow.c.

Referenced by dshow_add_device().

static int shall_we_drop ( AVFormatContext s  )  [static]

Definition at line 185 of file dshow.c.

Referenced by callback(), and videostream_cb().

static enum CodecID waveform_codec_id ( enum AVSampleFormat  sample_fmt  )  [static]

Definition at line 642 of file dshow.c.

Referenced by dshow_add_device().


Variable Documentation

const AVClass dshow_class [static]

Initial value:

 {
    .class_name = "DirectShow indev",
    .item_name  = av_default_item_name,
    .option     = options,
    .version    = LIBAVUTIL_VERSION_INT,
}

Definition at line 956 of file dshow.c.

Initial value:

 {
    "dshow",
    NULL_IF_CONFIG_SMALL("DirectShow capture"),
    sizeof(struct dshow_ctx),
    NULL,
    dshow_read_header,
    dshow_read_packet,
    dshow_read_close,
    .flags = AVFMT_NOFILE,
    .priv_class = &dshow_class,
}

Definition at line 963 of file dshow.c.

const AVOption options[] [static]

Initial value:

 {
    { "video_size", "set video size given a string such as 640x480 or hd720.", OFFSET(video_size), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
    { "framerate", "set video frame rate", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
    { "sample_rate", "set audio sample rate", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, DEC },
    { "sample_size", "set audio sample size", OFFSET(sample_size), AV_OPT_TYPE_INT, {.dbl = 0}, 0, 16, DEC },
    { "channels", "set number of audio channels, such as 1 or 2", OFFSET(channels), AV_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, DEC },
    { "list_devices", "list available devices", OFFSET(list_devices), AV_OPT_TYPE_INT, {.dbl=0}, 0, 1, DEC, "list_devices" },
    { "true", "", 0, AV_OPT_TYPE_CONST, {.dbl=1}, 0, 0, DEC, "list_devices" },
    { "false", "", 0, AV_OPT_TYPE_CONST, {.dbl=0}, 0, 0, DEC, "list_devices" },
    { "list_options", "list available options for specified device", OFFSET(list_options), AV_OPT_TYPE_INT, {.dbl=0}, 0, 1, DEC, "list_options" },
    { "true", "", 0, AV_OPT_TYPE_CONST, {.dbl=1}, 0, 0, DEC, "list_options" },
    { "false", "", 0, AV_OPT_TYPE_CONST, {.dbl=0}, 0, 0, DEC, "list_options" },
    { "video_device_number", "set video device number for devices with same name (starts at 0)", OFFSET(video_device_number), AV_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, DEC },
    { "audio_device_number", "set audio device number for devices with same name (starts at 0)", OFFSET(audio_device_number), AV_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, DEC },
    { NULL },
}

Definition at line 939 of file dshow.c.


Generated on Fri Oct 26 02:46:11 2012 for FFmpeg by  doxygen 1.5.8