[mythtv-users] Danish xmltv + MythTV working for anyone?

Jens Axboe mythtv-users at kernel.dk
Thu Oct 23 22:14:47 EDT 2003


On Thu, Oct 23 2003, Steen Suder, privat wrote:
> Well, my question is pretty much what the subject says:
> 
> Has anyone Danish XMLTV (tv_grab_dk) working with MythTV (at this moment 
> 0.12 should fresh out the compiler)?
> 
> How?
> 
> I've been fiddling around with a patch to integrate tv_grab_dk into MythTV.

Yep works for me, I just added tv_grab_dk a bit hackishly ala the
attached.

diff -ur mythtv-0.12.vanilla/libs/libmythtv/ivtvdecoder.cpp mythtv-0.12/libs/libmythtv/ivtvdecoder.cpp
--- mythtv-0.12.vanilla/libs/libmythtv/ivtvdecoder.cpp	2003-10-19 01:40:36.000000000 +0200
+++ mythtv-0.12/libs/libmythtv/ivtvdecoder.cpp	2003-10-23 09:44:01.000000000 +0200
@@ -18,6 +18,8 @@
 #include "videoout_ivtv.h"
 #include "videodev_myth.h"
 
+#include "videodev2_myth.h"
+
 IvtvDecoder::IvtvDecoder(NuppelVideoPlayer *parent, QSqlDatabase *db,
                          ProgramInfo *pginfo)
            : DecoderBase(parent)
@@ -25,6 +27,9 @@
     m_db = db;
     m_playbackinfo = pginfo;
 
+    // probe this
+    pal = 1;
+
     framesPlayed = 0;
     framesRead = 0;
 
@@ -38,7 +43,11 @@
     firstgoppos = 0;
     prevgoppos = 0;
 
-    fps = 29.97;
+    if (pal)
+    	fps = 25.00;
+    else
+	fps = 29.97;
+
     validvpts = false;
 
     lastKey = 0;
@@ -73,7 +82,7 @@
     QString videodev = gContext->GetSetting("PVR350VideoDev");
 
     int testfd = open(videodev.ascii(), O_RDWR);
-    if (testfd <= 0)
+    if (testfd < 0)
         return false;
 
     bool ok = false;
@@ -86,8 +95,17 @@
             ok = true;
     }
 
-    // probe for pal/ntsc while we're here..
-    
+#if 0
+    v4l2_std_id vid;
+    pal = 0;
+    memset(&vid, 0, sizeof(vid));
+    if (ioctl(testfd, VIDIOC_G_STD, &vid) >= 0)
+    {
+	if (vid & V4L2_STD_PAL)
+	    pal = 1;
+    }
+#endif
+
     close(testfd);
 
     if (!ok)
@@ -118,9 +136,11 @@
 
     m_parent->ForceVideoOutputType(kVideoOutput_IVTV);
 
-    // need to probe pal/ntsc
-    m_parent->SetVideoParams(720, 480, 29.97, 15, 1.5);
-             
+    if (pal)
+    	m_parent->SetVideoParams(720, 576, 25.00, 15, 1.33);
+    else
+	m_parent->SetVideoParams(720, 480, 29.97, 15, 1.5);
+
     ringBuffer->CalcReadAheadThresh(8000);
 
     if (m_playbackinfo && m_db)
diff -ur mythtv-0.12.vanilla/libs/libmythtv/ivtvdecoder.h mythtv-0.12/libs/libmythtv/ivtvdecoder.h
--- mythtv-0.12.vanilla/libs/libmythtv/ivtvdecoder.h	2003-09-25 01:40:00.000000000 +0200
+++ mythtv-0.12/libs/libmythtv/ivtvdecoder.h	2003-10-23 09:39:48.000000000 +0200
@@ -86,6 +86,8 @@
 
     long long laststartpos;
 
+    bool pal;
+
     unsigned char prvpkt[3];
 };
 
diff -ur mythtv-0.12.vanilla/libs/libmythtv/videoout_ivtv.cpp mythtv-0.12/libs/libmythtv/videoout_ivtv.cpp
--- mythtv-0.12.vanilla/libs/libmythtv/videoout_ivtv.cpp	2003-10-19 01:40:36.000000000 +0200
+++ mythtv-0.12/libs/libmythtv/videoout_ivtv.cpp	2003-10-23 09:45:13.000000000 +0200
@@ -104,13 +104,13 @@
         prep.dest_offset = 0;
         prep.count = osdcoords.max_offset;
 
-        memset(osdbuf_aligned, 0x00, 720 * 480 * 4);
+        memset(osdbuf_aligned, 0x00, 720 * 576 * 4);
 
         ioctl(fbfd, IVTVFB_IOCTL_PREP_FRAME, &prep);
 
         usleep(20000);
 
