get different message from two same element

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

get different message from two same element

simosimo
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?


thanks
Reply | Threaded
Open this post in threaded view
|

Re: get different message from two same element

Nathanael D. Noblet
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)

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: get different message from two same element

simosimo
yeep, fixed, thank you for your help :)

by the way, how can i add a field to message, like a sequence number, I try to capture the message from the first element, add a sequence number, then retrieve the message on the second element with add number of seauence.

again, thank you.
Reply | Threaded
Open this post in threaded view
|

Re: get different message from two same element

Stefan Sauer
On 05/12/2012 06:55 PM, simosimo wrote:
> yeep, fixed, thank you for your help :)
>
> by the way, how can i add a field to message, like a sequence number, I try
> to capture the message from the first element, add a sequence number, then
> retrieve the message on the second element with add number of seauence.
As an application you can't. Most analysers include a timestamp field
that might be helpful too.

Stefan

>
> again, thank you.
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/get-different-message-from-two-same-element-tp4628864p4629144.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

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