[spice-gtk v1 03/11] channel-display: remove unneeded function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Victor Toso <me@xxxxxxxxxxxxxx>

The get_stream_id_by_stream() was introduced in 141c2d82 to debug
GStreamer's pipeline. But with previous patch, we are moving the ID to
the display_stream structure and can be accessible directly.

Signed-off-by: Victor Toso <victortoso@xxxxxxxxxx>
---
 src/channel-display-gst.c  |  5 ++---
 src/channel-display-priv.h |  1 -
 src/channel-display.c      | 17 -----------------
 3 files changed, 2 insertions(+), 21 deletions(-)

diff --git a/src/channel-display-gst.c b/src/channel-display-gst.c
index c6280d3..8b23036 100644
--- a/src/channel-display-gst.c
+++ b/src/channel-display-gst.c
@@ -293,9 +293,8 @@ static gboolean handle_pipeline_message(GstBus *bus, GstMessage *msg, gpointer v
         break;
     }
     case GST_MESSAGE_STREAM_START: {
-        gchar *filename = g_strdup_printf("spice-gtk-gst-pipeline-debug-%" G_GINT64_FORMAT "-%s",
-                                          get_stream_id_by_stream(decoder->base.stream->channel,
-                                                                  decoder->base.stream),
+        gchar *filename = g_strdup_printf("spice-gtk-gst-pipeline-debug-%" G_GUINT32_FORMAT "-%s",
+                                          decoder->base.stream->id,
                                           gst_opts[decoder->base.codec_type].name);
         GST_DEBUG_BIN_TO_DOT_FILE(GST_BIN(decoder->pipeline),
                                   GST_DEBUG_GRAPH_SHOW_ALL
diff --git a/src/channel-display-priv.h b/src/channel-display-priv.h
index 94c9913..6a90a78 100644
--- a/src/channel-display-priv.h
+++ b/src/channel-display-priv.h
@@ -195,7 +195,6 @@ guint32 stream_get_time(display_stream *st);
 void stream_dropped_frame_on_playback(display_stream *st);
 #define SPICE_UNKNOWN_STRIDE 0
 void stream_display_frame(display_stream *st, SpiceFrame *frame, uint32_t width, uint32_t height, int stride, uint8_t* data);
-gint64 get_stream_id_by_stream(SpiceChannel *channel, display_stream *st);
 
 
 G_END_DECLS
diff --git a/src/channel-display.c b/src/channel-display.c
index 1a79a8b..2ea0922 100644
--- a/src/channel-display.c
+++ b/src/channel-display.c
@@ -1218,23 +1218,6 @@ static display_stream *get_stream_by_id(SpiceChannel *channel, uint32_t id)
     return NULL;
 }
 
-G_GNUC_INTERNAL
-gint64 get_stream_id_by_stream(SpiceChannel *channel, display_stream *st)
-{
-    SpiceDisplayChannelPrivate *c = SPICE_DISPLAY_CHANNEL(channel)->priv;
-    guint i;
-
-    g_return_val_if_fail(c->streams != NULL, -1);
-    g_return_val_if_fail(c->nstreams > 0, -1);
-
-    for (i = 0; i < c->nstreams; i++) {
-        if (c->streams[i] == st)
-            return i;
-    }
-
-    return -1;
-}
-
 /* coroutine context */
 static display_stream *display_stream_create(SpiceChannel *channel,
                                              uint32_t id, uint32_t surface_id,
-- 
2.16.2

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]