diff -ur nxtvepg-2.8.0pre10/epgui/cmdline.c nxtvepg-2.8.0pre10dvb/epgui/cmdline.c --- nxtvepg-2.8.0pre10/epgui/cmdline.c 2006-01-04 19:29:37.000000000 +0100 +++ nxtvepg-2.8.0pre10dvb/epgui/cmdline.c 2006-01-07 16:55:12.000000000 +0100 @@ -168,8 +168,8 @@ " -outfile \t: target file for export and other output\n" " -dump xml|html|pi|...\t: export database in various formats\n" " -provider \t: network id of EPG provider (hex)\n" - " -card \t: index of TV card for acq (starting at 0)\n"; - + " -card \t: index of TV card for acq (starting at 0)\n" + " -dvbpid \t: Use DVB with this pid\n"; const char * const pGuiUsage = " -remctrl \t: remote control nxtvepg\n" " -demo \t: load database in demo mode\n" @@ -568,6 +568,20 @@ else Usage(argv[0], argv[argIdx], "missing card index after"); } + else if (!strcmp(argv[argIdx], "-dvbpid")) + { + if (argIdx + 1 < argc) + { // read PID for DVB + char *pe; + ulong dvbPid = strtol(argv[argIdx + 1], &pe, 0); + if ((pe != (argv[argIdx + 1] + strlen(argv[argIdx + 1])))) + MainOptionError(argv[0], argv[argIdx+1], "invalid value for -dvbpid"); + mainOpts.dvbPid = (int) dvbPid; + argIdx += 2; + } + else + Usage(argv[0], argv[argIdx], "missing card index after"); + } else if ( !strcmp(argv[argIdx], "-provider") || !strcmp(argv[argIdx], "-prov") ) { @@ -808,6 +822,7 @@ #endif mainOpts.dbdir = NULL; mainOpts.videoCardIndex = -1; + mainOpts.dvbPid = -1; mainOpts.disableAcq = FALSE; mainOpts.optDaemonMode = FALSE; mainOpts.optDumpMode = EPG_DUMP_NONE; diff -ur nxtvepg-2.8.0pre10/epgui/cmdline.h nxtvepg-2.8.0pre10dvb/epgui/cmdline.h --- nxtvepg-2.8.0pre10/epgui/cmdline.h 2005-12-11 19:21:40.000000000 +0100 +++ nxtvepg-2.8.0pre10dvb/epgui/cmdline.h 2006-01-07 16:55:12.000000000 +0100 @@ -78,6 +78,7 @@ const char * rcfile; const char * dbdir; int videoCardIndex; + int dvbPid; bool disableAcq; EPG_DAEMON_MODE optDaemonMode; EPG_DUMP_MODE optDumpMode; diff -ur nxtvepg-2.8.0pre10/epgui/epgsetup.c nxtvepg-2.8.0pre10dvb/epgui/epgsetup.c --- nxtvepg-2.8.0pre10/epgui/epgsetup.c 2005-12-11 19:26:43.000000000 +0100 +++ nxtvepg-2.8.0pre10dvb/epgui/epgsetup.c 2006-01-07 16:58:43.000000000 +0100 @@ -553,7 +553,7 @@ #endif // pass the hardware config params to the driver - if (BtDriver_Configure(cardIdx, drvType, prio, chipType, cardType, tuner, pll, wdmStop)) + if (BtDriver_Configure(cardIdx, drvType, mainOpts.dvbPid, prio, chipType, cardType, tuner, pll, wdmStop)) { // pass the input selection to acquisition control EpgAcqCtl_SetInputSource(input, slicer); diff -ur nxtvepg-2.8.0pre10/epgvbi/btdrv.h nxtvepg-2.8.0pre10dvb/epgvbi/btdrv.h --- nxtvepg-2.8.0pre10/epgvbi/btdrv.h 2006-01-04 19:07:30.000000000 +0100 +++ nxtvepg-2.8.0pre10dvb/epgvbi/btdrv.h 2006-01-07 17:04:09.426647384 +0100 @@ -251,6 +251,7 @@ uint vbiQueryFreq; uchar cardIndex; + int dvbPid; uint slicerType; # if defined(__NetBSD__) || defined(__FreeBSD__) uchar inputIndex; @@ -306,7 +307,7 @@ void BtDriver_ScanDevices( bool isMasterProcess ); #endif const char * BtDriver_GetInputName( uint cardIdx, uint cardType, uint drvType, uint inputIdx ); -bool BtDriver_Configure( int sourceIdx, int drvType, int prio, int chipType, int cardType, +bool BtDriver_Configure( int sourceIdx, int drvType, int dvbPid, int prio, int chipType, int cardType, int tunerType, int pllType, bool wdmStop ); void BtDriver_SelectSlicer( VBI_SLICER_TYPE slicerType ); #ifndef WIN32 diff -ur nxtvepg-2.8.0pre10/epgvbi/btdrv4linux.c nxtvepg-2.8.0pre10dvb/epgvbi/btdrv4linux.c --- nxtvepg-2.8.0pre10/epgvbi/btdrv4linux.c 2005-05-29 15:50:30.000000000 +0200 +++ nxtvepg-2.8.0pre10dvb/epgvbi/btdrv4linux.c 2006-01-07 17:45:14.745861896 +0100 @@ -173,6 +173,7 @@ // vars used in the acq slave process static bool acqShouldExit; static int vbiCardIndex; +static int vbiDvbPid; static int vbi_fdin; #ifndef USE_LIBZVBI static int bufLineSize; @@ -205,6 +206,7 @@ #if defined(__NetBSD__) || defined(__FreeBSD__) DEV_TYPE_TUNER, #endif + DEV_TYPE_DVB, } BTDRV_DEV_TYPE; // --------------------------------------------------------------------------- @@ -234,6 +236,9 @@ case DEV_TYPE_VBI: sprintf(devName, "%s/vbi%u", pDevPath, cardIdx); break; + case DEV_TYPE_DVB: + sprintf(devName, "/dev/dvb/adapter%u/demux0", cardIdx); + break; default: strcpy(devName, "/dev/null"); fatal1("BtDriver-GetDevicePath: illegal device type %d", devType); @@ -457,6 +462,7 @@ #endif vbiCardIndex = pVbiBuf->cardIndex; + vbiDvbPid = pVbiBuf->dvbPid; pVbiBuf->is_v4l2 = FALSE; #if defined(__NetBSD__) || defined(__FreeBSD__) @@ -534,10 +540,15 @@ pZvbiCapt = vbi_capture_v4l_new(pDevName, 0, &services, 0, &pErrStr, ZVBI_TRACE); } #if (VBI_VERSION_MAJOR>0) || (VBI_VERSION_MINOR>2) || (VBI_VERSION_MICRO >= 6) - if (pZvbiCapt == NULL) + if ((pZvbiCapt == NULL) && (vbiDvbPid!=-1)) { + char *pDvbDevName = BtDriver_GetDevicePath(DEV_TYPE_DVB, vbiCardIndex); services = VBI_SLICED_TELETEXT_B; - pZvbiCapt = vbi_capture_dvb_new(pDevName, 0, &services, 0, &pErrStr, ZVBI_TRACE); + pZvbiCapt = vbi_capture_dvb_new(pDvbDevName, 0, &services, 0, &pErrStr, ZVBI_TRACE); + if (pZvbiCapt != NULL) + { + vbi_capture_dvb_filter(pZvbiCapt, vbiDvbPid); + } } #endif @@ -1465,7 +1476,7 @@ // hence these parameters can be ignored in Linux // - there isn't any need for priority adaptions, so that's not supported either // -bool BtDriver_Configure( int cardIndex, int drvType, int prio, int chipType, int cardType, +bool BtDriver_Configure( int cardIndex, int drvType, int dvbPid, int prio, int chipType, int cardType, int tunerType, int pllType, bool wdmStop ) { struct timeval tv; @@ -1476,6 +1487,7 @@ // pass the new card index to the slave via shared memory pVbiBuf->cardIndex = cardIndex; + pVbiBuf->dvbPid = dvbPid; if (wasEnabled) { // wait 30ms for the slave to process the request