summaryrefslogtreecommitdiffstats
path: root/gst
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
commit9c2276190fed0f65fd3a51f66f636ef33cce02ae (patch)
treeca91e76e470dd21cabf934ffffe952a5d2c2026c /gst
parentd7f9aaebf372c05638fdd66efd6663a7600bce79 (diff)
downloadgst-plugins-bad-9c2276190fed0f65fd3a51f66f636ef33cce02ae.tar.gz
gst-plugins-bad-9c2276190fed0f65fd3a51f66f636ef33cce02ae.tar.bz2
gst-plugins-bad-9c2276190fed0f65fd3a51f66f636ef33cce02ae.zip
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')
-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;