vaapidec: Fix uninitialized vars

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3918>
This commit is contained in:
Mengkejiergeli Ba 2023-02-09 10:42:00 +08:00 committed by GStreamer Marge Bot
parent 2837f14b6b
commit 9147dc3d37
9 changed files with 91 additions and 54 deletions

View file

@ -314,16 +314,20 @@ av1_decoder_ensure_context (GstVaapiDecoderAV1 * decoder)
if (priv->current_picture)
gst_vaapi_picture_replace (&priv->current_picture, NULL);
info.profile = priv->profile;
info.entrypoint = GST_VAAPI_ENTRYPOINT_VLD;
info.width = priv->width;
info.height = priv->height;
info.chroma_type = av1_get_chroma_type (info.profile, priv->seq_header);
/* *INDENT-OFF* */
info = (GstVaapiContextInfo) {
.profile = priv->profile,
.entrypoint = GST_VAAPI_ENTRYPOINT_VLD,
.chroma_type = av1_get_chroma_type (priv->profile, priv->seq_header),
.width = priv->width,
.height = priv->height,
.ref_frames = GST_AV1_NUM_REF_FRAMES + 2,
};
/* *INDENT-ON* */
if (!info.chroma_type)
return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CHROMA_FORMAT;
info.ref_frames = GST_AV1_NUM_REF_FRAMES + 2;
priv->reset_context = FALSE;
if (!gst_vaapi_decoder_ensure_context (GST_VAAPI_DECODER (decoder), &info)) {
GST_WARNING ("can not make av1 decoder context with profile %s,"

View file

@ -1645,12 +1645,16 @@ ensure_context (GstVaapiDecoderH264 * decoder, GstH264SPS * sps)
return GST_VAAPI_DECODER_STATUS_SUCCESS;
/* XXX: fix surface size when cropping is implemented */
info.profile = priv->profile;
info.entrypoint = priv->entrypoint;
info.chroma_type = priv->chroma_type;
info.width = sps->width;
info.height = sps->height;
info.ref_frames = dpb_size;
/* *INDENT-OFF* */
info = (GstVaapiContextInfo) {
.profile = priv->profile,
.entrypoint = priv->entrypoint,
.chroma_type = priv->chroma_type,
.width = sps->width,
.height = sps->height,
.ref_frames = dpb_size,
};
/* *INDENT-ON* */
if (!gst_vaapi_decoder_ensure_context (GST_VAAPI_DECODER (decoder), &info))
return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN;

View file

@ -1210,12 +1210,16 @@ ensure_context (GstVaapiDecoderH265 * decoder, GstH265SPS * sps)
return GST_VAAPI_DECODER_STATUS_SUCCESS;
/* XXX: fix surface size when cropping is implemented */
info.profile = priv->profile;
info.entrypoint = priv->entrypoint;
info.chroma_type = priv->chroma_type;
info.width = sps->width;
info.height = sps->height;
info.ref_frames = dpb_size;
/* *INDENT-OFF* */
info = (GstVaapiContextInfo) {
.profile = priv->profile,
.entrypoint = priv->entrypoint,
.chroma_type = priv->chroma_type,
.width = sps->width,
.height = sps->height,
.ref_frames = dpb_size,
};
/* *INDENT-ON* */
if (!gst_vaapi_decoder_ensure_context (GST_VAAPI_DECODER (decoder), &info))
return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN;

View file

@ -250,14 +250,19 @@ ensure_context (GstVaapiDecoderJpeg * decoder)
if (reset_context) {
GstVaapiContextInfo info;
info.profile = priv->profile;
info.entrypoint = entrypoint;
info.width = priv->width;
info.height = priv->height;
info.ref_frames = 2;
if (!get_chroma_type (frame_hdr, &chroma_type))
return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CHROMA_FORMAT;
info.chroma_type = chroma_type;
/* *INDENT-OFF* */
info = (GstVaapiContextInfo) {
.profile = priv->profile,
.entrypoint = entrypoint,
.chroma_type = chroma_type,
.width = priv->width,
.height = priv->height,
.ref_frames = 2,
};
/* *INDENT-ON* */
reset_context =
gst_vaapi_decoder_ensure_context (GST_VAAPI_DECODER (decoder), &info);

View file

@ -461,13 +461,17 @@ ensure_context (GstVaapiDecoderMpeg2 * decoder)
if (reset_context) {
GstVaapiContextInfo info;
/* *INDENT-OFF* */
info = (GstVaapiContextInfo) {
.profile = priv->hw_profile,
.entrypoint = entrypoint,
.chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420,
.width = priv->width,
.height = priv->height,
.ref_frames = 2,
};
/* *INDENT-ON* */
info.profile = priv->hw_profile;
info.entrypoint = entrypoint;
info.chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420;
info.width = priv->width;
info.height = priv->height;
info.ref_frames = 2;
reset_context =
gst_vaapi_decoder_ensure_context (GST_VAAPI_DECODER_CAST (decoder),
&info);

View file

@ -231,13 +231,17 @@ ensure_context (GstVaapiDecoderMpeg4 * decoder)
if (reset_context) {
GstVaapiContextInfo info;
/* *INDENT-OFF* */
info = (GstVaapiContextInfo) {
.profile = priv->profile,
.entrypoint = entrypoint,
.chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420,
.width = priv->width,
.height = priv->height,
.ref_frames = 2,
};
/* *INDENT-ON* */
info.profile = priv->profile;
info.entrypoint = entrypoint;
info.chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420;
info.width = priv->width;
info.height = priv->height;
info.ref_frames = 2;
reset_context =
gst_vaapi_decoder_ensure_context (GST_VAAPI_DECODER (decoder), &info);
if (!reset_context)

View file

@ -233,13 +233,17 @@ ensure_context (GstVaapiDecoderVC1 * decoder)
if (reset_context) {
GstVaapiContextInfo info;
/* *INDENT-OFF* */
info = (GstVaapiContextInfo) {
.profile = priv->profile,
.entrypoint = entrypoint,
.chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420,
.width = priv->width,
.height = priv->height,
.ref_frames = 2,
};
/* *INDENT-ON* */
info.profile = priv->profile;
info.entrypoint = entrypoint;
info.chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420;
info.width = priv->width;
info.height = priv->height;
info.ref_frames = 2;
reset_context =
gst_vaapi_decoder_ensure_context (GST_VAAPI_DECODER (decoder), &info);
if (!reset_context)

View file

@ -180,13 +180,17 @@ ensure_context (GstVaapiDecoderVp8 * decoder)
if (reset_context) {
GstVaapiContextInfo info;
/* *INDENT-OFF* */
info = (GstVaapiContextInfo) {
.profile = priv->profile,
.entrypoint = entrypoint,
.chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420,
.width = priv->width,
.height = priv->height,
.ref_frames = 3,
};
/* *INDENT-ON* */
info.profile = priv->profile;
info.entrypoint = entrypoint;
info.chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420;
info.width = priv->width;
info.height = priv->height;
info.ref_frames = 3;
reset_context =
gst_vaapi_decoder_ensure_context (GST_VAAPI_DECODER (decoder), &info);

View file

@ -259,12 +259,16 @@ ensure_context (GstVaapiDecoderVp9 * decoder)
if (reset_context) {
GstVaapiContextInfo info;
/* *INDENT-OFF* */
info = (GstVaapiContextInfo) {
.profile = priv->profile,
.entrypoint = entrypoint,
.width = priv->width,
.height = priv->height,
.ref_frames = 8,
};
/* *INDENT-ON* */
info.profile = priv->profile;
info.entrypoint = entrypoint;
info.width = priv->width;
info.height = priv->height;
info.ref_frames = 8;
if (!get_chroma_type (frame_hdr, parser, &info))
return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CHROMA_FORMAT;