set_context() vfunc for GstVideoDecoder

Sebastian Dröge sebastian at centricular.com
Tue Nov 26 00:44:12 PST 2013


On Mo, 2013-11-25 at 11:58 -0500, Jim Hodapp wrote:
> I'm trying to use a CONTEXT query between a custom video sink and decoder
> pair of plugins. In my case, the decoder originates the CONTEXT query and
> the video sink should be the one to answer it stuffing the appropriate
> context data into the GstContext and then replying to the query. My
> question is, once the decoder receives the reply, it calls
> gst_query_parse_context, and then gst_element_set_context. My question is
> with setting the context - if a GstVideoDecoder doesn't have a vfunc for
> set_context(), how is this supposed to work? How do I get access to the
> contents of the GstQuery without this vfunc? I could figure some weird way
> of getting access to it, but I want to follow the intent of the original
> design. Any thoughts?

An element that handles GstContexts must implement the
GstElement::set_context() vfunc. This is then called from
gst_element_set_context() by the application or the surrounding bin as a
result of the need-context message or because a specific context should
be used on the element.

Independent of that you should, before the need-context message, check
if some context was set on your element via GstElement::set_context()
already, and if not query upstream and downstream for a context first.
Only then send the message.

-- 
Sebastian Dröge <sebastian at centricular.com>
Centricular Ltd - http://www.centricular.com
Expertise, Straight from the Source
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 966 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20131126/adb28fbb/attachment.pgp>


More information about the gstreamer-devel mailing list