Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/6] lavfi/qsvvpp: track the runtime version in vpp context
@ 2023-06-12  8:14 Xiang, Haihao
  2023-06-12  8:14 ` [FFmpeg-devel] [PATCH 2/6] lavfi/qsvvpp: copy metadata fields from src to dst Xiang, Haihao
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Xiang, Haihao @ 2023-06-12  8:14 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Haihao Xiang

From: Haihao Xiang <haihao.xiang@intel.com>

We may check whether a feature is supported via the runtime version in
future.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
---
 libavfilter/qsvvpp.c | 6 ++++++
 libavfilter/qsvvpp.h | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
index b233b81243..779afce66d 100644
--- a/libavfilter/qsvvpp.c
+++ b/libavfilter/qsvvpp.c
@@ -655,6 +655,12 @@ static int init_vpp_session(AVFilterContext *avctx, QSVVPPContext *s)
     if (ret)
         return ret;
 
+    ret = MFXQueryVersion(s->session, &s->ver);
+    if (ret != MFX_ERR_NONE) {
+        av_log(avctx, AV_LOG_ERROR, "Error querying the runtime version\n");
+        return AVERROR_UNKNOWN;
+    }
+
     if (handle) {
         ret = MFXVideoCORE_SetHandle(s->session, handle_type, handle);
         if (ret != MFX_ERR_NONE)
diff --git a/libavfilter/qsvvpp.h b/libavfilter/qsvvpp.h
index 3b32193744..8851185ff3 100644
--- a/libavfilter/qsvvpp.h
+++ b/libavfilter/qsvvpp.h
@@ -83,6 +83,8 @@ typedef struct QSVVPPContext {
     int eof;
     /** order with frame_out, sync */
     AVFifo *async_fifo;
+
+    mfxVersion ver;
 } QSVVPPContext;
 
 typedef struct QSVVPPCrop {
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [FFmpeg-devel] [PATCH 2/6] lavfi/qsvvpp: copy metadata fields from src to dst
  2023-06-12  8:14 [FFmpeg-devel] [PATCH 1/6] lavfi/qsvvpp: track the runtime version in vpp context Xiang, Haihao
@ 2023-06-12  8:14 ` Xiang, Haihao
  2023-06-12  8:14 ` [FFmpeg-devel] [PATCH 3/6] lavfi/qsvvpp: check the parameters before initializing vpp session Xiang, Haihao
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Xiang, Haihao @ 2023-06-12  8:14 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Haihao Xiang

From: Haihao Xiang <haihao.xiang@intel.com>

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
---
 libavfilter/qsvvpp.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
index 779afce66d..61402c8e0a 100644
--- a/libavfilter/qsvvpp.c
+++ b/libavfilter/qsvvpp.c
@@ -474,7 +474,7 @@ static QSVFrame *submit_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *p
 }
 
 /* get the output surface */
-static QSVFrame *query_frame(QSVVPPContext *s, AVFilterLink *outlink)
+static QSVFrame *query_frame(QSVVPPContext *s, AVFilterLink *outlink, const AVFrame *in)
 {
     AVFilterContext *ctx = outlink->src;
     QSVFrame        *out_frame;
@@ -493,6 +493,12 @@ static QSVFrame *query_frame(QSVVPPContext *s, AVFilterLink *outlink)
         if (!out_frame->frame)
             return NULL;
 
+        ret = av_frame_copy_props(out_frame->frame, in);
+        if (ret < 0) {
+            av_log(ctx, AV_LOG_ERROR, "Failed to copy metadata fields from src to dst.\n");
+            return NULL;
+        }
+
         ret = av_hwframe_get_buffer(outlink->hw_frames_ctx, out_frame->frame, 0);
         if (ret < 0) {
             av_log(ctx, AV_LOG_ERROR, "Can't allocate a surface.\n");
@@ -509,6 +515,12 @@ static QSVFrame *query_frame(QSVVPPContext *s, AVFilterLink *outlink)
         if (!out_frame->frame)
             return NULL;
 
+        ret = av_frame_copy_props(out_frame->frame, in);
+        if (ret < 0) {
+            av_log(ctx, AV_LOG_ERROR, "Failed to copy metadata fields from src to dst.\n");
+            return NULL;
+        }
+
         ret = map_frame_to_surface(out_frame->frame,
                                    &out_frame->surface);
         if (ret < 0)
@@ -884,7 +896,7 @@ int ff_qsvvpp_filter_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *picr
     }
 
     do {
-        out_frame = query_frame(s, outlink);
+        out_frame = query_frame(s, outlink, in_frame->frame);
         if (!out_frame) {
             av_log(ctx, AV_LOG_ERROR, "Failed to query an output frame.\n");
             return AVERROR(ENOMEM);
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [FFmpeg-devel] [PATCH 3/6] lavfi/qsvvpp: check the parameters before initializing vpp session
  2023-06-12  8:14 [FFmpeg-devel] [PATCH 1/6] lavfi/qsvvpp: track the runtime version in vpp context Xiang, Haihao
  2023-06-12  8:14 ` [FFmpeg-devel] [PATCH 2/6] lavfi/qsvvpp: copy metadata fields from src to dst Xiang, Haihao
