<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>I agree, this is what I have used.</p>
    <p>As it has been mentioned you can do something like
      source.parent.name if you want the pipeline<br>
    </p>
    <p><br>
    </p>
    <p>def on_debug(category, level, dfile, dfctn, dline, source,
      message, user_data):<br>
          if source:<br>
              print('Debug {} {}: {}'.format(<br>
                  Gst.DebugLevel.get_name(level), source.name,
      message.get()))<br>
          else:<br>
              print('Debug {}: {}'.format(<br>
                  Gst.DebugLevel.get_name(level), message.get()))</p>
    <p><br>
    </p>
    <p>And</p>
    <p>        if not Gst.debug_is_active():            <br>
                  Gst.debug_remove_log_function(None)<br>
                  Gst.debug_add_log_function(on_debug, None)<br>
                  level = Gst.debug_get_default_threshold()<br>
                  if level < Gst.DebugLevel.ERROR:<br>
                     
      Gst.debug_set_default_threshold(Gst.DebugLevel.WARNING)<br>
                  Gst.debug_set_active(True)<br>
      <br>
                  # Init GObject loop to handle Gstreamer Bus Events<br>
                  self.loop = GLib.MainLoop()<br>
                  try:<br>
                      self.loop.run()<br>
                  except:<br>
                      print("Exception gst")<br>
                      for pipe in self.pipeline: <br>
                          ret = pipe.set_state(Gst.State.NULL)<br>
                      sys.exit(0)</p>
    <p>This allows me to use gstreamer loging if I set GST_DEBUG="*:3"
      (or whatever level) or my own logging otherwise.</p>
    <p>Prints something like:</p>
    <pre style="box-sizing: border-box; overflow: auto; font-family: monospace; font-size: 14px; display: block; padding: 1px 0px; margin: 0px; line-height: inherit; color: rgb(0, 0, 0); word-break: break-all; overflow-wrap: break-word; background-color: rgb(255, 255, 255); border: 0px; border-radius: 0px; white-space: pre-wrap; vertical-align: baseline; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Debug WARN    tcpserversink0: [socket 0x7f734028d670] client 0x7f733c001d20 is lagging at 5, recover using policy 1</pre>
    <p><br>
    </p>
    <p>Best regards</p>
    <p>Marianna<br>
    </p>
    <div class="moz-cite-prefix">On 11.12.2021 13.00,
      <a class="moz-txt-link-abbreviated" href="mailto:gstreamer-devel-request@lists.freedesktop.org">gstreamer-devel-request@lists.freedesktop.org</a> wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:mailman.26.1639224002.29692.gstreamer-devel@lists.freedesktop.org">
      <pre class="moz-quote-pre" wrap="">Send gstreamer-devel mailing list submissions to
        <a class="moz-txt-link-abbreviated" href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a>

To subscribe or unsubscribe via the World Wide Web, visit
        <a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
or, via email, send a message with subject or body 'help' to
        <a class="moz-txt-link-abbreviated" href="mailto:gstreamer-devel-request@lists.freedesktop.org">gstreamer-devel-request@lists.freedesktop.org</a>

You can reach the person managing the list at
        <a class="moz-txt-link-abbreviated" href="mailto:gstreamer-devel-owner@lists.freedesktop.org">gstreamer-devel-owner@lists.freedesktop.org</a>

When replying, please edit your Subject line so it is more specific
than "Re: Contents of gstreamer-devel digest..."


Today's Topics:

   1. Re: Multi pipeline logging identification (Michael Gruner)


----------------------------------------------------------------------

Message: 1
Date: Fri, 10 Dec 2021 17:29:50 -0600
From: Michael Gruner <a class="moz-txt-link-rfc2396E" href="mailto:michael.gruner@ridgerun.com"><michael.gruner@ridgerun.com></a>
To: Discussion of the development of and with GStreamer
        <a class="moz-txt-link-rfc2396E" href="mailto:gstreamer-devel@lists.freedesktop.org"><gstreamer-devel@lists.freedesktop.org></a>
Cc: vinod kesti <a class="moz-txt-link-rfc2396E" href="mailto:vinodkesti@yahoo.com"><vinodkesti@yahoo.com></a>, Dwight Kulkarni
        <a class="moz-txt-link-rfc2396E" href="mailto:dwight@realtime-7.com"><dwight@realtime-7.com></a>
Subject: Re: Multi pipeline logging identification
Message-ID: <a class="moz-txt-link-rfc2396E" href="mailto:C6FDBE8B-D64A-4DA9-8334-6C51EB047F67@ridgerun.com"><C6FDBE8B-D64A-4DA9-8334-6C51EB047F67@ridgerun.com></a>
Content-Type: text/plain; charset="utf-8"

