*/
/**
* SECTION:element-filesink
+ * @title: filesink
* @see_also: #GstFileSrc
*
* Write incoming data to a file in the local file system.
*
- * <refsect2>
- * <title>Example launch line</title>
+ * ## Example launch line
* |[
* gst-launch-1.0 v4l2src num-buffers=1 ! jpegenc ! filesink location=capture1.jpeg
* ]| Capture one frame from a v4l2 camera and save as jpeg image.
- * </refsect2>
+ *
*/
#ifdef HAVE_CONFIG_H
#include <unistd.h>
#endif
+#ifdef __BIONIC__ /* Android */
+#undef lseek
+#define lseek lseek64
+#undef off_t
+#define off_t guint64
+#endif
+
#include "gstelements_private.h"
#include "gstfilesink.h"
/**
* GstFileSink:append
- *
+ *
* Append to an already existing file.
*/
g_object_class_install_property (gobject_class, PROP_APPEND,
"File Sink",
"Sink/File", "Write stream to a file",
"Thomas Vander Stichele <thomas at apestaart dot org>");
- gst_element_class_add_pad_template (gstelement_class,
- gst_static_pad_template_get (&sinktemplate));
+ gst_element_class_add_static_pad_template (gstelement_class, &sinktemplate);
gstbasesink_class->start = GST_DEBUG_FUNCPTR (gst_file_sink_start);
gstbasesink_class->stop = GST_DEBUG_FUNCPTR (gst_file_sink_stop);
{
if (sink->file) {
if (fclose (sink->file) != 0)
- goto close_failed;
+ GST_ELEMENT_ERROR (sink, RESOURCE, CLOSE,
+ (_("Error closing file \"%s\"."), sink->filename), GST_ERROR_SYSTEM);
GST_DEBUG_OBJECT (sink, "closed file");
sink->file = NULL;
g_free (sink->buffer);
sink->buffer = NULL;
}
- return;
-
- /* ERRORS */
-close_failed:
- {
- GST_ELEMENT_ERROR (sink, RESOURCE, CLOSE,
- (_("Error closing file \"%s\"."), sink->filename), GST_ERROR_SYSTEM);
- return;
- }
}
static gboolean
num_buffers, total_mems, sink->current_pos);
return gst_writev_buffers (GST_OBJECT_CAST (sink), fileno (sink->file), NULL,
- buffers, num_buffers, mem_nums, total_mems, NULL, &sink->current_pos);
+ buffers, num_buffers, mem_nums, total_mems, &sink->current_pos, 0);
}
static GstFlowReturn