From: Ronald B. <rb...@us...> - 2002-10-27 18:08:59
|
CVS Root: /cvsroot/gstreamer Module: gst-plugins Changes by: rbultje Date: Sun Oct 27 2002 10:08:56 PST Log message: Add ogg/vorbis support for avi files Modified files: gst-libs/gst/riff: riff.h gst/avi : gstavidemux.c gstavimux.c Links: http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst-libs/gst/riff/riff.h.diff?r1=1.2&r2=1.3 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/avi/gstavidemux.c.diff?r1=1.46&r2=1.47 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/avi/gstavimux.c.diff?r1=1.24&r2=1.25 ====Begin Diffs==== Index: gstavidemux.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/gst/avi/gstavidemux.c,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- gstavidemux.c 10 Oct 2002 22:14:54 -0000 1.46 +++ gstavidemux.c 27 Oct 2002 18:08:43 -0000 1.47 @@ -146,6 +146,11 @@ "avidemux_src_audio", "audio/mp3", NULL + ), + GST_CAPS_NEW ( + "avidemux_src_audio", + "application/x-ogg", + NULL ) ) @@ -511,13 +516,13 @@ /* let's try some gstreamer-formatted mime types */ switch (GUINT16_FROM_LE(strf->format)) { - case 0x0050: - case 0x0055: /* mp3 */ + case GST_RIFF_WAVE_FORMAT_MPEGL3: + case GST_RIFF_WAVE_FORMAT_MPEGL12: /* mp3 */ newcaps = gst_caps_new ("avidemux_audio_src", "audio/mp3", NULL); break; - case 0x0001: /* PCM/wav */ + case GST_RIFF_WAVE_FORMAT_PCM: /* PCM/wav */ newcaps = gst_caps_new ("avidemux_audio_src", "audio/raw", gst_props_new ( @@ -532,6 +537,16 @@ "channels", GST_PROPS_INT (GUINT16_FROM_LE (strf->channels)), NULL )); + break; + case GST_RIFF_WAVE_FORMAT_VORBIS1: /* ogg/vorbis mode 1 */ + case GST_RIFF_WAVE_FORMAT_VORBIS2: /* ogg/vorbis mode 2 */ + case GST_RIFF_WAVE_FORMAT_VORBIS3: /* ogg/vorbis mode 3 */ + case GST_RIFF_WAVE_FORMAT_VORBIS1PLUS: /* ogg/vorbis mode 1+ */ + case GST_RIFF_WAVE_FORMAT_VORBIS2PLUS: /* ogg/vorbis mode 2+ */ + case GST_RIFF_WAVE_FORMAT_VORBIS3PLUS: /* ogg/vorbis mode 3+ */ + newcaps = gst_caps_new ("avidemux_audio_src", + "application/x-ogg", + NULL); break; } Index: gstavimux.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/gst/avi/gstavimux.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- gstavimux.c 24 Oct 2002 19:32:11 -0000 1.24 +++ gstavimux.c 27 Oct 2002 18:08:43 -0000 1.25 @@ -157,6 +157,11 @@ "avimux_sink_audio", "audio/mp3", NULL + ), + GST_CAPS_NEW ( + "avimux_sink_audio", + "application/x-ogg", + NULL ) ) @@ -422,6 +427,11 @@ avimux->auds.format = (layer == 3? GST_RIFF_WAVE_FORMAT_MPEGL3 : GST_RIFF_WAVE_FORMAT_MPEGL12); + goto done; + } + else if (!strcmp (mimetype, "application/x-ogg")) + { + avimux->auds.format = GST_RIFF_WAVE_FORMAT_VORBIS1; goto done; } } Index: riff.h =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/gst-libs/gst/riff/riff.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- riff.h 20 Mar 2002 21:45:03 -0000 1.2 +++ riff.h 27 Oct 2002 18:08:43 -0000 1.3 @@ -287,6 +287,12 @@ #define GST_RIFF_IBM_FORMAT_ADPCM (0x0103) #define GST_RIFF_WAVE_FORMAT_DIVX (0x0160) #define GST_RIFF_WAVE_FORMAT_divx (0x0161) +#define GST_RIFF_WAVE_FORMAT_VORBIS1 (0x674f) +#define GST_RIFF_WAVE_FORMAT_VORBIS2 (0x6750) +#define GST_RIFF_WAVE_FORMAT_VORBIS3 (0x6751) +#define GST_RIFF_WAVE_FORMAT_VORBIS1PLUS (0x676f) +#define GST_RIFF_WAVE_FORMAT_VORBIS2PLUS (0x6770) +#define GST_RIFF_WAVE_FORMAT_VORBIS3PLUS (0x6771) guint16 channels; guint32 rate; guint32 av_bps; |