changeset 8594:00326905484b

DVB-HEAD (aka. NEWSTRUCT) detection & support patch by Dimitrios Dimitrakos <mail@dimitrios.de>
author arpi
date Sat, 28 Dec 2002 12:04:58 +0000
parents 2c7870bf81db
children 64efd67fee9b
files configure libao2/ao_mpegpes.c libvo/vo_mpegpes.c
diffstat 3 files changed, 86 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Sat Dec 28 11:39:31 2002 +0000
+++ b/configure	Sat Dec 28 12:04:58 2002 +0000
@@ -970,6 +970,7 @@
 _fbdev=auto
 _fbdev_nocopy=no
 _dvb=auto
+_dvbhead=auto
 _dxr2=auto
 _dxr3=auto
 _iconv=auto
@@ -1098,6 +1099,8 @@
   --disable-fbdev)	_fbdev=no	;;
   --enable-dvb)		_dvb=yes	;;
   --disable-dvb)        _dvb=no		;;
+  --enable-dvbhead)	_dvbhead=yes	;;
+  --disable-dvbhead)    _dvbhead=no	;;
   --enable-dxr2)	_dxr2=yes	;;
   --disable-dxr2)	_dxr2=no	;;
   --enable-dxr3)	_dxr3=yes	;;
@@ -2745,10 +2748,53 @@
   _def_dvb='#define HAVE_DVB 1'
   _aomodules="mpegpes(dvb) $_aomodules"
   _vomodules="mpegpes(dvb) $_vomodules"
-else
+fi
+if test "$_dvbhead" != no ; then
+  echocheck "DVB HEAD"
+  if test "$_dvbhead" != no ; then
+    _dvbhead=no
+    test -c /dev/dvb/adapter0/video0 && _dvbhead=yes
+
+cat >$TMPC << EOF
+#include <sys/poll.h>
+#include <sys/ioctl.h>
+#include <stdio.h>
+#include <time.h>
+#include <unistd.h>
+
+#include <linux/dvb/dmx.h>
+#include <linux/dvb/frontend.h>
+#include <linux/dvb/video.h>
+#include <linux/dvb/audio.h>
+int main(void) {return 0;}
+EOF
+    if cc_check ; then
+      _dvbhead=yes
+      echores "yes"
+    else
+      for I in "-I/usr/src/DVB/include" "$_inc_extra/include/linux" ; do
+        if cc_check "$I" ; then
+          _dvbhead=yes
+          _inc_dvb="$I"
+          echores "yes (using $_inc_dvb)"
+          break
+        fi
+      done
+      test "$_dvbhead" = no && echores "no (specify path to DVB/include (HEAD Version) with --with-extraincdir=DIR)"
+    fi
+  else
+    echores "no"
+  fi
+  if test "$_dvbhead" = yes ; then
+    _def_dvb='#define HAVE_DVB_HEAD 1'
+    _aomodules="mpegpes(dvb) $_aomodules"
+    _vomodules="mpegpes(dvb) $_vomodules"
+  fi
+fi
+if test "$_dvbhead" = no && test "$_dvb" = no ; then
   _def_dvb='#undef HAVE_DVB'
   _aomodules="mpegpes(file) $_aomodules"
-  _vomodules="mpegpes(file) $_vomodules"  
+  _vomodules="mpegpes(file) $_vomodules"
 fi
 
 
--- a/libao2/ao_mpegpes.c	Sat Dec 28 11:39:31 2002 +0000
+++ b/libao2/ao_mpegpes.c	Sat Dec 28 12:04:58 2002 +0000
@@ -1,6 +1,10 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#ifdef DVB_HEAD
+#define HAVE_DVB 1
+#endif
+
 #ifdef HAVE_DVB
 #include <sys/ioctl.h>
 #endif
@@ -15,8 +19,13 @@
 #include "../mp_msg.h"
 
 #ifdef HAVE_DVB
+#ifndef HAVE_DVB_HEAD
 #include <ost/audio.h>
 audioMixer_t dvb_mixer={255,255};
+#else
+#include </linux/dvb/audio.h>
+audio_mixer_t dvb_mixer={255,255};
+#endif
 #endif
 extern int vo_mpegpes_fd;
 extern int vo_mpegpes_fd2;
--- a/libvo/vo_mpegpes.c	Sat Dec 28 11:39:31 2002 +0000
+++ b/libvo/vo_mpegpes.c	Sat Dec 28 12:04:58 2002 +0000
@@ -26,9 +26,11 @@
 #include <unistd.h>
 
 #include "mp_msg.h"
-
+#ifdef HAVE_DVB_HEAD
+#define HAVE_DVB 1
+#endif
 #ifdef HAVE_DVB
-
+#ifndef HAVE_DVB_HEAD
 #include <sys/poll.h>
 
 #include <sys/ioctl.h>
@@ -41,6 +43,20 @@
 #include <ost/video.h>
 #include <ost/audio.h>
 
+#else
+#define true 1
+#define false 0
+#include <sys/poll.h>
+
+#include <sys/ioctl.h>
+#include <stdio.h>
+#include <time.h>
+
+#include <linux/dvb/dmx.h>
+#include <linux/dvb/frontend.h>
+#include <linux/dvb/video.h>
+#include <linux/dvb/audio.h>
+#endif
 #endif
 
 #include "config.h"
@@ -86,6 +102,7 @@
 #ifdef HAVE_DVB
     if(!arg){
     //|O_NONBLOCK
+#ifndef HAVE_DVB_HEAD
 	if((vo_mpegpes_fd = open("/dev/ost/video",O_RDWR)) < 0){
 		perror("DVB VIDEO DEVICE: ");
 		return -1;
@@ -94,6 +111,16 @@
 		perror("DVB AUDIO DEVICE: ");
 		return -1;
 	}
+#else
+	if((vo_mpegpes_fd = open("/dev/dvb/adapter0/video0",O_RDWR)) < 0){
+        	perror("DVB VIDEO DEVICE: ");
+        	return -1;
+	}
+	if((vo_mpegpes_fd2 = open("/dev/dvb/adapter0/audio0",O_RDWR|O_NONBLOCK)) < 0){
+        	perror("DVB AUDIO DEVICE: ");
+        	return -1;
+	}
+#endif
 	if ( (ioctl(vo_mpegpes_fd,VIDEO_SET_BLANK, false) < 0)){
 		perror("DVB VIDEO SET BLANK: ");
 		return -1;