[spice-gtk,2/2] gstreamer: add debug message for each element added to pipeline

Submitted by Snir Sheriber on Sept. 24, 2019, 2:06 p.m.

Details

Message ID 20190924140654.9351-2-ssheribe@redhat.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Snir Sheriber Sept. 24, 2019, 2:06 p.m.
Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
---

This helps to debug plugins load related issues
---
 src/channel-display-gst.c | 4 ++++
 1 file changed, 4 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/channel-display-gst.c b/src/channel-display-gst.c
index 437328b..16bfa37 100644
--- a/src/channel-display-gst.c
+++ b/src/channel-display-gst.c
@@ -473,6 +473,10 @@  sink_event_probe(GstPad *pad, GstPadProbeInfo *info, gpointer data)
 static void
 element_setup_cb(GstElement *pipeline, GstElement *element, SpiceGstDecoder *decoder)
 {
+    GstElementFactory *f = gst_element_get_factory (element);
+
+    SPICE_DEBUG("A new element was added to Gstreamer's pipeline (%s)",
+                f ? GST_OBJECT_NAME(f) : GST_OBJECT_NAME(element));
     /* Attach a probe to the sink to update the statistics */
     if (GST_IS_BASE_SINK(element)) {
         GstPad *pad = gst_element_get_static_pad(element, "sink");

Comments

> 
> Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
> ---
> 
> This helps to debug plugins load related issues

Why this is not in the commit message? Which kind of issues (this too
would be fine in the commit message) ?

> ---
>  src/channel-display-gst.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/channel-display-gst.c b/src/channel-display-gst.c
> index 437328b..16bfa37 100644
> --- a/src/channel-display-gst.c
> +++ b/src/channel-display-gst.c
> @@ -473,6 +473,10 @@ sink_event_probe(GstPad *pad, GstPadProbeInfo *info,
> gpointer data)
>  static void
>  element_setup_cb(GstElement *pipeline, GstElement *element, SpiceGstDecoder
>  *decoder)
>  {
> +    GstElementFactory *f = gst_element_get_factory (element);

Style: space after function name.

> +
> +    SPICE_DEBUG("A new element was added to Gstreamer's pipeline (%s)",
> +                f ? GST_OBJECT_NAME(f) : GST_OBJECT_NAME(element));

Why just not GST_OBJECT_NAME(element) ? Or always element name and factory
one if available ?

>      /* Attach a probe to the sink to update the statistics */
>      if (GST_IS_BASE_SINK(element)) {
>          GstPad *pad = gst_element_get_static_pad(element, "sink");

Frediano