+static GstMssStreamQuality *
+gst_mss_stream_quality_new (xmlNodePtr node)
+{
+ GstMssStreamQuality *q = g_slice_new (GstMssStreamQuality);
+
+ q->xmlnode = node;
+ q->bitrate_str = (gchar *) xmlGetProp (node, (xmlChar *) MSS_PROP_BITRATE);
+ q->bitrate = strtoull (q->bitrate_str, NULL, 10);
+
+ return q;
+}
+
+static void
+gst_mss_stream_quality_free (GstMssStreamQuality * quality)
+{
+ g_return_if_fail (quality != NULL);
+
+ g_free (quality->bitrate_str);
+ g_slice_free (GstMssStreamQuality, quality);
+}
+
+static gint
+compare_bitrate (GstMssStreamQuality * a, GstMssStreamQuality * b)
+{
+ if (a->bitrate > b->bitrate)
+ return 1;
+ if (a->bitrate < b->bitrate)
+ return -1;
+ return 0;
+
+}
+