[FFmpeg-devel] [PATCH 1/4] lavf: add probe device API

Michael Niedermayer michaelni at gmx.at
Thu Dec 5 00:49:12 CET 2013


On Tue, Nov 12, 2013 at 12:11:59AM +0100, Lukasz Marek wrote:
> Adds new API dedicated for output devices.
> 
> This API allows to
> - Test device with provided configuration
>   Audio devices params:
>     - device name
>     - codec
>     - sample format
>     - channel count
>     - channels layout
>     - sample rate
>   Video devices params:
>     - device name
>     - codec
>     - pixel format
>     - width (minimal width as input and real width as output)
>     - height (minimal height as input and real height as output)
> 
> - Get all supported configurations matching provided filter.
>   Filter may contain any subset of Audio/Video device params.
> 
> Behaviour of probe function can also be modified by flags.
> 
> Signed-off-by: Lukasz Marek <lukasz.m.luki at gmail.com>
> ---
>  libavformat/avformat.h |   97 +++++++++++++++++++++++++++++++++++++++++++++++-
>  libavformat/utils.c    |   72 +++++++++++++++++++++++++++++++++++
>  2 files changed, 167 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
> index 6bd54ce..68b9269 100644
> --- a/libavformat/avformat.h
> +++ b/libavformat/avformat.h
> @@ -323,6 +323,28 @@ typedef struct AVFrac {
>      int64_t val, num, den;
>  } AVFrac;
>  
> +/**
> + *
> + */
> +typedef struct AVDeviceConfig {
> +    struct AVDeviceConfig *next;
> +    char* device_name;                  ///< device name, format depends on device
> +    char* device_description;           ///< human friendly name
> +    enum AVCodecID codec;               ///< codec
> +    int format;                         ///< format (AVPixelFormat / AVSampleFormat)
> +    union {
> +        struct {  // audio parameters
> +            int sample_rate;            ///< [in]: expected sample rate,   [out]: device's default sample rate
> +            int channels;               ///< [in]: expected channel count, [out]: device's default channel count
> +            int64_t channel_layout;     ///< [in]: expected layout,        [out]: device's default layout
> +        };
> +        struct {  // video parameters
> +            int width;                  ///< [in]: required width,  [out]: maximum width
> +            int height;                 ///< [in]: required height, [out]: maximum height
> +        };
> +    } stream_info;

this has ABI issues
that is you cant add fields to the common part easily

also please take a look at AVOptionRange(s) i think theres some
overlap with this API, maybe parts of it could be used to simplify
or extend this ...


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

During times of universal deceit, telling the truth becomes a
revolutionary act. -- George Orwell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131205/4b42aae4/attachment.asc>


More information about the ffmpeg-devel mailing list