@ 2023-06-12  8:14 ` Xiang, Haihao
  2023-06-12  8:14 ` [FFmpeg-devel] [PATCH 4/6] lavfi/qsvvpp: store a copy of the sequence parameters Xiang, Haihao
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Xiang, Haihao @ 2023-06-12  8:14 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Haihao Xiang

From: Haihao Xiang <haihao.xiang@intel.com>

According to the description about MFXVideoVPP_Query [1], we may call
MFXVideoVPP_Query to check the validity of the parameters for vpp
session, use the corrected values to initialize the session.

[1] https://spec.oneapi.io/versions/latest/elements/oneVPL/source/API_ref/VPL_func_vid_vpp.html#mfxvideovpp-query

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
---
 libavfilter/qsvvpp.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
index 61402c8e0a..8683a4f217 100644
--- a/libavfilter/qsvvpp.c
+++ b/libavfilter/qsvvpp.c
@@ -823,6 +823,14 @@ int ff_qsvvpp_init(AVFilterContext *avctx, QSVVPPParam *param)
     ff_qsvvpp_print_iopattern(avctx, s->vpp_param.IOPattern & 0x0F, "VPP");
     /* Print output memory mode */
     ff_qsvvpp_print_iopattern(avctx, s->vpp_param.IOPattern & 0xF0, "VPP");
+
+    ret = MFXVideoVPP_Query(s->session, &s->vpp_param, &s->vpp_param);
+    if (ret < 0) {
+        ret = ff_qsvvpp_print_error(avctx, ret, "Error querying VPP params");
+        goto failed;
+    } else if (ret > 0)
+        ff_qsvvpp_print_warning(avctx, ret, "Warning When querying VPP params");
+
     ret = MFXVideoVPP_Init(s->session, &s->vpp_param);
     if (ret < 0) {
         ret = ff_qsvvpp_print_error(avctx, ret, "Failed to create a qsvvpp");
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [FFmpeg-devel] [PATCH 4/6] lavfi/qsvvpp: store a copy of the sequence parameters
  2023-06-12  8:14 [FFmpeg-devel] [PATCH 1/6] lavfi/qsvvpp: track the runtime version in vpp context Xiang, Haihao
  2023-06-12  8:14 ` [FFmpeg-devel] [PATCH 2/6] lavfi/qsvvpp: copy metadata fields from src to dst Xiang, Haihao
  2023-06-12  8:14 ` [FFmpeg-devel] [PATCH 3/6] lavfi/qsvvpp: check the parameters before initializing vpp session Xiang, Haihao
@ 2023-06-12  8:14 ` Xiang, Haihao
  2023-06-12  8:14 ` [FFmpeg-devel] [PATCH 5/6] lavfi/qsvvpp: postpone vpp session initialization Xiang, Haihao
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Xiang, Haihao @ 2023-06-12  8:14 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Haihao Xiang

From: Haihao Xiang <haihao.xiang@intel.com>

We will postpone the vpp session initialization to when input and output
frames are ready, this copy of the sequence parameters will be used to
initialize vpp session.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
---
 libavfilter/qsvvpp.c | 42 ++++++++++++++++++++++++++----------------
 libavfilter/qsvvpp.h |  7 ++++++-
 2 files changed, 32 insertions(+), 17 deletions(-)

diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
index 8683a4f217..d168ab5d1d 100644
--- a/libavfilter/qsvvpp.c
+++ b/libavfilter/qsvvpp.c
@@ -767,28 +767,39 @@ int ff_qsvvpp_init(AVFilterContext *avctx, QSVVPPParam *param)
         goto failed;
     }
 
