Routing logging for each pipeline

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

Routing logging for each pipeline

Tyler Compton
Hi list,

I'm working on an application that handles multiple video streams with GStreamer, and I would like to be able to present users with logging information for each stream in the UI to make it easier for users to diagnose problems. For my application, a "video stream" has only one pipeline associated with it.

In order to capture GStreamer logs, I'm installing a new handler with Gst.debug_add_log_function, which provides me some information alongside the actual log message. However, it's not clear to me how I should sort logs by their pipeline with this information. I assume the key is the "object" field given to my log handler, but considering this object can be of any type, I'm not sure how to reliably figure out which pipeline this object is from.

I'm using GStreamer 1.16.2 with PyGObject.

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

Re: Routing logging for each pipeline

David Ing
I don't think you can do that.  There is no concept of scope with the gstreamer logger.

Many log statements do not have a GObject passed in.  If you get a GObject passed in, you can check to see if it is a GstObject ... in which case you might be able to traverse the hierarchy (upwards) until you **maybe** hit a GstPipeline.  But that only works for a tiny fraction of log statements.

You can't even find the parent thread of the current thread (this is an OS limitation) ... which means you can't trace back to the main thread of your pipeline.

On Wed, Aug 5, 2020 at 3:38 PM Tyler Compton <[hidden email]> wrote:
Hi list,

I'm working on an application that handles multiple video streams with GStreamer, and I would like to be able to present users with logging information for each stream in the UI to make it easier for users to diagnose problems. For my application, a "video stream" has only one pipeline associated with it.

In order to capture GStreamer logs, I'm installing a new handler with Gst.debug_add_log_function, which provides me some information alongside the actual log message. However, it's not clear to me how I should sort logs by their pipeline with this information. I assume the key is the "object" field given to my log handler, but considering this object can be of any type, I'm not sure how to reliably figure out which pipeline this object is from.

I'm using GStreamer 1.16.2 with PyGObject.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

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

Re: Routing logging for each pipeline

Tyler Compton
Thanks for the info! It's a shame that this may not be entirely possible. If I were to try to categorize the logs that do have GObjects, and I found the GObject to be a GstElement, how would I traverse the hierarchy? The only way I'm aware of is by traversing the tree downwards by iterating the elements in the GstPipeline, and recursively iterating elements in each GstBin, which isn't ideal from an efficiency standpoint.

On Wed, Aug 5, 2020 at 3:57 PM David Ing <[hidden email]> wrote:
I don't think you can do that.  There is no concept of scope with the gstreamer logger.

Many log statements do not have a GObject passed in.  If you get a GObject passed in, you can check to see if it is a GstObject ... in which case you might be able to traverse the hierarchy (upwards) until you **maybe** hit a GstPipeline.  But that only works for a tiny fraction of log statements.

You can't even find the parent thread of the current thread (this is an OS limitation) ... which means you can't trace back to the main thread of your pipeline.

On Wed, Aug 5, 2020 at 3:38 PM Tyler Compton <[hidden email]> wrote:
Hi list,

I'm working on an application that handles multiple video streams with GStreamer, and I would like to be able to present users with logging information for each stream in the UI to make it easier for users to diagnose problems. For my application, a "video stream" has only one pipeline associated with it.

In order to capture GStreamer logs, I'm installing a new handler with Gst.debug_add_log_function, which provides me some information alongside the actual log message. However, it's not clear to me how I should sort logs by their pipeline with this information. I assume the key is the "object" field given to my log handler, but considering this object can be of any type, I'm not sure how to reliably figure out which pipeline this object is from.

I'm using GStreamer 1.16.2 with PyGObject.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

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

Re: Routing logging for each pipeline

David Ing
A GstElement is a GstObject so cast and then call gst_object_get_parent

On Wed, Aug 5, 2020, 5:56 PM Tyler Compton <[hidden email]> wrote:
Thanks for the info! It's a shame that this may not be entirely possible. If I were to try to categorize the logs that do have GObjects, and I found the GObject to be a GstElement, how would I traverse the hierarchy? The only way I'm aware of is by traversing the tree downwards by iterating the elements in the GstPipeline, and recursively iterating elements in each GstBin, which isn't ideal from an efficiency standpoint.

On Wed, Aug 5, 2020 at 3:57 PM David Ing <[hidden email]> wrote:
I don't think you can do that.  There is no concept of scope with the gstreamer logger.

Many log statements do not have a GObject passed in.  If you get a GObject passed in, you can check to see if it is a GstObject ... in which case you might be able to traverse the hierarchy (upwards) until you **maybe** hit a GstPipeline.  But that only works for a tiny fraction of log statements.

You can't even find the parent thread of the current thread (this is an OS limitation) ... which means you can't trace back to the main thread of your pipeline.

On Wed, Aug 5, 2020 at 3:38 PM Tyler Compton <[hidden email]> wrote:
Hi list,

I'm working on an application that handles multiple video streams with GStreamer, and I would like to be able to present users with logging information for each stream in the UI to make it easier for users to diagnose problems. For my application, a "video stream" has only one pipeline associated with it.

In order to capture GStreamer logs, I'm installing a new handler with Gst.debug_add_log_function, which provides me some information alongside the actual log message. However, it's not clear to me how I should sort logs by their pipeline with this information. I assume the key is the "object" field given to my log handler, but considering this object can be of any type, I'm not sure how to reliably figure out which pipeline this object is from.

I'm using GStreamer 1.16.2 with PyGObject.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

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

Re: Routing logging for each pipeline

Tyler Compton
Thanks for your help, David! I'll see what I can do.

On Wed, Aug 5, 2020 at 6:31 PM David Ing <[hidden email]> wrote:
A GstElement is a GstObject so cast and then call gst_object_get_parent

On Wed, Aug 5, 2020, 5:56 PM Tyler Compton <[hidden email]> wrote:
Thanks for the info! It's a shame that this may not be entirely possible. If I were to try to categorize the logs that do have GObjects, and I found the GObject to be a GstElement, how would I traverse the hierarchy? The only way I'm aware of is by traversing the tree downwards by iterating the elements in the GstPipeline, and recursively iterating elements in each GstBin, which isn't ideal from an efficiency standpoint.

On Wed, Aug 5, 2020 at 3:57 PM David Ing <[hidden email]> wrote:
I don't think you can do that.  There is no concept of scope with the gstreamer logger.

Many log statements do not have a GObject passed in.  If you get a GObject passed in, you can check to see if it is a GstObject ... in which case you might be able to traverse the hierarchy (upwards) until you **maybe** hit a GstPipeline.  But that only works for a tiny fraction of log statements.

You can't even find the parent thread of the current thread (this is an OS limitation) ... which means you can't trace back to the main thread of your pipeline.

On Wed, Aug 5, 2020 at 3:38 PM Tyler Compton <[hidden email]> wrote:
Hi list,

I'm working on an application that handles multiple video streams with GStreamer, and I would like to be able to present users with logging information for each stream in the UI to make it easier for users to diagnose problems. For my application, a "video stream" has only one pipeline associated with it.

In order to capture GStreamer logs, I'm installing a new handler with Gst.debug_add_log_function, which provides me some information alongside the actual log message. However, it's not clear to me how I should sort logs by their pipeline with this information. I assume the key is the "object" field given to my log handler, but considering this object can be of any type, I'm not sure how to reliably figure out which pipeline this object is from.

I'm using GStreamer 1.16.2 with PyGObject.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

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