mssdemux: add max-queue-size-buffers property
authorThiago Santos <thiago.sousa.santos@collabora.com>
Tue, 22 Jan 2013 20:33:41 +0000 (17:33 -0300)
committerThiago Santos <thiago.sousa.santos@collabora.com>
Wed, 8 May 2013 00:09:47 +0000 (21:09 -0300)
Indicates how much buffering should be done internally in
mssdemux

ext/smoothstreaming/gstmssdemux.c

index e05ef53914aa926926fe8e30cf069927268ee500..121b52452c905e2f8147d792ded71025905ee468 100644 (file)
 GST_DEBUG_CATEGORY (mssdemux_debug);
 
 #define DEFAULT_CONNECTION_SPEED 0
 GST_DEBUG_CATEGORY (mssdemux_debug);
 
 #define DEFAULT_CONNECTION_SPEED 0
+#define DEFAULT_MAX_QUEUE_SIZE_BUFFERS 0
 
 enum
 {
   PROP_0,
 
   PROP_CONNECTION_SPEED,
 
 enum
 {
   PROP_0,
 
   PROP_CONNECTION_SPEED,
+  PROP_MAX_QUEUE_SIZE_BUFFERS,
   PROP_LAST
 };
 
   PROP_LAST
 };
 
@@ -130,6 +132,12 @@ gst_mss_demux_class_init (GstMssDemuxClass * klass)
           0, G_MAXUINT / 1000, DEFAULT_CONNECTION_SPEED,
           G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
           0, G_MAXUINT / 1000, DEFAULT_CONNECTION_SPEED,
           G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
+  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",
+          "Maximum buffers that can be stored in each internal stream queue "
+          "(0 = infinite)", 0, G_MAXUINT, DEFAULT_MAX_QUEUE_SIZE_BUFFERS,
+          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
   gstelement_class->change_state =
       GST_DEBUG_FUNCPTR (gst_mss_demux_change_state);
 }
   gstelement_class->change_state =
       GST_DEBUG_FUNCPTR (gst_mss_demux_change_state);
 }
@@ -149,6 +157,8 @@ gst_mss_demux_init (GstMssDemux * mssdemux, GstMssDemuxClass * klass)
   mssdemux->stream_task =
       gst_task_create ((GstTaskFunction) gst_mss_demux_stream_loop, mssdemux);
   gst_task_set_lock (mssdemux->stream_task, &mssdemux->stream_lock);
   mssdemux->stream_task =
       gst_task_create ((GstTaskFunction) gst_mss_demux_stream_loop, mssdemux);
   gst_task_set_lock (mssdemux->stream_task, &mssdemux->stream_lock);
+
+  mssdemux->data_queue_max_size = DEFAULT_MAX_QUEUE_SIZE_BUFFERS;
 }
 
 static gboolean
 }
 
 static gboolean
@@ -292,6 +302,9 @@ gst_mss_demux_set_property (GObject * object, guint prop_id,
           mssdemux->connection_speed);
       GST_OBJECT_UNLOCK (mssdemux);
       break;
           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;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -308,6 +321,9 @@ gst_mss_demux_get_property (GObject * object, guint prop_id, GValue * value,
     case PROP_CONNECTION_SPEED:
       g_value_set_uint (value, mssdemux->connection_speed / 1000);
       break;
     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;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;