newbie help writing plugin

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

newbie help writing plugin

Rainer Clasen
Hello,

in theory I just wanted to scan my music collection for replay gain.
So basically I need something like

 gst-launch filesrc location=[all files] ! decodebin2 ! rganalysis num-tracks=[count] ! fakesink

and change the src location on each EOS.

This is supposed to be integrated into an existing collection of perl
applications. Unfortunatly there's a bug, that keeps me from using any of
the decodebin signals: https://bugzilla.gnome.org/show_bug.cgi?id=614650

After plenty other attempts, I'm currently trying to work around this
issue by writing my own "decodebin" with a static src pad in C and hide
all the callback stuff deep inside. I'd limit this to decoding a single
audio/x-raw-(float/int) stream to keep thinks simple.

The idea was to subclass GstBin, embed decodebin2 and dynamically link it
to some ghost pads.

So in my element's _init function I
- create decodebin2, gst_bin_add() it to $self
- set caps property on decodebin2 to "audio/x-raw-int;audio/x-raw-float"
- create sink ghostpad for decodebin2:sink, gst_element_add_pad() it to
  $self
- create src ghostpad without target, gst_element_add_pad() it to $self
- setup a "pad-added" signal handler on decodebin2 to issue
  gst_ghost_pad_set_target() for the src ghostpad.

I've tried this with an ANY and an "audio/x-raw..." caps on the src
template of my element without success.

Is this something that's supposed to work in the described way - i.e. I
just need to "fix" it? Is something missing from my aproach? Or is my
aproach too twisted?

Can somebody give me a hint what's neccessary to write such an element?
Do I have to do the caps negotiation (_setcaps and friends) myself?


Rainer

--
KeyID=759975BD fingerprint=887A 4BE3 6AB7 EE3C 4AE0  B0E1 0556 E25A 7599 75BD
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: newbie help writing plugin

Rainer Clasen
Rainer Clasen wrote:

> After plenty other attempts, I'm currently trying to work around this
> issue by writing my own "decodebin" with a static src pad in C and hide
> all the callback stuff deep inside. I'd limit this to decoding a single
> audio/x-raw-(float/int) stream to keep thinks simple.
>
> The idea was to subclass GstBin, embed decodebin2 and dynamically link it
> to some ghost pads.
>
> So in my element's _init function I
> - create decodebin2, gst_bin_add() it to $self
> - set caps property on decodebin2 to "audio/x-raw-int;audio/x-raw-float"
> - create sink ghostpad for decodebin2:sink, gst_element_add_pad() it to
>   $self
> - create src ghostpad without target, gst_element_add_pad() it to $self
> - setup a "pad-added" signal handler on decodebin2 to issue
>   gst_ghost_pad_set_target() for the src ghostpad.
Acutally it *is* that easy... if I don't set the caps property of
decodebin2.

So I guess, I'm mis-setting the property somehow. Would be nice, if
somebody could check the attached code and point me to my mistake.

Would be nice to have decodebin2 automagically divert non-audio streams to
a fakesink ;)

Rainer

--
KeyID=759975BD fingerprint=887A 4BE3 6AB7 EE3C 4AE0  B0E1 0556 E25A 7599 75BD

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

gstdudldecode.c (6K) Download Attachment