vajpegdec: Reenable element negotiation.
negotiation vmethod were overwritten by vabasedec, leading to errors. This was a regression of commit b6538e0560. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3509>
This commit is contained in:
parent
9f9e625776
commit
901ad2b4f5
@ -140,6 +140,7 @@ gst_va_jpeg_dec_new_picture (GstJpegDecoder * decoder,
|
|||||||
{
|
{
|
||||||
GstVaJpegDec *self = GST_VA_JPEG_DEC (decoder);
|
GstVaJpegDec *self = GST_VA_JPEG_DEC (decoder);
|
||||||
GstVaBaseDec *base = GST_VA_BASE_DEC (decoder);
|
GstVaBaseDec *base = GST_VA_BASE_DEC (decoder);
|
||||||
|
GstVideoInfo *info = &base->output_info;
|
||||||
GstFlowReturn ret;
|
GstFlowReturn ret;
|
||||||
VAProfile profile;
|
VAProfile profile;
|
||||||
VAPictureParameterBufferJPEGBaseline pic_param;
|
VAPictureParameterBufferJPEGBaseline pic_param;
|
||||||
@ -162,14 +163,17 @@ gst_va_jpeg_dec_new_picture (GstJpegDecoder * decoder,
|
|||||||
frame_hdr->width, frame_hdr->height)) {
|
frame_hdr->width, frame_hdr->height)) {
|
||||||
base->profile = profile;
|
base->profile = profile;
|
||||||
base->rt_format = rt_format;
|
base->rt_format = rt_format;
|
||||||
base->width = frame_hdr->width;
|
GST_VIDEO_INFO_WIDTH (info) = base->width = frame_hdr->width;
|
||||||
base->height = frame_hdr->height;
|
GST_VIDEO_INFO_HEIGHT (info) = base->height = frame_hdr->height;
|
||||||
|
|
||||||
base->need_negotiation = TRUE;
|
base->need_negotiation = TRUE;
|
||||||
GST_INFO_OBJECT (self, "Format changed to %s [%x] (%dx%d)",
|
GST_INFO_OBJECT (self, "Format changed to %s [%x] (%dx%d)",
|
||||||
gst_va_profile_name (profile), rt_format, base->width, base->height);
|
gst_va_profile_name (profile), rt_format, base->width, base->height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_clear_pointer (&base->input_state, gst_video_codec_state_unref);
|
||||||
|
base->input_state = gst_video_codec_state_ref (decoder->input_state);
|
||||||
|
|
||||||
ret = gst_va_base_dec_prepare_output_frame (base, frame);
|
ret = gst_va_base_dec_prepare_output_frame (base, frame);
|
||||||
if (ret != GST_FLOW_OK) {
|
if (ret != GST_FLOW_OK) {
|
||||||
GST_ERROR_OBJECT (self, "Failed to allocate output buffer: %s",
|
GST_ERROR_OBJECT (self, "Failed to allocate output buffer: %s",
|
||||||
@ -351,7 +355,6 @@ gst_va_jpeg_dec_negotiate (GstVideoDecoder * decoder)
|
|||||||
{
|
{
|
||||||
GstVaBaseDec *base = GST_VA_BASE_DEC (decoder);
|
GstVaBaseDec *base = GST_VA_BASE_DEC (decoder);
|
||||||
GstVaJpegDec *self = GST_VA_JPEG_DEC (decoder);
|
GstVaJpegDec *self = GST_VA_JPEG_DEC (decoder);
|
||||||
GstJpegDecoder *jpegdec = GST_JPEG_DECODER (decoder);
|
|
||||||
GstVideoFormat format;
|
GstVideoFormat format;
|
||||||
GstCapsFeatures *capsfeatures = NULL;
|
GstCapsFeatures *capsfeatures = NULL;
|
||||||
|
|
||||||
@ -397,7 +400,7 @@ gst_va_jpeg_dec_negotiate (GstVideoDecoder * decoder)
|
|||||||
|
|
||||||
base->output_state =
|
base->output_state =
|
||||||
gst_video_decoder_set_output_state (decoder, format,
|
gst_video_decoder_set_output_state (decoder, format,
|
||||||
base->width, base->height, jpegdec->input_state);
|
base->width, base->height, base->input_state);
|
||||||
|
|
||||||
base->output_state->caps = gst_video_info_to_caps (&base->output_state->info);
|
base->output_state->caps = gst_video_info_to_caps (&base->output_state->info);
|
||||||
if (capsfeatures)
|
if (capsfeatures)
|
||||||
@ -448,6 +451,15 @@ gst_va_jpeg_dec_class_init (gpointer g_class, gpointer class_data)
|
|||||||
|
|
||||||
parent_class = g_type_class_peek_parent (g_class);
|
parent_class = g_type_class_peek_parent (g_class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GstVaJpegDec:device-path:
|
||||||
|
*
|
||||||
|
* It shows the DRM device path used for the VA operation, if any.
|
||||||
|
*/
|
||||||
|
gst_va_base_dec_class_init (GST_VA_BASE_DEC_CLASS (g_class), JPEG,
|
||||||
|
cdata->render_device_path, cdata->sink_caps, cdata->src_caps,
|
||||||
|
src_doc_caps, sink_doc_caps);
|
||||||
|
|
||||||
gobject_class->dispose = gst_va_jpeg_dec_dispose;
|
gobject_class->dispose = gst_va_jpeg_dec_dispose;
|
||||||
|
|
||||||
decoder_class->negotiate = GST_DEBUG_FUNCPTR (gst_va_jpeg_dec_negotiate);
|
decoder_class->negotiate = GST_DEBUG_FUNCPTR (gst_va_jpeg_dec_negotiate);
|
||||||
@ -461,15 +473,6 @@ gst_va_jpeg_dec_class_init (gpointer g_class, gpointer class_data)
|
|||||||
jpegdecoder_class->output_picture =
|
jpegdecoder_class->output_picture =
|
||||||
GST_DEBUG_FUNCPTR (gst_va_jpeg_dec_output_picture);
|
GST_DEBUG_FUNCPTR (gst_va_jpeg_dec_output_picture);
|
||||||
|
|
||||||
/**
|
|
||||||
* GstVaJpegDec:device-path:
|
|
||||||
*
|
|
||||||
* It shows the DRM device path used for the VA operation, if any.
|
|
||||||
*/
|
|
||||||
gst_va_base_dec_class_init (GST_VA_BASE_DEC_CLASS (g_class), JPEG,
|
|
||||||
cdata->render_device_path, cdata->sink_caps, cdata->src_caps,
|
|
||||||
src_doc_caps, sink_doc_caps);
|
|
||||||
|
|
||||||
g_free (long_name);
|
g_free (long_name);
|
||||||
g_free (cdata->description);
|
g_free (cdata->description);
|
||||||
g_free (cdata->render_device_path);
|
g_free (cdata->render_device_path);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user