[FFmpeg-devel] [PATCH 5/8] lavd: add device capabilities API
Don Moir
donmoir at comcast.net
Thu Apr 10 01:54:34 CEST 2014
--- a/libavdevice/avdevice.h
+++ b/libavdevice/avdevice.h
@@ -43,6 +43,9 @@
* @}
*/
+#include "libavutil/log.h"
+#include "libavutil/opt.h"
+#include "libavutil/dict.h"
#include "libavformat/avformat.h"
/**
@@ -228,6 +231,131 @@ int avdevice_dev_to_app_control_message(struct AVFormatContext *s,
void *data, size_t data_size);
/**
+ * 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:
+ * - 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
----- Original Message -----
From: "Lukasz Marek" <lukasz.m.luki2 at gmail.com>
To: <ffmpeg-devel at ffmpeg.org>
Sent: Wednesday, April 09, 2014 4:33 PM
Subject: Re: [FFmpeg-devel] [PATCH 5/8] lavd: add device capabilities API
> On 05.04.2014 23:14, Michael Niedermayer wrote:
>> On Sat, Apr 05, 2014 at 10:58:37PM +0200, wm4 wrote:
>>> On Sat, 5 Apr 2014 22:47:37 +0200
>>> Michael Niedermayer <michaelni at gmx.at> wrote:
>>>
>>>> On Sat, Apr 05, 2014 at 10:17:33PM +0200, Lukasz Marek wrote:
>>>
>>>>> I still think this there should be separate struct to store them in
>>>>> both cases.
>>>>> It can be moved to AVFormatContext to simplify API, but avformat
>>>>> need to know size of the structure. It is avdevice specific so I
>>>>> don't know if moving it to avformat is good idea. I can add alloc
>>>>> function in libavdevice, but it will create dependency.
>>>>> I don't know if it all is worth removing 2 simple API calls.
>>>>
>>>> well, if people are happy with how it is with teh 2 calls, i dont mind
>>>
>>> What people? Is anyone else working on / using the stuff discussed here?
>>
>> The API discussed here allows to get the capabilities of devices
>> but they are technically muxers and demuxers, so maybe this API
>> would at some point in the future also be used for gathering the
>> capabilities of muxers and demuxers
>
>
> I attached a bit updated version.
> I separated sample format and pixel format (it had common field format).
> It could be a problem in case some device can handle both.
>
> I'm almost done with implementation of the API for pulseaudio and opengl
> so it is quite well tested from developer point of view.
>
> If there are no other remarks than you can merge this one.
>
>
--------------------------------------------------------------------------------
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
More information about the ffmpeg-devel
mailing list