+    s->nb_seq_buffers = param->num_ext_buf;
 #if QSV_HAVE_OPAQUE
-    if (IS_OPAQUE_MEMORY(s->in_mem_mode) || IS_OPAQUE_MEMORY(s->out_mem_mode)) {
-        s->nb_ext_buffers = param->num_ext_buf + 1;
+    if (IS_OPAQUE_MEMORY(s->in_mem_mode) || IS_OPAQUE_MEMORY(s->out_mem_mode))
+        s->nb_seq_buffers++;
+#endif
+
+    if (s->nb_seq_buffers) {
+        s->seq_buffers = av_calloc(s->nb_seq_buffers, sizeof(*s->seq_buffers));
+        if (!s->seq_buffers) {
+            ret = AVERROR(ENOMEM);
+            goto failed;
+        }
+
+        for (i = 0; i < param->num_ext_buf; i++)
+            s->seq_buffers[i]    = param->ext_buf[i];
+
+#if QSV_HAVE_OPAQUE
+        if (IS_OPAQUE_MEMORY(s->in_mem_mode) || IS_OPAQUE_MEMORY(s->out_mem_mode))
+            s->seq_buffers[i] = (mfxExtBuffer *)&s->opaque_alloc;
+#endif
+
+        s->nb_ext_buffers = s->nb_seq_buffers;
         s->ext_buffers = av_calloc(s->nb_ext_buffers, sizeof(*s->ext_buffers));
         if (!s->ext_buffers) {
             ret = AVERROR(ENOMEM);
             goto failed;
         }
 
-        s->ext_buffers[0] = (mfxExtBuffer *)&s->opaque_alloc;
-        for (i = 1; i < param->num_ext_buf; i++)
-            s->ext_buffers[i]    = param->ext_buf[i - 1];
-        s->vpp_param.ExtParam    = s->ext_buffers;
-        s->vpp_param.NumExtParam = s->nb_ext_buffers;
-    } else {
-        s->vpp_param.NumExtParam = param->num_ext_buf;
-        s->vpp_param.ExtParam    = param->ext_buf;
+        memcpy(s->ext_buffers, s->seq_buffers, s->nb_seq_buffers * sizeof(*s->seq_buffers));
     }
-#else
-    s->vpp_param.NumExtParam = param->num_ext_buf;
-    s->vpp_param.ExtParam    = param->ext_buf;
-#endif
+
+    s->vpp_param.ExtParam    = s->ext_buffers;
+    s->vpp_param.NumExtParam = s->nb_ext_buffers;
 
     s->got_frame = 0;
 
@@ -861,9 +872,8 @@ int ff_qsvvpp_close(AVFilterContext *avctx)
     clear_frame_list(&s->out_frame_list);
     av_freep(&s->surface_ptrs_in);
     av_freep(&s->surface_ptrs_out);
-#if QSV_HAVE_OPAQUE
+    av_freep(&s->seq_buffers);
     av_freep(&s->ext_buffers);
-#endif
     av_freep(&s->frame_infos);
     av_fifo_freep2(&s->async_fifo);
 
diff --git a/libavfilter/qsvvpp.h b/libavfilter/qsvvpp.h
index 8851185ff3..073c89fe70 100644
--- a/libavfilter/qsvvpp.h
+++ b/libavfilter/qsvvpp.h
@@ -74,9 +74,14 @@ typedef struct QSVVPPContext {
 #if QSV_HAVE_OPAQUE
     /** MFXVPP extern parameters */
     mfxExtOpaqueSurfaceAlloc opaque_alloc;
+#endif
+    /** store sequence parameters */
+    mfxExtBuffer      **seq_buffers;
+    int                 nb_seq_buffers;
+
+    /** store all parameters for vpp execution, including parameters per frame */
     mfxExtBuffer      **ext_buffers;
     int                 nb_ext_buffers;
-#endif
 
     int got_frame;
     int async_depth;
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [FFmpeg-devel] [PATCH 5/6] lavfi/qsvvpp: postpone vpp session initialization
  2023-06-12  8:14 [FFmpeg-devel] [PATCH 1/6] lavfi/qsvvpp: track the runtime version in vpp context Xiang, Haihao
                   ` (2 preceding siblings ...)
  2023-06-12  8:14 ` [FFmpeg-devel] [PATCH 4/6] lavfi/qsvvpp: store a copy of the sequence parameters Xiang, Haihao
@ 2023-06-12  8:14 ` Xiang, Haihao
  2023-06-12  8:14 ` [FFmpeg-devel] [PATCH 6/6] lavfi/qsvvpp: use the right picture struct for vpp initilaization Xiang, Haihao
  2023-06-19  4:46 ` [FFmpeg-devel] [PATCH 1/6] lavfi/qsvvpp: track the runtime version in vpp context Xiang, Haihao
  5 siblings, 0 replies; 8+ messages in thread
From: Xiang, Haihao @ 2023-06-12  8:14 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Haihao Xiang

From: Haihao Xiang <haihao.xiang@intel.com>

So there is a chance to update vpp parameters per frame

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
---
 libavfilter/qsvvpp.c | 38 +++++++++++++++++++++++++++++++-------
 libavfilter/qsvvpp.h |  1 +
 2 files changed, 32 insertions(+), 7 deletions(-)

diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
index d168ab5d1d..f2e8e5fd73 100644
--- a/libavfilter/qsvvpp.c
+++ b/libavfilter/qsvvpp.c
@@ -835,6 +835,7 @@ int ff_qsvvpp_init(AVFilterContext *avctx, QSVVPPParam *param)
     /* Print output memory mode */
     ff_qsvvpp_print_iopattern(avctx, s->vpp_param.IOPattern & 0xF0, "VPP");
 
+    /* Validate VPP params, but don't initial VPP session here */
     ret = MFXVideoVPP_Query(s->session, &s->vpp_param, &s->vpp_param);
     if (ret < 0) {
         ret = ff_qsvvpp_print_error(avctx, ret, "Error querying VPP params");
@@ -842,13 +843,6 @@ int ff_qsvvpp_init(AVFilterContext *avctx, QSVVPPParam *param)
     } else if (ret > 0)
         ff_qsvvpp_print_warning(avctx, ret, "Warning When querying VPP params");
 
-    ret = MFXVideoVPP_Init(s->session, &s->vpp_param);
-    if (ret < 0) {
-        ret = ff_qsvvpp_print_error(avctx, ret, "Failed to create a qsvvpp");
-        goto failed;
-    } else if (ret > 0)
-        ff_qsvvpp_print_warning(avctx, ret, "Warning When creating qsvvpp");
-
     return 0;
 
 failed:
@@ -857,6 +851,31 @@ failed:
     return ret;
 }
 
+static int qsvvpp_init_vpp_session(AVFilterContext *avctx, QSVVPPContext *s)
+{
+    int ret;
+
+    if (s->vpp_initted)
+        return 0;
+
+    /* Query VPP params again, including params for frame */
+    ret = MFXVideoVPP_Query(s->session, &s->vpp_param, &s->vpp_param);
+    if (ret < 0)
+        return ff_qsvvpp_print_error(avctx, ret, "Error querying VPP params");
+    else if (ret > 0)
+        ff_qsvvpp_print_warning(avctx, ret, "Warning When querying VPP params");
+
+    ret = MFXVideoVPP_Init(s->session, &s->vpp_param);
+    if (ret < 0)
+        return ff_qsvvpp_print_error(avctx, ret, "Failed to create a qsvvpp");
+    else if (ret > 0)
+        ff_qsvvpp_print_warning(avctx, ret, "Warning When creating qsvvpp");
+
+    s->vpp_initted = 1;
+
+    return 0;
+}
+
 int ff_qsvvpp_close(AVFilterContext *avctx)
 {
     QSVVPPContext *s = avctx->priv;
@@ -865,6 +884,7 @@ int ff_qsvvpp_close(AVFilterContext *avctx)
         MFXVideoVPP_Close(s->session);
         MFXClose(s->session);
         s->session = NULL;
+        s->vpp_initted = 0;
     }
 
     /* release all the resources */
@@ -920,6 +940,10 @@ int ff_qsvvpp_filter_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *picr
             return AVERROR(ENOMEM);
         }
 
+        ret = qsvvpp_init_vpp_session(ctx, s);
+        if (ret)
+            return ret;
+
         do {
             ret = MFXVideoVPP_RunFrameVPPAsync(s->session, &in_frame->surface,
                                                &out_frame->surface, NULL, &sync);
diff --git a/libavfilter/qsvvpp.h b/libavfilter/qsvvpp.h
index 073c89fe70..fba5f037d4 100644
--- a/libavfilter/qsvvpp.h
+++ b/libavfilter/qsvvpp.h
@@ -90,6 +90,7 @@ typedef struct QSVVPPContext {
     AVFifo *async_fifo;
 
     mfxVersion ver;
+    int vpp_initted;
 } QSVVPPContext;
 
 typedef struct QSVVPPCrop {
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [FFmpeg-devel] [PATCH 6/6] lavfi/qsvvpp: use the right picture struct for vpp initilaization
  2023-06-12  8:14 [FFmpeg-devel] [PATCH 1/6] lavfi/qsvvpp: track the runtime version in vpp context Xiang, Haihao
                   ` (3 preceding siblings ...)
  2023-06-12  8:14 ` [FFmpeg-devel] [PATCH 5/6] lavfi/qsvvpp: postpone vpp session initialization Xiang, Haihao
@ 2023-06-12  8:14 ` Xiang, Haihao
  2023-06-19  4:46 ` [FFmpeg-devel] [PATCH 1/6] lavfi/qsvvpp: track the runtime version in vpp context Xiang, Haihao
  5 siblings, 0 replies; 8+ messages in thread
From: Xiang, Haihao @ 2023-06-12  8:14 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Haihao Xiang

From: Haihao Xiang <haihao.xiang@intel.com>

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
---
 libavfilter/qsvvpp.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
index f2e8e5fd73..a03de05d9c 100644
--- a/libavfilter/qsvvpp.c
+++ b/libavfilter/qsvvpp.c
@@ -536,6 +536,20 @@ static QSVFrame *query_frame(QSVVPPContext *s, AVFilterLink *outlink, const AVFr
     out_frame->frame->height = outlink->h;
     out_frame->surface.Info = s->vpp_param.vpp.Out;
 
+    for (int i = 0; i < s->vpp_param.NumExtParam; i++) {
+        mfxExtBuffer *extbuf = s->vpp_param.ExtParam[i];
+
+        if (extbuf->BufferId == MFX_EXTBUFF_VPP_DEINTERLACING) {
+            out_frame->frame->interlaced_frame = 0;
+            break;
+        }
+    }
+
+    out_frame->surface.Info.PicStruct =
+        !out_frame->frame->interlaced_frame ? MFX_PICSTRUCT_PROGRESSIVE :
+        (out_frame->frame->top_field_first ? MFX_PICSTRUCT_FIELD_TFF :
+         MFX_PICSTRUCT_FIELD_BFF);
+
     return out_frame;
 }
 
@@ -851,13 +865,16 @@ failed:
     return ret;
 }
 
-static int qsvvpp_init_vpp_session(AVFilterContext *avctx, QSVVPPContext *s)
+static int qsvvpp_init_vpp_session(AVFilterContext *avctx, QSVVPPContext *s, const QSVFrame *in, QSVFrame *out)
 {
     int ret;
 
     if (s->vpp_initted)
         return 0;
 
+    s->vpp_param.vpp.In.PicStruct = in->surface.Info.PicStruct;
+    s->vpp_param.vpp.Out.PicStruct = out->surface.Info.PicStruct;
+
     /* Query VPP params again, including params for frame */
     ret = MFXVideoVPP_Query(s->session, &s->vpp_param, &s->vpp_param);
     if (ret < 0)
@@ -940,7 +957,7 @@ int ff_qsvvpp_filter_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *picr
             return AVERROR(ENOMEM);
         }
 
-        ret = qsvvpp_init_vpp_session(ctx, s);
+        ret = qsvvpp_init_vpp_session(ctx, s, in_frame, out_frame);
         if (ret)
             return ret;
 
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/6] lavfi/qsvvpp: track the runtime version in vpp context
  2023-06-12  8:14 [FFmpeg-devel] [PATCH 1/6] lavfi/qsvvpp: track the runtime version in vpp context Xiang, Haihao
                   ` (4 preceding siblings ...)
  2023-06-12  8:14 ` [FFmpeg-devel] [PATCH 6/6] lavfi/qsvvpp: use the right picture struct for vpp initilaization Xiang, Haihao
@ 2023-06-19  4:46 ` Xiang, Haihao
  2023-06-20  2:01   ` Xiang, Haihao
  5 siblings, 1 reply; 8+ messages in thread
From: Xiang, Haihao @ 2023-06-19  4:46 UTC (permalink / raw)
  To: ffmpeg-devel

On Ma, 2023-06-12 at 16:14 +0800, Xiang, Haihao wrote:
> From: Haihao Xiang <haihao.xiang@intel.com>
> 
> We may check whether a feature is supported via the runtime version in
> future.
> 
> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
> ---
>  libavfilter/qsvvpp.c | 6 ++++++
>  libavfilter/qsvvpp.h | 2 ++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
> index b233b81243..779afce66d 100644
> --- a/libavfilter/qsvvpp.c
> +++ b/libavfilter/qsvvpp.c
> @@ -655,6 +655,12 @@ static int init_vpp_session(AVFilterContext *avctx,
> QSVVPPContext *s)
>      if (ret)
>          return ret;
>  
> +    ret = MFXQueryVersion(s->session, &s->ver);
> +    if (ret != MFX_ERR_NONE) {
> +        av_log(avctx, AV_LOG_ERROR, "Error querying the runtime version\n");
> +        return AVERROR_UNKNOWN;
> +    }
> +
>      if (handle) {
>          ret = MFXVideoCORE_SetHandle(s->session, handle_type, handle);
>          if (ret != MFX_ERR_NONE)
> diff --git a/libavfilter/qsvvpp.h b/libavfilter/qsvvpp.h
> index 3b32193744..8851185ff3 100644
> --- a/libavfilter/qsvvpp.h
> +++ b/libavfilter/qsvvpp.h
> @@ -83,6 +83,8 @@ typedef struct QSVVPPContext {
>      int eof;
>      /** order with frame_out, sync */
>      AVFifo *async_fifo;
> +
> +    mfxVersion ver;
>  } QSVVPPContext;
>  
>  typedef struct QSVVPPCrop {

Will apply 

-Haihao


_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/6] lavfi/qsvvpp: track the runtime version in vpp context
  2023-06-19  4:46 ` [FFmpeg-devel] [PATCH 1/6] lavfi/qsvvpp: track the runtime version in vpp context Xiang, Haihao
@ 2023-06-20  2:01   ` Xiang, Haihao
  0 siblings, 0 replies; 8+ messages in thread
From: Xiang, Haihao @ 2023-06-20  2:01 UTC (permalink / raw)
  To: ffmpeg-devel

On Ma, 2023-06-19 at 04:46 +0000, Xiang, Haihao wrote:
> On Ma, 2023-06-12 at 16:14 +0800, Xiang, Haihao wrote:
> > From: Haihao Xiang <haihao.xiang@intel.com>
> > 
> > We may check whether a feature is supported via the runtime version in
> > future.
> > 
> > Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
> > ---
> >  libavfilter/qsvvpp.c | 6 ++++++
> >  libavfilter/qsvvpp.h | 2 ++
> >  2 files changed, 8 insertions(+)
> > 
> > diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
> > index b233b81243..779afce66d 100644
> > --- a/libavfilter/qsvvpp.c
> > +++ b/libavfilter/qsvvpp.c
> > @@ -655,6 +655,12 @@ static int init_vpp_session(AVFilterContext *avctx,
> > QSVVPPContext *s)
> >      if (ret)
> >          return ret;
> >  
> > +    ret = MFXQueryVersion(s->session, &s->ver);
> > +    if (ret != MFX_ERR_NONE) {
> > +        av_log(avctx, AV_LOG_ERROR, "Error querying the runtime
> > version\n");
> > +        return AVERROR_UNKNOWN;
> > +    }
> > +
> >      if (handle) {
> >          ret = MFXVideoCORE_SetHandle(s->session, handle_type, handle);
> >          if (ret != MFX_ERR_NONE)
> > diff --git a/libavfilter/qsvvpp.h b/libavfilter/qsvvpp.h
> > index 3b32193744..8851185ff3 100644
> > --- a/libavfilter/qsvvpp.h
> > +++ b/libavfilter/qsvvpp.h
> > @@ -83,6 +83,8 @@ typedef struct QSVVPPContext {
> >      int eof;
> >      /** order with frame_out, sync */
> >      AVFifo *async_fifo;
> > +
> > +    mfxVersion ver;
> >  } QSVVPPContext;
> >  
> >  typedef struct QSVVPPCrop {
> 
> Will apply 

Pushed, 

-Haihao


_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-06-20  2:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-12  8:14 [FFmpeg-devel] [PATCH 1/6] lavfi/qsvvpp: track the runtime version in vpp context Xiang, Haihao
2023-06-12  8:14 ` [FFmpeg-devel] [PATCH 2/6] lavfi/qsvvpp: copy metadata fields from src to dst Xiang, Haihao
2023-06-12  8:14 ` [FFmpeg-devel] [PATCH 3/6] lavfi/qsvvpp: check the parameters before initializing vpp session Xiang, Haihao
2023-06-12  8:14 ` [FFmpeg-devel] [PATCH 4/6] lavfi/qsvvpp: store a copy of the sequence parameters Xiang, Haihao
2023-06-12  8:14 ` [FFmpeg-devel] [PATCH 5/6] lavfi/qsvvpp: postpone vpp session initialization Xiang, Haihao
2023-06-12  8:14 ` [FFmpeg-devel] [PATCH 6/6] lavfi/qsvvpp: use the right picture struct for vpp initilaization Xiang, Haihao
2023-06-19  4:46 ` [FFmpeg-devel] [PATCH 1/6] lavfi/qsvvpp: track the runtime version in vpp context Xiang, Haihao
2023-06-20  2:01   ` Xiang, Haihao

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git