Decodebin query (autoplug externally created elements)

Tim Müller tim at centricular.com
Tue May 5 04:30:37 PDT 2015


On Tue, 2015-05-05 at 03:48 -0700, ruchikachaddha wrote:

Hi,

> I need advice in customizing decodebin to accept externally created elements.
> Decodebin generates "autoplug-select" signal on finding factory for the
> given caps, this signal is generated once for each factory. I want to
> leverage on this signal callback. I plan to add an enum in
> GstAutoplugSelectResult
> typedef enum {
>   GST_AUTOPLUG_SELECT_TRY,
>   GST_AUTOPLUG_SELECT_EXPOSE,
>   GST_AUTOPLUG_SELECT_SKIP
> #if 1 // enum added for plugging externally created factory
>   ,GST_AUTOPLUG_SELECT_EXTERNALLY_CREATED_FACTORY
> #endif
> } GstAutoplugSelectResult;
> 
> This enum shall be returned when user want to provide its own element. Along
> with this, a message will also be posted to decodebin (application msg?)
> which contains element pointer for this factory.
> 
> On the other side, decodebin on receiving
> GST_AUTOPLUG_SELECT_EXTERNALLY_CREATED_FACTORY return value can wait for
> this message (via gst_bus_poll). Once the message is received, decodebin
> will get the element pointer, which it can add to bin and hence avoid
> factory_create internally.
> Does it sound workable? Please suggest if there's any better way to do this?

This is not needed at all. Decodebin will happily plug external/3rd
party elements if they

a) have a rank (GST_RANK_*) that's higher than the other suitable
elements, you set the rank in gst_element_register()

b) advertise the right caps in their sink pad template

c) advertise the right element factory classes (Decoder etc.) in their
element factory metadata.

You can also add your own element in "autoplug-factories" or
"autoplug-sort".

Cheers
 -Tim



-- 
Tim Müller, Centricular Ltd - http://www.centricular.com



More information about the gstreamer-devel mailing list