flvmux: Rename unreleased property 'indexed' to 'streamable'
authorThiago Santos <thiago.sousa.santos@collabora.co.uk>
Wed, 9 Jun 2010 12:13:09 +0000 (09:13 -0300)
committerThiago Santos <thiago.sousa.santos@collabora.co.uk>
Wed, 9 Jun 2010 12:13:09 +0000 (09:13 -0300)
Rename 'indexed' to 'streamable' for a better name while it
hasn't been released

gst/flv/gstflvmux.c
gst/flv/gstflvmux.h

index eb0d561..f9f3a23 100644 (file)
@@ -46,10 +46,10 @@ GST_DEBUG_CATEGORY_STATIC (flvmux_debug);
 enum
 {
   PROP_0,
-  PROP_INDEXED
+  PROP_STREAMABLE
 };
 
-#define DEFAULT_INDEXED TRUE
+#define DEFAULT_STREAMABLE FALSE
 #define MAX_INDEX_ENTRIES 128
 
 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
    * automatically using queries when parameter not specified. */
-  g_object_class_install_property (gobject_class, PROP_INDEXED,
-      g_param_spec_boolean ("indexed", "indexed",
-          "If set to false, the output should be as if it is to be streamed "
-          "and hence no indexes written or duration written.", DEFAULT_INDEXED,
-          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+  g_object_class_install_property (gobject_class, PROP_STREAMABLE,
+      g_param_spec_boolean ("streamable", "streamable",
+          "If set to true, the output should be as if it is to be streamed "
+          "and hence no indexes written or duration written.",
+          DEFAULT_STREAMABLE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
   gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_flv_mux_change_state);
   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);
 
   /* property */
-  mux->indexed = DEFAULT_INDEXED;
+  mux->streamable = DEFAULT_STREAMABLE;
 
   mux->collect = gst_collect_pads_new ();
   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
      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);
     script_tag = gst_buffer_join (script_tag, tmp);
     tags_written++;
   }
 
-  if (mux->indexed) {
+  if (!mux->streamable) {
     tmp = gst_flv_mux_preallocate_index (mux);
     script_tag = gst_buffer_join (script_tag, tmp);
   } 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++) {
@@ -1183,7 +1183,7 @@ gst_flv_mux_write_buffer (GstFlvMux * mux, GstFlvPad * cpad)
       gst_collect_pads_pop (mux->collect, (GstCollectData *) cpad);
   GstFlowReturn ret;
 
-  if (mux->indexed)
+  if (!mux->streamable)
     gst_flv_mux_update_index (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 i, index_skip;
 
-  if (!mux->indexed)
+  if (mux->streamable)
     return GST_FLOW_OK;
 
   /* 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
      bigger timestamp is seen, for live the timestamp will get wrapped in
      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) {
     GST_WARNING_OBJECT (mux, "Timestamp larger than FLV supports - EOS");
     eos = TRUE;
@@ -1449,8 +1449,8 @@ gst_flv_mux_get_property (GObject * object,
   GstFlvMux *mux = GST_FLV_MUX (object);
 
   switch (prop_id) {
-    case PROP_INDEXED:
-      g_value_set_boolean (value, mux->indexed);
+    case PROP_STREAMABLE:
+      g_value_set_boolean (value, mux->streamable);
       break;
     default:
       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);
 
   switch (prop_id) {
-    case PROP_INDEXED:
-      mux->indexed = g_value_get_boolean (value);
+    case PROP_STREAMABLE:
+      mux->streamable = g_value_get_boolean (value);
       break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
index 66e5fb8..c0fd384 100644 (file)
@@ -73,7 +73,7 @@ typedef struct _GstFlvMux {
   GstFlvMuxState state;
   gboolean have_audio;
   gboolean have_video;
-  gboolean indexed;
+  gboolean streamable;
 
   GstTagList *tags;
   GList *index;