GNOME Bugzilla – Bug 679878
[0.11][videodecoder] Need explicit negotiation method
Last modified: 2013-12-02 12:14:37 UTC
Starting program: /home/tpm/gst/0.11/gstreamer/tools/.libs/lt-gst-launch-1.0 filesrc location=/home/tpm/samples/misc/331301-xgl-gentoo-lycos-mpeg2dec-cropping.avi \! decodebin \! video/x-raw \! fakesink [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Setting pipeline to PAUSED ... [New Thread 0x7ffff409e700 (LWP 20836)] Pipeline is PREROLLING ... [New Thread 0x7ffff2acd700 (LWP 20837)] [New Thread 0x7ffff22cc700 (LWP 20838)] Redistribute latency... ** (gst-launch-1.0:20833): CRITICAL **: gst_video_decoder_alloc_output_frame: assertion `frame->output_buffer == NULL' failed Program received signal SIGTRAP, Trace/breakpoint trap.
+ Trace 230508
Thread 140737256408832 (LWP 20838)
This, and also it doesn't actually seem to make use of the cropping support offered by e.g. ximagesink or xvimagesink.
The problem is due to the way negotiation works with the base classes. When you set the output format (which may include striding and whatsoever), the call to _set_caps and _negotiate doesn't happen before you call buffer_alloc or push()... It looks like we might need to reinstate an explicit gst_video_decoder_negotiate() method for that. It's also very likely this is the cause PAR isn't correct with some video feeds also.
Created attachment 219123 [details] [review] videodecoder: Expose _negotiate function This is to be called by decoders once they have set the output format in order for (re)negotiation to be triggered as early as possible.
Can't we let set_ouput_format() call this instead?
(In reply to comment #3) > Can't we let set_ouput_format() call this instead? No, because you will be setting more details between set_output_format() and negotiate() (videoinfo settings, interlacing, etc....)
Oh yes, sorry, nevermind. Please get this in :) Also for the encoder please
commit 8feaebb6ebb7bcafbe3d2b7cd46ee5f0a45bce0c Author: Edward Hervey <edward.hervey@collabora.co.uk> Date: Wed Jul 18 15:34:06 2012 +0200 videodecoder: Expose _negotiate function This is to be called by decoders once they have set the output format in order for (re)negotiation to be triggered as early as possible. https://bugzilla.gnome.org/show_bug.cgi?id=679878
Any opinions on doing the same with the video encoder base class?
hi, I noticed that GstVideoDecoder::gst_video_decoder_negotiate does not clear the GST_PAD_FLAG_NEED_RECONFIGURE flag when it succeeds. It causes to negociate again, so query allocation is done twice. (the second time in gst_video_decoder_allocate_output_frame). Is it expected ? Is the subclass of GstVideoDecoder responsible for clearing the flag when manually calling gst_video_decoder_negotiate ? It happens in the following pipeline: gst-launch-1.0 v4l2src io-mode=mmap ! jpegdec ! xvimagesink Since recently it seems that initially a pad is set to GST_PAD_FLAG_NEED_RECONFIGURE : http://cgit.freedesktop.org/gstreamer/gstreamer/tree/gst/gstpad.c#n1080 Since this commit: http://cgit.freedesktop.org/gstreamer/gstreamer/commit/gst/gstpad.c?id=c279bdb663de532be58b31970b26ff515ff4f098 The negotiation design: http://cgit.freedesktop.org/gstreamer/gstreamer/tree/docs/design/part-negotiation.txt
That should probably be changed in the base class, it currently manually unsets the flag after calling negotiate() but AFAIU this could as well just be done inside negotiate() at the end.
Also this should get a new bug report