GstFormat format;
gint64 duration;
} duration[5]; /* cached durations */
+
+ guint64 ring_buffer_max_size; /* 0 means disabled */
};
struct _GstPlayBinClass
#define DEFAULT_CONNECTION_SPEED 0
#define DEFAULT_BUFFER_DURATION -1
#define DEFAULT_BUFFER_SIZE -1
+#define DEFAULT_RING_BUFFER_MAX_SIZE 0
enum
{
PROP_BUFFER_SIZE,
PROP_BUFFER_DURATION,
PROP_AV_OFFSET,
+ PROP_RING_BUFFER_MAX_SIZE,
PROP_LAST
};
G_MININT64, G_MAXINT64, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /**
+ * GstQueue2:ring-buffer-max-size
+ *
+ * The maximum size of the ring buffer in bytes. If set to 0, the ring
+ * buffer is disabled. Default 0.
+ *
+ * Since: 0.10.31
+ */
+ g_object_class_install_property (gobject_klass, PROP_RING_BUFFER_MAX_SIZE,
+ g_param_spec_uint64 ("ring-buffer-max-size",
+ "Max. ring buffer size (bytes)",
+ "Max. amount of data in the ring buffer (bytes, 0 = ring buffer disabled)",
+ 0, G_MAXUINT, DEFAULT_RING_BUFFER_MAX_SIZE,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
/**
* GstPlayBin2::about-to-finish
* @playbin: a #GstPlayBin2
playbin->buffer_duration = DEFAULT_BUFFER_DURATION;
playbin->buffer_size = DEFAULT_BUFFER_SIZE;
+ playbin->ring_buffer_max_size = DEFAULT_RING_BUFFER_MAX_SIZE;
}
static void
gst_play_sink_set_av_offset (playbin->playsink,
g_value_get_int64 (value));
break;
+ case PROP_RING_BUFFER_MAX_SIZE:
+ playbin->ring_buffer_max_size = g_value_get_uint64 (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
g_value_set_int64 (value,
gst_play_sink_get_av_offset (playbin->playsink));
break;
+ case PROP_RING_BUFFER_MAX_SIZE:
+ g_value_set_uint64 (value, playbin->ring_buffer_max_size);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
GstPad *text_sinkpad = NULL;
text_sink =
- (group->playbin->text_sink) ? gst_object_ref (group->playbin->
- text_sink) : NULL;
+ (group->playbin->text_sink) ? gst_object_ref (group->
+ playbin->text_sink) : NULL;
if (text_sink)
text_sinkpad = gst_element_get_static_pad (text_sink, "sink");
g_object_set (uridecodebin, "buffer-duration", playbin->buffer_duration,
NULL);
g_object_set (uridecodebin, "buffer-size", playbin->buffer_size, NULL);
+ g_object_set (uridecodebin, "ring-buffer-max-size",
+ playbin->ring_buffer_max_size, NULL);
/* connect pads and other things */
group->pad_added_id = g_signal_connect (uridecodebin, "pad-added",
gboolean async_pending; /* async-start has been emited */
gboolean expose_allstreams; /* Whether to expose unknow type streams or not */
+
+ guint64 ring_buffer_max_size; /* 0 means disabled */
};
struct _GstURIDecodeBinClass
#define DEFAULT_DOWNLOAD FALSE
#define DEFAULT_USE_BUFFERING FALSE
#define DEFAULT_EXPOSE_ALL_STREAMS TRUE
+#define DEFAULT_RING_BUFFER_MAX_SIZE 0
enum
{
PROP_DOWNLOAD,
PROP_USE_BUFFERING,
PROP_EXPOSE_ALL_STREAMS,
+ PROP_RING_BUFFER_MAX_SIZE,
PROP_LAST
};
"Expose all streams, including those of unknown type or that don't match the 'caps' property",
DEFAULT_EXPOSE_ALL_STREAMS,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+ /**
+ * GstQueue2:ring-buffer-max-size
+ *
+ * The maximum size of the ring buffer in kilobytes. If set to 0, the ring
+ * buffer is disabled. Default is 0.
+ *
+ * Since: 0.10.31
+ */
+ g_object_class_install_property (gobject_class, PROP_RING_BUFFER_MAX_SIZE,
+ g_param_spec_uint64 ("ring-buffer-max-size",
+ "Max. ring buffer size (bytes)",
+ "Max. amount of data in the ring buffer (bytes, 0 = ring buffer disabled)",
+ 0, G_MAXUINT, DEFAULT_RING_BUFFER_MAX_SIZE,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
/**
* GstURIDecodeBin::unknown-type:
* @bin: The uridecodebin
dec->download = DEFAULT_DOWNLOAD;
dec->use_buffering = DEFAULT_USE_BUFFERING;
dec->expose_allstreams = DEFAULT_EXPOSE_ALL_STREAMS;
+ dec->ring_buffer_max_size = DEFAULT_RING_BUFFER_MAX_SIZE;
}
static void
case PROP_EXPOSE_ALL_STREAMS:
dec->expose_allstreams = g_value_get_boolean (value);
break;
+ case PROP_RING_BUFFER_MAX_SIZE:
+ dec->ring_buffer_max_size = g_value_get_uint64 (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
case PROP_EXPOSE_ALL_STREAMS:
g_value_set_boolean (value, dec->expose_allstreams);
break;
+ case PROP_RING_BUFFER_MAX_SIZE:
+ g_value_set_uint64 (value, dec->ring_buffer_max_size);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
goto no_queue2;
g_object_set (queue, "use-buffering", TRUE, NULL);
+ g_object_set (queue, "ring-buffer-max-size", decoder->ring_buffer_max_size,
+ NULL);
GST_DEBUG_OBJECT (decoder, "check media-type %s, %d", media_type,
decoder->download);