From: Soft Works <softworkz@hotmail.com>
To: "ffmpeg-devel@ffmpeg.org" <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH v3] avfilter/vpp_qsv: fix regression on older api versions (e.g. 1.11)
Date: Fri, 7 Jan 2022 07:01:02 +0000
Message-ID: <DM8P223MB0365FB2A0C275239214DB544BA4D9@DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <82f72b147e752c537011219088aeb313a7f2086a.camel@intel.com>
> -----Original Message-----
> From: Xiang, Haihao <haihao.xiang@intel.com>
> Sent: Friday, January 7, 2022 7:48 AM
> To: ffmpeg-devel@ffmpeg.org
> Cc: haihao.xiang-at-intel.com@ffmpeg.org; softworkz@hotmail.com
> Subject: Re: [FFmpeg-devel] [PATCH v3] avfilter/vpp_qsv: fix regression on
> older api versions (e.g. 1.11)
>
> On Fri, 2022-01-07 at 03:58 +0000, ffmpegagent wrote:
> > From: softworkz <softworkz@hotmail.com>
> >
> > Commit 8b83dad82512a6948b63408f964463b063ad24c9 introduced a
> > regression in a way that scaling via vpp_qsv doesn't work any longer
> > for devices with an MSDK runtime version lower than 1.19. This is true
> > for older CPUs which are stuck at 1.11.
> > The commit added checks for the compile-sdk version but it didn't test
> > for the runtime version.
> >
> > Signed-off-by: softworkz <softworkz@hotmail.com>
> > ---
> > avfilter/vpp_qsv: fix regression on older api versions (e.g. 1.11)
> >
> > Fix a recently introduced regression when using QSV VPP.
> >
> > v2: Fixed commit message wrapping v3: Use different way to acquire
> > runtime version
> >
> > Published-As:
> > https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-
> 15%2Fsoftworkz%2Fqsv_vpp_regression-v3
> > Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-
> > 15/softworkz/qsv_vpp_regression-v3
> > Pull-Request: https://github.com/ffstaging/FFmpeg/pull/15
> >
> > Range-diff vs v2:
> >
> > 1: ccede9d840 ! 1: cbf53d8ef4 avfilter/vpp_qsv: fix regression on older
> api
> > versions (e.g. 1.11)
> > @@ Commit message
> > Signed-off-by: softworkz <softworkz@hotmail.com>
> >
> > ## libavfilter/vf_vpp_qsv.c ##
> > +@@
> > + #include "libavutil/opt.h"
> > + #include "libavutil/eval.h"
> > + #include "libavutil/hwcontext.h"
> > ++#include "libavutil/hwcontext_qsv.h"
> > + #include "libavutil/pixdesc.h"
> > + #include "libavutil/mathematics.h"
> > +
> > @@ libavfilter/vf_vpp_qsv.c: static const AVOption options[] = {
> > { "height", "Output video height", OFFSET(oh),
> AV_OPT_TYPE_STRING,
> > { .str="w*ch/cw" }, 0, 255, .flags = FLAGS },
> > { "format", "Output pixel format", OFFSET(output_format_str),
> > AV_OPT_TYPE_STRING, { .str = "same" }, .flags = FLAGS },
> > @@ libavfilter/vf_vpp_qsv.c: static const AVOption options[] = {
> > { NULL }
> > };
> >
> > +@@ libavfilter/vf_vpp_qsv.c: static int config_input(AVFilterLink
> > *inlink)
> > + return 0;
> > + }
> > +
> > ++static int get_mfx_version(const AVFilterContext *ctx, mfxVersion
> > *mfx_version)
> > ++{
> > ++ const AVFilterLink *inlink = ctx->inputs[0];
> > ++ AVBufferRef *device_ref;
> > ++ AVHWDeviceContext *device_ctx;
> > ++ AVQSVDeviceContext *device_hwctx;
> > ++
> > ++ if (inlink->hw_frames_ctx) {
> > ++ AVHWFramesContext *frames_ctx = (AVHWFramesContext *)inlink-
> > >hw_frames_ctx->data;
> > ++ device_ref = frames_ctx->device_ref;
> > ++ } else if (ctx->hw_device_ctx) {
> > ++ device_ref = ctx->hw_device_ctx;
> > ++ } else {
> > ++ // Unavailable hw context doesn't matter in pass-through
> mode,
> > ++ // so don't error here but let runtime version checks fail
> by
> > setting to 0.0
> > ++ mfx_version->Major = 0;
> > ++ mfx_version->Minor = 0;
> > ++ return 0;
> > ++ }
> > ++
> > ++ device_ctx = (AVHWDeviceContext *)device_ref->data;
> > ++ device_hwctx = device_ctx->hwctx;
> > ++
> > ++ return MFXQueryVersion(device_hwctx->session, mfx_version);
>
> Thanks for the new patch version, it works well for me.
>
> It would be better to change the return type of get_mfx_version from int to
> mfxStatus if returning MFXQueryVersion(device_hwctx->session, mfx_version)
> here.
> Otherwise map the returned mfx status to ffmpeg status, then return ffmpeg
> status.
Yes, makes sense. Update on the way..
sw
_______________________________________________
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".
next prev parent reply other threads:[~2022-01-07 7:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-02 3:12 [FFmpeg-devel] [PATCH] " ffmpegagent
2022-01-02 3:41 ` [FFmpeg-devel] [PATCH v2] " ffmpegagent
2022-01-04 2:16 ` Xiang, Haihao
2022-01-04 2:25 ` Soft Works
2022-01-04 2:37 ` Xiang, Haihao
2022-01-04 2:42 ` Soft Works
2022-01-04 8:09 ` Xiang, Haihao
2022-01-07 3:58 ` [FFmpeg-devel] [PATCH v3] " ffmpegagent
2022-01-07 6:48 ` Xiang, Haihao
2022-01-07 7:01 ` Soft Works [this message]
2022-01-07 7:01 ` [FFmpeg-devel] [PATCH v4] " ffmpegagent
2022-01-10 7:02 ` Xiang, Haihao
2022-01-10 7:17 ` Soft Works
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DM8P223MB0365FB2A0C275239214DB544BA4D9@DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM \
--to=softworkz@hotmail.com \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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