#define MAX_DOWNLOAD_ERROR_COUNT 3
#define DEFAULT_FAILED_COUNT 3
-#define DEFAULT_LOOKBACK_FRAGMENTS 3
#define DEFAULT_CONNECTION_SPEED 0
#define DEFAULT_BITRATE_LIMIT 0.8
#define SRC_QUEUE_MAX_BYTES 20 * 1024 * 1024 /* For safety. Large enough to hold a segment. */
enum
{
PROP_0,
- PROP_LOOKBACK_FRAGMENTS,
PROP_CONNECTION_SPEED,
PROP_BITRATE_LIMIT,
PROP_LAST
GST_MANIFEST_LOCK (demux);
switch (prop_id) {
- case PROP_LOOKBACK_FRAGMENTS:
- demux->num_lookback_fragments = g_value_get_uint (value);
- break;
case PROP_CONNECTION_SPEED:
demux->connection_speed = g_value_get_uint (value) * 1000;
GST_DEBUG_OBJECT (demux, "Connection speed set to %u",
GST_MANIFEST_LOCK (demux);
switch (prop_id) {
- case PROP_LOOKBACK_FRAGMENTS:
- g_value_set_uint (value, demux->num_lookback_fragments);
- break;
case PROP_CONNECTION_SPEED:
g_value_set_uint (value, demux->connection_speed / 1000);
break;
gobject_class->get_property = gst_adaptive_demux_get_property;
gobject_class->finalize = gst_adaptive_demux_finalize;
- g_object_class_install_property (gobject_class, PROP_LOOKBACK_FRAGMENTS,
- g_param_spec_uint ("num-lookback-fragments",
- "Number of fragments to look back",
- "The number of fragments the demuxer will look back to calculate an average bitrate",
- 1, G_MAXUINT, DEFAULT_LOOKBACK_FRAGMENTS,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY));
-
g_object_class_install_property (gobject_class, PROP_CONNECTION_SPEED,
g_param_spec_uint ("connection-speed", "Connection Speed",
"Network connection speed in kbps (0 = calculate from downloaded"
GST_DEBUG_FUNCPTR (gst_adaptive_demux_sink_chain));
/* Properties */
- demux->num_lookback_fragments = DEFAULT_LOOKBACK_FRAGMENTS;
demux->bitrate_limit = DEFAULT_BITRATE_LIMIT;
demux->connection_speed = DEFAULT_CONNECTION_SPEED;
{
GstElement *dashdemux = testData->scratchData->dashdemux;
- /* num-lookback-fragments can only be set at construction */
- test_invalid_int_prop (G_OBJECT (dashdemux), "num-lookback-fragments", 10);
-
test_int_prop (G_OBJECT (dashdemux), "connection-speed", 1000);
test_invalid_int_prop (G_OBJECT (dashdemux), "connection-speed", 4294967 + 1);