75 int index, index_limit = 1000;
76 index_pos = strlen(type_name);
85 if (
index >= index_limit) {
109 const char *errmsg, *p, *q;
112 k = strcspn(
arg,
":=@");
122 errmsg =
"unknown device type";
127 k = strcspn(p + 1,
":@,");
135 errmsg =
"named device already exists";
155 }
else if (*p ==
':') {
169 errmsg =
"failed to parse options";
175 q ? device : p[0] ? p :
NULL,
180 }
else if (*p ==
'@') {
185 errmsg =
"invalid source device name";
193 }
else if (*p ==
',') {
197 errmsg =
"failed to parse options";
206 errmsg =
"parse error";
233 "Invalid device specification \"%s\": %s\n",
arg, errmsg);
238 "Device creation failed: %d.\n", err);
261 "Device creation failed: %d.\n", err);
309 "%s of type %s is picked for filters by default. Set hardware "
310 "device explicitly with the filter_hw_device option if device "
311 "%s is not usable for filters.\n",
#define i(width, name, range_min, range_max)
HWDevice * filter_hw_device
static HWDevice ** hw_devices
int hw_device_init_from_string(const char *arg, HWDevice **dev_out)
AVBufferRef * hw_device_for_filter(void)
Get a hardware device to be used with this filtergraph.
HWDevice * hw_device_get_by_name(const char *name)
void hw_device_free_all(void)
int hw_device_init_from_type(enum AVHWDeviceType type, const char *device, HWDevice **dev_out)
static HWDevice * hw_device_add(void)
HWDevice * hw_device_get_by_type(enum AVHWDeviceType type)
static char * hw_device_default_name(enum AVHWDeviceType type)
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values.
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.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
char * av_strndup(const char *s, size_t len)
Duplicate a substring of a string.
int av_reallocp_array(void *ptr, size_t nmemb, size_t size)
Allocate, reallocate an array through a pointer to a pointer.
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.
const char * av_hwdevice_get_type_name(enum AVHWDeviceType type)
Get the string name of an AVHWDeviceType.
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.
enum AVHWDeviceType av_hwdevice_find_type_by_name(const char *name)
Look up an AVHWDeviceType by name.
Memory handling functions.
A reference to a data buffer.