videodecoder: invalid buffer size on alternate interlace mode
Version: 1.18.0
Pipeline:
filesrc location=test.ts ! tsdemux ! video/x-h265 ! h265parse ! avdec_h265 ! fakesink
Video: test.ts
Error:
0:00:00.189203923 16470 0x55cf953e8b20 ERROR default video-frame.c:182:gst_video_frame_map_id: invalid buffer size 779520 < 1555200
ERROR: from element /GstPipeline:pipeline0/avdec_h265:avdec_h265-0: Cannot access memory for read and write operation.
Additional debug info:
../subprojects/gst-libav/ext/libav/gstavviddec.c(1538): get_output_buffer (): /GstPipeline:pipeline0/avdec_h265:avdec_h265-0:
The video memory allocated from downstream pool could not mapped forread and write.
ERROR: pipeline doesn't want to preroll.
Interlace mode detected by the parser: alternate
In videodecoder, I discovered a hardcoded progressive interlace mode. At the same time, the real interlace mode is specified in reference->info.interlace_mode.
GstVideoCodecState *
gst_video_decoder_set_output_state (GstVideoDecoder * decoder,
GstVideoFormat fmt, guint width, guint height,
GstVideoCodecState * reference)
{
return gst_video_decoder_set_interlaced_output_state (decoder, fmt,
GST_VIDEO_INTERLACE_MODE_PROGRESSIVE /* reference->info.interlace_mode */,
width, height, reference);
}
After replacing this value with a real one, the size of the allocated buffer became correct, but many errors appeared in other places (e.g. avdec_h265, nvh265sldec). Please correct me if this replacement is wrong and there are no errors on this line.
I also checked version 1.14.5 and found that this pipeline works fine with no errors. In this version, the interlaced mode detected by the parser is mixed.
Does this mean that the parser did not correctly recognize interlace mode as alternate in the new version? Or is it because alternate mode has poor support at the moment? Are there any ways to work around this issue on the new version?