[FFmpeg-devel] how to specify, when enumerating devices, that a device has "various options"

Roger Pack rogerdpack2 at gmail.com
Wed Jan 14 20:03:01 CET 2015

My basic question at hand "how to enumerate" dshow devices.

I noticed that the current AVDeviceInfo struct (used by
avdevice_list_devices and I presume by libraries that want to use
libavdevice, to enumerate devices and options) looks the following:

typedef struct AVDeviceInfo {
    char *device_name;                   /**< device name, format
depends on device */
    char *device_description;            /**< human friendly name */
} AVDeviceInfo;

I'm aware you can use the new "device capabilities" api to query a
particular device for its capabilities.

My problem here is that I have devices that have various options.

For instance a single capture device may have multiple output pins.
It could also have multiple "upstream" crossbar input sources, each of
which could send to that pin.  So it's like, for one device, I have
1*pins*crossbar_pin_count total number of permutations.  Somehow or
other I want to be able to let users of libav that these various
parameters are available/possible.

I could create (pins*crossbar_pin_count) different devices, each
counting as a separate device.  I suppose I could put it all in
*device_name -- i.e. device_name *and* its parameters, like
"audio=name=USB Audio Device:pin=Audio Out:crossbar_pin=3"

And modify dshow so that it can accept input parameters like that
(frei0r parameters style).  Is that the preferred way, any
feedback/comment?  Is separating by colons the best way?  If I did so
(since dshow can specify multiple sources simultaneously) it would
probably end up with options like

"audio=name=USB Audio Device:pin=Audio
Out:crossbar_pin=3:video=name=Video Device:pin=Capture"  does that sem

Modifying it to allow parameters that way might be nice anyway since I
may need something like that for dshow later.


More information about the ffmpeg-devel mailing list