Go to the documentation of this file.
77 int index, index_limit = 1000;
78 index_pos = strlen(type_name);
87 if (
index >= index_limit) {
111 const char *errmsg, *p, *q;
114 k = strcspn(
arg,
":=@");
124 errmsg =
"unknown device type";
129 k = strcspn(p + 1,
":@,");
137 errmsg =
"named device already exists";
157 }
else if (*p ==
':') {
171 errmsg =
"failed to parse options";
177 q ? device : p[0] ? p :
NULL,
182 }
else if (*p ==
'@') {
187 errmsg =
"invalid source device name";
195 }
else if (*p ==
',') {
199 errmsg =
"failed to parse options";
208 errmsg =
"parse error";
235 "Invalid device specification \"%s\": %s\n",
arg, errmsg);
240 "Device creation failed: %d.\n", err);
263 "Device creation failed: %d.\n", err);
311 "%s of type %s is picked for filters by default. Set hardware "
312 "device explicitly with the filter_hw_device option if device "
313 "%s is not usable for filters.\n",
#define AV_LOG_WARNING
Something somehow does not look correct.
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 default minimum maximum flags name is the option name
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
int hw_device_init_from_type(enum AVHWDeviceType type, const char *device, HWDevice **dev_out)
enum AVHWDeviceType av_hwdevice_find_type_by_name(const char *name)
Look up an AVHWDeviceType by name.
static char * hw_device_default_name(enum AVHWDeviceType type)
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
void hw_device_free_all(void)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVBufferRef * hw_device_for_filter(void)
Get a hardware device to be used with this filtergraph.
const char * av_hwdevice_get_type_name(enum AVHWDeviceType type)
Get the string name of an AVHWDeviceType.
HWDevice * hw_device_get_by_name(const char *name)
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
static HWDevice ** hw_devices
static HWDevice * hw_device_add(void)
const OptionDef options[]
int av_reallocp_array(void *ptr, size_t nmemb, size_t size)
Allocate, reallocate an array through a pointer to a pointer.
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values.
int av_hwdevice_ctx_create_derived(AVBufferRef **dst_ref_ptr, enum AVHWDeviceType type, AVBufferRef *src_ref, int flags)
Create a new device of the specified type from an existing device.
#define i(width, name, range_min, range_max)
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
int av_hwdevice_ctx_create(AVBufferRef **pdevice_ref, enum AVHWDeviceType type, const char *device, AVDictionary *opts, int flags)
Open a device of the specified type and create an AVHWDeviceContext for it.
HWDevice * filter_hw_device
int av_dict_parse_string(AVDictionary **pm, const char *str, const char *key_val_sep, const char *pairs_sep, int flags)
Parse the key/value pairs list and add the parsed entries to a dictionary.
int hw_device_init_from_string(const char *arg, HWDevice **dev_out)
A reference to a data buffer.
HWDevice * hw_device_get_by_type(enum AVHWDeviceType type)
char * av_strndup(const char *s, size_t len)
Duplicate a substring of a string.