-        osdcoords.lines = 480;
+        osdcoords.lines = 576;
         osdcoords.offset = 0;
         osdcoords.pixel_stride = 720 * 2;
 
@@ -199,11 +199,11 @@
         height = igfb.sizey;
         stride = igfb.sizex * 4;
 
-        osdbuffer = new char[720 * 480 * 4 + PAGE_SIZE];
+        osdbuffer = new char[720 * 576 * 4 + PAGE_SIZE];
         osdbuf_aligned = (char *)((int)osdbuffer + (PAGE_SIZE - 1));
         osdbuf_aligned = (char *)((int)osdbuf_aligned & PAGE_MASK);
 
-        memset(osdbuf_aligned, 0x00, 720 * 480 * 4);
+        memset(osdbuf_aligned, 0x00, 720 * 576 * 4);
 
         ClearOSD();
     }
@@ -361,7 +361,7 @@
             usleep(20000);
 
             osdcoords.offset = 0;
-            osdcoords.lines = 480;
+            osdcoords.lines = 576;
             osdcoords.pixel_stride = 720 * 2;
 
             ioctl(fbfd, IVTVFB_IOCTL_SET_ACTIVE_BUFFER, &osdcoords);
diff -ur mythtv-0.12.vanilla/libs/libmythtv/videosource.h mythtv-0.12/libs/libmythtv/videosource.h
--- mythtv-0.12.vanilla/libs/libmythtv/videosource.h	2003-10-19 01:40:36.000000000 +0200
+++ mythtv-0.12/libs/libmythtv/videosource.h	2003-10-21 11:38:38.000000000 +0200
@@ -192,6 +192,9 @@
 
         addTarget("tv_grab_nl", new XMLTV_generic_config(parent, "tv_grab_nl"));
         grabber->addSelection("Holland", "tv_grab_nl");
+
+        addTarget("tv_grab_dk", new XMLTV_generic_config(parent, "tv_grab_dk"));
+        grabber->addSelection("Denmark", "tv_grab_dk");
     };
 };
 
diff -ur mythtv-0.12.vanilla/programs/mythfilldatabase/filldata.cpp mythtv-0.12/programs/mythfilldatabase/filldata.cpp
--- mythtv-0.12.vanilla/programs/mythfilldatabase/filldata.cpp	2003-10-17 09:19:41.000000000 +0200
+++ mythtv-0.12/programs/mythfilldatabase/filldata.cpp	2003-10-21 12:20:07.000000000 +0200
@@ -1341,6 +1341,11 @@
         command.sprintf("nice %s --days 14 --config-file '%s' --output %s",
                         xmltv_grabber.ascii(), configfile.ascii(),
                         filename.ascii());
+    else if (xmltv_grabber == "tv_grab_dk")
+        // Use fixed interval of 7 days for Danish grabber
+        command.sprintf("nice %s --days 7 --config-file '%s' --output %s",
+                        xmltv_grabber.ascii(), configfile.ascii(),
+                        filename.ascii());
     else
     {
         isNorthAmerica = true;
@@ -1356,6 +1361,7 @@
          xmltv_grabber == "tv_grab_es" ||
          xmltv_grabber == "tv_grab_nz" ||
          xmltv_grabber == "tv_grab_sn" ||
+         xmltv_grabber == "tv_grab_dk" ||
          xmltv_grabber == "tv_grab_uk" ||
          xmltv_grabber == "tv_grab_uk_rt" ||
          xmltv_grabber == "tv_grab_nl" ||
@@ -1427,7 +1433,11 @@
             if (!grabData(*it, 0))
                 ++failures;
         }
-        else if (xmltv_grabber == "tv_grab_nz")
+	else if (xmltv_grabber == "tv_grab_dk") {
+	    if (!grabData(*it, 0))
+		++failures;
+	}
+	else if (xmltv_grabber == "tv_grab_nz")
         {
             // tv_grab_nz only supports a 7-day "grab".
             grabData(*it, 1);
diff -ur mythtv-0.12.vanilla/settings.pro mythtv-0.12/settings.pro
--- mythtv-0.12.vanilla/settings.pro	2003-09-07 19:24:58.000000000 +0200
+++ mythtv-0.12/settings.pro	2003-10-23 08:16:56.000000000 +0200
@@ -14,7 +14,7 @@
 
 release {
         DEFINES += MMX
-        QMAKE_CXXFLAGS_RELEASE = -O3 -march=pentiumpro -fomit-frame-pointer
+        QMAKE_CXXFLAGS_RELEASE = -O3 -march=c3 -fomit-frame-pointer
         QMAKE_CFLAGS_RELEASE = $${QMAKE_CXXFLAGS_RELEASE}
 }
 

-- 
Jens Axboe



More information about the mythtv-users mailing list