[filesink] Add property current_byte 77/47977/1
authorHyongtaek Lim <hyongtaek.lim@samsung.com>
Thu, 10 Sep 2015 12:06:47 +0000 (21:06 +0900)
committerHyongtaek Lim <hyongtaek.lim@samsung.com>
Thu, 10 Sep 2015 12:07:14 +0000 (21:07 +0900)
Signed-off-by: Hyongtaek Lim <hyongtaek.lim@samsung.com>
Change-Id: I02875ba15f929e1e00078f0cf752d147014c4f7b

packaging/gstreamer.spec
plugins/elements/gstfilesink.c

index 301125c..7be9cfc 100644 (file)
@@ -69,7 +69,10 @@ to develop applications that require these.
 # Silently ignored compilation of uninstalled gtk-doc scanners without RPM_OPT_FLAGS.
 export V=1
 NOCONFIGURE=1 ./autogen.sh
-export CFLAGS="%{optflags} -fno-strict-aliasing"
+export CFLAGS="%{optflags} \
+       -DGST_QUEUE2_MODIFICATION\
+       -DGST_EXT_CURRENT_BYTES\
+       -fno-strict-aliasing"
 %configure\
 %if %{with introspection}
         --enable-introspection\
index 470ad5e..e4dc1ba 100644 (file)
@@ -108,6 +108,9 @@ enum
   PROP_BUFFER_MODE,
   PROP_BUFFER_SIZE,
   PROP_APPEND,
+#ifdef GST_EXT_CURRENT_BYTES
+  PROP_CURRENT_BYTES,
+#endif
   PROP_LAST
 };
 
@@ -209,6 +212,13 @@ gst_file_sink_class_init (GstFileSinkClass * klass)
           "Size of buffer in number of bytes for line or full buffer-mode", 0,
           G_MAXUINT, DEFAULT_BUFFER_SIZE,
           G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+#ifdef GST_EXT_CURRENT_BYTES
+  g_object_class_install_property (gobject_class, PROP_CURRENT_BYTES,
+      g_param_spec_uint64 ("current-bytes", "Current bytes",
+          "downloaded bytes so far", 0,
+          G_MAXUINT64, 0,
+          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+#endif
 
   /**
    * GstFileSink:append
@@ -348,6 +358,11 @@ gst_file_sink_get_property (GObject * object, guint prop_id, GValue * value,
     case PROP_APPEND:
       g_value_set_boolean (value, sink->append);
       break;
+#ifdef GST_EXT_CURRENT_BYTES
+    case PROP_CURRENT_BYTES:
+      g_value_set_uint64(value, sink->current_pos);
+      break;
+#endif
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;