GNOME Bugzilla – Bug 701237
videomixer : on query caps, we should return FALSE if the source pad has no current caps.
Last modified: 2013-05-30 19:39:27 UTC
Created attachment 245607 [details] [review] Proposed patch to fix the issue For now, I have a case where 1) the caps get queried 2) get_current_caps(srcpad) returns NULL 3) make_writable is called on NULL, which causes a miniobject != NULL assertion. I have not investigated the cause of the caps being NULL in that specific case, but it seems quite logical to me to return FALSE to the query instead of raising that assertion, and the case I'm implementing now (videomixing in GESVideoTracks) (kind of) works, at least I don't experience any caps / caps negotiation issues. The proposed patch does exactly that.
Created attachment 245608 [details] [review] Proposed patch to fix the issue oops that's better
How can it even happen that we have no current caps but GST_VIDEO_INFO_FORMAT (&mix->info) != GST_VIDEO_FORMAT_UNKNOWN. That might be the real bug here. Otherwise, if that is acceptable and not a problem at all, you probably want to return the template caps in that case too.
Oh, I forgot about it, but I had a patch somewhere for that (which is better then returning FALSE iirc). In answer to your question, the new code delay the caps event until _collected() is called, which mean there exist a gap between the moment we do have mix->info set, and the moment the pad has current caps. Hope this answer the question. Mathieu, the right patch would be to return the current caps (maybe from the mix->info).
Review of attachment 245608 [details] [review]: As per previous comment, mix->info is set, so we do have caps.
Created attachment 245672 [details] [review] Proposed patch to fix the issue OK so I think that would be the correct fix then.
Review of attachment 245672 [details] [review]: commit 5223868caa9dc82d18dc3c92113bf2b8e37761fe Author: Mathieu Duponchelle <mathieu.duponchelle@epitech.eu> Date: Thu May 30 21:20:59 2013 +0200 videomixer: Set a reference to mix->current_caps as the QUERY_CAPS result.
Thanks.
Oops, sorry forgot to add the bug reference in the commit.