[gst-devel] FreeBSD patch

oh oh at btinternet.com
Mon Mar 26 16:41:02 CEST 2001


Hi

Here is a patch to the current CVS version that allows gstreamer to be
built out of the box on FreeBSD.  A couple of the mods will also help on
other platforms, e.g. by just not building linux specific plugins.

If there is anything you don't like, yell and I'll tweak.

Kind Regards
- Orion
-------------- next part --------------
? 2
? gst-freebsd.patch
Index: acconfig.h
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/acconfig.h,v
retrieving revision 1.21
diff -u -r1.21 acconfig.h
--- acconfig.h	2001/03/04 22:22:36	1.21
+++ acconfig.h	2001/03/26 14:26:49
@@ -25,12 +25,15 @@
 #undef HAVE_LIBGHTTP
 #undef HAVE_LIBMMX
 #undef HAVE_LIBXV
+#undef HAVE_OSS
 #undef HAVE_XAUDIO
 #undef HAVE_CSSAUTH
 #undef HAVE_VORBIS
 #undef HAVE_LIBJPEG
 #undef HAVE_NASM
 #undef HAVE_MPEG2DEC
+#undef HAVE_LINUX_CDROM
+#undef HAVE_LINUX_VIDEODEV
 
 #undef HAVE_ATOMIC_H
 
Index: configure.in
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/configure.in,v
retrieving revision 1.122
diff -u -r1.122 configure.in
--- configure.in	2001/03/24 17:22:01	1.122
+++ configure.in	2001/03/26 14:26:53
@@ -344,6 +344,11 @@
 HAVE_LIBXV=no, $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS)
 LIBS=${xvsave_LIBS}
 
+dnl Check for OSS audio
+AC_CHECK_HEADER(sys/soundcard.h,[
+  AC_DEFINE(HAVE_OSS) 
+  HAVE_OSS="yes", []
+])
 
 dnl Check for xaudio
 AC_CHECK_HEADER(xaudio/decoder.h,[
@@ -351,7 +356,6 @@
   HAVE_XAUDIO="yes", []
 ])
 
