[spice-gtk,1/2] gstreamer: Use the element-setup signal instead of deep-element-added

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

Details

Message ID 20190924140654.9351-1-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.
Its functionally is equivalent to connecting to the deep-element-added
signal, but a bit more convenient

Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
---
 src/channel-display-gst.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/channel-display-gst.c b/src/channel-display-gst.c
index 6fccf62..437328b 100644
--- a/src/channel-display-gst.c
+++ b/src/channel-display-gst.c
@@ -471,8 +471,7 @@  sink_event_probe(GstPad *pad, GstPadProbeInfo *info, gpointer data)
 
 /* This function is called to used to set a probe on the sink */
 static void
-deep_element_added_cb(GstBin *pipeline, GstBin *bin, GstElement *element,
-                      SpiceGstDecoder *decoder)
+element_setup_cb(GstElement *pipeline, GstElement *element, SpiceGstDecoder *decoder)
 {
     /* Attach a probe to the sink to update the statistics */
     if (GST_IS_BASE_SINK(element)) {
@@ -543,7 +542,7 @@  static gboolean create_pipeline(SpiceGstDecoder *decoder)
 #endif
     }
 
-    g_signal_connect(playbin, "deep-element-added", G_CALLBACK(deep_element_added_cb), decoder);
+    g_signal_connect(playbin, "element-setup", G_CALLBACK(element_setup_cb), decoder);
     g_signal_connect(playbin, "source-setup", G_CALLBACK(app_source_setup), decoder);
 
     g_object_set(playbin,

Comments

> 
> Its functionally is equivalent to connecting to the deep-element-added
> signal, but a bit more convenient
> 

Why is more convenient? If we need "bin" in the future we won't have it.

> Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
> ---
>  src/channel-display-gst.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/src/channel-display-gst.c b/src/channel-display-gst.c
> index 6fccf62..437328b 100644
> --- a/src/channel-display-gst.c
> +++ b/src/channel-display-gst.c
> @@ -471,8 +471,7 @@ sink_event_probe(GstPad *pad, GstPadProbeInfo *info,
> gpointer data)
>  
>  /* This function is called to used to set a probe on the sink */
>  static void
> -deep_element_added_cb(GstBin *pipeline, GstBin *bin, GstElement *element,
> -                      SpiceGstDecoder *decoder)
> +element_setup_cb(GstElement *pipeline, GstElement *element, SpiceGstDecoder
> *decoder)
>  {
>      /* Attach a probe to the sink to update the statistics */
>      if (GST_IS_BASE_SINK(element)) {
> @@ -543,7 +542,7 @@ static gboolean create_pipeline(SpiceGstDecoder *decoder)
>  #endif
>      }
>  
> -    g_signal_connect(playbin, "deep-element-added",
> G_CALLBACK(deep_element_added_cb), decoder);
> +    g_signal_connect(playbin, "element-setup", G_CALLBACK(element_setup_cb),
> decoder);
>      g_signal_connect(playbin, "source-setup", G_CALLBACK(app_source_setup),
>      decoder);
>  
>      g_object_set(playbin,

Frediano