summaryrefslogtreecommitdiffstats
path: root/gst/multifile
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sourceforge.net>2007-07-18 07:51:11 +0000
committerStefan Kost <ensonic@users.sourceforge.net>2007-07-18 07:51:11 +0000
commit1b55aabe4e6730da279a6ac875b7b0187172c517 (patch)
tree1c524c90fa132926f815191060ba14b59046eec3 /gst/multifile
parent728a5af63ee8bfbd6422b31a78a69f26cb85766a (diff)
gst/multifile/gstmultifilesrc.c: Add example to the docs. Fix buffer-offset-end and add some debug.
Original commit message from CVS: * gst/multifile/gstmultifilesrc.c: (gst_multi_file_src_create): Add example to the docs. Fix buffer-offset-end and add some debug.
Diffstat (limited to 'gst/multifile')
-rw-r--r--gst/multifile/gstmultifilesrc.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/gst/multifile/gstmultifilesrc.c b/gst/multifile/gstmultifilesrc.c
index 7978a1e7..43e449d5 100644
--- a/gst/multifile/gstmultifilesrc.c
+++ b/gst/multifile/gstmultifilesrc.c
@@ -23,8 +23,22 @@
* @short_description: reads buffers from sequentially-named files
* @see_also: #GstFileSrc
*
- * Reads buffers from sequentially named files.
- */
+ * <refsect2>
+ * <para>
+ * Reads buffers from sequentially named files. If used together with an image
+ * decoder one needs to use the GstMultiFileSrc::caps property or a capsfilter
+ * to force to caps containing a framerate. Otherwise imagedecoders send EOS
+ * after the first picture.
+ * </para>
+ * <title>Example launch line</title>
+ * <para>
+ * <programlisting>
+ * gst-launch multifilesrc location="img.%04d.png" index=0 ! image/png,framerate='(fraction)'1/1 ! pngdec ! ffmpegcolorspace ! ffenc_mpeg4 ! avimux ! filesink location="images.avi"
+ * </programlisting>
+ * This pipeline joins multiple frames into one video.
+ * </para>
+ * </refsect2>
+*/
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -246,6 +260,8 @@ gst_multi_file_src_create (GstPushSrc * src, GstBuffer ** buffer)
filename = gst_multi_file_src_get_filename (filesrc);
+ GST_DEBUG_OBJECT (filesrc, "reading from file \"%s\".", filename);
+
file = fopen (filename, "rb");
if (!file) {
goto handle_error;
@@ -266,12 +282,13 @@ gst_multi_file_src_create (GstPushSrc * src, GstBuffer ** buffer)
GST_BUFFER_SIZE (buf) = size;
GST_BUFFER_OFFSET (buf) = filesrc->offset;
- GST_BUFFER_OFFSET (buf) = filesrc->offset + size;
+ GST_BUFFER_OFFSET_END (buf) = filesrc->offset + size;
filesrc->offset += size;
gst_buffer_set_caps (buf, filesrc->caps);
- fclose (file);
+ GST_DEBUG_OBJECT (filesrc, "read file \"%s\".", filename);
+ fclose (file);
g_free (filename);
*buffer = buf;
return GST_FLOW_OK;