plugindir = $(libdir)/gst
-plugin_LTLIBRARIES = libgstafsink.la libgstafsrc.la
+plugin_LTLIBRARIES = libgstaf.la
-libgstafsink_la_SOURCES = gstafsink.c
-libgstafsink_la_CFLAGS = $(GST_CFLAGS) $(AUDIOFILE_CFLAGS)
-libgstafsink_la_LIBADD = $(AUDIOFILE_LIBS)
-libgstafsink_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
+libgstaf_la_SOURCES = gstaf.c gstafsink.c gstafsrc.c gstafparse.c
+libgstaf_la_CFLAGS = $(GST_CFLAGS) $(AUDIOFILE_CFLAGS)
+libgstaf_la_LIBADD = $(AUDIOFILE_LIBS)
+libgstaf_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
-libgstafsrc_la_SOURCES = gstafsrc.c
-libgstafsrc_la_CFLAGS = $(GST_CFLAGS) $(AUDIOFILE_CFLAGS)
-libgstafsrc_la_LIBADD = $(AUDIOFILE_LIBS)
-libgstafsrc_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
-
-noinst_HEADERS = gstafsink.h gstafsrc.h
+noinst_HEADERS = gstafsink.h gstafsrc.h
--- /dev/null
+/* GStreamer
+ * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * 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.
+ */
+
+
+#include "gstafsrc.h"
+#include "gstafsink.h"
+#include "gstafparse.h"
+
+static gboolean
+plugin_init (GModule *module, GstPlugin *plugin)
+{
+ gst_afsink_plugin_init (module, plugin);
+ gst_afsrc_plugin_init (module, plugin);
+ gst_afparse_plugin_init (module, plugin);
+
+ return TRUE;
+}
+
+GstPluginDesc plugin_desc = {
+ GST_VERSION_MAJOR,
+ GST_VERSION_MINOR,
+ "gstaf",
+ plugin_init
+};
GstAFParse *afparse;
GstBuffer *buf;
GstBufferPool *bufpool;
- gint numframes, frames_to_bytes, frames_per_read, bytes_per_read;
+ gint numframes = 0, frames_to_bytes, frames_per_read, bytes_per_read;
guint8 *data;
gboolean bypass_afread = TRUE;
GstByteStream *bs;
}
}
-static gboolean
-plugin_init (GModule *module, GstPlugin *plugin)
+gboolean
+gst_afparse_plugin_init (GModule *module, GstPlugin *plugin)
{
GstElementFactory *factory;
return TRUE;
}
-
-GstPluginDesc plugin_desc = {
- GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- "afparse",
- plugin_init
-};
-
/* this is where we open the audiofile */
static gboolean
gst_afparse_open_file (GstAFParse *afparse)
gst_afparse_vf_seek (AFvirtualfile *vfile, long offset, int is_relative)
{
GstByteStream *bs = (GstByteStream*)vfile->closure;
- GstSeekType type;
+ GstSeekType method;
guint64 current_offset = gst_bytestream_tell(bs);
if (!is_relative){
return offset;
}
- type = GST_SEEK_BYTEOFFSET_SET;
+ method = GST_SEEK_METHOD_SET;
}
else {
if (offset == 0) return current_offset;
- type = GST_SEEK_BYTEOFFSET_CUR;
+ method = GST_SEEK_METHOD_CUR;
}
-
- g_print("doing seek to %d, current offset %lld\n", (gint)offset, current_offset);
- if (gst_bytestream_seek(bs, type, (gint64)offset)){
-
+
+ if (gst_bytestream_seek(bs, (gint64)offset, method)){
+ g_print("doing seek to %d\n", (gint)offset);
return offset;
}
return 0;
void (*handoff) (GstElement *element,GstPad *pad);
};
+gboolean gst_afparse_plugin_init (GModule *module, GstPlugin *plugin);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
}
}
-static gboolean
-plugin_init (GModule *module, GstPlugin *plugin)
+gboolean
+gst_afsink_plugin_init (GModule *module, GstPlugin *plugin)
{
GstElementFactory *factory;
return TRUE;
}
-
-GstPluginDesc plugin_desc = {
- GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- "afsink",
- plugin_init
-};
-
/* this is where we open the audiofile */
static gboolean
gst_afsink_open_file (GstAFSink *sink)
typedef struct _GstAFSinkClass GstAFSinkClass;
typedef enum {
- GST_AFSINK_OPEN = GST_ELEMENT_FLAG_LAST,
+ GST_AFSINK_OPEN = GST_ELEMENT_FLAG_LAST,
GST_AFSINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2,
} GstAFSinkFlags;
void (*handoff) (GstElement *element,GstPad *pad);
};
-GType gst_afsink_get_type(void);
-/*gboolean gst_afsink_factory_init (GstElementFactory *factory); */
+GType gst_afsink_get_type (void);
+gboolean gst_afsink_plugin_init (GModule *module, GstPlugin *plugin);
+
#ifdef __cplusplus
}
}
-static gboolean
-plugin_init (GModule *module, GstPlugin *plugin)
+gboolean
+gst_afsrc_plugin_init (GModule *module, GstPlugin *plugin)
{
GstElementFactory *factory;
}
-GstPluginDesc plugin_desc = {
- GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- "afsrc",
- plugin_init
-};
-
/* this is where we open the audiofile */
static gboolean
gst_afsrc_open_file (GstAFSrc *src)
void (*handoff) (GstElement *element,GstPad *pad);
};
-GType gst_afsrc_get_type(void);
-/*gboolean gst_afsrc_factory_init (GstElementFactory *factory);*/
+GType gst_afsrc_get_type (void);
+gboolean gst_afsrc_plugin_init (GModule *module, GstPlugin *plugin);
+
+
#ifdef __cplusplus
GST_ELEMENT (sdlvideosink)->setclockfunc = gst_sdlvideosink_set_clock;
GST_FLAG_SET(sdlvideosink, GST_ELEMENT_THREAD_SUGGESTED);
+ GST_FLAG_SET(sdlvideosink, GST_ELEMENT_EVENT_AWARE);
}
gst_sdlvideosink_chain (GstPad *pad, GstBuffer *buf)
{
GstSDLVideoSink *sdlvideosink;
- SDL_Event event;
+ SDL_Event sdl_event;
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_PAD (pad));
sdlvideosink = GST_SDLVIDEOSINK (gst_pad_get_parent (pad));
- GST_DEBUG (0,"videosink: clock wait: %llu", GST_BUFFER_TIMESTAMP(buf));
- while (SDL_PollEvent(&event))
+ while (SDL_PollEvent(&sdl_event))
{
- switch(event.type)
+ switch(sdl_event.type)
{
case SDL_VIDEORESIZE:
/* create a SDL window of the size requested by the user */
- sdlvideosink->window_width = event.resize.w;
- sdlvideosink->window_height = event.resize.h;
+ sdlvideosink->window_width = sdl_event.resize.w;
+ sdlvideosink->window_height = sdl_event.resize.h;
gst_sdlvideosink_create(sdlvideosink, FALSE);
break;
}
}
+ if (GST_IS_EVENT (buf)) {
+ GstEvent *event = GST_EVENT (buf);
+ gint64 offset;
+
+ switch (GST_EVENT_TYPE (event)) {
+ case GST_EVENT_DISCONTINUOUS:
+ offset = GST_EVENT_DISCONT_OFFSET (event, 0).value;
+ g_print ("sdl discont %lld\n", offset);
+ gst_clock_handle_discont (sdlvideosink->clock, (guint64) GST_EVENT_DISCONT_OFFSET (event, 0).value);
+ break;
+ default:
+ gst_pad_event_default (pad, event);
+ break;
+ }
+ gst_event_free (event);
+ return;
+ }
+
+ GST_DEBUG (0,"videosink: clock wait: %llu", GST_BUFFER_TIMESTAMP(buf));
if (sdlvideosink->clock) {
gst_element_clock_wait (GST_ELEMENT (sdlvideosink),
- sdlvideosink->clock, GST_BUFFER_TIMESTAMP (buf));
+ sdlvideosink->clock, GST_BUFFER_TIMESTAMP (buf), NULL);
}
if (!gst_sdlvideosink_lock(sdlvideosink))