[FFmpeg-devel] [PATCH 5/8] lavd: add device capabilities API
Don Moir
donmoir at comcast.net
Thu Apr 10 02:32:58 CEST 2014
----- Original Message -----
From: "Lukasz Marek" <lukasz.m.luki2 at gmail.com>
To: <ffmpeg-devel at ffmpeg.org>
Sent: Wednesday, April 09, 2014 8:11 PM
Subject: Re: [FFmpeg-devel] [PATCH 5/8] lavd: add device capabilities API
> >
>> /**
>> + * Following API allows user to probe device capabilities (supported
>> codecs,
>> + * pixel formats, sample formats, resolutions, channel counts, etc).
>> + * It is build on top op AVOption API.
>> + * Queried capabilities allows to set up converters of video or audio
>> + * parameters that fit to the device.
>> + *
>> + * List of capablities that can be queried:
>> + * - Capabilities valid for both audio and video devices:
>> + * - codec: supported audio/video codecs.
>> + * type: AV_OPT_TYPE_INT (AVCodecID value)
>> + * - Capabilities valid for audio devices:
>> + * - sample_format: supported sample formats.
>> + * type: AV_OPT_TYPE_INT (AVSampleFormat value)
>> + * - sample_rate: supported sample rates.
>> + * type: AV_OPT_TYPE_INT
>> + * - channels: supported number of channels.
>> + * type: AV_OPT_TYPE_INT
>> + * - channel_layout: supported channel layouts.
>> + * type: AV_OPT_TYPE_INT64
>>
>> Following should be: * - Capabilities valid for video devices:
>
> yes, fixed locallly, thx
>
>> + * - Capabilities valid for audio devices:
>>
>> + * - pixel_format: supported pixel formats.
>> + * type: AV_OPT_TYPE_INT (AVPixelFormat value)
>> + * - window_size: supported window sizes (describes size of the
>> window size presented to the user).
>> + * type: AV_OPT_TYPE_IMAGE_SIZE
>> + * - frame_size: supported frame sizes (describes size of
>> provided video frames).
>> + * type: AV_OPT_TYPE_IMAGE_SIZE
>> + * - fps: supported fps values
>> + * type: AV_OPT_TYPE_RATIONAL
>>
>> FPS can be a range for capture devices
>
> It can be a range by now.
Did you mean: by how or by now :)
+typedef struct AVDeviceCapabilitiesQuery {
+ const AVClass *class;
+ AVFormatContext *device_context;
+ enum AVCodecID codec;
+ enum AVSampleFormat sample_format;
+ enum AVPixelFormat pixel_format;
+ int sample_rate;
+ int channels;
+ int64_t channel_layout;
+ int window_width;
+ int window_height;
+ int frame_width;
+ int frame_height;
+ AVRational fps;
+} AVDeviceCapabilitiesQuery;
For a capture device and for each pixel format, width, and height, there can be a range of FPS values, like a min of a 1 FPS to max
60 FPS. Just varies for each device and format. So don't see how that fits into the AVDeviceCapabilitiesQuery structure as it
stands.
More information about the ffmpeg-devel
mailing list