flvmux: Rename unreleased property 'indexed' to 'streamable'

Rename 'indexed' to 'streamable' for a better name while it
hasn't been released
This commit is contained in:
Thiago Santos 2010-06-09 09:13:09 -03:00
parent 02c279a511
commit c27dc49bf7
2 changed files with 19 additions and 19 deletions

View File

@ -46,10 +46,10 @@ GST_DEBUG_CATEGORY_STATIC (flvmux_debug);
enum enum
{ {
PROP_0, PROP_0,
PROP_INDEXED PROP_STREAMABLE
}; };
#define DEFAULT_INDEXED TRUE #define DEFAULT_STREAMABLE FALSE
#define MAX_INDEX_ENTRIES 128 #define MAX_INDEX_ENTRIES 128
static GstStaticPadTemplate src_templ = GST_STATIC_PAD_TEMPLATE ("src", static GstStaticPadTemplate src_templ = GST_STATIC_PAD_TEMPLATE ("src",
@ -162,11 +162,11 @@ gst_flv_mux_class_init (GstFlvMuxClass * klass)
/* FIXME: ideally the right mode of operation should be detected /* FIXME: ideally the right mode of operation should be detected
* automatically using queries when parameter not specified. */ * automatically using queries when parameter not specified. */
g_object_class_install_property (gobject_class, PROP_INDEXED, g_object_class_install_property (gobject_class, PROP_STREAMABLE,
g_param_spec_boolean ("indexed", "indexed", g_param_spec_boolean ("streamable", "streamable",
"If set to false, the output should be as if it is to be streamed " "If set to true, the output should be as if it is to be streamed "
"and hence no indexes written or duration written.", DEFAULT_INDEXED, "and hence no indexes written or duration written.",
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); DEFAULT_STREAMABLE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_flv_mux_change_state); gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_flv_mux_change_state);
gstelement_class->request_new_pad = gstelement_class->request_new_pad =
@ -182,7 +182,7 @@ gst_flv_mux_init (GstFlvMux * mux, GstFlvMuxClass * g_class)
gst_element_add_pad (GST_ELEMENT (mux), mux->srcpad); gst_element_add_pad (GST_ELEMENT (mux), mux->srcpad);
/* property */ /* property */
mux->indexed = DEFAULT_INDEXED; mux->streamable = DEFAULT_STREAMABLE;
mux->collect = gst_collect_pads_new (); mux->collect = gst_collect_pads_new ();
gst_collect_pads_set_function (mux->collect, gst_collect_pads_set_function (mux->collect,
@ -677,17 +677,17 @@ gst_flv_mux_create_metadata (GstFlvMux * mux)
/* Sometimes the information about the total file size is useful for the /* Sometimes the information about the total file size is useful for the
player. It will be filled later, after getting EOS */ player. It will be filled later, after getting EOS */
if (mux->indexed) { if (!mux->streamable) {
tmp = gst_flv_mux_create_number_script_value ("filesize", 0); tmp = gst_flv_mux_create_number_script_value ("filesize", 0);
script_tag = gst_buffer_join (script_tag, tmp); script_tag = gst_buffer_join (script_tag, tmp);
tags_written++; tags_written++;
} }
if (mux->indexed) { if (!mux->streamable) {
tmp = gst_flv_mux_preallocate_index (mux); tmp = gst_flv_mux_preallocate_index (mux);
script_tag = gst_buffer_join (script_tag, tmp); script_tag = gst_buffer_join (script_tag, tmp);
} else { } else {
GST_DEBUG_OBJECT (mux, "not preallocating index, stream is live"); GST_DEBUG_OBJECT (mux, "not preallocating index, streamable mode");
} }
for (i = 0; tags && i < n_tags; i++) { for (i = 0; tags && i < n_tags; i++) {
@ -1183,7 +1183,7 @@ gst_flv_mux_write_buffer (GstFlvMux * mux, GstFlvPad * cpad)
gst_collect_pads_pop (mux->collect, (GstCollectData *) cpad); gst_collect_pads_pop (mux->collect, (GstCollectData *) cpad);
GstFlowReturn ret; GstFlowReturn ret;
if (mux->indexed) if (!mux->streamable)
gst_flv_mux_update_index (mux, buffer, cpad); gst_flv_mux_update_index (mux, buffer, cpad);
tag = gst_flv_mux_buffer_to_tag (mux, buffer, cpad); tag = gst_flv_mux_buffer_to_tag (mux, buffer, cpad);
@ -1238,7 +1238,7 @@ gst_flv_mux_rewrite_header (GstFlvMux * mux)
guint32 index_len, allocate_size; guint32 index_len, allocate_size;
guint32 i, index_skip; guint32 i, index_skip;
if (!mux->indexed) if (mux->streamable)
return GST_FLOW_OK; return GST_FLOW_OK;
/* seek back to the preallocated index space */ /* seek back to the preallocated index space */
@ -1425,7 +1425,7 @@ gst_flv_mux_collected (GstCollectPads * pads, gpointer user_data)
/* The FLV timestamp is an int32 field. For non-live streams error out if a /* The FLV timestamp is an int32 field. For non-live streams error out if a
bigger timestamp is seen, for live the timestamp will get wrapped in bigger timestamp is seen, for live the timestamp will get wrapped in
gst_flv_mux_buffer_to_tag */ gst_flv_mux_buffer_to_tag */
if (mux->indexed && GST_CLOCK_TIME_IS_VALID (best_time) if (!mux->streamable && GST_CLOCK_TIME_IS_VALID (best_time)
&& best_time / GST_MSECOND > G_MAXINT32) { && best_time / GST_MSECOND > G_MAXINT32) {
GST_WARNING_OBJECT (mux, "Timestamp larger than FLV supports - EOS"); GST_WARNING_OBJECT (mux, "Timestamp larger than FLV supports - EOS");
eos = TRUE; eos = TRUE;
@ -1449,8 +1449,8 @@ gst_flv_mux_get_property (GObject * object,
GstFlvMux *mux = GST_FLV_MUX (object); GstFlvMux *mux = GST_FLV_MUX (object);
switch (prop_id) { switch (prop_id) {
case PROP_INDEXED: case PROP_STREAMABLE:
g_value_set_boolean (value, mux->indexed); g_value_set_boolean (value, mux->streamable);
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@ -1465,8 +1465,8 @@ gst_flv_mux_set_property (GObject * object,
GstFlvMux *mux = GST_FLV_MUX (object); GstFlvMux *mux = GST_FLV_MUX (object);
switch (prop_id) { switch (prop_id) {
case PROP_INDEXED: case PROP_STREAMABLE:
mux->indexed = g_value_get_boolean (value); mux->streamable = g_value_get_boolean (value);
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);

View File

@ -73,7 +73,7 @@ typedef struct _GstFlvMux {
GstFlvMuxState state; GstFlvMuxState state;
gboolean have_audio; gboolean have_audio;
gboolean have_video; gboolean have_video;
gboolean indexed; gboolean streamable;
GstTagList *tags; GstTagList *tags;
GList *index; GList *index;