Hey Vinod

The only way I can think of achieving something similar is to implement your own custom log handlers. Check:

<a class="moz-txt-link-freetext" href="https://gstreamer.freedesktop.org/documentation/gstreamer/gstinfo.html?gi-language=c#gst_debug_add_log_function">https://gstreamer.freedesktop.org/documentation/gstreamer/gstinfo.html?gi-language=c#gst_debug_add_log_function</a>

Note that the callback handler receives the GstObject that generated the entry (may be null though). Having the element you can recursively find the topmost parent which will be the pipeline, if the element has been added to one already. 

Michael
<a class="moz-txt-link-abbreviated" href="http://www.ridgerun.com">www.ridgerun.com</a> 

</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">On 10 Dec 2021, at 12:28, vinod kesti via gstreamer-devel <a class="moz-txt-link-rfc2396E" href="mailto:gstreamer-devel@lists.freedesktop.org"><gstreamer-devel@lists.freedesktop.org></a> wrote:

?
Hi all,

I am running multiple Gstreamer pipelines in single linux process. All the pipelines are similar and only udp input and output ports are chanig. 
Log function is Registered using gst_debug_add_log_function(),  after the gst_init(). I am not able to identify the which pipeline dumping the error.

One way I found is if GObject is an GstElement/GstPad I am able to find the parent pipeline and dump the pipeline name. But I have facing problem when GObject in the callback is null. Is there any way to differentiate from which Pipeline we are getting warning.




Sent from Yahoo Mail. Get the app


On Thursday, 9 December, 2021, 06:56:44 pm GMT-6, Dwight Kulkarni via gstreamer-devel <a class="moz-txt-link-rfc2396E" href="mailto:gstreamer-devel@lists.freedesktop.org"><gstreamer-devel@lists.freedesktop.org></a> wrote:


Hi Vinod,

I don't know enough about the debug log to help you with that, but it doesn't appear to be the right architecture to have multiple pipelines that are similar or same with udp different ports.

I did use multiple pipelines and had to put all the similar elements into a single pipeline and then pull out data to multiple app sinks. Some source elements like v4l2src did not allow two pipelines to access them simultaneously (if memory serves).

Best regards.


On Thu., Dec. 9, 2021, 4:16 p.m. vinod kesti, <a class="moz-txt-link-rfc2396E" href="mailto:vinodkesti@yahoo.com"><vinodkesti@yahoo.com></a> wrote:
Hi  Dwight Kulkarni,

Thanks for responding. gst_bus_add_watch() handles messages. GST_ELEMENT_ERROR/WARNINGS are reported on the bus but not the GST_ERROR() and GST_WARNING().
Any help is appreciated thanks in advance.




Sent from Yahoo Mail. Get the app


On Thursday, 9 December, 2021, 02:22:29 pm GMT-6, Dwight Kulkarni via gstreamer-devel <a class="moz-txt-link-rfc2396E" href="mailto:gstreamer-devel@lists.freedesktop.org"><gstreamer-devel@lists.freedesktop.org></a> wrote:


Hi Vinod,

You can try registering for the Bus messages with: gst_bus_add_watch(..)

The GstMessage object returned can be queried for it's source object name.


On Thu, Dec 9, 2021 at 11:54 AM vinod kesti via gstreamer-devel <a class="moz-txt-link-rfc2396E" href="mailto:gstreamer-devel@lists.freedesktop.org"><gstreamer-devel@lists.freedesktop.org></a> wrote:
Hi all,

I am running multiple Gstreamer pipelines in single linux process. All the pipelines are similar and only udp input and output ports are chanig. 
Log function is Registered using gst_debug_add_log_function(),  after the gst_init(). I am not able to identify the which pipeline dumping the error.

One way I found is if GObject is an GstElement/GstPad I am able to find the parent pipeline and dump the pipeline name. But I have facing problem when GObject in the callback is null. Is there any way to differentiate from which Pipeline we are getting warning.



Sent from Yahoo Mail. Get the app


-- 
Sincerely,

Dwight Kulkarni                

</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">-------------- next part --------------
An HTML attachment was scrubbed...
URL: <a class="moz-txt-link-rfc2396E" href="https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20211210/20bea73e/attachment-0001.htm"><https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20211210/20bea73e/attachment-0001.htm></a>

------------------------------

Subject: Digest Footer

_______________________________________________
gstreamer-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>


------------------------------

End of gstreamer-devel Digest, Vol 131, Issue 14
************************************************
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Best regards / Med venlig hilsen
“Marianna Smidth Buschle”</pre>
  </body>
</html>