mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-07 07:40:16 +00:00
qsvdec: fix get_format and hwaccel_context handling
This enables the qsv transcoder to actually get activated
This commit is contained in:
parent
dd8a4b0f8c
commit
b54d645116
@ -58,8 +58,13 @@ static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q, AVPacket *avpkt
|
|||||||
AV_PIX_FMT_NV12,
|
AV_PIX_FMT_NV12,
|
||||||
AV_PIX_FMT_NONE };
|
AV_PIX_FMT_NONE };
|
||||||
|
|
||||||
|
ret = ff_get_format(avctx, pix_fmts);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
avctx->pix_fmt = ret;
|
||||||
|
|
||||||
q->iopattern = MFX_IOPATTERN_OUT_SYSTEM_MEMORY;
|
q->iopattern = MFX_IOPATTERN_OUT_SYSTEM_MEMORY;
|
||||||
if (!q->session) {
|
|
||||||
if (avctx->hwaccel_context) {
|
if (avctx->hwaccel_context) {
|
||||||
AVQSVContext *qsv = avctx->hwaccel_context;
|
AVQSVContext *qsv = avctx->hwaccel_context;
|
||||||
|
|
||||||
@ -69,14 +74,15 @@ static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q, AVPacket *avpkt
|
|||||||
q->nb_ext_buffers = qsv->nb_ext_buffers;
|
q->nb_ext_buffers = qsv->nb_ext_buffers;
|
||||||
}
|
}
|
||||||
if (!q->session) {
|
if (!q->session) {
|
||||||
|
if (!q->internal_qs.session) {
|
||||||
ret = ff_qsv_init_internal_session(avctx, &q->internal_qs,
|
ret = ff_qsv_init_internal_session(avctx, &q->internal_qs,
|
||||||
q->load_plugins);
|
q->load_plugins);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
q->session = q->internal_qs.session;
|
q->session = q->internal_qs.session;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (avpkt->size) {
|
if (avpkt->size) {
|
||||||
bs.Data = avpkt->data;
|
bs.Data = avpkt->data;
|
||||||
@ -123,11 +129,6 @@ static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q, AVPacket *avpkt
|
|||||||
return ff_qsv_error(ret);
|
return ff_qsv_error(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = ff_get_format(avctx, pix_fmts);
|
|
||||||
if (ret < 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
avctx->pix_fmt = ret;
|
|
||||||
avctx->profile = param.mfx.CodecProfile;
|
avctx->profile = param.mfx.CodecProfile;
|
||||||
avctx->level = param.mfx.CodecLevel;
|
avctx->level = param.mfx.CodecLevel;
|
||||||
avctx->coded_width = param.mfx.FrameInfo.Width;
|
avctx->coded_width = param.mfx.FrameInfo.Width;
|
||||||
|
Loading…
Reference in New Issue
Block a user