[mythtv-users] patching OS X mplayer
mark at zzo.com
mark at zzo.com
Sat Mar 29 19:16:22 UTC 2003
Here's the patch - basically don't try to compile the
'setup' & 'mythbackend' directories & either don't have
NuppelVideoRecorder.cpp in your libs/libmythtv directory when
you first make or delete it (NuppelVideoRecorder.cpp &
NuppelVideoRecorder.o) out of your makefile from the libs/libmythtv
directory.
Make sure $QTDIR/mkspecs/conf/default points to the rite qmake.conf.
My libc didn't have the 'llabs' function so I defined it myself.
FreeBSD has 'inttypes.h' instead of 'stdint.h'.
Some flags to 'open' (no O_LARGEFILE) & 'shmget' are different.
Comment out all references to 'linux/videodev.h' & any structures
in there.
Finally I was getting segfaults when transitioning between playing
previously recorded shows & the menu so I put a buncha extra checking
in playbackbox.cpp & that's it.
My icons don't draw correctly (they're just rectangles of fuzz) but
the fonts draw okay...
No '/dev/dsp' & no '/dev/mixer' ... that'll be interesting... lemmie
know how it goes...
Mark
Cedar McKay(cedarmckay at mac.com)@2003.03.29 09:07:42 +0000:
> >
> >Essentially just don't compile 'NuppelViedoRecorder.cpp' in libmythtv
> >& a couple other changes & yer good - I can send you a patch even.
> >
>
> please do! I'm not sure it will be quite as trivial as you think. I
> sure as hell don't have a /dev/dsp on my machine. But the fink people
> manage to port everything to os X including all of kde and gnome (with
> working sound), so I'm sure it is possible.
>
>
> cedar
>
>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at snowman.net
> http://lists.snowman.net/cgi-bin/mailman/listinfo/mythtv-users
--
------------------------------------------
Mark Ethan Trostler mark at zzo.com
Computing Solutions http://www.zzo.com
------------------------------------------
-------------- next part --------------
Index: Makefile
===================================================================
RCS file: /var/lib/cvs/MC/Makefile,v
retrieving revision 1.22
diff -u -p -r1.22 Makefile
--- Makefile 21 Mar 2003 17:05:37 -0000 1.22
+++ Makefile 29 Mar 2003 19:04:11 -0000
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: mythtv
-# Generated by qmake (1.04a) (Qt 3.1.1) on: Fri Mar 21 11:43:34 2003
+# Generated by qmake (1.04a) (Qt 3.1.1) on: Thu Mar 27 12:09:33 2003
# Project: mythtv.pro
# Template: subdirs
# Command: $(QMAKE) -o Makefile mythtv.pro
@@ -14,7 +14,6 @@ SUBTARGETS = \
sub-filters \
sub-programs \
sub-themes \
- sub-setup \
sub-i18n
first: all
@@ -41,42 +40,34 @@ themes/$(MAKEFILE):
sub-themes: themes/$(MAKEFILE) FORCE
cd themes && $(MAKE) -f $(MAKEFILE)
-setup/$(MAKEFILE):
- cd setup && $(QMAKE) -o $(MAKEFILE)
-sub-setup: setup/$(MAKEFILE) FORCE
- cd setup && $(MAKE) -f $(MAKEFILE)
-
i18n/$(MAKEFILE):
cd i18n && $(QMAKE) -o $(MAKEFILE)
sub-i18n: i18n/$(MAKEFILE) FORCE
cd i18n && $(MAKE) -f $(MAKEFILE)
-Makefile: mythtv.pro $(QTDIR)/mkspecs/linux-g++/qmake.conf
+Makefile: mythtv.pro $(QTDIR)/mkspecs/default/qmake.conf
$(QMAKE) -o Makefile mythtv.pro
qmake: qmake_all
@$(QMAKE) -o Makefile mythtv.pro
all: $(SUBTARGETS)
-qmake_all: libs/$(MAKEFILE) filters/$(MAKEFILE) programs/$(MAKEFILE) themes/$(MAKEFILE) setup/$(MAKEFILE) i18n/$(MAKEFILE)
+qmake_all: libs/$(MAKEFILE) filters/$(MAKEFILE) programs/$(MAKEFILE) themes/$(MAKEFILE) i18n/$(MAKEFILE)
( [ -d libs ] && cd libs ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
( [ -d filters ] && cd filters ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
( [ -d programs ] && cd programs ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
( [ -d themes ] && cd themes ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
- ( [ -d setup ] && cd setup ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
( [ -d i18n ] && cd i18n ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
clean uninstall install uiclean mocclean lexclean yaccclean: qmake_all FORCE
( [ -d libs ] && cd libs ; $(MAKE) -f $(MAKEFILE) $@; ) || true
( [ -d filters ] && cd filters ; $(MAKE) -f $(MAKEFILE) $@; ) || true
( [ -d programs ] && cd programs ; $(MAKE) -f $(MAKEFILE) $@; ) || true
( [ -d themes ] && cd themes ; $(MAKE) -f $(MAKEFILE) $@; ) || true
- ( [ -d setup ] && cd setup ; $(MAKE) -f $(MAKEFILE) $@; ) || true
( [ -d i18n ] && cd i18n ; $(MAKE) -f $(MAKEFILE) $@; ) || true
distclean: qmake_all FORCE
( [ -d libs ] && cd libs ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
( [ -d filters ] && cd filters ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
( [ -d programs ] && cd programs ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
( [ -d themes ] && cd themes ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
- ( [ -d setup ] && cd setup ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
( [ -d i18n ] && cd i18n ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
FORCE:
Index: mythtv.pro
===================================================================
RCS file: /var/lib/cvs/MC/mythtv.pro,v
retrieving revision 1.10
diff -u -p -r1.10 mythtv.pro
--- mythtv.pro 21 Mar 2003 17:05:37 -0000 1.10
+++ mythtv.pro 29 Mar 2003 19:04:11 -0000
@@ -5,4 +5,5 @@
TEMPLATE = subdirs
# Directories
-SUBDIRS += libs filters programs themes setup i18n
+SUBDIRS += libs filters programs themes i18n
+#setup
Index: libs/libmyth/mythcontext.h
===================================================================
RCS file: /var/lib/cvs/MC/libs/libmyth/mythcontext.h,v
retrieving revision 1.38
diff -u -p -r1.38 mythcontext.h
--- libs/libmyth/mythcontext.h 11 Mar 2003 21:34:12 -0000 1.38
+++ libs/libmyth/mythcontext.h 29 Mar 2003 19:04:12 -0000
@@ -7,6 +7,8 @@
#include <qobject.h>
#include <qptrlist.h>
#include <qevent.h>
+#include <pthread.h>
+
#include <vector>
using namespace std;
Index: libs/libmyth/volumecontrol.cpp
===================================================================
RCS file: /var/lib/cvs/MC/libs/libmyth/volumecontrol.cpp,v
retrieving revision 1.3
diff -u -p -r1.3 volumecontrol.cpp
--- libs/libmyth/volumecontrol.cpp 11 Mar 2003 20:09:26 -0000 1.3
+++ libs/libmyth/volumecontrol.cpp 29 Mar 2003 19:04:13 -0000
@@ -1,6 +1,6 @@
#include "volumecontrol.h"
-#include <linux/soundcard.h>
+#include <machine/soundcard.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <stdio.h>
Index: libs/libmythtv/NuppelVideoPlayer.cpp
===================================================================
RCS file: /var/lib/cvs/MC/libs/libmythtv/NuppelVideoPlayer.cpp,v
retrieving revision 1.155
diff -u -p -r1.155 NuppelVideoPlayer.cpp
--- libs/libmythtv/NuppelVideoPlayer.cpp 24 Mar 2003 18:55:47 -0000 1.155
+++ libs/libmythtv/NuppelVideoPlayer.cpp 29 Mar 2003 19:04:21 -0000
@@ -32,9 +32,18 @@ extern "C" {
#include "../libvbitext/vbi.h"
}
+/* Return the absolute value of I. */
+long long int
+llabs (long long int i)
+{
+ return i < 0 ? -i : i;
+}
+
+
#include "remoteencoder.h"
-extern pthread_mutex_t avcodeclock;
+//extern pthread_mutex_t avcodeclock;
+pthread_mutex_t avcodeclock = PTHREAD_MUTEX_INITIALIZER;
#define wsUp 0x52 + 256
#define wsDown 0x54 + 256
Index: libs/libmythtv/NuppelVideoPlayer.h
===================================================================
RCS file: /var/lib/cvs/MC/libs/libmythtv/NuppelVideoPlayer.h,v
retrieving revision 1.72
diff -u -p -r1.72 NuppelVideoPlayer.h
--- libs/libmythtv/NuppelVideoPlayer.h 24 Mar 2003 18:55:47 -0000 1.72
+++ libs/libmythtv/NuppelVideoPlayer.h 29 Mar 2003 19:04:22 -0000
@@ -414,4 +414,6 @@ class NuppelVideoPlayer
QString cclines[4];
};
+__extension__ extern long long int llabs (long long int __x);
+
#endif
Index: libs/libmythtv/RTjpegN.h
===================================================================
RCS file: /var/lib/cvs/MC/libs/libmythtv/RTjpegN.h,v
retrieving revision 1.4
diff -u -p -r1.4 RTjpegN.h
--- libs/libmythtv/RTjpegN.h 12 Nov 2002 06:30:32 -0000 1.4
+++ libs/libmythtv/RTjpegN.h 29 Mar 2003 19:04:22 -0000
@@ -44,7 +44,7 @@ Foundation, Inc., 59 Temple Place, Suite
#endif
#ifndef _STDINT_H
-#include <stdint.h>
+#include <inttypes.h>
#endif
#ifdef MMX
Index: libs/libmythtv/RingBuffer.cpp
===================================================================
RCS file: /var/lib/cvs/MC/libs/libmythtv/RingBuffer.cpp,v
retrieving revision 1.44
diff -u -p -r1.44 RingBuffer.cpp
--- libs/libmythtv/RingBuffer.cpp 8 Mar 2003 00:22:04 -0000 1.44
+++ libs/libmythtv/RingBuffer.cpp 29 Mar 2003 19:04:23 -0000
@@ -236,7 +236,7 @@ RingBuffer::RingBuffer(const QString &lf
if (write)
{
tfw = new ThreadedFileWriter(filename.ascii(),
- O_WRONLY|O_TRUNC|O_CREAT|O_LARGEFILE,
+ O_WRONLY|O_TRUNC|O_CREAT,
0644);
writemode = true;
}
@@ -245,7 +245,7 @@ RingBuffer::RingBuffer(const QString &lf
if (filename.left(7) == "myth://")
remotefile = new RemoteFile(filename, needevents);
else
- fd2 = open(filename.ascii(), O_RDONLY|O_LARGEFILE);
+ fd2 = open(filename.ascii(), O_RDONLY);
writemode = false;
}
@@ -284,9 +284,9 @@ RingBuffer::RingBuffer(const QString &lf
if (recorder_num == 0)
{
tfw = new ThreadedFileWriter(filename.ascii(),
- O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE,
+ O_WRONLY|O_CREAT|O_TRUNC,
0644);
- fd2 = open(filename.ascii(), O_RDONLY|O_LARGEFILE);
+ fd2 = open(filename.ascii(), O_RDONLY);
}
else
{
@@ -339,7 +339,7 @@ void RingBuffer::Start(void)
void RingBuffer::TransitionToFile(const QString &lfilename)
{
dumpfw = new ThreadedFileWriter(lfilename.ascii(),
- O_WRONLY|O_TRUNC|O_CREAT|O_LARGEFILE, 0644);
+ O_WRONLY|O_TRUNC|O_CREAT, 0644);
dumpwritepos = 0;
}
@@ -367,9 +367,9 @@ void RingBuffer::Reset(void)
close(fd2);
tfw = new ThreadedFileWriter(filename.ascii(),
- O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE,
+ O_WRONLY|O_CREAT|O_TRUNC,
0644);
- fd2 = open(filename.ascii(), O_RDONLY|O_LARGEFILE);
+ fd2 = open(filename.ascii(), O_RDONLY);
}
totalwritepos = writepos = 0;
Index: libs/libmythtv/XJ.cpp
===================================================================
RCS file: /var/lib/cvs/MC/libs/libmythtv/XJ.cpp,v
retrieving revision 1.46
diff -u -p -r1.46 XJ.cpp
--- libs/libmythtv/XJ.cpp 26 Mar 2003 02:49:46 -0000 1.46
+++ libs/libmythtv/XJ.cpp 29 Mar 2003 19:04:25 -0000
@@ -351,7 +351,7 @@ bool XvVideoOutput::Init(int width, int
colorid, 0, XJ_width, XJ_height,
&(data->XJ_SHMInfo)[i]);
(data->XJ_SHMInfo)[i].shmid = shmget(IPC_PRIVATE, image->data_size,
- IPC_CREAT|0777);
+ SHM_R|SHM_W);
if ((data->XJ_SHMInfo)[i].shmid < 0)
{
perror("shmget failed:");
@@ -381,7 +381,7 @@ bool XvVideoOutput::Init(int width, int
curw, curh);
(data->XJ_SHMInfo)[i].shmid = shmget(IPC_PRIVATE,
image->bytes_per_line * image->height,
- IPC_CREAT|0777);
+ SHM_R|SHM_W);
if ((data->XJ_SHMInfo)[i].shmid < 0)
{
perror("shmget failed:");
@@ -693,6 +693,23 @@ inline void scale_image( unsigned char *
void XvVideoOutput::Show(unsigned char *buffer, int width, int height)
{
+static int skip=0;
+static int skipcnt=-1;
+
+ if (skipcnt < 0)
+ {
+ char *pskip;
+ if(pskip = getenv("SKIP"))
+ {
+ skipcnt=atoi(pskip);
+ free(pskip);
+ }
+ else skipcnt = 0;
+ }
+
+ if(skipcnt) {skip++; skip%=skipcnt;}
+ if(skip) return;
+
if ( xv_port != -1 )
{
XvImage *image = data->buffers[buffer];
Index: libs/libmythtv/XJ.h
===================================================================
RCS file: /var/lib/cvs/MC/libs/libmythtv/XJ.h,v
retrieving revision 1.21
diff -u -p -r1.21 XJ.h
--- libs/libmythtv/XJ.h 5 Mar 2003 17:20:55 -0000 1.21
+++ libs/libmythtv/XJ.h 29 Mar 2003 19:04:25 -0000
@@ -1,6 +1,8 @@
#ifndef XJ_H_
#define XJ_H_
+#include <pthread.h>
+
struct XvData;
class XvVideoOutput
Index: libs/libmythtv/channel.cpp
===================================================================
RCS file: /var/lib/cvs/MC/libs/libmythtv/channel.cpp,v
retrieving revision 1.34
diff -u -p -r1.34 channel.cpp
--- libs/libmythtv/channel.cpp 27 Mar 2003 20:06:39 -0000 1.34
+++ libs/libmythtv/channel.cpp 29 Mar 2003 19:04:26 -0000
@@ -6,7 +6,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
-#include <linux/videodev.h>
+/* #include <linux/videodev.h> */
#include "channel.h"
#include "frequencies.h"
#include "tv.h"
@@ -23,7 +23,7 @@ Channel::Channel(TVRec *parent, const QS
curList = 0;
totalChannels = 0;
pParent = parent;
- videomode = VIDEO_MODE_NTSC;
+ /* videomode = VIDEO_MODE_NTSC; */
capchannels = 0;
currentcapchannel = 0;
@@ -61,7 +61,8 @@ void Channel::SetFormat(const QString &f
if (!isopen)
return;
- int mode = VIDEO_MODE_AUTO;
+/*
+ int mode = VIDEO_MODE_AUTO;
struct video_tuner tuner;
memset(&tuner, 0, sizeof(tuner));
@@ -112,6 +113,7 @@ void Channel::SetFormat(const QString &f
ioctl(videofd, VIDIOCSCHAN, &vc);
videomode = mode;
+*/
pParent->RetrieveInputChannels(inputChannel, inputTuneTo, externalChanger);
}
@@ -182,11 +184,13 @@ bool Channel::TuneTo(const QString &chan
{
int i = GetCurrentChannelNum(chan);
int frequency = curList[i].freq * 16 / 1000 + finetune;
+/*
if (ioctl(videofd, VIDIOCSFREQ, &frequency) == -1)
{
perror("channel set:");
return false;
}
+*/
return true;
}
@@ -344,6 +348,7 @@ void Channel::SwitchToInput(int newcapch
if (newcapchannel == currentcapchannel)
return;
+/*
struct video_channel set;
memset(&set, 0, sizeof(set));
ioctl(videofd, VIDIOCGCHAN, &set);
@@ -353,6 +358,7 @@ void Channel::SwitchToInput(int newcapch
{
perror("VIDIOCSCHAN: ");
}
+*/
currentcapchannel = newcapchannel;
curchannelname = "";
@@ -366,6 +372,7 @@ void Channel::SwitchToInput(int newcapch
void Channel::SetContrast()
{
+/*
struct video_picture vid_pic;
memset(&vid_pic, 0, sizeof(vid_pic));
@@ -387,12 +394,14 @@ void Channel::SetContrast()
return;
}
}
+*/
return;
}
void Channel::SetBrightness()
{
+/*
struct video_picture vid_pic;
memset(&vid_pic, 0, sizeof(vid_pic));
@@ -414,12 +423,14 @@ void Channel::SetBrightness()
return;
}
}
+*/
return;
}
void Channel::SetColour()
{
+/*
struct video_picture vid_pic;
memset(&vid_pic, 0, sizeof(vid_pic));
@@ -442,13 +453,16 @@ void Channel::SetColour()
}
}
+*/
return;
}
int Channel::ChangeContrast(bool up)
{
+/*
struct video_picture vid_pic;
memset(&vid_pic, 0, sizeof(vid_pic));
+*/
int newcontrast; // The int should have ample space to avoid overflow
// in the case that we're just over or under 65535
@@ -457,6 +471,7 @@ int Channel::ChangeContrast(bool up)
int current_contrast = pParent->GetChannelValue(channel_field, this,
curchannelname);
+/*
if (ioctl(videofd, VIDIOCGPICT, &vid_pic) < 0)
{
perror("VIDIOCGPICT: ");
@@ -501,10 +516,13 @@ int Channel::ChangeContrast(bool up)
}
return vid_pic.contrast / 655;
+*/
+ return 0;
}
int Channel::ChangeBrightness(bool up)
{
+/*
struct video_picture vid_pic;
memset(&vid_pic, 0, sizeof(vid_pic));
@@ -560,10 +578,13 @@ int Channel::ChangeBrightness(bool up)
}
return vid_pic.brightness / 655;
+*/
+ return 0;
}
int Channel::ChangeColour(bool up)
{
+/*
struct video_picture vid_pic;
memset(&vid_pic, 0, sizeof(vid_pic));
@@ -618,6 +639,8 @@ int Channel::ChangeColour(bool up)
}
return vid_pic.colour / 655;
+*/
+return 0;
}
bool Channel::ChangeExternalChannel(const QString &channum)
Index: libs/libmythtv/videosource.cpp
===================================================================
RCS file: /var/lib/cvs/MC/libs/libmythtv/videosource.cpp,v
retrieving revision 1.17
diff -u -p -r1.17 videosource.cpp
--- libs/libmythtv/videosource.cpp 10 Mar 2003 23:09:20 -0000 1.17
+++ libs/libmythtv/videosource.cpp 29 Mar 2003 19:04:27 -0000
@@ -15,7 +15,7 @@
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/types.h>
-#include <linux/videodev.h>
+/* #include <linux/videodev.h> */
QString VSSetting::whereClause(void) {
return QString("sourceid = %1").arg(parent.getSourceID());
@@ -263,6 +263,7 @@ int CardInputEditor::exec(QSqlDatabase*
}
void CardInputEditor::load(QSqlDatabase* db) {
+/*
clearSelections();
// We do this manually because we want custom labels. If
@@ -318,6 +319,7 @@ void CardInputEditor::load(QSqlDatabase*
close(videofd);
}
+*/
}
CardInputEditor::~CardInputEditor() {
Index: programs/programs.pro
===================================================================
RCS file: /var/lib/cvs/MC/programs/programs.pro,v
retrieving revision 1.4
diff -u -p -r1.4 programs.pro
--- programs/programs.pro 24 Jan 2003 17:37:17 -0000 1.4
+++ programs/programs.pro 29 Mar 2003 19:04:27 -0000
@@ -5,4 +5,5 @@
TEMPLATE = subdirs
# Directories
-SUBDIRS += mythepg mythprogfind menutest mythfilldatabase mythtv mythbackend mythfrontend
+SUBDIRS += mythepg mythprogfind menutest mythfilldatabase mythtv mythfrontend
+# mythbackend
Index: programs/mythfrontend/playbackbox.cpp
===================================================================
RCS file: /var/lib/cvs/MC/programs/mythfrontend/playbackbox.cpp,v
retrieving revision 1.88
diff -u -p -r1.88 playbackbox.cpp
--- programs/mythfrontend/playbackbox.cpp 26 Mar 2003 18:43:17 -0000 1.88
+++ programs/mythfrontend/playbackbox.cpp 29 Mar 2003 19:04:31 -0000
@@ -669,17 +669,24 @@ void PlaybackBox::updateShowTitles(QPain
h = i + showList.count();
if (i > (signed int)(showList.count() - 1))
h = i - showList.count();
+ //if (h < 0) h = 0;
if (i == curTitle)
disp = disp + titleSkip;
+ cerr << "just h is " << h << endl;
+if (h >= 0 && titleData[h] != NULL)
+ cerr << "h is " << h << " titleData[h] is " << titleData[h] << endl;
+ cerr << "i is " << i << " curTitle is " << curTitle << endl;
+if (h >= 0 && titleData[h] ) {
if (titleData[h] != "***FILLER***" && i != curTitle)
{
// LAYER 2
//tmp.drawText(32, disp, 195, 40, AlignCenter, titleData[h]);
tmp.drawText(titleLeft, disp, titleWidth, titleHeight, AlignLeft, titleData[h]);
}
+}
disp = disp + titleSpace;
@@ -713,7 +720,9 @@ void PlaybackBox::updateShowTitles(QPain
titleitems = 0;
- if (titleData[curTitle] != "All Programs")
+ cerr << "titleData[curTitle] " << titleData[curTitle] << " curTitle is " << curTitle << endl;
+
+ if (titleData[curTitle] != NULL && titleData[curTitle] != "All Programs")
{
ShowData::Iterator it;
for ( it = showData.begin(); it != showData.end(); ++it )
More information about the mythtv-users
mailing list