API changes, most recent first:
+2020-05-23 - xxxxxxxxxx - lavu 56.48.100 - hwcontext.h
+ Add av_hwdevice_ctx_create_derived_opts.
+
2020-05-23 - xxxxxxxxxx - lavu 56.47.100 - rational.h
Add av_gcd_q().
return ret;
}
-int av_hwdevice_ctx_create_derived(AVBufferRef **dst_ref_ptr,
- enum AVHWDeviceType type,
- AVBufferRef *src_ref, int flags)
+int av_hwdevice_ctx_create_derived_opts(AVBufferRef **dst_ref_ptr,
+ enum AVHWDeviceType type,
+ AVBufferRef *src_ref,
+ AVDictionary *options, int flags)
{
AVBufferRef *dst_ref = NULL, *tmp_ref;
AVHWDeviceContext *dst_ctx, *tmp_ctx;
if (dst_ctx->internal->hw_type->device_derive) {
ret = dst_ctx->internal->hw_type->device_derive(dst_ctx,
tmp_ctx,
+ options,
flags);
if (ret == 0) {
dst_ctx->internal->source_device = av_buffer_ref(src_ref);
return ret;
}
+int av_hwdevice_ctx_create_derived(AVBufferRef **dst_ref_ptr,
+ enum AVHWDeviceType type,
+ AVBufferRef *src_ref, int flags)
+{
+ return av_hwdevice_ctx_create_derived_opts(dst_ref_ptr, type, src_ref,
+ NULL, flags);
+}
+
static void ff_hwframe_unmap(void *opaque, uint8_t *data)
{
HWMapDescriptor *hwmap = (HWMapDescriptor*)data;
enum AVHWDeviceType type,
AVBufferRef *src_ctx, int flags);
+/**
+ * Create a new device of the specified type from an existing device.
+ *
+ * This function performs the same action as av_hwdevice_ctx_create_derived,
+ * however, it is able to set options for the new device to be derived.
+ *
+ * @param dst_ctx On success, a reference to the newly-created
+ * AVHWDeviceContext.
+ * @param type The type of the new device to create.
+ * @param src_ctx A reference to an existing AVHWDeviceContext which will be
+ * used to create the new device.
+ * @param options Options for the new device to create, same format as in
+ * av_hwdevice_ctx_create.
+ * @param flags Currently unused; should be set to zero.
+ * @return Zero on success, a negative AVERROR code on failure.
+ */
+int av_hwdevice_ctx_create_derived_opts(AVBufferRef **dst_ctx,
+ enum AVHWDeviceType type,
+ AVBufferRef *src_ctx,
+ AVDictionary *options, int flags);
/**
* Allocate an AVHWFramesContext tied to a given device context.
}
static int cuda_device_derive(AVHWDeviceContext *device_ctx,
- AVHWDeviceContext *src_ctx,
+ AVHWDeviceContext *src_ctx, AVDictionary *opts,
int flags) {
AVCUDADeviceContext *hwctx = device_ctx->hwctx;
CudaFunctions *cu;
int (*device_create)(AVHWDeviceContext *ctx, const char *device,
AVDictionary *opts, int flags);
int (*device_derive)(AVHWDeviceContext *dst_ctx,
- AVHWDeviceContext *src_ctx, int flags);
+ AVHWDeviceContext *src_ctx,
+ AVDictionary *opts, int flags);
int (*device_init)(AVHWDeviceContext *ctx);
void (*device_uninit)(AVHWDeviceContext *ctx);
#endif
static int opencl_device_derive(AVHWDeviceContext *hwdev,
- AVHWDeviceContext *src_ctx,
+ AVHWDeviceContext *src_ctx, AVDictionary *opts,
int flags)
{
int err;
// Surface mapping works via DRM PRIME fds with no special
// initialisation required in advance. This just finds the
// Beignet ICD by name.
- AVDictionary *opts = NULL;
+ AVDictionary *selector_opts = NULL;
- err = av_dict_set(&opts, "platform_vendor", "Intel", 0);
+ err = av_dict_set(&selector_opts, "platform_vendor", "Intel", 0);
if (err >= 0)
- err = av_dict_set(&opts, "platform_version", "beignet", 0);
+ err = av_dict_set(&selector_opts, "platform_version", "beignet", 0);
if (err >= 0) {
OpenCLDeviceSelector selector = {
.platform_index = -1,
.device_index = 0,
- .context = opts,
+ .context = selector_opts,
.enumerate_platforms = &opencl_enumerate_platforms,
.filter_platform = &opencl_filter_platform,
.enumerate_devices = &opencl_enumerate_devices,
};
err = opencl_device_create_internal(hwdev, &selector, NULL);
}
- av_dict_free(&opts);
+ av_dict_free(&selector_opts);
}
break;
#endif
}
static int qsv_device_derive(AVHWDeviceContext *ctx,
- AVHWDeviceContext *child_device_ctx, int flags)
+ AVHWDeviceContext *child_device_ctx,
+ AVDictionary *opts, int flags)
{
return qsv_device_derive_from_child(ctx, MFX_IMPL_HARDWARE_ANY,
child_device_ctx, flags);
}
static int vaapi_device_derive(AVHWDeviceContext *ctx,
- AVHWDeviceContext *src_ctx, int flags)
+ AVHWDeviceContext *src_ctx,
+ AVDictionary *opts, int flags)
{
#if HAVE_VAAPI_DRM
if (src_ctx->type == AV_HWDEVICE_TYPE_DRM) {
}
static int vulkan_device_derive(AVHWDeviceContext *ctx,
- AVHWDeviceContext *src_ctx, int flags)
+ AVHWDeviceContext *src_ctx,
+ AVDictionary *opts, int flags)
{
av_unused VulkanDeviceSelection dev_select = { 0 };
if (strstr(vendor, "AMD"))
dev_select.vendor_id = 0x1002;
- return vulkan_device_create_internal(ctx, &dev_select, NULL, flags);
+ return vulkan_device_create_internal(ctx, &dev_select, opts, flags);
}
#endif
case AV_HWDEVICE_TYPE_DRM: {
drmFreeDevice(&drm_dev_info);
- return vulkan_device_create_internal(ctx, &dev_select, NULL, flags);
+ return vulkan_device_create_internal(ctx, &dev_select, opts, flags);
}
#endif
#if CONFIG_CUDA
dev_select.has_uuid = 1;
- return vulkan_device_create_internal(ctx, &dev_select, NULL, flags);
+ return vulkan_device_create_internal(ctx, &dev_select, opts, flags);
}
#endif
default:
*/
#define LIBAVUTIL_VERSION_MAJOR 56
-#define LIBAVUTIL_VERSION_MINOR 47
+#define LIBAVUTIL_VERSION_MINOR 48
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \