Commit 112b1959 authored by Benjamin Otte's avatar Benjamin Otte

merge TYPEFIND branch. Major changes:

Original commit message from CVS:
merge TYPEFIND branch. Major changes:
- totally reworked type(find) system
- all typefind functions are in gst/typefind now
- more typefind functions then before
- some plugins might fail to compile now because I don't have them installed and they
a) require bytestream or
b) haven't had their typefind fixed.
Please fix those plugins and put the typefind functions into gst/typefind if they don't have dependencies
parent b24e75aa
......@@ -264,10 +264,10 @@ GST_PLUGINS_ALL="\
cutter debug deinterlace effectv festival \
filter flx goom id3 intfloat law level median mixmatrix \
mpeg1sys mpeg1videoparse mpeg2enc mpeg2sub \
mpegaudio mpegaudioparse mpegstream mpegtypes \
mpegaudio mpegaudioparse mpegstream \
monoscope oneton overlay passthrough playondemand qtdemux \
realmedia rtp rtjpeg silence sine smooth smpte \
spectrum speed stereo synaesthesia tcp udp vbidec \
spectrum speed stereo synaesthesia tcp typefind udp vbidec \
videocrop videodrop videofilter videoflip videoscale \
videotestsrc volenv volume wavenc wavparse y4m"
......@@ -1193,7 +1193,6 @@ gst/mpeg2sub/Makefile
gst/mpegaudio/Makefile
gst/mpegaudioparse/Makefile
gst/mpegstream/Makefile
gst/mpegtypes/Makefile
gst/modplug/Makefile
gst/modplug/libmodplug/Makefile
gst/monoscope/Makefile
......@@ -1214,6 +1213,7 @@ gst/speed/Makefile
gst/stereo/Makefile
gst/synaesthesia/Makefile
gst/tcp/Makefile
gst/typefind/Makefile
gst/udp/Makefile
gst/vbidec/Makefile
gst/videocrop/Makefile
......
......@@ -25,8 +25,6 @@ extern GType vorbisfile_get_type(void);
extern GstElementDetails vorbisfile_details;
extern GstElementDetails vorbisenc_details;
static GstCaps* vorbis_type_find (GstByteStream *bs, gpointer private);
GstPadTemplate *gst_vorbisdec_src_template, *gst_vorbisdec_sink_template;
GstPadTemplate *gst_vorbisenc_src_template, *gst_vorbisenc_sink_template;
......@@ -73,44 +71,15 @@ raw_caps2_factory (void)
NULL));
}
static GstTypeDefinition vorbisdefinition = {
"vorbis_audio/x-ogg",
"application/ogg",
".ogg",
vorbis_type_find,
};
static GstCaps*
vorbis_type_find (GstByteStream *bs, gpointer private)
{
GstBuffer *buf = NULL;
GstCaps *new = NULL;
if (gst_bytestream_peek (bs, &buf, 4) == 4) {
guint32 head = GUINT32_FROM_BE (*((guint32 *) GST_BUFFER_DATA (buf)));
if (head == 0x4F676753) {
new = GST_CAPS_NEW ("vorbis_type_find",
"application/ogg",
NULL);
}
}
if (buf != NULL) {
gst_buffer_unref (buf);
}
return new;
}
static gboolean
plugin_init (GModule *module, GstPlugin *plugin)
{
GstElementFactory *enc, *file;
GstTypeFactory *type;
GstCaps *raw_caps, *vorbis_caps, *raw_caps2;
if (!gst_library_load ("gstbytestream"))
return FALSE;
gst_plugin_set_longname (plugin, "The OGG Vorbis Codec");
/* create an elementfactory for the vorbisenc element */
......@@ -158,9 +127,6 @@ plugin_init (GModule *module, GstPlugin *plugin)
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (file));
type = gst_type_factory_new (&vorbisdefinition);
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (type));
return TRUE;
}
......
......@@ -24,7 +24,10 @@
#include <gst/gst.h>
#include <vorbis/codec.h>
#include <vorbis/vorbisfile.h>
#include <gst/gstbytestream.h>
#include <gst/bytestream.h>
GST_DEBUG_CATEGORY_STATIC (vorbisfile_debug);
#define GST_CAT_DEFAULT vorbisfile_debug
#define GST_TYPE_VORBISFILE \
(vorbisfile_get_type())
......@@ -168,6 +171,8 @@ vorbisfile_get_type (void)
&vorbisfile_info, 0);
logical_stream_format = gst_format_register ("logical_stream", "The logical stream");
GST_DEBUG_CATEGORY_INIT (vorbisfile_debug, "vorbisfile", 0, "vorbis in ogg decoding element");
}
return vorbisfile_type;
}
......@@ -229,6 +234,8 @@ gst_vorbisfile_init (VorbisFile * vorbisfile)
vorbisfile->streaminfo = NULL;
vorbisfile->current_link = -1;
vorbisfile->blocksize = DEFAULT_BLOCKSIZE;
GST_FLAG_SET (vorbisfile, GST_ELEMENT_EVENT_AWARE);
}
/* the next four functions are the ov callbacks we provide to vorbisfile
......
D2003.10.26.10.00.00
2003-10-26 10:00 GMT
......@@ -603,6 +603,9 @@ plugin_init (GModule *module, GstPlugin *plugin)
{
GstElementFactory *factory;
if (!gst_library_load ("gstbytestream"))
return FALSE;
factory = gst_element_factory_new ("adder", GST_TYPE_ADDER, &adder_details);
g_return_val_if_fail (factory != NULL, FALSE);
......
......@@ -24,7 +24,7 @@
#define __GST_ADDER_H__
#include <gst/gst.h>
#include <gst/gstbytestream.h>
#include <gst/bytestream.h>
#ifdef __cplusplus
extern "C" {
......
plugin_LTLIBRARIES = libgsttypefindfunctions.la
libgsttypefindfunctions_la_SOURCES = gsttypefindfunctions.c
libgsttypefindfunctions_la_CFLAGS = $(GST_CFLAGS)
libgsttypefindfunctions_la_LIBADD =
libgsttypefindfunctions_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment