After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 691475 - [API] baseparse: need vfunc to intercept queries
[API] baseparse: need vfunc to intercept queries
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal enhancement
: 1.1.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Reported: 2013-01-10 14:23 UTC by Tim-Philipp Müller
Modified: 2013-01-13 14:48 UTC
See Also:
GNOME target: ---
GNOME version: ---

Description Tim-Philipp Müller 2013-01-10 14:23:01 UTC
GstBaseParse needs a vfunc for queries, so we can intercept ALLOCATION queries in video parsers and add our own meta, for example, and/or find out what downstream supports.

There's a patch here, though we might want to bikeshed about the naming a bit more :)
Comment 1 Tim-Philipp Müller 2013-01-10 14:27:50 UTC
Ok, so I think we want query vfuncs rather than a special vfunc just for the allocation query?

26-12-2012 11:19:44 bilboed: so I might need to have a way for baseparse to do a downstream ALLOCATE query if upstream didn't send one
26-12-2012 11:19:53 bilboed: so that implementations can know what GstMeta are suported downstream
26-12-2012 11:21:18 bilboed: right now I've added a observe_allocation(baseparse, query) vmethod which subclasses can implement, and if so the base class gives it the query once returned from downstream
26-12-2012 11:21:24 bilboed: but that assumes upstream initiated such a query
26-12-2012 11:24:34     tim: right
26-12-2012 11:26:00     tim: here's a question: the elements that would be making use of those parser meta things, will they still support parsing themselves as fallback?
26-12-2012 11:26:18   slomo: bilboed: can't you re-use the ::query_sink() vfunc instead of adding a new one?
26-12-2012 11:26:33 bilboed: in baseparse ?
26-12-2012 11:26:39     tim: oh, also, why do you want to query? Why not just put those metas on the output in any case - if nothing uses them, it doesn't matter
26-12-2012 11:26:52     tim: (minus allocation overhead)
26-12-2012 11:26:58 bilboed: tim, it's extra processing which might not be needed
26-12-2012 11:27:06 bilboed: tim, I'm parsing stuff which isn't usually parsed
26-12-2012 11:27:10     tim: ah, ok
26-12-2012 11:27:15 bilboed: like picture slice headers for h264
26-12-2012 11:27:26 bilboed: yah, otherwise I wouldn't bother :)
26-12-2012 11:27:36   slomo: bilboed: oh there are no query vfuncs... so, instead of adding observe_allocation() adding something to intercept all queries might be more useful :)
26-12-2012 11:27:58     tim: but the thing is that you will already have to do some parsing, so you can determine the caps and downstream can plug a decoder or whatever
26-12-2012 11:28:03 bilboed: slomo, in this case I don't want to intercept them *before*, I want to observe the result
26-12-2012 11:28:10     tim: so I think a first step would be to just always put them on
26-12-2012 11:28:20     tim: and then optimise to remove them when not needed later
26-12-2012 11:28:32     tim: no?
26-12-2012 11:28:37 bilboed: __tim, I could switch the default from "never do it" to "always do it" and remove them when I'm sure downstream don't need them
26-12-2012 11:28:38 bilboed: indeed
26-12-2012 11:28:47     tim: right
26-12-2012 11:29:37   slomo: bilboed: GST_BASE_PARSE_CLASS(parent_class)->query_sink(bparse,query); gst_query_parse_allocation(query, ...);
26-12-2012 11:29:37   slomo: bilboed: anyway, sorry for distracting with details that can be done later :)
Comment 2 Sebastian Dröge (slomo) 2013-01-10 15:23:46 UTC
Yes, ::query_sink() and ::query_src()
Comment 3 Tim-Philipp Müller 2013-01-13 14:48:19 UTC
commit 1702623b209a172b93c6e7ea1fce320a78a9cb3e
Author: Tim-Philipp Müller <>
Date:   Sun Jan 13 14:45:31 2013 +0000

    baseparse: add vfuncs to intercept queries
    Useful for video parses that want to attach matter or
    find out if downstream supports certain metas.
    API: GstBaseParseClass::src_query()
    API: GstBaseParseClass::sink_query()