Go to the documentation of this file.
26 const char *derived_name;
44 fprintf(stderr,
"Unable to derive %s -> %s: %d.\n",
45 src_name, derived_name, err);
50 if (derived_dev->
type != derived_type) {
51 fprintf(stderr,
"Device derived as type %d has type %d.\n",
52 derived_type, derived_dev->
type);
56 if (derived_type == src_dev->
type) {
57 if (derived_dev != src_dev) {
58 fprintf(stderr,
"Derivation of %s from itself succeeded "
59 "but did not return the same device.\n", src_name);
69 fprintf(stderr,
"Derivation %s to %s succeeded, but derivation "
70 "back again failed: %d.\n",
71 src_name, derived_name, err);
75 if (back_ref->data != src_ref->
data) {
76 fprintf(stderr,
"Derivation %s to %s succeeded, but derivation "
77 "back again did not return the original device.\n",
78 src_name, derived_name);
82 fprintf(stderr,
"Successfully tested derivation %s -> %s.\n",
83 src_name, derived_name);
106 fprintf(stderr,
"Failed to create %s device: %d.\n",
name, err);
112 fprintf(stderr,
"Device created as type %d has type %d.\n",
118 fprintf(stderr,
"Device type %s successfully created.\n",
name);
127 static const struct {
134 {
"/dev/dri/card0",
"/dev/dri/card1",
135 "/dev/dri/renderD128",
"/dev/dri/renderD129" } },
141 {
"0.0",
"0.1",
"1.0",
"1.1" } },
143 {
"/dev/dri/renderD128",
"/dev/dri/renderD129",
":0" } },
150 int i, j, found, err;
154 fprintf(stderr,
"No name available for device type %d.\n",
type);
160 fprintf(stderr,
"Type %d maps to name %s maps to type %d.\n",
169 fprintf(stderr,
"Test failed for %s with default options.\n",
name);
173 fprintf(stderr,
"Test passed for %s with default options.\n",
name);
186 fprintf(stderr,
"Test failed for %s with device %s.\n",
191 fprintf(stderr,
"Test passed for %s with device %s.\n",
221 fprintf(stderr,
"Attempted to test %d device types: "
222 "%d passed, %d failed, %d skipped.\n",
static int test_derivation(AVBufferRef *src_ref, const char *src_name)
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
static const struct @338 test_devices[]
uint8_t * data
The data buffer.
enum AVHWDeviceType av_hwdevice_find_type_by_name(const char *name)
Look up an AVHWDeviceType by name.
enum AVHWDeviceType av_hwdevice_iterate_types(enum AVHWDeviceType prev)
Iterate over supported device types.
@ AV_HWDEVICE_TYPE_D3D11VA
This struct aggregates all the (hardware/vendor-specific) "high-level" state, i.e.
#define FF_ARRAY_ELEMS(a)
#define check(x, y, S, v)
const char * av_hwdevice_get_type_name(enum AVHWDeviceType type)
Get the string name of an AVHWDeviceType.
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
@ AV_HWDEVICE_TYPE_OPENCL
static int test_device_type(enum AVHWDeviceType type)
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)
static int test_device(enum AVHWDeviceType type, const char *name, const char *device, AVDictionary *opts, int flags)
enum AVHWDeviceType type
This field identifies the underlying API used for hardware access.
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.
static int ref[MAX_W *MAX_W]
A reference to a data buffer.
const char * possible_devices[5]
#define flags(name, subs,...)
static void BS_FUNC() skip(BSCTX *bc, unsigned int n)
Skip n bits in the buffer.