diff options
Diffstat (limited to 'abs/mv-core/myth/release-fixes/mythtv-release-fixes')
20 files changed, 2071 insertions, 0 deletions
diff --git a/abs/mv-core/myth/release-fixes/mythtv-release-fixes/3466-v1.patch b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/3466-v1.patch new file mode 100755 index 0000000..912ce27 --- /dev/null +++ b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/3466-v1.patch @@ -0,0 +1,240 @@ +Index: libs/libmythtv/NuppelVideoPlayer.cpp +=================================================================== +--- libs/libmythtv/NuppelVideoPlayer.cpp (revision 13535) ++++ libs/libmythtv/NuppelVideoPlayer.cpp (working copy) +@@ -1475,6 +1475,12 @@ + } + } + ++void NuppelVideoPlayer::DrawUnusedRects(bool sync) ++{ ++ if (videoOutput) ++ videoOutput->DrawUnusedRects(sync); ++} ++ + void NuppelVideoPlayer::ResetCaptions(uint mode_override) + { + uint origMode = textDisplayMode; +Index: libs/libmythtv/guidegrid.h +=================================================================== +--- libs/libmythtv/guidegrid.h (revision 13535) ++++ libs/libmythtv/guidegrid.h (working copy) +@@ -86,8 +86,9 @@ + void paintEvent(QPaintEvent *); + + private slots: +- void timeout(); +- void jumpToChannelTimeout(); ++ void timeCheckTimeout(void); ++ void repaintVideoTimeout(void); ++ void jumpToChannelTimeout(void); + + private: + void keyPressEvent(QKeyEvent *e); +@@ -174,6 +175,7 @@ + QString currentTimeColor; + + QTimer *timeCheck; ++ QTimer *videoRepaintTimer; + + bool keyDown; + +Index: libs/libmythtv/tv_play.h +=================================================================== +--- libs/libmythtv/tv_play.h (revision 13535) ++++ libs/libmythtv/tv_play.h (working copy) +@@ -112,6 +112,7 @@ + void StopEmbeddingOutput(void); + bool IsEmbedding(void); + void EPGChannelUpdate(uint chanid, QString channum); ++ void DrawUnusedRects(bool sync); + + // Recording commands + int PlayFromRecorder(int recordernum); +Index: libs/libmythtv/guidegrid.cpp +=================================================================== +--- libs/libmythtv/guidegrid.cpp (revision 13535) ++++ libs/libmythtv/guidegrid.cpp (working copy) +@@ -261,9 +261,14 @@ + + timeCheck = NULL; + timeCheck = new QTimer(this); +- connect(timeCheck, SIGNAL(timeout()), SLOT(timeout()) ); ++ connect(timeCheck, SIGNAL(timeout()), SLOT(timeCheckTimeout()) ); + timeCheck->start(200); + ++ videoRepaintTimer = new QTimer(this); ++ QObject::connect(videoRepaintTimer, SIGNAL(timeout()), ++ this, SLOT(repaintVideoTimeout())); ++ videoRepaintTimer->start(1000); ++ + selectState = false; + + updateBackground(); +@@ -281,18 +286,46 @@ + for (int x = 0; x < MAX_DISPLAY_TIMES; x++) + { + if (m_timeInfos[x]) ++ { + delete m_timeInfos[x]; ++ m_timeInfos[x] = NULL; ++ } + } + + for (int y = 0; y < MAX_DISPLAY_CHANS; y++) + { + if (m_programs[y]) ++ { + delete m_programs[y]; ++ m_programs[y] = NULL; ++ } + } + + m_channelInfos.clear(); + +- delete theme; ++ if (theme) ++ { ++ delete theme; ++ theme = NULL; ++ } ++ ++ if (jumpToChannelTimer) ++ { ++ jumpToChannelTimer->deleteLater(); ++ jumpToChannelTimer = NULL; ++ } ++ ++ if (timeCheck) ++ { ++ timeCheck->deleteLater(); ++ timeCheck = NULL; ++ } ++ ++ if (videoRepaintTimer) ++ { ++ videoRepaintTimer->deleteLater(); ++ videoRepaintTimer = NULL; ++ } + } + + void GuideGrid::keyPressEvent(QKeyEvent *e) +@@ -533,7 +566,7 @@ + return m_channelInfos[idx].chanid; + } + +-void GuideGrid::timeout() ++void GuideGrid::timeCheckTimeout(void) + { + timeCheck->changeInterval((int)(60 * 1000)); + QTime new_time = QTime::currentTime(); +@@ -561,6 +594,12 @@ + repaint(curInfoRect, false); + } + ++void GuideGrid::repaintVideoTimeout(void) ++{ ++ timeCheck->changeInterval(1000); ++ update(videoRect); ++} ++ + void GuideGrid::fillChannelInfos(bool gotostartchannel) + { + m_channelInfos.clear(); +@@ -974,6 +1013,7 @@ + if (r.intersects(videoRect) && m_player) + { + timeCheck->changeInterval((int)(200)); ++ m_player->DrawUnusedRects(false); + } + + qApp->unlock(); +@@ -1794,7 +1834,10 @@ + ChannelInfo info = m_channelInfos[idx]; + + if (m_player) ++ { + m_player->EPGChannelUpdate(info.chanid, info.chanstr); ++ videoRepaintTimer->start(200); ++ } + } + + // +Index: libs/libmythtv/NuppelVideoPlayer.h +=================================================================== +--- libs/libmythtv/NuppelVideoPlayer.h (revision 13535) ++++ libs/libmythtv/NuppelVideoPlayer.h (working copy) +@@ -118,6 +118,7 @@ + void StopEmbedding(void); + void ExposeEvent(void); + bool IsEmbedding(void); ++ void DrawUnusedRects(bool sync); + + // Audio Sets + void SetNoAudio(void) { no_audio_out = true; } +Index: libs/libmythtv/tv_play.cpp +=================================================================== +--- libs/libmythtv/tv_play.cpp (revision 13535) ++++ libs/libmythtv/tv_play.cpp (working copy) +@@ -5035,6 +5035,12 @@ + return false; + } + ++void TV::DrawUnusedRects(bool sync) ++{ ++ if (nvp) ++ nvp->DrawUnusedRects(sync); ++} ++ + void TV::doEditSchedule(int editType) + { + if (!playbackinfo) +Index: libs/libmythtv/videoout_xv.cpp +=================================================================== +--- libs/libmythtv/videoout_xv.cpp (revision 13535) ++++ libs/libmythtv/videoout_xv.cpp (working copy) +@@ -2465,7 +2465,7 @@ + } + + if ((needrepaint || xv_need_bobdeint_repaint) && +- (VideoOutputSubType() >= XVideo)) ++ (VideoOutputSubType() >= XVideo) && !embedding) + { + DrawUnusedRects(/* don't do a sync*/false); + } +@@ -2480,12 +2480,6 @@ + + void VideoOutputXv::DrawUnusedRects(bool sync) + { +- // Unfortunately, this gets drawn in the wrong place on prebuffering +- // pauses when embedding and this is rarely useful when embedding +- // since the background is drawn in guidegrid so we bail here. -- dtk +- if (embedding) +- return; +- + // boboff assumes the smallest interlaced resolution is 480 lines - 5% + bool use_bob = (m_deinterlacing && m_deintfiltername == "bobdeint"); + int boboff_raw = (int)round(((double)display_video_rect.height()) / +@@ -2512,7 +2506,12 @@ + + X11L; + +- if (xv_draw_colorkey && needrepaint) ++ // This is used to avoid drawing the colorkey when embedding and ++ // not using overlay. This is needed because we don't paint this ++ // in the vertical retrace period when calling this from the EPG. ++ bool clrdraw = xv_colorkey || !embedding; ++ ++ if (xv_draw_colorkey && needrepaint && clrdraw) + { + XSetForeground(XJ_disp, XJ_gc, xv_colorkey); + XFillRectangle(XJ_disp, XJ_curwin, XJ_gc, +@@ -2521,7 +2520,7 @@ + display_visible_rect.width(), + display_visible_rect.height() - 2 * boboff); + } +- else if (xv_draw_colorkey && xv_need_bobdeint_repaint) ++ else if (xv_draw_colorkey && xv_need_bobdeint_repaint && clrdraw) + { + // if this is only for deinterlacing mode switching, draw + // the border areas, presumably the main image is undamaged. diff --git a/abs/mv-core/myth/release-fixes/mythtv-release-fixes/PKGBUILD b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/PKGBUILD new file mode 100755 index 0000000..c210b55 --- /dev/null +++ b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/PKGBUILD @@ -0,0 +1,79 @@ +pkgname=mythtv-release-fixes +pkgver=18322 +pkgrel=13 +pkgdesc=".21 A personal video recorder for Linux" +url="http://www.mythtv.org" +license="GPL" +depends=('lame' 'libmysqlclient' 'alsa-lib' 'wget' 'qt3' 'x-server' 'freetype2' 'libmpeg2' 'libxml2' 'libraw1394' 'lirc' 'perl-date-manip' 'libavc1394' 'libdc1394' 'libiec61883') +makedepends=('subversion') +conflicts=(mythtv-svn) +replaces=() +backup=() +options=(!strip) +MAKEFLAGS="-j6" + +install='mythtv.install' +#source=(mythbackend myth.sh 3466-v1.patch reload.patch) +source=(mythbackend myth.sh myth.find_orphans.pl dbconfig.patch myththemedmenu.cpp.patch myththemedmenu.h.patch screenshots2.diff screenshot_jump.patch pop_be_restart.h.patch pop_be_restart.cpp.patch jump_snapshot.patch smolt_jump.patch) +arch=('i686') +md5sums=() +_svntrunk=http://svn.mythtv.org/svn/branches/release-0-21-fixes/mythtv +#_svntrunk=http://cvs.mythtv.org/svn/trunk/mythtv +_svnmod=mythtv + +build() { + svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod + cd $startdir/src/mythtv + patch -p0 < ../dbconfig.patch + grep snapshot programs/mythfrontend/networkcontrol.cpp|grep -q jumpMap + status=$? + + if [ $status != 0 ] + then + echo "patching for screenshot" + patch -p0 < ../screenshots2.diff + patch -p0 < ../screenshot_jump.patch + # patch -p0 < ../jump_snapshot.patch + + else + echo "screenshot already patched" + fi + patch -p0 < ../myththemedmenu.cpp.patch + patch -p0 < ../myththemedmenu.h.patch + patch -p0 < ../pop_be_restart.h.patch + patch -p0 < ../pop_be_restart.cpp.patch + patch -p0 < ../smolt_jump.patch + sed -i -e "s/\`(svnversion \$\${SVNTREEDIR} 2>\/dev\/null) || echo Unknown\`/$pkgver/" version.pro + make distclean + make clean + ./configure --prefix=/usr/local --enable-xvmc --enable-xvmc-pro --enable-opengl-vsync --enable-dvb --enable-firewire --compile-type=release --with-bindings=perl --disable-audio-arts --disable-xrandr --disable-audio-jack + #./configure --prefix=/usr/local --enable-xvmc --enable-xvmc-pro --enable-opengl-vsync --enable-dvb --enable-firewire --compile-type=release --disable-audio-arts --disable-xrandr --without-bindings=perl --disable-audio-jack +. /etc/profile + + make + make INSTALL_ROOT=$startdir/pkg install + mkdir -p $startdir/pkg/usr/local/share/mythtv/contrib + mkdir -p $startdir/pkg/etc/rc.d + mkdir -p $startdir/pkg/var/log/mythtv + mkdir -p $startdir/pkg/etc/profile.d + install -m0755 ../myth.sh $startdir/pkg/etc/profile.d/ +# install contrib + mkdir -p $startdir/pkg/usr/local/share/mythtv/contrib || return 1 + #cp -rp contrib/* $startdir/pkg/usr/local/share/mythtv/contrib + rsync -a --exclude=.svn contrib/* $startdir/pkg/usr/local/share/mythtv/contrib + echo "-release-fixes" > $startdir/pkg/usr/local/share/mythtv/.releasetype + #install -m0755 themes/*.ttf $startdir/pkg/usr/local/share/mythtv/themes/ + # set suid on mythfrontend +# chmod a+s $startdir/pkg/usr/local/bin/mythfrontend + +# mkdir -p $startdir/pkg/usr/lib/ +# mv $startdir/pkg/usr/local/lib/perl5 $startdir/pkg/usr/lib/perl5 + cd $startdir/src/mythtv/contrib + gcc -Wall -o firewire_tester firewire_tester.c -liec61883 -lraw1394 + install -m0755 firewire_tester $startdir/pkg/usr/local/bin/firewire_tester + install -m0755 $startdir/pkg/usr/local/share/mythtv/contrib/optimize_mythdb.pl $startdir/pkg/usr/local/bin/optimize_mythdb.pl + cp $startdir/src/myth.find_orphans.pl $startdir/pkg/usr/local/share/mythtv/contrib/myth.find_orphans.pl + install -m0755 $startdir/pkg/usr/local/share/mythtv/contrib/myth.find_orphans.pl $startdir/pkg/usr/local/bin/myth.find_orphans.pl + + +} diff --git a/abs/mv-core/myth/release-fixes/mythtv-release-fixes/dbconfig.patch b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/dbconfig.patch new file mode 100644 index 0000000..1d181ac --- /dev/null +++ b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/dbconfig.patch @@ -0,0 +1,19 @@ +--- libs/libmyth/mythcontext.cpp 2007-10-04 00:20:28.000000000 -0500 ++++ libs/libmyth/mythcontext.cpp.new 2007-11-12 22:54:57.000000000 -0600 +@@ -852,14 +852,14 @@ + cout << endl << error << endl << endl; + response = getResponse("Would you like to configure the database " + "connection now?", +- "yes"); ++ "no"); + if (!response || response.left(1).lower() != "y") + return false; + + params.dbHostName = getResponse("Database host name:", + params.dbHostName); + response = getResponse("Should I test connectivity to this host " +- "using the ping command?", "yes"); ++ "using the ping command?", "no"); + params.dbHostPing = (!response || response.left(1).lower() != "y"); + + params.dbPort = intResponse("Database non-default port:", diff --git a/abs/mv-core/myth/release-fixes/mythtv-release-fixes/debug_uitypes.cpp.patch b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/debug_uitypes.cpp.patch new file mode 100644 index 0000000..b87b89f --- /dev/null +++ b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/debug_uitypes.cpp.patch @@ -0,0 +1,21 @@ +--- mythtv/libs/libmyth/uitypes.cpp.orig 2007-11-30 14:03:07.000000000 -0600 ++++ mythtv/libs/libmyth/uitypes.cpp 2007-11-30 14:04:09.000000000 -0600 +@@ -3831,15 +3831,15 @@ + // + // Debugging, draw edges around bins + // +- +- /* ++ if (m_debug == true) ++ { + p->setPen(QColor(255,0,0)); + CornerMap::Iterator it; + for ( it = bin_corners.begin(); it != bin_corners.end(); ++it ) + { + p->drawRect(it.data()); + } +- */ ++ } + + } + diff --git a/abs/mv-core/myth/release-fixes/mythtv-release-fixes/debug_xmlparse.cpp.patch b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/debug_xmlparse.cpp.patch new file mode 100644 index 0000000..f479bbe --- /dev/null +++ b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/debug_xmlparse.cpp.patch @@ -0,0 +1,14 @@ +--- mythtv/libs/libmyth/xmlparse.cpp.orig 2007-11-30 14:03:00.000000000 -0600 ++++ mythtv/libs/libmyth/xmlparse.cpp 2007-11-30 14:06:22.000000000 -0600 +@@ -2618,6 +2618,11 @@ + area = parseRect(getFirstText(info)); + normalizeRect(area); + } ++ if (info.tagName() == "debug") ++ { ++ if (getFirstText(info) == "true") ++ container->SetDebug(true); ++ } + else if (info.tagName() == "image") + { + QString imgname = ""; diff --git a/abs/mv-core/myth/release-fixes/mythtv-release-fixes/jump_snapshot.patch b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/jump_snapshot.patch new file mode 100644 index 0000000..2d2c68b --- /dev/null +++ b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/jump_snapshot.patch @@ -0,0 +1,13 @@ +--- libs/libmythui/mythmainwindow.cpp.orrig 2008-03-19 18:43:08.000000000 +0000 ++++ libs/libmythui/mythmainwindow.cpp 2008-03-19 18:43:51.000000000 +0000 +@@ -1132,7 +1132,9 @@ + + void MythMainWindow::JumpTo(const QString& destination, bool pop) + { +- if (d->destinationMap.count(destination) > 0 && d->exitmenucallback == NULL) ++ if (destination == "ScreenShot") ++ screenShot(); ++ else if (d->destinationMap.count(destination) > 0 && d->exitmenucallback == NULL) + { + d->exitingtomain = true; + d->popwindows = pop; diff --git a/abs/mv-core/myth/release-fixes/mythtv-release-fixes/myth.find_orphans.pl b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/myth.find_orphans.pl new file mode 100755 index 0000000..c258e1d --- /dev/null +++ b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/myth.find_orphans.pl @@ -0,0 +1,260 @@ +#!/usr/bin/perl + +# check for recording anomolies - +# based somewhat on greg froese's "myth.rebuilddatabase.pl" +# -- Lincoln Dale <ltd@interlink.com.au>, September 2006 +# 2007-03-11: Added pretty print of unknown files vs. orphaned thumbnails. (Robert Kulagowski) + +# The intent of this script is to be able to find orphaned rows in the 'recorded' table +# (entries which don't have matching media files) and orphaned media files (potentially +# taking up gigabytes of otherwise usable disk space) which have no matching row in +# the 'recorded' db table. +# +# By default, running the script will simply return a list of problems it finds. +# Running with --dodbdelete will remove db recorded rows for which there is no matching +# media file. Running with --dodelete will delete media files for which there is no +# matching db record. +# +# This script may be useful to fix up some orphaned db entries (causes mythweb to run +# verrry slow) as well as reclaim some disk space from some orphaned media files. +# (in an ideal world, neither of these would ever happen, but i've seen both happen in reality). +# This script makes it easy to keep track of whether it has or hasn't happened, even if you +# have thousands of recordings and terabytes of stored media. +# +# no warranties expressed or implied. if you run this and it deletes all your recordings +# and sets mythtv to fill up all your disk space with The Home Shopping Network, its entirely +# your fault. + +my $progname = "myth.find_orphans.pl"; +my $revision = "0.20"; + +use DBI; +use Sys::Hostname; +use Getopt::Long; + +# +# options +# + +my $opt_host = hostname; +my $opt_dbhost = "localhost"; +my $opt_database = "mythconverg"; +my $opt_user = "mythtv"; +my $opt_pass = "mythtv"; +my $opt_ext = "{nuv,mpg,mpeg,avi}"; +my $opt_dir = ""; +my $opt_dodelete = 0; +my $opt_dodbdelete = 0; +my $debug = 0; +my $opt_help = 0; + +GetOptions( + 'host=s' => \$opt_host, + 'dbhost=s' => \$opt_dbhost, + 'database=s' => \$opt_database, + 'user=s' => \$opt_user, + 'pass=s' => \$opt_pass, + 'dir=s' => \$opt_dir, + 'dodelete' => \$opt_dodelete, + 'dodbdelete' => \$opt_dodbdelete, + 'debug+' => \$debug, + 'help' => \$opt_help, + 'h' => \$opt_help, + 'v' => \$opt_help); + +if ($opt_help) { + print<<EOF +$progname (rev $revision) +(checks MythTV recording directories for orphaned files) + +options: + --host=(host) MythTV backend host ($opt_host) + --dbhost=(host) host where MySQL database for backend is ($opt_dbhost) + --database=(dbname) MythTV database ($opt_database) + --user=(user) MySQL MythTV database user ($opt_user) + --pass=(pass) MySQL MythTV database password ($opt_pass) + --dir=directories manually specify recording directories (otherwise setting is from database) + --debug increase debug level + --dodbdelete remove recorded db entries with no matching file (default: don't) + --dodelete delete files with no record (default: don't) + +EOF +; + exit(0); +} + +# +# go go go! +# + +my $valid_recordings = 0; +my $missing_recordings = 0; +my $errors = 0; +my $unknown_files = 0; +my $known_files = 0; +my $unknown_size = 0; +my $known_size = 0; +my $unknown_thumbnail = 0; + +if (!($dbh = DBI->connect("dbi:mysql:database=$opt_database:host=$opt_dbhost","$opt_user","$opt_pass"))) { + die "Cannot connect to database $opt_database on host $opt_dbhost: $!\n"; +} + +if ($opt_dir eq "") { + &dir_lookup("SELECT dirname FROM storagegroup WHERE hostname=(?)"); + &dir_lookup("SELECT data FROM settings WHERE value='RecordFilePrefix' AND hostname=(?)"); + + printf STDERR "Recording directories ($opt_host): $opt_dir\n" if $debug; +} + +if ($opt_dir eq "") { + printf "ERROR: no directory found or specified\n"; + exit 1; +} + +foreach $d (split(/,/,$opt_dir)) { + $d =~ s/\/$//g; # strip trailing / + $dirs{$d}++; +} + + +# +# look in recorded table, make sure we can find every file .. +# + +my $q = "SELECT title, subtitle, starttime, endtime, chanid, basename FROM recorded WHERE hostname=(?) ORDER BY starttime"; +$sth = $dbh->prepare($q); +$sth->execute($opt_host) || die "Could not execute ($q): $!\n"; + +while (my @row=$sth->fetchrow_array) { + ($title, $subtitle, $starttime, $endtime, $channel, $basename) = @row; + + # see if we can find it... + $loc = find_file($basename); + if ($loc eq "") { + printf "Missing media: %s (title:%s, start:%s)\n",$basename,$title,$starttime; + $missing_recordings++; + + if ($opt_dodbdelete) { + my $sql = sprintf "DELETE FROM recorded WHERE basename LIKE \"%s\" LIMIT 1",$basename; + printf "performing database delete: %s\n",$sql; + $dbh->do($sql) || die "Could not execute $sql: $!\n"; + } + } else { + $valid_recordings++; + $seen_basename{$basename}++; + $seen_basename{$basename.".png"}++; # thumbnail + } +} + +# +# look in recording directories, see if there are extra files not in database +# + +foreach my $this_dir (keys %dirs) { + opendir(DIR, $this_dir) || die "cannot open directory $this_dir: $!\n"; + foreach $this_file (readdir(DIR)) { + if (-f "$this_dir/$this_file") { + + next if ($this_file eq "nfslockfile.lock"); + next if ($this_file =~ m/^mythconv.*/); + next if ($this_dir eq "/data/database_backup"); + + my $this_filesize = -s "$this_dir/$this_file"; + if ($seen_basename{$this_file} == 0) { + $sorted_filesizes{$this_filesize} .= sprintf "unknown file [%s]: %s/%s\n",pretty_filesize($this_filesize),$this_dir,$this_file; + $unknown_size += $this_filesize; + if (substr($this_file,-4) eq ".png") { + $unknown_thumbnail++; + } + else { + $unknown_files++; + } + + if ($opt_dodelete) { + printf STDERR "deleting [%s]: %s/%s\n",pretty_filesize($this_filesize),$this_dir,$this_file; + unlink "$this_dir/$this_file"; + + if (-f "$this_dir/$this_file") { + $errors++; + printf "ERROR: could not delete $this_dir/$this_file\n"; + } + } + } else { + $known_files++; + $known_size += $this_filesize; + printf "KNOWN file [%s]: %s/%s\n",pretty_filesize($this_filesize),$this_dir,$this_file if $debug; + } + } else { + printf "NOT A FILE: %s/%s\n",$this_dir,$this_file if $debug; + } + } + closedir DIR; +} + + +# +# finished, report results +# + +foreach my $key (sort { $a <=> $b } keys %sorted_filesizes) { + printf $sorted_filesizes{$key}; +} + +printf "Summary:\n"; +printf " Host: %s, Directories: %s\n", $opt_host, join(" ",keys %dirs); +printf " %d ERRORS ENCOUNTERED (see above for details)\n",$errors if ($errors > 0); +printf " %d valid recording%s, %d missing recording%s %s\n", + $valid_recordings, ($valid_recordings != 1 ? "s" : ""), + $missing_recordings, ($missing_recordings != 1 ? "s" : ""), + ($missing_recordings > 0 ? ($opt_dodbdelete ? "were fixed" : "not fixed, check above is valid and use --dodbdelete to fix") : ""); +printf " %d known media files using %s\n %d orphaned thumbnails with no corresponding recording\n %d unknown files using %s %s\n", + $known_files, pretty_filesize($known_size), + $unknown_thumbnail,$unknown_files, pretty_filesize($unknown_size), + ($unknown_files > 0 ? ($opt_dodelete ? "were fixed" : "not fixed, check above and use --dodelete to clean up if the above output is accurate") : ""); + +exit(0); + +########################################################################### +# filesize bling + +sub pretty_filesize +{ + local($fsize) = @_; + return sprintf "%0.1fGB",($fsize / 1000000000) if ($fsize >= 1000000000); + return sprintf "%0.1fMB",($fsize / 1000000) if ($fsize >= 1000000); + return sprintf "%0.1fKB",($fsize / 1000) if ($fsize >= 1000); + return sprintf "%0.0fB",$fsize; +} + +########################################################################### +# find a file in directories without globbing + +sub find_file +{ + local($fname) = @_; + + foreach my $d (keys %dirs) { + my $f = $d."/".$fname; + if (-e $f) { + return $f; + } + } + return; +} + +########################################################################### + +sub dir_lookup +{ + my $query = shift; + + $sth = $dbh->prepare($query); + $sth->execute($opt_host) || die "Could not execute ($dir_query)"; + while (my @row = $sth->fetchrow_array) { + $opt_dir .= "," if ($opt_dir ne ""); + $opt_dir .= $row[0]; + } +} + +########################################################################### diff --git a/abs/mv-core/myth/release-fixes/mythtv-release-fixes/myth.sh b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/myth.sh new file mode 100755 index 0000000..fb7122c --- /dev/null +++ b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/myth.sh @@ -0,0 +1,4 @@ +export PATH=$PATH:/usr/local/bin +# set core file size to 0 +ulimit -c 0 +export MALLOC_CHECK_=0
\ No newline at end of file diff --git a/abs/mv-core/myth/release-fixes/mythtv-release-fixes/mythbackend b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/mythbackend new file mode 100755 index 0000000..f96c6b7 --- /dev/null +++ b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/mythbackend @@ -0,0 +1,37 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +PID=`pidof -o %PPID /usr/bin/mythbackend` +case "$1" in + start) + stat_busy "Starting MythTV Backend" + [ ! -e /var/run/mysqld.pid ] && echo -n "mysqld not started" && stat_fail && exit + [ -z "$PID" ] && /usr/local/bin/mythbackend -d -l /var/log/mythbackend.log -v quiet + if [ $? -gt 0 ]; then + stat_fail + else + echo $PID > /var/run/mythbackend.pid + add_daemon mythbackend + stat_done + fi + ;; + stop) + stat_busy "Stopping MythTV Backend" + [ ! -z "$PID" ] && kill $PID &>/dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon mythbackend + stat_done + fi + ;; + restart) + $0 stop + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 diff --git a/abs/mv-core/myth/release-fixes/mythtv-release-fixes/mythbackend.sh b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/mythbackend.sh new file mode 100755 index 0000000..e7a7b70 --- /dev/null +++ b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/mythbackend.sh @@ -0,0 +1,117 @@ +#!/bin/bash +# +# /etc/rc.d/init.d/mythbackend +# +# Starts the mythbackend as a daemon +# +# chkconfig: 345 90 10 +# description: Starts the mythbackend process as a daemon after the XWindows \ +# system is started, in runlevel 5. This allows scheduled \ +# recordings to occur without manual intervention. +# processname: mythbackend + +# Copyright (c) by Michael Thomson <linux at m-thomson dot net> +# With thanks to Stu Tomlinson <stu at nosnilmot dot com> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Default values to use if none are supplied in the config file. +# User who should start the mythbackend processes +MBE_USER="root" +# Directory holding the mythbackend binary +MBE_LOCATION="/usr/local/bin/" +# Name of mythbackend binary +MBE_PROG="mythbackend" +# Full path to mythbackend log file +MBE_LOGFILE="/var/log/mythtv/mythbackend.log" + +# Source function library. +. /etc/init.d/functions + +# Source config file if available +if [ -f "/etc/sysconfig/mythbackend" ]; then + . /etc/sysconfig/mythbackend +fi + +test -x ${MBE_LOCATION}${MBE_PROG} || exit 0 + +RETVAL=0 + +# +# See how we were called. +# + +start() { + # Check if mythbackend is already running + if [ ! -f /var/lock/subsys/${MBE_PROG} ]; then + echo -n "Starting ${MBE_PROG}: " + # /usr/local/bin/mythbackend -d -l /some/log/file + #daemon --user ${MBE_USER} ${MBE_LOCATION}${MBE_PROG} -d -l ${MBE_LOGFILE} + ${MBE_LOCATION}${MBE_PROG} -d -l ${MBE_LOGFILE} + RETVAL=$? + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/${MBE_PROG} + echo + fi + return $RETVAL +} + +stop() { + echo -n "Stopping ${MBE_PROG}: " + killproc ${MBE_LOCATION}${MBE_PROG} + RETVAL=$? + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/${MBE_PROG} + echo + return $RETVAL +} + + +restart() { + stop + start +} + +reload() { + restart +} + +status_at() { + status ${MBE_LOCATION}${MBE_PROG} +} + +case "$1" in +start) + start + ;; +stop) + stop + ;; +reload|restart) + restart + ;; +condrestart) + if [ -f /var/lock/subsys/${MBE_PROG} ]; then + restart + fi + ;; +status) + status_at + ;; +*) + echo "Usage: $0 {start|stop|restart|condrestart|status}" + exit 1 +esac + +exit $? +exit $RETVAL diff --git a/abs/mv-core/myth/release-fixes/mythtv-release-fixes/myththemedmenu.cpp.patch b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/myththemedmenu.cpp.patch new file mode 100644 index 0000000..f5baccd --- /dev/null +++ b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/myththemedmenu.cpp.patch @@ -0,0 +1,125 @@ +--- libs/libmythui/myththemedmenu.cpp.orig 2008-01-31 15:26:38.000000000 +0000 ++++ libs/libmythui/myththemedmenu.cpp 2008-02-07 22:24:27.000000000 +0000 +@@ -2102,6 +2102,10 @@ + } + lastbutton = NULL; + } ++ else if (action == "MENU") ++ { ++ parent->doMenu(); ++ } + else if (action == "EJECT") + { + myth_eject(); +@@ -2482,6 +2486,8 @@ + + if (d->foundtheme) + d->parseMenu(menufile); ++ ++ m_menuPopup = NULL; + } + + MythThemedMenu::~MythThemedMenu(void) +@@ -2592,3 +2598,102 @@ + MythScreenType::aboutToShow(); + d->updateLCD(); + } ++void MythThemedMenu::doMenu() ++{ ++ int allowsd = gContext->GetNumSetting("AllowQuitShutdown"); ++ if (m_menuPopup) ++ return; ++ QString label = "System Menu"; ++ MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); ++ m_menuPopup = new MythDialogBox(label, mainStack, "menuPopup"); ++ if (m_menuPopup->Create()) ++ mainStack->AddScreen(m_menuPopup); ++ ++ ++ if ( allowsd != 0 && allowsd !=4 ) ++ { ++ m_menuPopup->SetReturnEvent(this,"popmenu_exit"); ++ m_menuPopup->AddButton("Shutdown"); ++ m_menuPopup->AddButton("Reboot"); ++ m_menuPopup->AddButton("About"); ++ m_menuPopup->AddButton("Cancel"); ++ } ++ else ++ { ++ m_menuPopup->SetReturnEvent(this,"popmenu_noexit"); ++ m_menuPopup->AddButton("About"); ++ m_menuPopup->AddButton("Cancel"); ++ } ++} ++ ++void MythThemedMenu::aboutScreen() ++{ ++{ ++ extern const char *myth_source_version; ++ extern const char *myth_source_path; ++ QString distro_line; ++ distro_line=""; ++ ++ QFile file("/etc/os_myth_release"); ++ if ( file.open(IO_ReadOnly | IO_Translate) ) ++ { ++ QTextStream t( &file ); // use a text stream ++ distro_line = t.readLine(); ++ file.close(); ++ } ++ ++ QString label = ""; ++ label.append(QObject::tr("Revision: ") + myth_source_version + " \n Branch:" + myth_source_path + "\n" + distro_line ); ++ ++ MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); ++ m_menuPopup = new MythDialogBox(label, mainStack, "About"); ++ if (m_menuPopup->Create()) ++ mainStack->AddScreen(m_menuPopup); ++ ++ m_menuPopup->SetReturnEvent(this,"About"); ++ m_menuPopup->AddButton("OK!"); ++ } ++} ++ ++void MythThemedMenu::customEvent(QCustomEvent *event) ++{ ++ if (event->type() == kMythDialogBoxCompletionEventType) ++ { ++ DialogCompletionEvent *dce = ++ dynamic_cast<DialogCompletionEvent*>(event); ++ ++ QString resultid= dce->GetId(); ++ int buttonnum = dce->GetResult(); ++ if (resultid == "popmenu_exit") ++ { ++ if (buttonnum == 0) ++ { ++ QString halt_cmd = gContext->GetSetting("HaltCommand", ++ "sudo /sbin/halt -p"); ++ if (!halt_cmd.isEmpty()) ++ system(halt_cmd.ascii()); ++ } ++ ++ if (buttonnum == 1) ++ { ++ QString reboot_cmd = gContext->GetSetting("RebootCommand", ++ "sudo /sbin/reboot"); ++ if (!reboot_cmd.isEmpty()) ++ system(reboot_cmd.ascii()); ++ } ++ ++ if (buttonnum == 2) ++ { ++ aboutScreen(); ++ } ++ } ++ ++ if (resultid == "popmenu_noexit") ++ { ++ if (buttonnum == 0) ++ aboutScreen(); ++ } ++ ++ m_menuPopup = NULL; ++ } ++} diff --git a/abs/mv-core/myth/release-fixes/mythtv-release-fixes/myththemedmenu.h.patch b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/myththemedmenu.h.patch new file mode 100644 index 0000000..9744b11 --- /dev/null +++ b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/myththemedmenu.h.patch @@ -0,0 +1,25 @@ +--- libs/libmythui/myththemedmenu.h.orig 2008-01-31 15:26:45.000000000 +0000 ++++ libs/libmythui/myththemedmenu.h 2008-02-07 21:00:22.000000000 +0000 +@@ -2,6 +2,7 @@ + #define MYTHTHEMEDMENU_H_ + + #include "mythscreentype.h" ++#include "mythdialogbox.h" + + class MythMainWindow; + class MythThemedMenuPrivate; +@@ -26,8 +27,14 @@ + + void ReloadTheme(void); + void ReloadExitKey(void); ++ + virtual void aboutToShow(void); + ++ void doMenu(); ++ void aboutScreen(); ++ MythDialogBox *m_menuPopup; ++ void customEvent(QCustomEvent *event); ++ + protected: + virtual bool keyPressEvent(QKeyEvent *e); + virtual void gestureEvent(MythUIType *origtype, MythGestureEvent *ge); diff --git a/abs/mv-core/myth/release-fixes/mythtv-release-fixes/mythtv.install b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/mythtv.install new file mode 100755 index 0000000..2c87aee --- /dev/null +++ b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/mythtv.install @@ -0,0 +1,59 @@ + +# arg 1: the new package version +pre_install () { + echo "backing up the database" + dbver=`pacman -Q mythtv-release-fixes | awk ' { print $2 } '` + if [ ! -e /data/databases_backup ] + then + mkdir -p /data/database_backup + fi + mysqldump -u mythtv -pmythtv mythconverg -c > /data/database_backup/${dbver}.dump.sql +} + +post_install() { + mkdir -p /data/home + /usr/sbin/useradd -G users,video,audio,optical -m -d /data/home/mythtv mythtv + /usr/sbin/usermod -G users,video,audio,optical mythtv +# mkdir /var/log/mythtv +# chown -R mythtv:users /var/log/mythtv + dbver=`pacman -Q mythtv-release-fixes | awk ' { print $2 } '` + if [ ! -e /data/database_backup ] + then + mkdir -p /data/database_backup + fi + chown mythtv:nobody /data/database_backup + chmod g+s /data/database_backup + + mysqldump -u mythtv -pmythtv mythconverg -c > /data/database_backup/${dbver}.dump.sql + grep -q /usr/local/lib /etc/ld.so.conf + if [ $? = 1 ] + then + echo "/usr/local/lib" >> /etc/ld.so.conf + fi + +} +pre_upgrade () { + pre_install +} + +# arg 1: the new package version +# arg 2: the old package version +post_upgrade() { + post_install + + /bin/true +} + +# arg 1: the old package version +pre_remove() { + /bin/true +} + +# arg 1: the old package version +post_remove() { +/bint/true +} + +op=$1 +shift +$op $* diff --git a/abs/mv-core/myth/release-fixes/mythtv-release-fixes/pop_be_restart.cpp.patch b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/pop_be_restart.cpp.patch new file mode 100644 index 0000000..a7a5326 --- /dev/null +++ b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/pop_be_restart.cpp.patch @@ -0,0 +1,51 @@ +--- libs/libmythui/myththemedmenu.cpp.orig 2008-03-17 15:54:00.000000000 -0500 ++++ libs/libmythui/myththemedmenu.cpp 2008-03-17 15:54:09.000000000 -0500 +@@ -2615,12 +2615,14 @@ + m_menuPopup->SetReturnEvent(this,"popmenu_exit"); + m_menuPopup->AddButton("Shutdown"); + m_menuPopup->AddButton("Reboot"); ++ m_menuPopup->AddButton("MythBackend restart"); + m_menuPopup->AddButton("About"); + m_menuPopup->AddButton("Cancel"); + } + else + { + m_menuPopup->SetReturnEvent(this,"popmenu_noexit"); ++ m_menuPopup->AddButton("MythBackend restart"); + m_menuPopup->AddButton("About"); + m_menuPopup->AddButton("Cancel"); + } +@@ -2655,6 +2657,11 @@ + } + } + ++void MythThemedMenu::Restartmythbackend() ++{ ++ system("/usr/MythVantage/bin/mythbeselect -restart"); ++} ++ + void MythThemedMenu::customEvent(QCustomEvent *event) + { + if (event->type() == kMythDialogBoxCompletionEventType) +@@ -2684,6 +2691,10 @@ + + if (buttonnum == 2) + { ++ Restartmythbackend(); ++ } ++ if (buttonnum == 3) ++ { + aboutScreen(); + } + } +@@ -2691,6 +2702,10 @@ + if (resultid == "popmenu_noexit") + { + if (buttonnum == 0) ++ { ++ Restartmythbackend(); ++ } ++ if (buttonnum == 1) + aboutScreen(); + } + diff --git a/abs/mv-core/myth/release-fixes/mythtv-release-fixes/pop_be_restart.h.patch b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/pop_be_restart.h.patch new file mode 100644 index 0000000..1fba435 --- /dev/null +++ b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/pop_be_restart.h.patch @@ -0,0 +1,10 @@ +--- libs/libmythui/myththemedmenu.h.orig 2008-03-17 15:48:28.000000000 -0500 ++++ libs/libmythui/myththemedmenu.h 2008-03-17 15:48:30.000000000 -0500 +@@ -32,6 +32,7 @@ + + void doMenu(); + void aboutScreen(); ++ void Restartmythbackend(); + MythDialogBox *m_menuPopup; + void customEvent(QCustomEvent *event); + diff --git a/abs/mv-core/myth/release-fixes/mythtv-release-fixes/reload.patch b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/reload.patch new file mode 100644 index 0000000..9cc2044 --- /dev/null +++ b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/reload.patch @@ -0,0 +1,52 @@ +--- programs/mythfrontend/main.cpp 2007-11-13 15:34:40.000000000 +0000 ++++ programs/mythfrontend/main.cpp.new 2007-11-13 15:36:15.000000000 +0000 +@@ -72,6 +72,9 @@ + RunProgramGuide(chanid, channum); + } + ++ ++ ++ + void startFinder(void) + { + RunProgramFind(); +@@ -761,6 +764,7 @@ + } + } + ++ + void InitJumpPoints(void) + { + REG_JUMP("Reload Theme", "", "", reloadTheme); +@@ -784,6 +788,17 @@ + TV::SetEmbedPbbFunc(PlaybackBox::RunPlaybackBox); + } + ++ ++void signal_USR1_handler(int){ ++ VERBOSE(VB_GENERAL, "SIG USR1 received, reloading theme"); ++ RemoteSendMessage("CLEAR_SETTINGS_CACHE"); ++ gContext->ActivateSettingsCache(false); ++ qApp->processEvents(); ++ GetMythMainWindow()->JumpTo("Reload Theme"); ++ gContext->removeCurrentLocation(); ++ gContext->ActivateSettingsCache(true); ++} ++ + int internal_media_init() + { + REG_MEDIAPLAYER("Internal", "MythTV's native media player.", +@@ -1411,7 +1426,12 @@ + + if (!RunMenu(themedir)) + break; +- ++ struct sigaction new_action, old_action; ++ /* Set up the structure to specify the new action. */ ++ new_action.sa_handler = signal_USR1_handler; ++ ::sigemptyset(&new_action.sa_mask); ++ new_action.sa_flags = 0; ++ ::sigaction (SIGUSR1, &new_action, &old_action); + qApp->setMainWidget(mainWindow); + qApp->exec(); + } while (!(exitstatus = handleExit())); diff --git a/abs/mv-core/myth/release-fixes/mythtv-release-fixes/screenshot_jump.patch b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/screenshot_jump.patch new file mode 100644 index 0000000..8a5dee4 --- /dev/null +++ b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/screenshot_jump.patch @@ -0,0 +1,10 @@ +--- programs/mythfrontend/networkcontrol.cpp.orig 2008-03-16 23:31:05.000000000 +0000 ++++ programs/mythfrontend/networkcontrol.cpp 2008-03-16 23:32:01.000000000 +0000 +@@ -80,6 +80,7 @@ + jumpMap["zoneminderconsole"] = "ZoneMinder Console"; + jumpMap["zoneminderliveview"] = "ZoneMinder Live View"; + jumpMap["zoneminderevents"] = "ZoneMinder Events"; ++ jumpMap["snapshot"] = "ScreenShot"; + + // These jump point names match the (lowercased) locations from gContext + jumpMap["channelrecpriority"] = "Channel Recording Priorities"; diff --git a/abs/mv-core/myth/release-fixes/mythtv-release-fixes/screenshots.diff b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/screenshots.diff new file mode 100644 index 0000000..2b5dabe --- /dev/null +++ b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/screenshots.diff @@ -0,0 +1,458 @@ +Index: libs/libmythui/mythmainwindow.cpp +=================================================================== +--- libs/libmythui/mythmainwindow.cpp (revision 15827) ++++ libs/libmythui/mythmainwindow.cpp (working copy) +@@ -504,6 +507,81 @@ + d->repaintRegion = d->repaintRegion.unite(pe->region()); + } + ++bool MythMainWindow::screenShot(QString fname, int x, int y, int x2, int y2, int w, int h) ++{ ++ bool ret = false; ++ ++ QString extension = fname.section('.', -1, -2); ++ ++ if (extension == "jpg") ++ extension = "JPEG"; ++ else ++ extension = "PNG"; ++ ++ VERBOSE(VB_GENERAL, QString("MythMainWindow::screenShot saving winId %1 to %2 (%3 x %4) [ %5/%6 - %7/%8]") ++ .arg(QApplication::desktop()->winId()) ++ .arg(fname) ++ .arg(w) ++ .arg(h) ++ .arg(x) ++ .arg(y) ++ .arg(x2) ++ .arg(y2)); ++ ++ QPixmap p; ++ p = QPixmap::grabWindow( QApplication::desktop()->winId(), x, y, x2, y2); ++ ++ QImage img = p.convertToImage(); ++ ++ if ( w == 0 ) ++ w = img.width(); ++ ++ if ( h == 0 ) ++ h = img.height(); ++ ++ VERBOSE(VB_GENERAL, QString("Scaling to %1 x %2 from %3 x %4") ++ .arg(w) ++ .arg(h) ++ .arg(img.width()) ++ .arg(img.height())); ++ ++ img = img.smoothScale( w, h , QImage::ScaleMin); ++ ++ if (img.save(fname ,extension)) ++ { ++ VERBOSE(VB_GENERAL, "MythMainWindow::screenShot succeeded"); ++ ret = true; ++ } ++ else ++ { ++ VERBOSE(VB_GENERAL, "MythMainWindow::screenShot Failed!"); ++ ret = false; ++ } ++ ++ return ret; ++} ++ ++bool MythMainWindow::screenShot(int x, int y, int x2, int y2) ++{ ++ QString fPath = gContext->GetSetting("ScreenShotPath","/tmp/"); ++ QString fName = QString("/%1/myth-screenshot-%2.png") ++ .arg(gContext->GetSetting("ScreenShotPath","/tmp/")) ++ .arg(QDateTime::currentDateTime().toString("yyyy-mm-ddThh-mm-ss.zzz")); ++ ++ return screenShot(fName, x, y, x2, y2, 0, 0); ++} ++ ++bool MythMainWindow::screenShot(QString fname, int w, int h) ++{ ++ return screenShot(fname, 0, 0, -1, -1, w, h); ++} ++ ++ ++bool MythMainWindow::screenShot(void) ++{ ++ return screenShot(0,0,-1,-1); ++} ++ + #ifdef USING_APPLEREMOTE + // This may be possible via installEventFilter() instead? + +Index: libs/libmythui/mythmainwindow.h +=================================================================== +--- libs/libmythui/mythmainwindow.h (revision 15827) ++++ libs/libmythui/mythmainwindow.h (working copy) +@@ -101,6 +101,11 @@ + + MythPainter *GetCurrentPainter(); + ++ bool screenShot(QString fname, int x, int y, int x2, int y2, int w, int h); ++ bool screenShot(int x, int y, int x2, int y2); ++ bool screenShot(QString fname, int w, int h); ++ bool screenShot(void); ++ + void AllowInput(bool allow); + + QRect GetUIScreenRect(); +Index: programs/mythfrontend/mediarenderer.cpp +=================================================================== +--- programs/mythfrontend/mediarenderer.cpp (revision 15827) ++++ programs/mythfrontend/mediarenderer.cpp (working copy) +@@ -9,6 +9,7 @@ + ///////////////////////////////////////////////////////////////////////////// + + #include "mediarenderer.h" ++#include "mythfexml.h" + #include "compat.h" + + ///////////////////////////////////////////////////////////////////////////// +@@ -85,6 +86,11 @@ + "http-get:*:video/mpeg:*," + "http-get:*:video/nupplevideo:*," + "http-get:*:video/x-ms-wmv:*"; ++ // ------------------------------------------------------------------ ++ // Register the MythFEXML protocol... ++ // ------------------------------------------------------------------ ++ VERBOSE(VB_UPNP, "MediaRenderer::Registering MythFEXML Service." ); ++ m_pHttpServer->RegisterExtension( new MythFEXML( RootDevice() )); + + // VERBOSE(VB_UPNP, QString( "MediaRenderer::Registering AVTransport Service." )); + // m_pHttpServer->RegisterExtension( m_pUPnpAVT = new UPnpAVTransport( RootDevice() )); +Index: programs/mythfrontend/MFEXML_scpd.xml +=================================================================== +--- programs/mythfrontend/MFEXML_scpd.xml (revision 0) ++++ programs/mythfrontend/MFEXML_scpd.xml (revision 0) +@@ -0,0 +1,34 @@ ++<?xml version="1.0" encoding="utf-8"?>
++<scpd xmlns="urn:schemas-upnp-org:service-1-0">
++ <specVersion>
++ <major>1</major>
++ <minor>0</minor>
++ </specVersion>
++ <actionList>
++ <action>
++ <name>GetScreenShot</name>
++ <argumentList>
++ <argument>
++ <name>Height</name>
++ <direction>in</direction>
++ <relatedStateVariable>A_ARG_TYPE_Height</relatedStateVariable>
++ </argument>
++ <argument>
++ <name>Width</name>
++ <direction>in</direction>
++ <relatedStateVariable>A_ARG_TYPE_Width</relatedStateVariable>
++ </argument>
++ </argumentList>
++ </action>
++ </actionList>
++ <serviceStateTable>
++ <stateVariable sendEvents="no">
++ <name>A_ARG_TYPE_Height</name>
++ <dataType>i2</dataType>
++ </stateVariable>
++ <stateVariable sendEvents="no">
++ <name>A_ARG_TYPE_Width</name>
++ <dataType>i2</dataType>
++ </stateVariable>
++ </serviceStateTable>
++</scpd>
+Index: programs/mythfrontend/globalsettings.cpp +=================================================================== +--- programs/mythfrontend/globalsettings.cpp (revision 15827) ++++ programs/mythfrontend/globalsettings.cpp (working copy) +@@ -2182,6 +2182,15 @@ + return ge; + } + ++static HostLineEdit *ScreenShotPath() ++{ ++ HostLineEdit *ge = new HostLineEdit("ScreenShotPath"); ++ ge->setLabel(QObject::tr("ScreenShotPath")); ++ ge->setValue(""); ++ ge->setHelpText(QObject::tr("Path to screenshot storage location. Should be writable by the frontend")); ++ return ge; ++} ++ + static HostCheckBox *UseArrowAccels() + { + HostCheckBox *gc = new HostCheckBox("UseArrowAccels"); +@@ -4455,6 +4464,7 @@ + MythMediaSettings *mediaMon = new MythMediaSettings(); + + general->addChild(LircKeyPressedApp()); ++ general->addChild(ScreenShotPath()); + general->addChild(row); + general->addChild(NetworkControlPort()); + general->addChild(mediaMon); +Index: programs/mythfrontend/mythfexml.h +=================================================================== +--- programs/mythfrontend/mythfexml.h (revision 0) ++++ programs/mythfrontend/mythfexml.h (revision 0) +@@ -0,0 +1,66 @@ ++////////////////////////////////////////////////////////////////////////////// ++// Program Name: mythxml.h ++// ++// Purpose - Myth Frontend XML protocol HttpServerExtension ++// ++////////////////////////////////////////////////////////////////////////////// ++ ++#ifndef MYTHFEXML_H_ ++#define MYTHFEXML_H_ ++ ++#include <qdom.h> ++#include <qdatetime.h> ++ ++#include "upnp.h" ++#include "eventing.h" ++#include "mythcontext.h" ++ ++typedef enum ++{ ++ MFEXML_Unknown = 0, ++ MFEXML_GetScreenShot = 1 ++ ++} MythFEXMLMethod; ++ ++class MythFEXML : public Eventing ++{ ++ private: ++ ++ QString m_sControlUrl; ++ QString m_sServiceDescFileName; ++ ++ protected: ++ ++ // Implement UPnpServiceImpl methods that we can ++ ++ virtual QString GetServiceType () { return "urn:schemas-mythtv-org:service:MythTv:1"; } ++ virtual QString GetServiceId () { return "urn:mythtv-org:serviceId:MYTHTV_1-0"; } ++ virtual QString GetServiceControlURL() { return m_sControlUrl.mid( 1 ); } ++ virtual QString GetServiceDescURL () { return m_sControlUrl.mid( 1 ) + "/GetServDesc"; } ++ ++ private: ++ ++ MythFEXMLMethod GetMethod( const QString &sURI ); ++ ++ void GetScreenShot ( HTTPRequest *pRequest ); ++ ++ public: ++ MythFEXML( UPnpDevice *pDevice ); ++ virtual ~MythFEXML(); ++ ++ bool ProcessRequest( HttpWorkerThread *pThread, HTTPRequest *pRequest ); ++ ++ // Static methods shared with HttpStatus ++ ++}; ++ ++///////////////////////////////////////////////////////////////////////////// ++///////////////////////////////////////////////////////////////////////////// ++// ++// ++// ++///////////////////////////////////////////////////////////////////////////// ++///////////////////////////////////////////////////////////////////////////// ++#endif ++ ++ +Index: programs/mythfrontend/main.cpp +=================================================================== +--- programs/mythfrontend/main.cpp (revision 15827) ++++ programs/mythfrontend/main.cpp (working copy) +@@ -799,6 +799,11 @@ + } + } + ++void getScreenShot(void) ++{ ++ (void) gContext->GetMainWindow()->screenShot(); ++} ++ + void InitJumpPoints(void) + { + REG_JUMP("Reload Theme", "", "", reloadTheme); +@@ -817,6 +822,8 @@ + REG_JUMP("Status Screen", "", "", showStatus); + REG_JUMP("Previously Recorded", "", "", startPrevious); + ++ REG_JUMPEX("ScreenShot","","",getScreenShot,false); ++ + REG_KEY("qt", "DELETE", "Delete", "D"); + REG_KEY("qt", "EDIT", "Edit", "E"); + +Index: programs/mythfrontend/mythfrontend.pro +=================================================================== +--- programs/mythfrontend/mythfrontend.pro (revision 15827) ++++ programs/mythfrontend/mythfrontend.pro (working copy) +@@ -15,7 +15,7 @@ + setting.files += util_menu.xml info_settings.xml main_settings.xml + setting.files += recpriorities_settings.xml tv_search.xml tv_lists.xml + setting.files += library.xml manage_recordings.xml optical_menu.xml tvmenu.xml +-setting.files += tv_settings.xml ++setting.files += tv_settings.xml MFEXML_scpd.xml + setting.extra = -ldconfig + + INSTALLS += setting +@@ -26,13 +26,13 @@ + HEADERS += manualbox.h playbackbox.h viewscheduled.h globalsettings.h + HEADERS += manualschedule.h programrecpriority.h channelrecpriority.h + HEADERS += statusbox.h networkcontrol.h custompriority.h +-HEADERS += mediarenderer.h ++HEADERS += mediarenderer.h mythfexml.h + HEADERS += mythappearance.h + + SOURCES += main.cpp manualbox.cpp playbackbox.cpp viewscheduled.cpp + SOURCES += globalsettings.cpp manualschedule.cpp programrecpriority.cpp + SOURCES += channelrecpriority.cpp statusbox.cpp networkcontrol.cpp +-SOURCES += mediarenderer.cpp ++SOURCES += mediarenderer.cpp mythfexml.cpp + SOURCES += custompriority.cpp + SOURCES += mythappearance.cpp + +Index: programs/mythfrontend/mythfexml.cpp +=================================================================== +--- programs/mythfrontend/mythfexml.cpp (revision 0) ++++ programs/mythfrontend/mythfexml.cpp (revision 0) +@@ -0,0 +1,135 @@ ++////////////////////////////////////////////////////////////////////////////// ++// Program Name: MythXML.cpp ++// ++// Purpose - Html & XML status HttpServerExtension ++// ++// Created By : David Blain Created On : Oct. 24, 2005 ++// Modified By : Daniel Kristjansson Modified On: Oct. 31, 2007 ++// ++////////////////////////////////////////////////////////////////////////////// ++ ++#include "mythfexml.h" ++ ++#include "libmyth/mythcontext.h" ++#include "libmyth/util.h" ++#include "libmyth/mythdbcon.h" ++ ++#include "mythmainwindow.h" ++ ++#include <qtextstream.h> ++#include <qdir.h> ++#include <qfile.h> ++#include <qregexp.h> ++#include <qbuffer.h> ++#include <math.h> ++ ++#include "../../config.h" ++ ++///////////////////////////////////////////////////////////////////////////// ++// ++///////////////////////////////////////////////////////////////////////////// ++ ++MythFEXML::MythFEXML( UPnpDevice *pDevice ) : Eventing( "MythFEXML", "MYTHTV_Event" ) ++{ ++ ++ QString sUPnpDescPath = UPnp::g_pConfig->GetValue( "UPnP/DescXmlPath", m_sSharePath ); ++ ++ m_sServiceDescFileName = sUPnpDescPath + "MFEXML_scpd.xml"; ++ m_sControlUrl = "/MythFE"; ++ ++ // Add our Service Definition to the device. ++ ++ RegisterService( pDevice ); ++} ++ ++///////////////////////////////////////////////////////////////////////////// ++// ++///////////////////////////////////////////////////////////////////////////// ++ ++MythFEXML::~MythFEXML() ++{ ++} ++ ++///////////////////////////////////////////////////////////////////////////// ++// ++///////////////////////////////////////////////////////////////////////////// ++ ++MythFEXMLMethod MythFEXML::GetMethod( const QString &sURI ) ++{ ++ if (sURI == "GetScreenShot" ) return MFEXML_GetScreenShot; ++ ++ return( MFEXML_Unknown ); ++} ++ ++///////////////////////////////////////////////////////////////////////////// ++// ++///////////////////////////////////////////////////////////////////////////// ++ ++bool MythFEXML::ProcessRequest( HttpWorkerThread *pThread, HTTPRequest *pRequest ) ++{ ++ try ++ { ++ if (pRequest) ++ { ++ if (pRequest->m_sBaseUrl != m_sControlUrl) ++ return( false ); ++ ++ VERBOSE(VB_UPNP, QString("MythFEXML::ProcessRequest: %1 : %2") ++ .arg(pRequest->m_sMethod) ++ .arg(pRequest->m_sRawRequest)); ++ ++ switch( GetMethod( pRequest->m_sMethod )) ++ { ++ case MFEXML_GetScreenShot : GetScreenShot ( pRequest ); return true; ++ ++ ++ default: ++ { ++ UPnp::FormatErrorResponse( pRequest, UPnPResult_InvalidAction ); ++ ++ return true; ++ } ++ } ++ } ++ } ++ catch( ... ) ++ { ++ VERBOSE( VB_IMPORTANT, "MythFEXML::ProcessRequest() - Unexpected Exception" ); ++ } ++ ++ return( false ); ++} ++ ++// ========================================================================== ++// Request handler Methods ++// ========================================================================== ++ ++///////////////////////////////////////////////////////////////////////////// ++// ++///////////////////////////////////////////////////////////////////////////// ++ ++void MythFEXML::GetScreenShot( HTTPRequest *pRequest ) ++{ ++ bool bDefaultPixmap = false; ++ ++ pRequest->m_eResponseType = ResponseTypeFile; ++ ++ // Optional Parameters ++ ++ int nWidth = pRequest->m_mapParams[ "Width" ].toInt(); ++ int nHeight = pRequest->m_mapParams[ "Height" ].toInt(); ++ ++ // Read Icon file path from database ++ ++ QString sFileName = "/tmp/moo.jpg"; ++ ++ ++ if (!gContext->GetMainWindow()->screenShot(sFileName,nWidth, nHeight)) ++ { ++ VERBOSE(VB_GENERAL, "MythFEXML: Failed to take screenshot. Aborting"); ++ return; ++ } ++ ++ pRequest->m_sFileName = sFileName; ++} ++ diff --git a/abs/mv-core/myth/release-fixes/mythtv-release-fixes/screenshots2.diff b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/screenshots2.diff new file mode 100644 index 0000000..64ce08c --- /dev/null +++ b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/screenshots2.diff @@ -0,0 +1,467 @@ +Index: libs/libmythui/mythmainwindow.cpp +=================================================================== +--- libs/libmythui/mythmainwindow.cpp (revision 16103) ++++ libs/libmythui/mythmainwindow.cpp (working copy) +@@ -8,6 +8,8 @@ + #include <qpaintdevicemetrics.h> + #include <qdir.h> + #include <qfile.h> ++#include <math.h> ++ + #ifdef QWS + #include <qwindowsystem_qws.h> + #endif +@@ -504,6 +507,83 @@ + d->repaintRegion = d->repaintRegion.unite(pe->region()); + } + ++bool MythMainWindow::screenShot(QString fname, int x, int y, int x2, int y2, int w, int h) ++{ ++ bool ret = false; ++ ++ QString extension = fname.section('.', -1, -1); ++ if (extension == "jpg") ++ extension = "JPEG"; ++ else ++ extension = "PNG"; ++ ++ VERBOSE(VB_GENERAL, QString("MythMainWindow::screenShot saving winId %1 to %2 (%3 x %4) [ %5/%6 - %7/%8] type %9") ++ .arg(QApplication::desktop()->winId()) ++ .arg(fname) ++ .arg(w) ++ .arg(h) ++ .arg(x) ++ .arg(y) ++ .arg(x2) ++ .arg(y2) ++ .arg(extension)); ++ ++ QPixmap p; ++ p = QPixmap::grabWindow( QApplication::desktop()->winId(), x, y, x2, y2); ++ ++ QImage img = p.convertToImage(); ++ ++ if ( w == 0 ) ++ w = img.width(); ++ ++ if ( h == 0 ) ++ h = img.height(); ++ ++ VERBOSE(VB_GENERAL, QString("Scaling to %1 x %2 from %3 x %4") ++ .arg(w) ++ .arg(h) ++ .arg(img.width()) ++ .arg(img.height())); ++ ++ img = img.smoothScale( w, h , QImage::ScaleMin); ++ ++ if (img.save(fname ,extension,100)) ++ { ++ VERBOSE(VB_GENERAL, "MythMainWindow::screenShot succeeded"); ++ ret = true; ++ } ++ else ++ { ++ VERBOSE(VB_GENERAL, "MythMainWindow::screenShot Failed!"); ++ ret = false; ++ } ++ ++ return ret; ++} ++ ++bool MythMainWindow::screenShot(int x, int y, int x2, int y2) ++{ ++ QString fPath = gContext->GetSetting("ScreenShotPath","/tmp/"); ++ QString fName = QString("/%1/myth-screenshot-%2.png") ++ .arg(fPath) ++ .arg(QDateTime::currentDateTime().toString("yyyy-mm-ddThh-mm-ss.zzz")); ++ ++ return screenShot(fName, x, y, x2, y2, 0, 0); ++} ++ ++bool MythMainWindow::screenShot(QString fname, int w, int h) ++{ ++ QRect sLoc = qApp->mainWidget()->geometry(); ++ return screenShot(fname, sLoc.left(),sLoc.top(), sLoc.width(), sLoc.height(), w, h); ++} ++ ++ ++bool MythMainWindow::screenShot(void) ++{ ++ QRect sLoc = qApp->mainWidget()->geometry(); ++ return screenShot(sLoc.left(),sLoc.top(), sLoc.width(), sLoc.height()); ++} ++ + #ifdef USING_APPLEREMOTE + // This may be possible via installEventFilter() instead? + +Index: libs/libmythui/mythmainwindow.h +=================================================================== +--- libs/libmythui/mythmainwindow.h (revision 16103) ++++ libs/libmythui/mythmainwindow.h (working copy) +@@ -101,6 +101,11 @@ + + MythPainter *GetCurrentPainter(); + ++ bool screenShot(QString fname, int x, int y, int x2, int y2, int w, int h); ++ bool screenShot(int x, int y, int x2, int y2); ++ bool screenShot(QString fname, int w, int h); ++ bool screenShot(void); ++ + void AllowInput(bool allow); + + QRect GetUIScreenRect(); +Index: programs/mythfrontend/mediarenderer.cpp +=================================================================== +--- programs/mythfrontend/mediarenderer.cpp (revision 16103) ++++ programs/mythfrontend/mediarenderer.cpp (working copy) +@@ -9,6 +9,7 @@ + ///////////////////////////////////////////////////////////////////////////// + + #include "mediarenderer.h" ++#include "mythfexml.h" + #include "compat.h" + + ///////////////////////////////////////////////////////////////////////////// +@@ -89,6 +90,11 @@ + "http-get:*:video/mpeg:*," + "http-get:*:video/nupplevideo:*," + "http-get:*:video/x-ms-wmv:*"; ++ // ------------------------------------------------------------------ ++ // Register the MythFEXML protocol... ++ // ------------------------------------------------------------------ ++ VERBOSE(VB_UPNP, "MediaRenderer::Registering MythFEXML Service." ); ++ m_pHttpServer->RegisterExtension( new MythFEXML( RootDevice() )); + + // VERBOSE(VB_UPNP, QString( "MediaRenderer::Registering AVTransport Service." )); + // m_pHttpServer->RegisterExtension( m_pUPnpAVT = new UPnpAVTransport( RootDevice() )); +Index: programs/mythfrontend/MFEXML_scpd.xml +=================================================================== +--- programs/mythfrontend/MFEXML_scpd.xml (revision 0) ++++ programs/mythfrontend/MFEXML_scpd.xml (revision 0) +@@ -0,0 +1,34 @@ ++<?xml version="1.0" encoding="utf-8"?>
++<scpd xmlns="urn:schemas-upnp-org:service-1-0">
++ <specVersion>
++ <major>1</major>
++ <minor>0</minor>
++ </specVersion>
++ <actionList>
++ <action>
++ <name>GetScreenShot</name>
++ <argumentList>
++ <argument>
++ <name>Height</name>
++ <direction>in</direction>
++ <relatedStateVariable>A_ARG_TYPE_Height</relatedStateVariable>
++ </argument>
++ <argument>
++ <name>Width</name>
++ <direction>in</direction>
++ <relatedStateVariable>A_ARG_TYPE_Width</relatedStateVariable>
++ </argument>
++ </argumentList>
++ </action>
++ </actionList>
++ <serviceStateTable>
++ <stateVariable sendEvents="no">
++ <name>A_ARG_TYPE_Height</name>
++ <dataType>i2</dataType>
++ </stateVariable>
++ <stateVariable sendEvents="no">
++ <name>A_ARG_TYPE_Width</name>
++ <dataType>i2</dataType>
++ </stateVariable>
++ </serviceStateTable>
++</scpd>
+Index: programs/mythfrontend/globalsettings.cpp +=================================================================== +--- programs/mythfrontend/globalsettings.cpp (revision 16103) ++++ programs/mythfrontend/globalsettings.cpp (working copy) +@@ -2220,6 +2220,15 @@ + return ge; + } + ++static HostLineEdit *ScreenShotPath() ++{ ++ HostLineEdit *ge = new HostLineEdit("ScreenShotPath"); ++ ge->setLabel(QObject::tr("ScreenShotPath")); ++ ge->setValue("/tmp/"); ++ ge->setHelpText(QObject::tr("Path to screenshot storage location. Should be writable by the frontend")); ++ return ge; ++} ++ + static HostCheckBox *UseArrowAccels() + { + HostCheckBox *gc = new HostCheckBox("UseArrowAccels"); +@@ -4502,6 +4511,7 @@ + MythMediaSettings *mediaMon = new MythMediaSettings(); + + general->addChild(LircKeyPressedApp()); ++ general->addChild(ScreenShotPath()); + general->addChild(row); + general->addChild(NetworkControlPort()); + general->addChild(mediaMon); +Index: programs/mythfrontend/mythfexml.h +=================================================================== +--- programs/mythfrontend/mythfexml.h (revision 0) ++++ programs/mythfrontend/mythfexml.h (revision 0) +@@ -0,0 +1,66 @@ ++////////////////////////////////////////////////////////////////////////////// ++// Program Name: mythxml.h ++// ++// Purpose - Myth Frontend XML protocol HttpServerExtension ++// ++////////////////////////////////////////////////////////////////////////////// ++ ++#ifndef MYTHFEXML_H_ ++#define MYTHFEXML_H_ ++ ++#include <qdom.h> ++#include <qdatetime.h> ++ ++#include "upnp.h" ++#include "eventing.h" ++#include "mythcontext.h" ++ ++typedef enum ++{ ++ MFEXML_Unknown = 0, ++ MFEXML_GetScreenShot = 1 ++ ++} MythFEXMLMethod; ++ ++class MythFEXML : public Eventing ++{ ++ private: ++ ++ QString m_sControlUrl; ++ QString m_sServiceDescFileName; ++ ++ protected: ++ ++ // Implement UPnpServiceImpl methods that we can ++ ++ virtual QString GetServiceType () { return "urn:schemas-mythtv-org:service:MythTv:1"; } ++ virtual QString GetServiceId () { return "urn:mythtv-org:serviceId:MYTHTV_1-0"; } ++ virtual QString GetServiceControlURL() { return m_sControlUrl.mid( 1 ); } ++ virtual QString GetServiceDescURL () { return m_sControlUrl.mid( 1 ) + "/GetServDesc"; } ++ ++ private: ++ ++ MythFEXMLMethod GetMethod( const QString &sURI ); ++ ++ void GetScreenShot ( HTTPRequest *pRequest ); ++ ++ public: ++ MythFEXML( UPnpDevice *pDevice ); ++ virtual ~MythFEXML(); ++ ++ bool ProcessRequest( HttpWorkerThread *pThread, HTTPRequest *pRequest ); ++ ++ // Static methods shared with HttpStatus ++ ++}; ++ ++///////////////////////////////////////////////////////////////////////////// ++///////////////////////////////////////////////////////////////////////////// ++// ++// ++// ++///////////////////////////////////////////////////////////////////////////// ++///////////////////////////////////////////////////////////////////////////// ++#endif ++ ++ +Index: programs/mythfrontend/main.cpp +=================================================================== +--- programs/mythfrontend/main.cpp (revision 16103) ++++ programs/mythfrontend/main.cpp (working copy) +@@ -800,6 +800,11 @@ + } + } + ++void getScreenShot(void) ++{ ++ (void) gContext->GetMainWindow()->screenShot(); ++} ++ + void InitJumpPoints(void) + { + REG_JUMP("Reload Theme", "", "", reloadTheme); +@@ -818,6 +823,8 @@ + REG_JUMP("Status Screen", "", "", showStatus); + REG_JUMP("Previously Recorded", "", "", startPrevious); + ++ REG_JUMPEX("ScreenShot","","",getScreenShot,false); ++ + REG_KEY("qt", "DELETE", "Delete", "D"); + REG_KEY("qt", "EDIT", "Edit", "E"); + +Index: programs/mythfrontend/mythfrontend.pro +=================================================================== +--- programs/mythfrontend/mythfrontend.pro (revision 16103) ++++ programs/mythfrontend/mythfrontend.pro (working copy) +@@ -15,7 +15,7 @@ + setting.files += util_menu.xml info_settings.xml main_settings.xml + setting.files += recpriorities_settings.xml tv_search.xml tv_lists.xml + setting.files += library.xml manage_recordings.xml optical_menu.xml tvmenu.xml +-setting.files += tv_settings.xml ++setting.files += tv_settings.xml MFEXML_scpd.xml + setting.extra = -ldconfig + + INSTALLS += setting +@@ -26,13 +26,13 @@ + HEADERS += manualbox.h playbackbox.h viewscheduled.h globalsettings.h + HEADERS += manualschedule.h programrecpriority.h channelrecpriority.h + HEADERS += statusbox.h networkcontrol.h custompriority.h +-HEADERS += mediarenderer.h ++HEADERS += mediarenderer.h mythfexml.h + HEADERS += mythappearance.h + + SOURCES += main.cpp manualbox.cpp playbackbox.cpp viewscheduled.cpp + SOURCES += globalsettings.cpp manualschedule.cpp programrecpriority.cpp + SOURCES += channelrecpriority.cpp statusbox.cpp networkcontrol.cpp +-SOURCES += mediarenderer.cpp ++SOURCES += mediarenderer.cpp mythfexml.cpp + SOURCES += custompriority.cpp + SOURCES += mythappearance.cpp + +Index: programs/mythfrontend/mythfexml.cpp +=================================================================== +--- programs/mythfrontend/mythfexml.cpp (revision 0) ++++ programs/mythfrontend/mythfexml.cpp (revision 0) +@@ -0,0 +1,133 @@ ++////////////////////////////////////////////////////////////////////////////// ++// Program Name: MythXML.cpp ++// ++// Purpose - Html & XML status HttpServerExtension ++// ++// Created By : David Blain Created On : Oct. 24, 2005 ++// Modified By : Daniel Kristjansson Modified On: Oct. 31, 2007 ++// ++////////////////////////////////////////////////////////////////////////////// ++ ++#include "mythfexml.h" ++ ++#include "libmyth/mythcontext.h" ++#include "libmyth/util.h" ++#include "libmyth/mythdbcon.h" ++ ++#include "mythmainwindow.h" ++ ++#include <qtextstream.h> ++#include <qdir.h> ++#include <qfile.h> ++#include <qregexp.h> ++#include <qbuffer.h> ++#include <math.h> ++ ++#include "../../config.h" ++ ++///////////////////////////////////////////////////////////////////////////// ++// ++///////////////////////////////////////////////////////////////////////////// ++ ++MythFEXML::MythFEXML( UPnpDevice *pDevice ) : Eventing( "MythFEXML", "MYTHTV_Event" ) ++{ ++ ++ QString sUPnpDescPath = UPnp::g_pConfig->GetValue( "UPnP/DescXmlPath", m_sSharePath ); ++ ++ m_sServiceDescFileName = sUPnpDescPath + "MFEXML_scpd.xml"; ++ m_sControlUrl = "/MythFE"; ++ ++ // Add our Service Definition to the device. ++ ++ RegisterService( pDevice ); ++} ++ ++///////////////////////////////////////////////////////////////////////////// ++// ++///////////////////////////////////////////////////////////////////////////// ++ ++MythFEXML::~MythFEXML() ++{ ++} ++ ++///////////////////////////////////////////////////////////////////////////// ++// ++///////////////////////////////////////////////////////////////////////////// ++ ++MythFEXMLMethod MythFEXML::GetMethod( const QString &sURI ) ++{ ++ if (sURI == "GetScreenShot" ) return MFEXML_GetScreenShot; ++ ++ return( MFEXML_Unknown ); ++} ++ ++///////////////////////////////////////////////////////////////////////////// ++// ++///////////////////////////////////////////////////////////////////////////// ++ ++bool MythFEXML::ProcessRequest( HttpWorkerThread *pThread, HTTPRequest *pRequest ) ++{ ++ try ++ { ++ if (pRequest) ++ { ++ if (pRequest->m_sBaseUrl != m_sControlUrl) ++ return( false ); ++ ++ VERBOSE(VB_UPNP, QString("MythFEXML::ProcessRequest: %1 : %2") ++ .arg(pRequest->m_sMethod) ++ .arg(pRequest->m_sRawRequest)); ++ ++ switch( GetMethod( pRequest->m_sMethod )) ++ { ++ case MFEXML_GetScreenShot : GetScreenShot ( pRequest ); return true; ++ ++ ++ default: ++ { ++ UPnp::FormatErrorResponse( pRequest, UPnPResult_InvalidAction ); ++ ++ return true; ++ } ++ } ++ } ++ } ++ catch( ... ) ++ { ++ VERBOSE( VB_IMPORTANT, "MythFEXML::ProcessRequest() - Unexpected Exception" ); ++ } ++ ++ return( false ); ++} ++ ++// ========================================================================== ++// Request handler Methods ++// ========================================================================== ++ ++///////////////////////////////////////////////////////////////////////////// ++// ++///////////////////////////////////////////////////////////////////////////// ++ ++void MythFEXML::GetScreenShot( HTTPRequest *pRequest ) ++{ ++ pRequest->m_eResponseType = ResponseTypeFile; ++ ++ // Optional Parameters ++ ++ int nWidth = pRequest->m_mapParams[ "Width" ].toInt(); ++ int nHeight = pRequest->m_mapParams[ "Height" ].toInt(); ++ ++ // Read Icon file path from database ++ ++ QString sFileName = QString("/%1/myth-screenshot-XML.jpg") ++ .arg(gContext->GetSetting("ScreenShotPath","/tmp/")); ++ ++ if (!gContext->GetMainWindow()->screenShot(sFileName,nWidth, nHeight)) ++ { ++ VERBOSE(VB_GENERAL, "MythFEXML: Failed to take screenshot. Aborting"); ++ return; ++ } ++ ++ pRequest->m_sFileName = sFileName; ++} ++ diff --git a/abs/mv-core/myth/release-fixes/mythtv-release-fixes/smolt_jump.patch b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/smolt_jump.patch new file mode 100644 index 0000000..ca9bd08 --- /dev/null +++ b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/smolt_jump.patch @@ -0,0 +1,10 @@ +--- programs/mythfrontend/networkcontrol.cpp.orig 2008-03-23 23:00:25.000000000 +0000 ++++ programs/mythfrontend/networkcontrol.cpp 2008-03-23 23:01:33.000000000 +0000 +@@ -81,6 +81,7 @@ + jumpMap["zoneminderliveview"] = "ZoneMinder Live View"; + jumpMap["zoneminderevents"] = "ZoneMinder Events"; + jumpMap["snapshot"] = "ScreenShot"; ++ jumpMap["mythsmolt"] = "MythSmolt"; + + // These jump point names match the (lowercased) locations from gContext + jumpMap["channelrecpriority"] = "Channel Recording Priorities"; |