diff options
author | Thiago Santos <thiagoss@osg.samsung.com> | 2015-02-17 10:03:44 -0300 |
---|---|---|
committer | Thiago Santos <thiagoss@osg.samsung.com> | 2015-02-17 11:12:41 -0300 |
commit | e9ab79dc36a1fb8dc20668f0d3a5172b936444ba (patch) | |
tree | 799373052d8e360c10c1b6ad728c4f58b152cbc3 /ext/smoothstreaming | |
parent | 34c9c86ab78e4d0455e1e776aae28a89f7d14c6d (diff) | |
download | gstreamer-plugins-bad-e9ab79dc36a1fb8dc20668f0d3a5172b936444ba.tar.gz |
adaptivedemux: add connection-speed property
Allows to set a bitrate directly instead of measuring it internally
based on the received chunks. The connection-speed was removed from
mssdemux and hlsdemux as it is now in the base class
Diffstat (limited to 'ext/smoothstreaming')
-rw-r--r-- | ext/smoothstreaming/gstmssdemux.c | 30 | ||||
-rw-r--r-- | ext/smoothstreaming/gstmssdemux.h | 3 |
2 files changed, 3 insertions, 30 deletions
diff --git a/ext/smoothstreaming/gstmssdemux.c b/ext/smoothstreaming/gstmssdemux.c index 09e375099..865e1059a 100644 --- a/ext/smoothstreaming/gstmssdemux.c +++ b/ext/smoothstreaming/gstmssdemux.c @@ -77,7 +77,6 @@ GST_DEBUG_CATEGORY (mssdemux_debug); -#define DEFAULT_CONNECTION_SPEED 0 #define DEFAULT_MAX_QUEUE_SIZE_BUFFERS 0 #define DEFAULT_BITRATE_LIMIT 0.8 @@ -85,7 +84,6 @@ enum { PROP_0, - PROP_CONNECTION_SPEED, PROP_MAX_QUEUE_SIZE_BUFFERS, PROP_BITRATE_LIMIT, PROP_LAST @@ -166,12 +164,6 @@ gst_mss_demux_class_init (GstMssDemuxClass * klass) gobject_class->set_property = gst_mss_demux_set_property; gobject_class->get_property = gst_mss_demux_get_property; - g_object_class_install_property (gobject_class, PROP_CONNECTION_SPEED, - g_param_spec_uint ("connection-speed", "Connection Speed", - "Network connection speed in kbps (0 = unknown)", - 0, G_MAXUINT / 1000, DEFAULT_CONNECTION_SPEED, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - #ifndef GST_REMOVE_DEPRECATED g_object_class_install_property (gobject_class, PROP_MAX_QUEUE_SIZE_BUFFERS, g_param_spec_uint ("max-queue-size-buffers", "Max queue size in buffers", @@ -250,14 +242,6 @@ gst_mss_demux_set_property (GObject * object, guint prop_id, GstMssDemux *mssdemux = GST_MSS_DEMUX (object); switch (prop_id) { - case PROP_CONNECTION_SPEED: - GST_OBJECT_LOCK (mssdemux); - mssdemux->connection_speed = g_value_get_uint (value) * 1000; - mssdemux->update_bitrates = TRUE; - GST_DEBUG_OBJECT (mssdemux, "Connection speed set to %" G_GUINT64_FORMAT, - mssdemux->connection_speed); - GST_OBJECT_UNLOCK (mssdemux); - break; case PROP_MAX_QUEUE_SIZE_BUFFERS: mssdemux->data_queue_max_size = g_value_get_uint (value); break; @@ -277,9 +261,6 @@ gst_mss_demux_get_property (GObject * object, guint prop_id, GValue * value, GstMssDemux *mssdemux = GST_MSS_DEMUX (object); switch (prop_id) { - case PROP_CONNECTION_SPEED: - g_value_set_uint (value, mssdemux->connection_speed / 1000); - break; case PROP_MAX_QUEUE_SIZE_BUFFERS: g_value_set_uint (value, mssdemux->data_queue_max_size); break; @@ -416,11 +397,9 @@ gst_mss_demux_setup_streams (GstAdaptiveDemux * demux) return FALSE; } - GST_INFO_OBJECT (mssdemux, "Changing max bitrate to %" G_GUINT64_FORMAT, - mssdemux->connection_speed); - gst_mss_manifest_change_bitrate (mssdemux->manifest, - mssdemux->connection_speed); - mssdemux->update_bitrates = FALSE; + GST_INFO_OBJECT (mssdemux, "Changing max bitrate to %u", + demux->connection_speed); + gst_mss_manifest_change_bitrate (mssdemux->manifest, demux->connection_speed); for (iter = streams; iter; iter = g_slist_next (iter)) { GstPad *srcpad = NULL; @@ -508,9 +487,6 @@ gst_mss_demux_stream_select_bitrate (GstAdaptiveDemuxStream * stream, gboolean ret = FALSE; bitrate *= mssdemux->bitrate_limit; - if (mssdemux->connection_speed) { - bitrate = MIN (mssdemux->connection_speed, bitrate); - } GST_DEBUG_OBJECT (stream->pad, "Using stream download bitrate %" G_GUINT64_FORMAT, bitrate); diff --git a/ext/smoothstreaming/gstmssdemux.h b/ext/smoothstreaming/gstmssdemux.h index fe8a49d34..afd750853 100644 --- a/ext/smoothstreaming/gstmssdemux.h +++ b/ext/smoothstreaming/gstmssdemux.h @@ -70,10 +70,7 @@ struct _GstMssDemux { guint n_videos; guint n_audios; - gboolean update_bitrates; - /* properties */ - guint64 connection_speed; /* in bps */ guint data_queue_max_size; gfloat bitrate_limit; }; |