FFmpeg
Data Fields
AVDeviceCapabilitiesQuery Struct Reference
libavdevice

Following API allows user to probe device capabilities (supported codecs, pixel formats, sample formats, resolutions, channel counts, etc). More...

#include <avdevice.h>

Data Fields

const AVClassav_class
 
 
enum AVCodecID  codec
 
 
 
 
 
int64_t  channel_layout
 
 
 
 
 
 

Detailed Description

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 make it possible to set up converters of video or audio parameters that fit to the device.

List of capabilities 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
  • Capabilities valid for video 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

Value of the capability may be set by user using av_opt_set() function and AVDeviceCapabilitiesQuery object. Following queries will limit results to the values matching already set capabilities. For example, setting a codec may impact number of formats or fps values returned during next query. Setting invalid value may limit results to zero.

Example of the usage basing on opengl output device:

AVFormatContext *oc = NULL;
AVDeviceCapabilitiesQuery *caps = NULL;
AVOptionRanges *ranges;
int ret;
if ((ret = avformat_alloc_output_context2(&oc, NULL, "opengl", NULL)) < 0)
goto fail;
if (avdevice_capabilities_create(&caps, oc, NULL) < 0)
goto fail;
//query codecs
if (av_opt_query_ranges(&ranges, caps, "codec", AV_OPT_MULTI_COMPONENT_RANGE)) < 0)
goto fail;
//pick codec here and set it
av_opt_set(caps, "codec", AV_CODEC_ID_RAWVIDEO, 0);
//query format
if (av_opt_query_ranges(&ranges, caps, "pixel_format", AV_OPT_MULTI_COMPONENT_RANGE)) < 0)
goto fail;
//pick format here and set it
av_opt_set(caps, "pixel_format", AV_PIX_FMT_YUV420P, 0);
//query and set more capabilities
fail:
//clean up code
avdevice_capabilities_free(&query, oc);
avformat_free_context(oc);

Structure describes device capabilities.

It is used by devices in conjunction with av_device_capabilities AVOption table to implement capabilities probing API based on AVOption API. Should not be used directly.

Definition at line 400 of file avdevice.h.

Field Documentation

const AVClass* AVDeviceCapabilitiesQuery::av_class

Definition at line 401 of file avdevice.h.

AVFormatContext* AVDeviceCapabilitiesQuery::device_context

Definition at line 402 of file avdevice.h.

enum AVCodecID AVDeviceCapabilitiesQuery::codec

Definition at line 403 of file avdevice.h.

enum AVSampleFormat AVDeviceCapabilitiesQuery::sample_format

Definition at line 404 of file avdevice.h.

enum AVPixelFormat AVDeviceCapabilitiesQuery::pixel_format

Definition at line 405 of file avdevice.h.

int AVDeviceCapabilitiesQuery::sample_rate

Definition at line 406 of file avdevice.h.

int AVDeviceCapabilitiesQuery::channels

Definition at line 407 of file avdevice.h.

int64_t AVDeviceCapabilitiesQuery::channel_layout

Definition at line 408 of file avdevice.h.

int AVDeviceCapabilitiesQuery::window_width

Definition at line 409 of file avdevice.h.

int AVDeviceCapabilitiesQuery::window_height

Definition at line 410 of file avdevice.h.

int AVDeviceCapabilitiesQuery::frame_width

Definition at line 411 of file avdevice.h.

int AVDeviceCapabilitiesQuery::frame_height

Definition at line 412 of file avdevice.h.

AVRational AVDeviceCapabilitiesQuery::fps

Definition at line 413 of file avdevice.h.


The documentation for this struct was generated from the following file:

Generated on Sun May 13 2018 02:04:28 for FFmpeg by   doxygen 1.8.6

AltStyle によって変換されたページ (->オリジナル) /