get different message from two same element

Nathanael Noblet nathanael at gnat.ca
Sat May 12 07:25:13 PDT 2012


On 05/12/2012 07:54 AM, simosimo wrote:
> I wrote a pygst code for transcoding, I use an element in the pipeline in two
> place. I need differentiates between messages of this element.
> for example :
>
> gst-launch v4l2src ! *element* ! videoscale ! videorate ! encoding !
> decoding ! *element *! filesrc ....
>
> in this pipeline i use twise  *element * , for the same element i get the
> same message, i want to get two different field in the message to
> differentiates the element place
>
> I use:
> message-name = message.structure.get_name()
> if message-name == "name":
>    code here
>
> but the same element use the same "name", so how can make the differnce
> between messages?

Not sure what the python equivalent is, however you can get the name of 
the element that sent the message in c like so:

GST_OBJECT_NAME(msg->src)



More information about the gstreamer-devel mailing list