rename multidisksrc to multifilesrc

Original commit message from CVS:
rename multidisksrc to multifilesrc
This commit is contained in:
Thomas Vander Stichele 2004-02-11 18:49:26 +00:00
parent d1525abbfc
commit 5d9481bfb6
9 changed files with 200 additions and 182 deletions

View file

@ -1,3 +1,21 @@
2004-02-11 Thomas Vander Stichele <thomas at apestaart dot org>
* configure.ac:
* gst/elements/Makefile.am:
* gst/elements/gstelements.c:
* gst/elements/gstmultifilesrc.c: (gst_multifilesrc_base_init),
(gst_multifilesrc_class_init), (gst_multifilesrc_init),
(gst_multifilesrc_set_property), (gst_multifilesrc_get_property),
(gst_multifilesrc_get), (gst_multifilesrc_open_file),
(gst_multifilesrc_close_file), (gst_multifilesrc_change_state):
* gst/elements/gstmultifilesrc.h:
rename multidisksrc to multifilesrc (part of #122200)
2004-02-11 Thomas Vander Stichele <thomas at apestaart dot org>
* configure.ac:
don't check for libxml when load/save and registry disabled (#105844)
2004-02-11 Thomas Vander Stichele <thomas at apestaart dot org> 2004-02-11 Thomas Vander Stichele <thomas at apestaart dot org>
* docs/manuals.mak: * docs/manuals.mak:

View file

@ -21,7 +21,7 @@ libgstelements_la_SOURCES = \
gstfdsrc.c \ gstfdsrc.c \
gstidentity.c \ gstidentity.c \
gstmd5sink.c \ gstmd5sink.c \
gstmultidisksrc.c \ gstmultifilesrc.c \
gstpipefilter.c \ gstpipefilter.c \
gstshaper.c \ gstshaper.c \
gststatistics.c \ gststatistics.c \
@ -43,7 +43,7 @@ noinst_HEADERS = \
gstfilesrc.h \ gstfilesrc.h \
gstidentity.h \ gstidentity.h \
gstmd5sink.h \ gstmd5sink.h \
gstmultidisksrc.h \ gstmultifilesrc.h \
gstpipefilter.h \ gstpipefilter.h \
gstshaper.h \ gstshaper.h \
gststatistics.h \ gststatistics.h \

View file

@ -36,7 +36,7 @@
#include "gstfilesrc.h" #include "gstfilesrc.h"
#include "gstidentity.h" #include "gstidentity.h"
#include "gstmd5sink.h" #include "gstmd5sink.h"
#include "gstmultidisksrc.h" #include "gstmultifilesrc.h"
#include "gstpipefilter.h" #include "gstpipefilter.h"
#include "gstshaper.h" #include "gstshaper.h"
#include "gststatistics.h" #include "gststatistics.h"
@ -64,7 +64,7 @@ static struct _elements_entry _elements[] = {
{ "filesink", GST_RANK_NONE, gst_filesink_get_type }, { "filesink", GST_RANK_NONE, gst_filesink_get_type },
{ "identity", GST_RANK_NONE, gst_identity_get_type }, { "identity", GST_RANK_NONE, gst_identity_get_type },
{ "md5sink", GST_RANK_NONE, gst_md5sink_get_type }, { "md5sink", GST_RANK_NONE, gst_md5sink_get_type },
{ "multidisksrc", GST_RANK_NONE, gst_multidisksrc_get_type }, { "multifilesrc", GST_RANK_NONE, gst_multifilesrc_get_type },
{ "pipefilter", GST_RANK_NONE, gst_pipefilter_get_type }, { "pipefilter", GST_RANK_NONE, gst_pipefilter_get_type },
{ "shaper", GST_RANK_NONE, gst_shaper_get_type }, { "shaper", GST_RANK_NONE, gst_shaper_get_type },
{ "statistics", GST_RANK_NONE, gst_statistics_get_type }, { "statistics", GST_RANK_NONE, gst_statistics_get_type },

View file

@ -3,7 +3,7 @@
* 2000 Wim Taymans <wtay@chello.be> * 2000 Wim Taymans <wtay@chello.be>
* 2001 Dominic Ludlam <dom@recoil.org> * 2001 Dominic Ludlam <dom@recoil.org>
* *
* gstmultidisksrc.c: * gstmultifilesrc.c:
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -35,19 +35,19 @@
#include "../gst-i18n-lib.h" #include "../gst-i18n-lib.h"
#include "gstmultidisksrc.h" #include "gstmultifilesrc.h"
GST_DEBUG_CATEGORY_STATIC (gst_multidisksrc_debug); GST_DEBUG_CATEGORY_STATIC (gst_multifilesrc_debug);
#define GST_CAT_DEFAULT gst_multidisksrc_debug #define GST_CAT_DEFAULT gst_multifilesrc_debug
GstElementDetails gst_multidisksrc_details = GST_ELEMENT_DETAILS ( GstElementDetails gst_multifilesrc_details = GST_ELEMENT_DETAILS (
"Multi Disk Source", "Multi File Source",
"Source/File", "Source/File",
"Read from multiple files in order", "Read from multiple files in order",
"Dominic Ludlam <dom@openfx.org>" "Dominic Ludlam <dom@openfx.org>"
); );
/* DiskSrc signals and args */ /* FileSrc signals and args */
enum { enum {
NEW_FILE, NEW_FILE,
LAST_SIGNAL LAST_SIGNAL
@ -59,32 +59,32 @@ enum {
}; };
#define _do_init(bla) \ #define _do_init(bla) \
GST_DEBUG_CATEGORY_INIT (gst_multidisksrc_debug, "multidisksrc", 0, "multidisksrc element"); GST_DEBUG_CATEGORY_INIT (gst_multifilesrc_debug, "multifilesrc", 0, "multifilesrc element");
GST_BOILERPLATE_FULL (GstMultiDiskSrc, gst_multidisksrc, GstElement, GST_TYPE_ELEMENT, _do_init); GST_BOILERPLATE_FULL (GstMultiFileSrc, gst_multifilesrc, GstElement, GST_TYPE_ELEMENT, _do_init);
static void gst_multidisksrc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void gst_multifilesrc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_multidisksrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); static void gst_multifilesrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static GstData * gst_multidisksrc_get (GstPad *pad); static GstData * gst_multifilesrc_get (GstPad *pad);
/*static GstBuffer * gst_multidisksrc_get_region (GstPad *pad,GstRegionType type,guint64 offset,guint64 len);*/ /*static GstBuffer * gst_multifilesrc_get_region (GstPad *pad,GstRegionType type,guint64 offset,guint64 len);*/
static GstElementStateReturn gst_multidisksrc_change_state (GstElement *element); static GstElementStateReturn gst_multifilesrc_change_state (GstElement *element);
static gboolean gst_multidisksrc_open_file (GstMultiDiskSrc *src, GstPad *srcpad); static gboolean gst_multifilesrc_open_file (GstMultiFileSrc *src, GstPad *srcpad);
static void gst_multidisksrc_close_file (GstMultiDiskSrc *src); static void gst_multifilesrc_close_file (GstMultiFileSrc *src);
static guint gst_multidisksrc_signals[LAST_SIGNAL] = { 0 }; static guint gst_multifilesrc_signals[LAST_SIGNAL] = { 0 };
static void static void
gst_multidisksrc_base_init (gpointer g_class) gst_multifilesrc_base_init (gpointer g_class)
{ {
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class); GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_multidisksrc_details); gst_element_class_set_details (gstelement_class, &gst_multifilesrc_details);
} }
static void static void
gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass) gst_multifilesrc_class_init (GstMultiFileSrcClass *klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
GstElementClass *gstelement_class; GstElementClass *gstelement_class;
@ -93,9 +93,9 @@ gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass)
gstelement_class = (GstElementClass*)klass; gstelement_class = (GstElementClass*)klass;
gst_multidisksrc_signals[NEW_FILE] = gst_multifilesrc_signals[NEW_FILE] =
g_signal_new ("new_file", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, g_signal_new ("new_file", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstMultiDiskSrcClass, new_file), NULL, NULL, G_STRUCT_OFFSET (GstMultiFileSrcClass, new_file), NULL, NULL,
g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
G_TYPE_POINTER); G_TYPE_POINTER);
@ -103,39 +103,39 @@ gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass)
g_param_spec_pointer("locations","locations","locations", g_param_spec_pointer("locations","locations","locations",
G_PARAM_READWRITE)); /* CHECKME */ G_PARAM_READWRITE)); /* CHECKME */
gobject_class->set_property = gst_multidisksrc_set_property; gobject_class->set_property = gst_multifilesrc_set_property;
gobject_class->get_property = gst_multidisksrc_get_property; gobject_class->get_property = gst_multifilesrc_get_property;
gstelement_class->change_state = gst_multidisksrc_change_state; gstelement_class->change_state = gst_multifilesrc_change_state;
} }
static void static void
gst_multidisksrc_init (GstMultiDiskSrc *multidisksrc) gst_multifilesrc_init (GstMultiFileSrc *multifilesrc)
{ {
/* GST_FLAG_SET (disksrc, GST_SRC_); */ /* GST_FLAG_SET (filesrc, GST_SRC_); */
multidisksrc->srcpad = gst_pad_new ("src", GST_PAD_SRC); multifilesrc->srcpad = gst_pad_new ("src", GST_PAD_SRC);
gst_pad_set_get_function (multidisksrc->srcpad,gst_multidisksrc_get); gst_pad_set_get_function (multifilesrc->srcpad,gst_multifilesrc_get);
/* gst_pad_set_getregion_function (multidisksrc->srcpad,gst_multidisksrc_get_region); */ /* gst_pad_set_getregion_function (multifilesrc->srcpad,gst_multifilesrc_get_region); */
gst_element_add_pad (GST_ELEMENT (multidisksrc), multidisksrc->srcpad); gst_element_add_pad (GST_ELEMENT (multifilesrc), multifilesrc->srcpad);
multidisksrc->listptr = NULL; multifilesrc->listptr = NULL;
multidisksrc->currentfilename = NULL; multifilesrc->currentfilename = NULL;
multidisksrc->fd = 0; multifilesrc->fd = 0;
multidisksrc->size = 0; multifilesrc->size = 0;
multidisksrc->map = NULL; multifilesrc->map = NULL;
multidisksrc->new_seek = FALSE; multifilesrc->new_seek = FALSE;
} }
static void static void
gst_multidisksrc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) gst_multifilesrc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{ {
GstMultiDiskSrc *src; GstMultiFileSrc *src;
/* it's not null if we got it, but it might not be ours */ /* it's not null if we got it, but it might not be ours */
g_return_if_fail (GST_IS_MULTIDISKSRC (object)); g_return_if_fail (GST_IS_MULTIFILESRC (object));
src = GST_MULTIDISKSRC (object); src = GST_MULTIFILESRC (object);
switch (prop_id) { switch (prop_id) {
case ARG_LOCATIONS: case ARG_LOCATIONS:
@ -157,14 +157,14 @@ gst_multidisksrc_set_property (GObject *object, guint prop_id, const GValue *val
} }
static void static void
gst_multidisksrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) gst_multifilesrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{ {
GstMultiDiskSrc *src; GstMultiFileSrc *src;
/* it's not null if we got it, but it might not be ours */ /* it's not null if we got it, but it might not be ours */
g_return_if_fail (GST_IS_MULTIDISKSRC (object)); g_return_if_fail (GST_IS_MULTIFILESRC (object));
src = GST_MULTIDISKSRC (object); src = GST_MULTIFILESRC (object);
switch (prop_id) { switch (prop_id) {
case ARG_LOCATIONS: case ARG_LOCATIONS:
@ -177,23 +177,23 @@ gst_multidisksrc_get_property (GObject *object, guint prop_id, GValue *value, GP
} }
/** /**
* gst_disksrc_get: * gst_filesrc_get:
* @pad: #GstPad to push a buffer from * @pad: #GstPad to push a buffer from
* *
* Push a new buffer from the disksrc at the current offset. * Push a new buffer from the filesrc at the current offset.
*/ */
static GstData * static GstData *
gst_multidisksrc_get (GstPad *pad) gst_multifilesrc_get (GstPad *pad)
{ {
GstMultiDiskSrc *src; GstMultiFileSrc *src;
GstBuffer *buf; GstBuffer *buf;
GSList *list; GSList *list;
g_return_val_if_fail (pad != NULL, NULL); g_return_val_if_fail (pad != NULL, NULL);
src = GST_MULTIDISKSRC (gst_pad_get_parent (pad)); src = GST_MULTIFILESRC (gst_pad_get_parent (pad));
if (GST_FLAG_IS_SET (src, GST_MULTIDISKSRC_OPEN)) if (GST_FLAG_IS_SET (src, GST_MULTIFILESRC_OPEN))
gst_multidisksrc_close_file(src); gst_multifilesrc_close_file(src);
if (!src->listptr) { if (!src->listptr) {
return GST_DATA (gst_event_new (GST_EVENT_EOS)); return GST_DATA (gst_event_new (GST_EVENT_EOS));
@ -203,11 +203,11 @@ gst_multidisksrc_get (GstPad *pad)
src->currentfilename = (gchar *) list->data; src->currentfilename = (gchar *) list->data;
src->listptr = src->listptr->next; src->listptr = src->listptr->next;
if (!gst_multidisksrc_open_file(src, pad)) if (!gst_multifilesrc_open_file(src, pad))
return NULL; return NULL;
/* emitted after the open, as the user may free the list and string from here*/ /* emitted after the open, as the user may free the list and string from here*/
g_signal_emit(G_OBJECT(src), gst_multidisksrc_signals[NEW_FILE], 0, list); g_signal_emit(G_OBJECT(src), gst_multifilesrc_signals[NEW_FILE], 0, list);
/* create the buffer */ /* create the buffer */
/* FIXME: should eventually use a bufferpool for this */ /* FIXME: should eventually use a bufferpool for this */
@ -232,9 +232,9 @@ gst_multidisksrc_get (GstPad *pad)
/* open the file and mmap it, necessary to go to READY state */ /* open the file and mmap it, necessary to go to READY state */
static static
gboolean gst_multidisksrc_open_file (GstMultiDiskSrc *src, GstPad *srcpad) gboolean gst_multifilesrc_open_file (GstMultiFileSrc *src, GstPad *srcpad)
{ {
g_return_val_if_fail (!GST_FLAG_IS_SET (src, GST_MULTIDISKSRC_OPEN), FALSE); g_return_val_if_fail (!GST_FLAG_IS_SET (src, GST_MULTIFILESRC_OPEN), FALSE);
/* open the file */ /* open the file */
src->fd = open ((const char *) src->currentfilename, O_RDONLY); src->fd = open ((const char *) src->currentfilename, O_RDONLY);
@ -259,7 +259,7 @@ gboolean gst_multidisksrc_open_file (GstMultiDiskSrc *src, GstPad *srcpad)
("mmap call failed.")); ("mmap call failed."));
return FALSE; return FALSE;
} }
GST_FLAG_SET (src, GST_MULTIDISKSRC_OPEN); GST_FLAG_SET (src, GST_MULTIFILESRC_OPEN);
src->new_seek = TRUE; src->new_seek = TRUE;
} }
return TRUE; return TRUE;
@ -267,9 +267,9 @@ gboolean gst_multidisksrc_open_file (GstMultiDiskSrc *src, GstPad *srcpad)
/* unmap and close the file */ /* unmap and close the file */
static void static void
gst_multidisksrc_close_file (GstMultiDiskSrc *src) gst_multifilesrc_close_file (GstMultiFileSrc *src)
{ {
g_return_if_fail (GST_FLAG_IS_SET (src, GST_MULTIDISKSRC_OPEN)); g_return_if_fail (GST_FLAG_IS_SET (src, GST_MULTIFILESRC_OPEN));
/* unmap the file from memory and close the file */ /* unmap the file from memory and close the file */
munmap (src->map, src->size); munmap (src->map, src->size);
@ -281,17 +281,17 @@ gst_multidisksrc_close_file (GstMultiDiskSrc *src)
src->map = NULL; src->map = NULL;
src->new_seek = FALSE; src->new_seek = FALSE;
GST_FLAG_UNSET (src, GST_MULTIDISKSRC_OPEN); GST_FLAG_UNSET (src, GST_MULTIFILESRC_OPEN);
} }
static GstElementStateReturn static GstElementStateReturn
gst_multidisksrc_change_state (GstElement *element) gst_multifilesrc_change_state (GstElement *element)
{ {
g_return_val_if_fail (GST_IS_MULTIDISKSRC (element), GST_STATE_FAILURE); g_return_val_if_fail (GST_IS_MULTIFILESRC (element), GST_STATE_FAILURE);
if (GST_STATE_PENDING (element) == GST_STATE_NULL) { if (GST_STATE_PENDING (element) == GST_STATE_NULL) {
if (GST_FLAG_IS_SET (element, GST_MULTIDISKSRC_OPEN)) if (GST_FLAG_IS_SET (element, GST_MULTIFILESRC_OPEN))
gst_multidisksrc_close_file (GST_MULTIDISKSRC (element)); gst_multifilesrc_close_file (GST_MULTIFILESRC (element));
} }
if (GST_ELEMENT_CLASS (parent_class)->change_state) if (GST_ELEMENT_CLASS (parent_class)->change_state)

View file

@ -3,7 +3,7 @@
* 2000 Wim Taymans <wtay@chello.be> * 2000 Wim Taymans <wtay@chello.be>
* 2001 Dominic Ludlam <dom@recoil.org> * 2001 Dominic Ludlam <dom@recoil.org>
* *
* gstmultidisksrc.h: * gstmultifilesrc.h:
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -21,35 +21,35 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#ifndef __GST_MULTIDISKSRC_H__ #ifndef __GST_MULTIFILESRC_H__
#define __GST_MULTIDISKSRC_H__ #define __GST_MULTIFILESRC_H__
#include <gst/gst.h> #include <gst/gst.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_MULTIDISKSRC \ #define GST_TYPE_MULTIFILESRC \
(gst_multidisksrc_get_type()) (gst_multifilesrc_get_type())
#define GST_MULTIDISKSRC(obj) \ #define GST_MULTIFILESRC(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MULTIDISKSRC,GstMultiDiskSrc)) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MULTIFILESRC,GstMultiFileSrc))
#define GST_MULTIDISKSRC_CLASS(klass) \ #define GST_MULTIFILESRC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MULTIDISKSRC,GstMultiDiskSrcClass)) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MULTIFILESRC,GstMultiFileSrcClass))
#define GST_IS_MULTIDISKSRC(obj) \ #define GST_IS_MULTIFILESRC(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MULTIDISKSRC)) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MULTIFILESRC))
#define GST_IS_MULTIDISKSRC_CLASS(obj) \ #define GST_IS_MULTIFILESRC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MULTIDISKSRC)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MULTIFILESRC))
typedef enum { typedef enum {
GST_MULTIDISKSRC_OPEN = GST_ELEMENT_FLAG_LAST, GST_MULTIFILESRC_OPEN = GST_ELEMENT_FLAG_LAST,
GST_MULTIDISKSRC_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2 GST_MULTIFILESRC_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2
} GstMultiDiskSrcFlags; } GstMultiFileSrcFlags;
typedef struct _GstMultiDiskSrc GstMultiDiskSrc; typedef struct _GstMultiFileSrc GstMultiFileSrc;
typedef struct _GstMultiDiskSrcClass GstMultiDiskSrcClass; typedef struct _GstMultiFileSrcClass GstMultiFileSrcClass;
struct _GstMultiDiskSrc { struct _GstMultiFileSrc {
GstElement element; GstElement element;
/* pads */ /* pads */
GstPad *srcpad; GstPad *srcpad;
@ -66,14 +66,14 @@ struct _GstMultiDiskSrc {
gboolean new_seek; gboolean new_seek;
}; };
struct _GstMultiDiskSrcClass { struct _GstMultiFileSrcClass {
GstElementClass parent_class; GstElementClass parent_class;
void (*new_file) (GstMultiDiskSrc *multidisksrc, gchar *newfilename); void (*new_file) (GstMultiFileSrc *multifilesrc, gchar *newfilename);
}; };
GType gst_multidisksrc_get_type(void); GType gst_multifilesrc_get_type(void);
G_END_DECLS G_END_DECLS
#endif /* __GST_MULTIDISKSRC_H__ */ #endif /* __GST_MULTIFILESRC_H__ */

View file

@ -21,7 +21,7 @@ libgstelements_la_SOURCES = \
gstfdsrc.c \ gstfdsrc.c \
gstidentity.c \ gstidentity.c \
gstmd5sink.c \ gstmd5sink.c \
gstmultidisksrc.c \ gstmultifilesrc.c \
gstpipefilter.c \ gstpipefilter.c \
gstshaper.c \ gstshaper.c \
gststatistics.c \ gststatistics.c \
@ -43,7 +43,7 @@ noinst_HEADERS = \
gstfilesrc.h \ gstfilesrc.h \
gstidentity.h \ gstidentity.h \
gstmd5sink.h \ gstmd5sink.h \
gstmultidisksrc.h \ gstmultifilesrc.h \
gstpipefilter.h \ gstpipefilter.h \
gstshaper.h \ gstshaper.h \
gststatistics.h \ gststatistics.h \

View file

@ -36,7 +36,7 @@
#include "gstfilesrc.h" #include "gstfilesrc.h"
#include "gstidentity.h" #include "gstidentity.h"
#include "gstmd5sink.h" #include "gstmd5sink.h"
#include "gstmultidisksrc.h" #include "gstmultifilesrc.h"
#include "gstpipefilter.h" #include "gstpipefilter.h"
#include "gstshaper.h" #include "gstshaper.h"
#include "gststatistics.h" #include "gststatistics.h"
@ -64,7 +64,7 @@ static struct _elements_entry _elements[] = {
{ "filesink", GST_RANK_NONE, gst_filesink_get_type }, { "filesink", GST_RANK_NONE, gst_filesink_get_type },
{ "identity", GST_RANK_NONE, gst_identity_get_type }, { "identity", GST_RANK_NONE, gst_identity_get_type },
{ "md5sink", GST_RANK_NONE, gst_md5sink_get_type }, { "md5sink", GST_RANK_NONE, gst_md5sink_get_type },
{ "multidisksrc", GST_RANK_NONE, gst_multidisksrc_get_type }, { "multifilesrc", GST_RANK_NONE, gst_multifilesrc_get_type },
{ "pipefilter", GST_RANK_NONE, gst_pipefilter_get_type }, { "pipefilter", GST_RANK_NONE, gst_pipefilter_get_type },
{ "shaper", GST_RANK_NONE, gst_shaper_get_type }, { "shaper", GST_RANK_NONE, gst_shaper_get_type },
{ "statistics", GST_RANK_NONE, gst_statistics_get_type }, { "statistics", GST_RANK_NONE, gst_statistics_get_type },

View file

@ -3,7 +3,7 @@
* 2000 Wim Taymans <wtay@chello.be> * 2000 Wim Taymans <wtay@chello.be>
* 2001 Dominic Ludlam <dom@recoil.org> * 2001 Dominic Ludlam <dom@recoil.org>
* *
* gstmultidisksrc.c: * gstmultifilesrc.c:
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -35,19 +35,19 @@
#include "../gst-i18n-lib.h" #include "../gst-i18n-lib.h"
#include "gstmultidisksrc.h" #include "gstmultifilesrc.h"
GST_DEBUG_CATEGORY_STATIC (gst_multidisksrc_debug); GST_DEBUG_CATEGORY_STATIC (gst_multifilesrc_debug);
#define GST_CAT_DEFAULT gst_multidisksrc_debug #define GST_CAT_DEFAULT gst_multifilesrc_debug
GstElementDetails gst_multidisksrc_details = GST_ELEMENT_DETAILS ( GstElementDetails gst_multifilesrc_details = GST_ELEMENT_DETAILS (
"Multi Disk Source", "Multi File Source",
"Source/File", "Source/File",
"Read from multiple files in order", "Read from multiple files in order",
"Dominic Ludlam <dom@openfx.org>" "Dominic Ludlam <dom@openfx.org>"
); );
/* DiskSrc signals and args */ /* FileSrc signals and args */
enum { enum {
NEW_FILE, NEW_FILE,
LAST_SIGNAL LAST_SIGNAL
@ -59,32 +59,32 @@ enum {
}; };
#define _do_init(bla) \ #define _do_init(bla) \
GST_DEBUG_CATEGORY_INIT (gst_multidisksrc_debug, "multidisksrc", 0, "multidisksrc element"); GST_DEBUG_CATEGORY_INIT (gst_multifilesrc_debug, "multifilesrc", 0, "multifilesrc element");
GST_BOILERPLATE_FULL (GstMultiDiskSrc, gst_multidisksrc, GstElement, GST_TYPE_ELEMENT, _do_init); GST_BOILERPLATE_FULL (GstMultiFileSrc, gst_multifilesrc, GstElement, GST_TYPE_ELEMENT, _do_init);
static void gst_multidisksrc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void gst_multifilesrc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_multidisksrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); static void gst_multifilesrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static GstData * gst_multidisksrc_get (GstPad *pad); static GstData * gst_multifilesrc_get (GstPad *pad);
/*static GstBuffer * gst_multidisksrc_get_region (GstPad *pad,GstRegionType type,guint64 offset,guint64 len);*/ /*static GstBuffer * gst_multifilesrc_get_region (GstPad *pad,GstRegionType type,guint64 offset,guint64 len);*/
static GstElementStateReturn gst_multidisksrc_change_state (GstElement *element); static GstElementStateReturn gst_multifilesrc_change_state (GstElement *element);
static gboolean gst_multidisksrc_open_file (GstMultiDiskSrc *src, GstPad *srcpad); static gboolean gst_multifilesrc_open_file (GstMultiFileSrc *src, GstPad *srcpad);
static void gst_multidisksrc_close_file (GstMultiDiskSrc *src); static void gst_multifilesrc_close_file (GstMultiFileSrc *src);
static guint gst_multidisksrc_signals[LAST_SIGNAL] = { 0 }; static guint gst_multifilesrc_signals[LAST_SIGNAL] = { 0 };
static void static void
gst_multidisksrc_base_init (gpointer g_class) gst_multifilesrc_base_init (gpointer g_class)
{ {
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class); GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_multidisksrc_details); gst_element_class_set_details (gstelement_class, &gst_multifilesrc_details);
} }
static void static void
gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass) gst_multifilesrc_class_init (GstMultiFileSrcClass *klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
GstElementClass *gstelement_class; GstElementClass *gstelement_class;
@ -93,9 +93,9 @@ gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass)
gstelement_class = (GstElementClass*)klass; gstelement_class = (GstElementClass*)klass;
gst_multidisksrc_signals[NEW_FILE] = gst_multifilesrc_signals[NEW_FILE] =
g_signal_new ("new_file", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, g_signal_new ("new_file", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstMultiDiskSrcClass, new_file), NULL, NULL, G_STRUCT_OFFSET (GstMultiFileSrcClass, new_file), NULL, NULL,
g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
G_TYPE_POINTER); G_TYPE_POINTER);
@ -103,39 +103,39 @@ gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass)
g_param_spec_pointer("locations","locations","locations", g_param_spec_pointer("locations","locations","locations",
G_PARAM_READWRITE)); /* CHECKME */ G_PARAM_READWRITE)); /* CHECKME */
gobject_class->set_property = gst_multidisksrc_set_property; gobject_class->set_property = gst_multifilesrc_set_property;
gobject_class->get_property = gst_multidisksrc_get_property; gobject_class->get_property = gst_multifilesrc_get_property;
gstelement_class->change_state = gst_multidisksrc_change_state; gstelement_class->change_state = gst_multifilesrc_change_state;
} }
static void static void
gst_multidisksrc_init (GstMultiDiskSrc *multidisksrc) gst_multifilesrc_init (GstMultiFileSrc *multifilesrc)
{ {
/* GST_FLAG_SET (disksrc, GST_SRC_); */ /* GST_FLAG_SET (filesrc, GST_SRC_); */
multidisksrc->srcpad = gst_pad_new ("src", GST_PAD_SRC); multifilesrc->srcpad = gst_pad_new ("src", GST_PAD_SRC);
gst_pad_set_get_function (multidisksrc->srcpad,gst_multidisksrc_get); gst_pad_set_get_function (multifilesrc->srcpad,gst_multifilesrc_get);
/* gst_pad_set_getregion_function (multidisksrc->srcpad,gst_multidisksrc_get_region); */ /* gst_pad_set_getregion_function (multifilesrc->srcpad,gst_multifilesrc_get_region); */
gst_element_add_pad (GST_ELEMENT (multidisksrc), multidisksrc->srcpad); gst_element_add_pad (GST_ELEMENT (multifilesrc), multifilesrc->srcpad);
multidisksrc->listptr = NULL; multifilesrc->listptr = NULL;
multidisksrc->currentfilename = NULL; multifilesrc->currentfilename = NULL;
multidisksrc->fd = 0; multifilesrc->fd = 0;
multidisksrc->size = 0; multifilesrc->size = 0;
multidisksrc->map = NULL; multifilesrc->map = NULL;
multidisksrc->new_seek = FALSE; multifilesrc->new_seek = FALSE;
} }
static void static void
gst_multidisksrc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) gst_multifilesrc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{ {
GstMultiDiskSrc *src; GstMultiFileSrc *src;
/* it's not null if we got it, but it might not be ours */ /* it's not null if we got it, but it might not be ours */
g_return_if_fail (GST_IS_MULTIDISKSRC (object)); g_return_if_fail (GST_IS_MULTIFILESRC (object));
src = GST_MULTIDISKSRC (object); src = GST_MULTIFILESRC (object);
switch (prop_id) { switch (prop_id) {
case ARG_LOCATIONS: case ARG_LOCATIONS:
@ -157,14 +157,14 @@ gst_multidisksrc_set_property (GObject *object, guint prop_id, const GValue *val
} }
static void static void
gst_multidisksrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) gst_multifilesrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{ {
GstMultiDiskSrc *src; GstMultiFileSrc *src;
/* it's not null if we got it, but it might not be ours */ /* it's not null if we got it, but it might not be ours */
g_return_if_fail (GST_IS_MULTIDISKSRC (object)); g_return_if_fail (GST_IS_MULTIFILESRC (object));
src = GST_MULTIDISKSRC (object); src = GST_MULTIFILESRC (object);
switch (prop_id) { switch (prop_id) {
case ARG_LOCATIONS: case ARG_LOCATIONS:
@ -177,23 +177,23 @@ gst_multidisksrc_get_property (GObject *object, guint prop_id, GValue *value, GP
} }
/** /**
* gst_disksrc_get: * gst_filesrc_get:
* @pad: #GstPad to push a buffer from * @pad: #GstPad to push a buffer from
* *
* Push a new buffer from the disksrc at the current offset. * Push a new buffer from the filesrc at the current offset.
*/ */
static GstData * static GstData *
gst_multidisksrc_get (GstPad *pad) gst_multifilesrc_get (GstPad *pad)
{ {
GstMultiDiskSrc *src; GstMultiFileSrc *src;
GstBuffer *buf; GstBuffer *buf;
GSList *list; GSList *list;
g_return_val_if_fail (pad != NULL, NULL); g_return_val_if_fail (pad != NULL, NULL);
src = GST_MULTIDISKSRC (gst_pad_get_parent (pad)); src = GST_MULTIFILESRC (gst_pad_get_parent (pad));
if (GST_FLAG_IS_SET (src, GST_MULTIDISKSRC_OPEN)) if (GST_FLAG_IS_SET (src, GST_MULTIFILESRC_OPEN))
gst_multidisksrc_close_file(src); gst_multifilesrc_close_file(src);
if (!src->listptr) { if (!src->listptr) {
return GST_DATA (gst_event_new (GST_EVENT_EOS)); return GST_DATA (gst_event_new (GST_EVENT_EOS));
@ -203,11 +203,11 @@ gst_multidisksrc_get (GstPad *pad)
src->currentfilename = (gchar *) list->data; src->currentfilename = (gchar *) list->data;
src->listptr = src->listptr->next; src->listptr = src->listptr->next;
if (!gst_multidisksrc_open_file(src, pad)) if (!gst_multifilesrc_open_file(src, pad))
return NULL; return NULL;
/* emitted after the open, as the user may free the list and string from here*/ /* emitted after the open, as the user may free the list and string from here*/
g_signal_emit(G_OBJECT(src), gst_multidisksrc_signals[NEW_FILE], 0, list); g_signal_emit(G_OBJECT(src), gst_multifilesrc_signals[NEW_FILE], 0, list);
/* create the buffer */ /* create the buffer */
/* FIXME: should eventually use a bufferpool for this */ /* FIXME: should eventually use a bufferpool for this */
@ -232,9 +232,9 @@ gst_multidisksrc_get (GstPad *pad)
/* open the file and mmap it, necessary to go to READY state */ /* open the file and mmap it, necessary to go to READY state */
static static
gboolean gst_multidisksrc_open_file (GstMultiDiskSrc *src, GstPad *srcpad) gboolean gst_multifilesrc_open_file (GstMultiFileSrc *src, GstPad *srcpad)
{ {
g_return_val_if_fail (!GST_FLAG_IS_SET (src, GST_MULTIDISKSRC_OPEN), FALSE); g_return_val_if_fail (!GST_FLAG_IS_SET (src, GST_MULTIFILESRC_OPEN), FALSE);
/* open the file */ /* open the file */
src->fd = open ((const char *) src->currentfilename, O_RDONLY); src->fd = open ((const char *) src->currentfilename, O_RDONLY);
@ -259,7 +259,7 @@ gboolean gst_multidisksrc_open_file (GstMultiDiskSrc *src, GstPad *srcpad)
("mmap call failed.")); ("mmap call failed."));
return FALSE; return FALSE;
} }
GST_FLAG_SET (src, GST_MULTIDISKSRC_OPEN); GST_FLAG_SET (src, GST_MULTIFILESRC_OPEN);
src->new_seek = TRUE; src->new_seek = TRUE;
} }
return TRUE; return TRUE;
@ -267,9 +267,9 @@ gboolean gst_multidisksrc_open_file (GstMultiDiskSrc *src, GstPad *srcpad)
/* unmap and close the file */ /* unmap and close the file */
static void static void
gst_multidisksrc_close_file (GstMultiDiskSrc *src) gst_multifilesrc_close_file (GstMultiFileSrc *src)
{ {
g_return_if_fail (GST_FLAG_IS_SET (src, GST_MULTIDISKSRC_OPEN)); g_return_if_fail (GST_FLAG_IS_SET (src, GST_MULTIFILESRC_OPEN));
/* unmap the file from memory and close the file */ /* unmap the file from memory and close the file */
munmap (src->map, src->size); munmap (src->map, src->size);
@ -281,17 +281,17 @@ gst_multidisksrc_close_file (GstMultiDiskSrc *src)
src->map = NULL; src->map = NULL;
src->new_seek = FALSE; src->new_seek = FALSE;
GST_FLAG_UNSET (src, GST_MULTIDISKSRC_OPEN); GST_FLAG_UNSET (src, GST_MULTIFILESRC_OPEN);
} }
static GstElementStateReturn static GstElementStateReturn
gst_multidisksrc_change_state (GstElement *element) gst_multifilesrc_change_state (GstElement *element)
{ {
g_return_val_if_fail (GST_IS_MULTIDISKSRC (element), GST_STATE_FAILURE); g_return_val_if_fail (GST_IS_MULTIFILESRC (element), GST_STATE_FAILURE);
if (GST_STATE_PENDING (element) == GST_STATE_NULL) { if (GST_STATE_PENDING (element) == GST_STATE_NULL) {
if (GST_FLAG_IS_SET (element, GST_MULTIDISKSRC_OPEN)) if (GST_FLAG_IS_SET (element, GST_MULTIFILESRC_OPEN))
gst_multidisksrc_close_file (GST_MULTIDISKSRC (element)); gst_multifilesrc_close_file (GST_MULTIFILESRC (element));
} }
if (GST_ELEMENT_CLASS (parent_class)->change_state) if (GST_ELEMENT_CLASS (parent_class)->change_state)

View file

@ -3,7 +3,7 @@
* 2000 Wim Taymans <wtay@chello.be> * 2000 Wim Taymans <wtay@chello.be>
* 2001 Dominic Ludlam <dom@recoil.org> * 2001 Dominic Ludlam <dom@recoil.org>
* *
* gstmultidisksrc.h: * gstmultifilesrc.h:
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -21,35 +21,35 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#ifndef __GST_MULTIDISKSRC_H__ #ifndef __GST_MULTIFILESRC_H__
#define __GST_MULTIDISKSRC_H__ #define __GST_MULTIFILESRC_H__
#include <gst/gst.h> #include <gst/gst.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_MULTIDISKSRC \ #define GST_TYPE_MULTIFILESRC \
(gst_multidisksrc_get_type()) (gst_multifilesrc_get_type())
#define GST_MULTIDISKSRC(obj) \ #define GST_MULTIFILESRC(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MULTIDISKSRC,GstMultiDiskSrc)) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MULTIFILESRC,GstMultiFileSrc))
#define GST_MULTIDISKSRC_CLASS(klass) \ #define GST_MULTIFILESRC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MULTIDISKSRC,GstMultiDiskSrcClass)) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MULTIFILESRC,GstMultiFileSrcClass))
#define GST_IS_MULTIDISKSRC(obj) \ #define GST_IS_MULTIFILESRC(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MULTIDISKSRC)) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MULTIFILESRC))
#define GST_IS_MULTIDISKSRC_CLASS(obj) \ #define GST_IS_MULTIFILESRC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MULTIDISKSRC)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MULTIFILESRC))
typedef enum { typedef enum {
GST_MULTIDISKSRC_OPEN = GST_ELEMENT_FLAG_LAST, GST_MULTIFILESRC_OPEN = GST_ELEMENT_FLAG_LAST,
GST_MULTIDISKSRC_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2 GST_MULTIFILESRC_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2
} GstMultiDiskSrcFlags; } GstMultiFileSrcFlags;
typedef struct _GstMultiDiskSrc GstMultiDiskSrc; typedef struct _GstMultiFileSrc GstMultiFileSrc;
typedef struct _GstMultiDiskSrcClass GstMultiDiskSrcClass; typedef struct _GstMultiFileSrcClass GstMultiFileSrcClass;
struct _GstMultiDiskSrc { struct _GstMultiFileSrc {
GstElement element; GstElement element;
/* pads */ /* pads */
GstPad *srcpad; GstPad *srcpad;
@ -66,14 +66,14 @@ struct _GstMultiDiskSrc {
gboolean new_seek; gboolean new_seek;
}; };
struct _GstMultiDiskSrcClass { struct _GstMultiFileSrcClass {
GstElementClass parent_class; GstElementClass parent_class;
void (*new_file) (GstMultiDiskSrc *multidisksrc, gchar *newfilename); void (*new_file) (GstMultiFileSrc *multifilesrc, gchar *newfilename);
}; };
GType gst_multidisksrc_get_type(void); GType gst_multifilesrc_get_type(void);
G_END_DECLS G_END_DECLS
#endif /* __GST_MULTIDISKSRC_H__ */ #endif /* __GST_MULTIFILESRC_H__ */