From: "Xiang, Haihao" <haihao.xiang-at-intel.com@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: Haihao Xiang <haihao.xiang@intel.com>
Subject: [FFmpeg-devel] [PATCH v2 2/3] lavc/qsvdec: track the runtime session version
Date: Mon, 24 Jan 2022 16:24:54 +0800
Message-ID: <20220124082455.30931-2-haihao.xiang@intel.com> (raw)
In-Reply-To: <20220124082455.30931-1-haihao.xiang@intel.com>
From: Haihao Xiang <haihao.xiang@intel.com>
We may check the runtime version for the given features
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
---
libavcodec/qsvdec.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index 783d252002..8b83d5695f 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -59,6 +59,7 @@ static const AVRational mfx_tb = { 1, 90000 };
typedef struct QSVContext {
// the session used for decoding
mfxSession session;
+ mfxVersion ver;
// the session we allocated internally, in case the caller did not provide
// one
@@ -202,6 +203,18 @@ static int qsv_init_session(AVCodecContext *avctx, QSVContext *q, mfxSession ses
q->session = q->internal_qs.session;
}
+ if (MFXQueryVersion(q->session, &q->ver) != MFX_ERR_NONE) {
+ av_log(avctx, AV_LOG_ERROR, "Error querying the session version. \n");
+ q->session = NULL;
+
+ if (q->internal_qs.session) {
+ MFXClose(q->internal_qs.session);
+ q->internal_qs.session = NULL;
+ }
+
+ return AVERROR_EXTERNAL;
+ }
+
/* make sure the decoder is uninitialized */
MFXVideoDECODE_Close(q->session);
--
2.17.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".
next prev parent reply other threads:[~2022-01-24 8:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-24 8:24 [FFmpeg-devel] [PATCH v2 1/3] lavc/qsv: allow to add more parameter buffers to QSV frame Xiang, Haihao
2022-01-24 8:24 ` Xiang, Haihao [this message]
2022-01-24 8:24 ` [FFmpeg-devel] [PATCH v2 3/3] lavc/qsvdec: export AVFilmGrainParams side data Xiang, Haihao
2022-01-27 5:37 ` [FFmpeg-devel] [PATCH v2 1/3] lavc/qsv: allow to add more parameter buffers to QSV frame Xiang, Haihao
2022-01-29 14:30 ` Timo Rothenpieler
2022-01-29 14:41 ` Timo Rothenpieler
2022-01-30 1:02 ` Xiang, Haihao
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=20220124082455.30931-2-haihao.xiang@intel.com \
--to=haihao.xiang-at-intel.com@ffmpeg.org \
--cc=ffmpeg-devel@ffmpeg.org \
--cc=haihao.xiang@intel.com \
/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