Go to the documentation of this file.
27 #include "libavutil/ffversion.h"
30 #define E AV_OPT_FLAG_ENCODING_PARAM
31 #define D AV_OPT_FLAG_DECODING_PARAM
32 #define A AV_OPT_FLAG_AUDIO_PARAM
33 #define V AV_OPT_FLAG_VIDEO_PARAM
34 #define OFFSET(x) offsetof(AVDeviceCapabilitiesQuery, x)
42 {.i64 = -1}, -1, INT_MAX,
E|
D|
A },
44 {.i64 = -1}, -1, INT_MAX,
E|
D|
A },
46 {.i64 = -1}, -1, INT_MAX,
E|
D|
A },
50 {.str =
NULL}, -1, INT_MAX,
E|
D|
V },
52 {.str =
NULL}, -1, INT_MAX,
E|
D|
V },
54 {.dbl = -1}, -1, INT_MAX,
E|
D|
V },
72 return FFMPEG_CONFIGURATION;
77 #define LICENSE_PREFIX "libavdevice license: "
88 if (!(prev = av_oformat_next(prev)))
92 if (!(prev = av_iformat_next(prev)))
128 void *
data,
size_t data_size)
130 if (!
s->oformat || !
s->oformat->control_message)
132 return s->oformat->control_message(
s,
type,
data, data_size);
136 void *
data,
size_t data_size)
138 if (!
s->control_message_cb)
140 return s->control_message_cb(
s,
type,
data, data_size);
149 if ((
s->oformat && !
s->oformat->create_device_capabilities) ||
150 (
s->iformat && !
s->iformat->create_device_capabilities))
155 (*caps)->device_context =
s;
159 if ((
ret =
s->iformat->create_device_capabilities(
s, *caps)) < 0)
162 if ((
ret =
s->oformat->create_device_capabilities(
s, *caps)) < 0)
174 if (!
s || !caps || !(*caps))
178 if (
s->iformat->free_device_capabilities)
179 s->iformat->free_device_capabilities(
s, *caps);
181 if (
s->oformat->free_device_capabilities)
182 s->oformat->free_device_capabilities(
s, *caps);
193 if ((
s->oformat && !
s->oformat->get_device_list) ||
194 (
s->iformat && !
s->iformat->get_device_list)) {
202 (*device_list)->default_device = -1;
204 ret =
s->oformat->get_device_list(
s, *device_list);
206 ret =
s->iformat->get_device_list(
s, *device_list);
261 for (
i = 0;
i <
list->nb_devices;
i++) {
262 dev =
list->devices[
i];
int avdevice_list_input_sources(AVInputFormat *device, const char *device_name, AVDictionary *device_options, AVDeviceInfoList **device_list)
List devices.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
void av_opt_set_defaults(void *s)
Set the values of all AVOption fields to their default values.
#define LIBAVDEVICE_VERSION_INT
char * device_name
device name, format depends on device
Following API allows user to probe device capabilities (supported codecs, pixel formats,...
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce output
int avdevice_list_devices(AVFormatContext *s, AVDeviceInfoList **device_list)
List devices.
AVAppToDevMessageType
Message types used by avdevice_app_to_dev_control_message().
int avdevice_dev_to_app_control_message(struct AVFormatContext *s, enum AVDevToAppMessageType type, void *data, size_t data_size)
Send control message from device to application.
#define LIBAVDEVICE_VERSION_MICRO
AVOutputFormat * av_output_video_device_next(AVOutputFormat *d)
Video output devices iterator.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
@ AV_CLASS_CATEGORY_DEVICE_INPUT
@ AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT
int av_opt_set_dict(void *obj, AVDictionary **options)
Set all the options from a given dictionary on an object.
int avdevice_capabilities_create(AVDeviceCapabilitiesQuery **caps, AVFormatContext *s, AVDictionary **device_options)
Initialize capabilities probing API based on AVOption API.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
const char * avdevice_license(void)
Return the libavdevice license.
static int list_devices_for_context(AVFormatContext *s, AVDictionary *options, AVDeviceInfoList **device_list)
Describe the class of an AVClass context structure.
@ AV_OPT_TYPE_IMAGE_SIZE
offset must point to two consecutive integers
const char * avdevice_configuration(void)
Return the libavdevice build-time configuration.
@ AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining list
@ AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT
AVOutputFormat * av_output_audio_device_next(AVOutputFormat *d)
Audio output devices iterator.
AVInputFormat * av_input_video_device_next(AVInputFormat *d)
Video input devices iterator.
const OptionDef options[]
AVClassCategory category
Category used for visualization (like color) This is only set if the category is equal for all object...
Structure describes basic parameters of the device.
@ AV_OPT_TYPE_CHANNEL_LAYOUT
void avdevice_free_list_devices(AVDeviceInfoList **device_list)
Convenient function to free result of avdevice_list_devices().
#define AV_OPT_SEARCH_CHILDREN
Search in possible children of the given object first.
AVInputFormat * av_input_audio_device_next(AVInputFormat *d)
Audio input devices iterator.
av_warn_unused_result int ff_alloc_input_device_context(struct AVFormatContext **avctx, struct AVInputFormat *iformat, const char *format)
const char av_device_ffversion[]
int av_opt_set_dict2(void *obj, AVDictionary **options, int search_flags)
Set all the options from a given dictionary on an object.
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values.
AVDevToAppMessageType
Message types used by avdevice_dev_to_app_control_message().
char * device_description
human friendly name
int avdevice_list_output_sinks(AVOutputFormat *device, const char *device_name, AVDictionary *device_options, AVDeviceInfoList **device_list)
const AVOption av_device_capabilities[]
AVOption table used by devices to implement device capabilities API.
unsigned avdevice_version(void)
Return the LIBAVDEVICE_VERSION_INT constant.
#define i(width, name, range_min, range_max)
@ AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
static void * device_next(void *prev, int output, AVClassCategory c1, AVClassCategory c2)
void avdevice_capabilities_free(AVDeviceCapabilitiesQuery **caps, AVFormatContext *s)
Free resources created by avdevice_capabilities_create()
void avformat_free_context(AVFormatContext *s)
Free an AVFormatContext and all its streams.
int avdevice_app_to_dev_control_message(struct AVFormatContext *s, enum AVAppToDevMessageType type, void *data, size_t data_size)
Send control message from application to device.
@ AV_CLASS_CATEGORY_DEVICE_OUTPUT
int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)
Copy entries from one AVDictionary struct into another.