GNOME Bugzilla – Bug 732874
audioencoder: Baseclass should call set_format() before propose_allocation()
Last modified: 2018-11-03 11:30:20 UTC
This was introduce during porting https://bugzilla.gnome.org/show_bug.cgi?id=680614. The downside is that it makes it counter intuitive, as propose_allocation() should happen after set_format(). To implement propose_allocation(), encoder have to get the caps from the pad, and then most likely parse these caps into GstVideoInfo structure. Without this patch, it would simply have cached the input_state, and read the information from there. I do think this is in the ABI now, but would at least be nice to revisit for 2.0.
This might be ok to change now, we should check early in 1.5. As you say it's completely unexpected behaviour, and was probably not noticed earlier only because nobody used propose_allocation in an encoder yet
(Retitling for GstVideoEncoder now since that's the main use case, but applies to GstAudioEncoder too.)
This has been done for the encoder in 2014. commit ce50fc221e8a795d7cfedf471d239d4a9d3bf824 Author: Nicolas Dufresne <nicolas.dufresne@collabora.com> Date: Tue Jul 8 16:59:37 2014 -0400 videoencoder: Don't delay set_format This prevent implementing allocation query, as the format need to be known in order to determin the size and number of buffers needed. Note: This may lead to few regressions that will need fixing https://bugzilla.gnome.org/show_bug.cgi?id=732288 So only the audio encoder got this behaviour now. I would believe it's less of a problem as the allocation in audio is not as dependant on the caps as it is for video. Shall we keep that bug open ?
I think we should still do the same in the audio base classes (is the decoder affected too?). It allows for faster negotiation and subclasses can still decide to do things later if they really need.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/123.