mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 05:06:17 +00:00
va: Fix some code defects
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4007>
This commit is contained in:
parent
0c693363fb
commit
fbab40bd5e
5 changed files with 24 additions and 6 deletions
|
@ -300,7 +300,11 @@ _create_internal_pool (GstVaAV1Dec * self, gint width, gint height)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_buffer_pool_set_active (pool, TRUE);
|
if (!gst_buffer_pool_set_active (pool, TRUE)) {
|
||||||
|
GST_WARNING_OBJECT (self, "Failed to activate internal pool");
|
||||||
|
gst_object_unref (pool);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return pool;
|
return pool;
|
||||||
}
|
}
|
||||||
|
|
|
@ -229,7 +229,10 @@ _get_sinkpad_pool (GstVaBaseEnc * base)
|
||||||
|
|
||||||
gst_object_unref (allocator);
|
gst_object_unref (allocator);
|
||||||
|
|
||||||
gst_buffer_pool_set_active (base->priv->raw_pool, TRUE);
|
if (!gst_buffer_pool_set_active (base->priv->raw_pool, TRUE)) {
|
||||||
|
GST_WARNING_OBJECT (base, "Failed to activate sinkpad pool");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return base->priv->raw_pool;
|
return base->priv->raw_pool;
|
||||||
}
|
}
|
||||||
|
@ -690,8 +693,10 @@ error_reorder:
|
||||||
{
|
{
|
||||||
GST_ELEMENT_ERROR (venc, STREAM, ENCODE,
|
GST_ELEMENT_ERROR (venc, STREAM, ENCODE,
|
||||||
("Failed to reorder the input frame."), (NULL));
|
("Failed to reorder the input frame."), (NULL));
|
||||||
gst_clear_buffer (&frame->output_buffer);
|
if (frame) {
|
||||||
gst_video_encoder_finish_frame (venc, frame);
|
gst_clear_buffer (&frame->output_buffer);
|
||||||
|
gst_video_encoder_finish_frame (venc, frame);
|
||||||
|
}
|
||||||
return GST_FLOW_ERROR;
|
return GST_FLOW_ERROR;
|
||||||
}
|
}
|
||||||
error_encode:
|
error_encode:
|
||||||
|
|
|
@ -768,7 +768,10 @@ _get_sinkpad_pool (GstVaBaseTransform * self)
|
||||||
|
|
||||||
if (self->priv->sinkpad_caps) {
|
if (self->priv->sinkpad_caps) {
|
||||||
caps = self->priv->sinkpad_caps;
|
caps = self->priv->sinkpad_caps;
|
||||||
gst_video_info_from_caps (&in_info, caps);
|
if (!gst_video_info_from_caps (&in_info, caps)) {
|
||||||
|
GST_ERROR_OBJECT (self, "Cannot parse caps %" GST_PTR_FORMAT, caps);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
caps = self->in_caps;
|
caps = self->in_caps;
|
||||||
in_info = self->in_info;
|
in_info = self->in_info;
|
||||||
|
|
|
@ -397,7 +397,11 @@ gst_va_encoder_open (GstVaEncoder * self, VAProfile profile,
|
||||||
GST_ERROR_OBJECT (self, "Failed to create reconstruct pool");
|
GST_ERROR_OBJECT (self, "Failed to create reconstruct pool");
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
gst_buffer_pool_set_active (recon_pool, TRUE);
|
|
||||||
|
if (!gst_buffer_pool_set_active (recon_pool, TRUE)) {
|
||||||
|
GST_ERROR_OBJECT (self, "Failed to activate reconstruct pool");
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
status = vaCreateContext (dpy, config, coded_width, coded_height,
|
status = vaCreateContext (dpy, config, coded_width, coded_height,
|
||||||
VA_PROGRESSIVE, NULL, 0, &context);
|
VA_PROGRESSIVE, NULL, 0, &context);
|
||||||
|
|
|
@ -1200,11 +1200,13 @@ _calculate_coded_size (GstVaH264Enc * self)
|
||||||
BitDepthC = 10;
|
BitDepthC = 10;
|
||||||
MbWidthC = 8;
|
MbWidthC = 8;
|
||||||
MbHeightC = 8;
|
MbHeightC = 8;
|
||||||
|
break;
|
||||||
case VA_RT_FORMAT_YUV422_10:
|
case VA_RT_FORMAT_YUV422_10:
|
||||||
BitDepthY = 10;
|
BitDepthY = 10;
|
||||||
BitDepthC = 10;
|
BitDepthC = 10;
|
||||||
MbWidthC = 8;
|
MbWidthC = 8;
|
||||||
MbHeightC = 16;
|
MbHeightC = 16;
|
||||||
|
break;
|
||||||
case VA_RT_FORMAT_YUV444_10:
|
case VA_RT_FORMAT_YUV444_10:
|
||||||
BitDepthY = 10;
|
BitDepthY = 10;
|
||||||
BitDepthC = 10;
|
BitDepthC = 10;
|
||||||
|
|
Loading…
Reference in a new issue