aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/hwcontext_qsv.c
diff options
context:
space:
mode:
authorHaihao Xiang <haihao.xiang@intel.com>2022-01-05 11:52:07 +0800
committerHaihao Xiang <haihao.xiang@intel.com>2022-01-05 11:56:58 +0800
commit7c6f9b9d638a9ae6020c8a388d5a6f2a89620663 (patch)
tree0da5f31b4b67a9b1895fdef0c1ee5c5d4d5bfca5 /libavutil/hwcontext_qsv.c
parent8d4c0c8823194c71bb825f2ccd28b912f3791e08 (diff)
downloadffmpeg-7c6f9b9d638a9ae6020c8a388d5a6f2a89620663.tar.gz
Revert "avutils/hwcontext: When deriving a hwdevice, search for existing device in both directions"
This reverts commit a4289497755386435783774a4f520eb7fc23cbc9. There were objections on ML (see https://ffmpeg.org/pipermail/ffmpeg-devel/2021-December/290530.html) Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
Diffstat (limited to 'libavutil/hwcontext_qsv.c')
-rw-r--r--libavutil/hwcontext_qsv.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c
index 91457c9c9e..853fb7f60d 100644
--- a/libavutil/hwcontext_qsv.c
+++ b/libavutil/hwcontext_qsv.c
@@ -274,7 +274,7 @@ static void qsv_frames_uninit(AVHWFramesContext *ctx)
av_buffer_unref(&s->child_frames_ref);
}
-static void qsv_release_dummy(void *opaque, uint8_t *data)
+static void qsv_pool_release_dummy(void *opaque, uint8_t *data)
{
}
@@ -287,7 +287,7 @@ static AVBufferRef *qsv_pool_alloc(void *opaque, size_t size)
if (s->nb_surfaces_used < hwctx->nb_surfaces) {
s->nb_surfaces_used++;
return av_buffer_create((uint8_t*)(s->surfaces_internal + s->nb_surfaces_used - 1),
- sizeof(*hwctx->surfaces), qsv_release_dummy, NULL, 0);
+ sizeof(*hwctx->surfaces), qsv_pool_release_dummy, NULL, 0);
}
return NULL;
@@ -1596,15 +1596,8 @@ static int qsv_device_create(AVHWDeviceContext *ctx, const char *device,
child_device = (AVHWDeviceContext*)priv->child_device_ctx->data;
impl = choose_implementation(device, child_device_type);
- ret = qsv_device_derive_from_child(ctx, impl, child_device, 0);
- if (ret >= 0) {
- ctx->internal->source_device = av_buffer_ref(priv->child_device_ctx);
- child_device->internal->derived_devices[ctx->type] = av_buffer_create((uint8_t*)ctx, sizeof(*ctx), qsv_release_dummy, ctx, 0);
- if (!child_device->internal->derived_devices[ctx->type])
- return AVERROR(ENOMEM);
- }
- return ret;
+ return qsv_device_derive_from_child(ctx, impl, child_device, 0);
}
const HWContextType ff_hwcontext_type_qsv = {