/* GStreamer
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wtay@chello.be>
+ * 2005 Wim Taymans <wim@fluendo.com>
*
- * gstfilesrc.h:
+ * gstfilesrc.h:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
*/
+#ifndef __GST_FILE_SRC_H__
+#define __GST_FILE_SRC_H__
-#ifndef __GST_FILESRC_H__
-#define __GST_FILESRC_H__
-
+#include <sys/types.h>
#include <gst/gst.h>
-#include <sys/types.h>
+#include <gst/base/gstbasesrc.h>
G_BEGIN_DECLS
-
-#define GST_TYPE_FILESRC \
- (gst_filesrc_get_type())
-#define GST_FILESRC(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FILESRC,GstFileSrc))
-#define GST_FILESRC_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FILESRC,GstFileSrcClass))
-#define GST_IS_FILESRC(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FILESRC))
-#define GST_IS_FILESRC_CLASS(obj) \
- (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FILESRC))
-
-typedef enum {
- GST_FILESRC_OPEN = GST_ELEMENT_FLAG_LAST,
-
- GST_FILESRC_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2
-} GstFileSrcFlags;
+#define GST_TYPE_FILE_SRC \
+ (gst_file_src_get_type())
+#define GST_FILE_SRC(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FILE_SRC,GstFileSrc))
+#define GST_FILE_SRC_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FILE_SRC,GstFileSrcClass))
+#define GST_IS_FILE_SRC(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FILE_SRC))
+#define GST_IS_FILE_SRC_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FILE_SRC))
+#define GST_FILE_SRC_CAST(obj) ((GstFileSrc*) obj)
typedef struct _GstFileSrc GstFileSrc;
typedef struct _GstFileSrcClass GstFileSrcClass;
+/**
+ * GstFileSrc:
+ *
+ * Opaque #GstFileSrc structure.
+ */
struct _GstFileSrc {
- GstElement element;
- GstPad *srcpad;
+ GstBaseSrc element;
- guint pagesize; /* system page size*/
-
+ /*< private >*/
gchar *filename; /* filename */
gchar *uri; /* caching the URI */
- gint fd; /* open file descriptor*/
- off_t filelen; /* what's the file length?*/
-
- off_t curoffset; /* current offset in file*/
- off_t block_size; /* bytes per read */
- gboolean touch; /* whether to touch every page */
- gboolean using_mmap; /* whether we opened it with mmap */
- gboolean is_regular; /* whether it's (symlink to)
- a regular file */
-
- GstBuffer *mapbuf;
- size_t mapsize;
+ gint fd; /* open file descriptor */
+ guint64 read_position; /* position of fd */
- gint need_discont;
- gboolean need_flush;
+ gboolean seekable; /* whether the file is seekable */
+ gboolean is_regular; /* whether it's a (symlink to a)
+ regular file */
};
struct _GstFileSrcClass {
- GstElementClass parent_class;
+ GstBaseSrcClass parent_class;
};
-GType gst_filesrc_get_type(void);
+G_GNUC_INTERNAL GType gst_file_src_get_type (void);
G_END_DECLS
-#endif /* __GST_FILESRC_H__ */
+#endif /* __GST_FILE_SRC_H__ */