-
 dnl Check for libvorbis
 AC_MSG_CHECKING(Vorbis library)
 AC_CHECK_LIB(vorbis, ogg_sync_init, 
@@ -407,6 +411,17 @@
   HAVE_CSSAUTH="no"
 fi
 
+dnl Check for linux/cdrom.h
+AC_CHECK_HEADER(linux/cdrom.h,[
+  AC_DEFINE(HAVE_LINUX_CDROM) 
+  HAVE_LINUX_CDROM="yes", []
+])
+
+dnl Check for linux/videodev.h
+AC_CHECK_HEADER(linux/videodev.h,[
+  AC_DEFINE(HAVE_LINUX_VIDEODEV) 
+  HAVE_LINUX_VIDEODEV="yes", []
+])
 
 
 dnl ######################################################################
@@ -616,7 +631,10 @@
 AM_CONDITIONAL(HAVE_LIBGHTTP,       test "x$USE_LIBGHTTP" = "xyes")
 AM_CONDITIONAL(HAVE_LIBMMX,         test "x$USE_LIBMMX" = "xyes")
 AM_CONDITIONAL(HAVE_ATOMIC_H,       test "x$USE_ATOMIC_H" = "xyes")
+AM_CONDITIONAL(HAVE_OSS,            test "x$HAVE_OSS" = "xyes")
 AM_CONDITIONAL(HAVE_XAUDIO,         test "x$HAVE_XAUDIO" = "xyes")
+AM_CONDITIONAL(HAVE_LINUX_CDROM,    test "x$HAVE_LINUX_CDROM" = "xyes")
+AM_CONDITIONAL(HAVE_LINUX_VIDEODEV, test "x$HAVE_LINUX_VIDEODEV" = "xyes")
 AM_CONDITIONAL(HAVE_CSSAUTH,        test "x$HAVE_CSSAUTH" = "xyes")
 AM_CONDITIONAL(HAVE_VORBIS,         test "x$HAVE_VORBIS" = "xyes")
 AM_CONDITIONAL(HAVE_LIBJPEG,        test "x$HAVE_LIBJPEG" = "xyes")
Index: plugins/Makefile.am
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/plugins/Makefile.am,v
retrieving revision 1.31
diff -u -r1.31 Makefile.am
--- plugins/Makefile.am	2001/03/24 17:22:02	1.31
+++ plugins/Makefile.am	2001/03/26 14:26:55
@@ -46,17 +46,36 @@
 ALSA_SUBDS = 
 endif
 
+if HAVE_OSS
+OSS_SUBDS = oss
+else
+OSS_SUBDS =
+endif
+
 if HAVE_LIBRTP
 RTP_SUBDS = rtp
 else
 RTP_SUBDS = 
 endif
+
+if HAVE_LINUX_CDROM
+LINUX_CDROM_SUBDS = vcdsrc
+else
+LINUX_CDROM_SUBDS = 
+endif
+
+if HAVE_LINUX_VIDEODEV
+LINUX_VIDEODEV_SUBDS = videosink capture
+else
+LINUX_VIDEODEV_SUBDS = 
+endif
 
-SUBDIRS = au wav mp3decode effects visualization mpeg2 mpeg1 vcdsrc \
-rtjpeg videosink capture $(JPEG_SUBDS) mpeg1video videoscale \
-filters audioscale $(CDPARANOIA_SUBDS) mp3encode icecast flx oss \
-$(GSTARCH_SUBDS) $(VORBIS_SUBDS) $(DVD_SUBDS) $(ESD_SUBDS) $(XMMS_SUBDS) \
-$(ALSA_SUBDS) $(RTP_SUBDS)
+SUBDIRS = au wav mp3decode effects visualization mpeg2 mpeg1 \
+rtjpeg $(JPEG_SUBDS) mpeg1video videoscale \
+filters audioscale $(CDPARANOIA_SUBDS) mp3encode icecast flx \
+$(GSTARCH_SUBDS) $(VORBIS_SUBDS) $(DVD_SUBDS) $(ESD_SUBDS) $(OSS_SUBDS) \
+$(XMMS_SUBDS) $(ALSA_SUBDS) $(RTP_SUBDS) $(LINUX_CDROM_SUBDS) \
+$(LINUX_VIDEODEV_SUBDS) 
 
 DIST_SUBDIRS = au wav mp3decode effects visualization mpeg2 mpeg1 vcdsrc \
 rtjpeg dvdsrc videosink capture jpeg mpeg1video videoscale flx oss \
Index: plugins/filters/Makefile.am
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/plugins/filters/Makefile.am,v
retrieving revision 1.2
diff -u -r1.2 Makefile.am
--- plugins/filters/Makefile.am	2001/01/01 03:57:28	1.2
+++ plugins/filters/Makefile.am	2001/03/26 14:26:55
@@ -1 +1,7 @@
-SUBDIRS = smooth median ladspa
+if HAVE_OSS
+OSS_SUBDS = ladspa
+else
+OSS_SUBDS = 
+endif
+
+SUBDIRS = smooth median $(OSS_SUBDS)
Index: plugins/filters/ladspa/gstladspa.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/plugins/filters/ladspa/gstladspa.c,v
retrieving revision 1.8
diff -u -r1.8 gstladspa.c
--- plugins/filters/ladspa/gstladspa.c	2001/01/29 00:06:01	1.8
+++ plugins/filters/ladspa/gstladspa.c	2001/03/26 14:26:57
@@ -19,7 +19,7 @@
 
 #include <string.h>
 #include <math.h>
-#include <linux/soundcard.h>
+#include <sys/soundcard.h>
 
 //#define DEBUG_ENABLED
 #include "gstladspa.h"
Index: plugins/mp3decode/mpg123/mpg123.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/plugins/mp3decode/mpg123/mpg123.c,v
retrieving revision 1.11
diff -u -r1.11 mpg123.c
--- plugins/mp3decode/mpg123/mpg123.c	2001/01/13 00:14:39	1.11
+++ plugins/mp3decode/mpg123/mpg123.c	2001/03/26 14:26:57
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <byteswap.h>
 #include <glib.h>
 #include "mpg123.h"
 
Index: plugins/oss/gstosssink.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/plugins/oss/gstosssink.c,v
retrieving revision 1.2
diff -u -r1.2 gstosssink.c
--- plugins/oss/gstosssink.c	2001/03/24 18:28:10	1.2
+++ plugins/oss/gstosssink.c	2001/03/26 14:27:00
@@ -31,7 +31,6 @@
 
 #include <gstosssink.h>
 
-
 static GstElementDetails gst_osssink_details = {  
   "Audio Sink (OSS)",
   "Sink/Audio",
@@ -204,10 +203,14 @@
 
   osssink->fd = -1;
   osssink->clock = gst_clock_get_system();
-  osssink->format = AFMT_S16_NE;
   osssink->channels = 2;
   osssink->frequency = 44100;
-  
+/* AFMT_*_BE not available on all OSS includes (e.g. FBSD) */
+#ifdef WORDS_BIGENDIAN
+  osssink->format = AFMT_S16_BE;
+#else
+  osssink->format = AFMT_S16_LE;
+#endif /* WORDS_BIGENDIAN */  
   gst_clock_register (osssink->clock, GST_OBJECT (osssink));
 
   GST_FLAG_SET (osssink, GST_ELEMENT_THREAD_SUGGESTED);
@@ -458,8 +461,14 @@
     if (caps & DSP_CAP_COPROC)   	g_print("osssink:   Has coprocessor\n");
     if (caps & DSP_CAP_TRIGGER)  	g_print("osssink:   Trigger\n");
     if (caps & DSP_CAP_MMAP)     	g_print("osssink:   Direct access\n");
+
+#ifdef DSP_CAP_MULTI
     if (caps & DSP_CAP_MULTI)    	g_print("osssink:   Multiple open\n");
+#endif /* DSP_CAP_MULTI */
+
+#ifdef DSP_CAP_BIND
     if (caps & DSP_CAP_BIND)     	g_print("osssink:   Channel binding\n");
+#endif /* DSP_CAP_BIND */
 
     ioctl(sink->fd, SNDCTL_DSP_GETFMTS, &caps);
 
Index: plugins/rtjpeg/RTjpeg.h
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/plugins/rtjpeg/RTjpeg.h,v
retrieving revision 1.3
diff -u -r1.3 RTjpeg.h
--- plugins/rtjpeg/RTjpeg.h	2000/02/01 19:40:10	1.3
+++ plugins/rtjpeg/RTjpeg.h	2001/03/26 14:27:01
@@ -22,13 +22,12 @@
 */
 
 #include <config.h>
-#include <asm/types.h>
-/*
-typedef unsigned char __u8;
-typedef unsigned long __u32;
-typedef signed char __s8;
-typedef unsigned short __u16;
-*/
+#include <inttypes.h>
+
+typedef uint8_t  __u8;
+typedef uint32_t __u32;
+typedef int8_t   __s8;
+typedef uint16_t __u16;
 
 extern void RTjpeg_init_Q(__u8 Q);
 extern void RTjpeg_init_compress(long unsigned int *buf, int width, int height, __u8 Q);


More information about the gstreamer-devel mailing list