From 8f133a2818646f654110f91d7d1ad0f684e617b9 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Sun, 26 Jan 2020 01:40:51 +0000 Subject: [PATCH] MVP code removal Remove Wwss class Remove LedMVP class Remove AudioMVP class Remove VideoMVP class Remove OsdMVP class Remove RemoteMVP class Remove SurfaceMVP class Remove all MTD classes Remove various MVP code Code cleanup Compiler warning fixes --- GNUmakefile | 4 +- abstractoption.h | 14 +- audiomvp.cc | 249 ------------------------ audiomvp.h | 109 ----------- boxx.h | 17 +- command.cc | 5 - defines.h | 21 +- demuxer.h | 11 +- ledmvp.cc | 66 ------- ledmvp.h | 48 ----- main.cc | 78 ++------ message.h | 2 - mtd.cc | 39 ---- mtd.h | 42 ---- mtdmvp.cc | 157 --------------- mtdmvp.h | 77 -------- mtdraspberry.cc | 51 ----- mtdraspberry.h | 41 ---- mtdwin.cc | 51 ----- mtdwin.h | 42 ---- objects.mk | 6 +- osd.h | 19 +- osdmvp.cc | 81 -------- osdmvp.h | 52 ----- osdopengl.cc | 10 - osdopenvg.cc | 1 - osdvector.h | 5 +- osdwinpixel.cc | 1 - osdwinvector.cc | 1 - remote.h | 5 +- remotelinux.cc | 9 +- remotemvp.cc | 138 ------------- remotemvp.h | 49 ----- select-platform | 2 +- stream.cc | 5 +- surface.h | 14 +- surfacemvp.cc | 498 ----------------------------------------------- surfacemvp.h | 250 ------------------------ surfacevector.h | 39 ++-- vcolourtuner.cc | 8 +- vepg.cc | 28 --- video.h | 54 ++--- videomvp.cc | 407 -------------------------------------- videomvp.h | 162 --------------- videoomx.cc | 1 - vopts.cc | 29 +-- vvideolivetv.cc | 459 +++++++++++++++++++++---------------------- vvideolivetv.h | 9 - vvideorec.cc | 39 ---- vvideorec.h | 16 +- winmain.cc | 30 +-- wseriesview.h | 7 +- wwss.cc | 324 ------------------------------ wwss.h | 49 ----- 54 files changed, 332 insertions(+), 3599 deletions(-) delete mode 100644 audiomvp.cc delete mode 100644 audiomvp.h delete mode 100644 ledmvp.cc delete mode 100644 ledmvp.h delete mode 100644 mtd.cc delete mode 100644 mtd.h delete mode 100644 mtdmvp.cc delete mode 100644 mtdmvp.h delete mode 100644 mtdraspberry.cc delete mode 100644 mtdraspberry.h delete mode 100644 mtdwin.cc delete mode 100644 mtdwin.h delete mode 100644 osdmvp.cc delete mode 100644 osdmvp.h delete mode 100644 remotemvp.cc delete mode 100644 remotemvp.h delete mode 100644 surfacemvp.cc delete mode 100644 surfacemvp.h delete mode 100644 videomvp.cc delete mode 100644 videomvp.h delete mode 100644 wwss.cc delete mode 100644 wwss.h diff --git a/GNUmakefile b/GNUmakefile index 4bd8628..4a78926 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -12,9 +12,7 @@ $(info selected $(vomp_platform)) # uncomment the line below if you want to build vomp application without a reboot option, automatically set for windows! #vomp_options+= -DVOMP_HAS_EXIT -ifdef VERBOSE -Q = -else +ifndef VERBOSE Q = @ endif diff --git a/abstractoption.h b/abstractoption.h index a08497c..21338dd 100644 --- a/abstractoption.h +++ b/abstractoption.h @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with VOMP. If not, see . */ #ifndef ABSTRACT_OPTION_H @@ -32,12 +31,11 @@ class AbstractOption { public: // inline definition allows plugins architecture for audio video - virtual bool loadOptionsfromServer(VDR* vdr) {return true;}; - virtual bool saveOptionstoServer() {return true;}; - virtual bool addOptionPagesToWTB(WTabBar *wtb) {return true;}; - virtual bool addOptionsToPanes(int panenumber,Options *options,WOptionPane* pane) {return true;}; - virtual bool handleOptionChanges(Option* option){return false;}; + virtual bool loadOptionsfromServer(VDR*) { return true; }; + virtual bool saveOptionstoServer() { return true; }; + virtual bool addOptionPagesToWTB(WTabBar*) { return true; }; + virtual bool addOptionsToPanes(int /* panenumber */, Options*, WOptionPane*) { return true; }; + virtual bool handleOptionChanges(Option*) { return false; }; }; #endif - diff --git a/audiomvp.cc b/audiomvp.cc deleted file mode 100644 index b9ba62e..0000000 --- a/audiomvp.cc +++ /dev/null @@ -1,249 +0,0 @@ -/* - Copyright 2004-2005 Chris Tallon - - This file is part of VOMP. - - VOMP 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. - - VOMP 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 VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include "audiomvp.h" - -#include "log.h" - -AudioMVP::AudioMVP() -{ - if (instance) return; - initted = 0; - fdAudio = 0; - streamType = 0; - volume = 20; - muted = 0; -} - -AudioMVP::~AudioMVP() -{ -} - -int AudioMVP::init(UCHAR tstreamType) -{ - if (initted) return 0; - initted = 1; - -// if ((fdAudio = open("/dev/adec_mpg", O_RDWR | O_NONBLOCK)) < 0) return 0; - if ((fdAudio = open("/dev/adec_mpg", O_WRONLY)) < 0) return 0; - - streamType = tstreamType; - - if (!initAllParams()) - { - shutdown(); - return 0; - } - - unMute(); - - // Set the volume variable to what the hardware is set at now - int hwvol = -1; - int hwvolFail = ioctl(fdAudio, AV_GET_AUD_VOLUME, &hwvol); - if (!hwvolFail) - { - volume = 20 - ((hwvol >> 16) & 0xFF); - if ((volume < 0) || (volume > 20)) volume = 20; - } - - return 1; -} - -int AudioMVP::initAllParams() -{ - return (setStreamType(streamType) && setChannel() && setSource()); -} - -int AudioMVP::shutdown() -{ - if (!initted) return 0; - initted = 0; - close(fdAudio); - return 1; -} - -int AudioMVP::setStreamType(UCHAR type) -{ - if (!initted) return 0; - - if (ioctl(fdAudio, AV_SET_AUD_STREAMTYPE, type) != 0) return 0; - return 1; -} - -int AudioMVP::setChannel() -{ - if (!initted) return 0; - - if (ioctl(fdAudio, AV_SET_AUD_CHANNEL, 0) != 0) return 0; - return 1; -} - -int AudioMVP::setSource() -{ - if (!initted) return 0; - - if (ioctl(fdAudio, AV_SET_AUD_SRC, 1) != 0) return 0; - return 1; -} - -int AudioMVP::sync() -{ - if (!initted) return 0; - - if (ioctl(fdAudio, AV_SET_AUD_SYNC, 2) != 0) return 0; - return 1; -} - -int AudioMVP::play() -{ - if (!initted) return 0; - - if (ioctl(fdAudio, AV_SET_AUD_PLAY, 0) != 0) return 0; - return 1; -} - -int AudioMVP::stop() -{ - if (!initted) return 0; - - if (ioctl(fdAudio, AV_SET_AUD_RESET, 0x11) != 0) return 0; - return 1; -} - -int AudioMVP::mute() -{ - if (!initted) return 0; - - if (ioctl(fdAudio, AV_SET_AUD_MUTE, 1) != 0) return 0; - Log::getInstance()->log("Audio", Log::DEBUG, "MUTE MUTE MUTE"); - - muted = 1; - return 1; -} - -int AudioMVP::unMute() -{ - if (!initted) return 0; - - if (ioctl(fdAudio, AV_SET_AUD_MUTE, 0) != 0) return 0; - Log::getInstance()->log("Audio", Log::DEBUG, "MUTE OFF OFF OFF"); - - muted = 0; - return 1; -} - -int AudioMVP::pause() -{ - if (!initted) return 0; - - if (ioctl(fdAudio, AV_SET_AUD_PAUSE, 1) != 0) return 0; - return 1; -} - -int AudioMVP::unPause() -{ - if (!initted) return 0; - - if (ioctl(fdAudio, AV_SET_AUD_UNPAUSE, 1) != 0) return 0; - return 1; -} - -int AudioMVP::reset() -{ - if (!initted) return 0; -//test(); - Log::getInstance()->log("Audio", Log::DEBUG, "reset called"); - if (ioctl(fdAudio, AV_SET_AUD_RESET, 0x11) != 0) return 0; - Log::getInstance()->log("Audio", Log::DEBUG, "reset back"); - if (ioctl(fdAudio, AV_SET_AUD_PLAY, 0) != 0) return 0; - - doMuting(); - return 1; -} - -int AudioMVP::setVolume(int tvolume) -{ - // parameter: 0 for silence, 20 for full - if ((tvolume < 0) || (tvolume > 20)) return 0; - -// volume = 2 * (20 - volume); -// Right, that one was rubbish... 0-10 were almost -// inaudible, 11-20 did what should have been done -// over the whole 0-20 range - - tvolume = 20 - tvolume; - - audio_volume Avolume; - Avolume.frontleft = tvolume + Aoffset.frontleft; - Avolume.frontright = tvolume + Aoffset.frontright; - Avolume.rearleft = tvolume + Aoffset.rearleft; - Avolume.rearright = tvolume + Aoffset.rearright; - Avolume.center = tvolume + Aoffset.center; - Avolume.lfe = tvolume + Aoffset.lfe; - - if (ioctl(fdAudio, AV_SET_AUD_VOLUME, &Avolume) != 0) return 0; - -// unsigned long vol = (tvolume << 24) | (tvolume << 16); -// -// Log::getInstance()->log("Audio", Log::DEBUG, "%lx", vol); -// Log::getInstance()->log("Audio", Log::DEBUG, "%i", tvolume); - -// if (ioctl(fdAudio, AV_SET_AUD_VOLUME, &vol) != 0) return 0; - return 1; -} - -#ifdef DEV -int AudioMVP::test() -{ -// ULLONG stc = 0; -// return ioctl(fdAudio, AV_SET_AUD_STC, &stc); - - aud_sync_parms_t a; - a.parm1 = 0; - a.parm2 = 0; - - int b = ioctl(fdAudio, AV_SET_AUD_DISABLE_SYNC, &a); - - - /*OK*/ printf("Audio sync disable = %i\n", b); - - return 1; - - -} -#endif - -void AudioMVP::PrepareMediaSample(const MediaPacketList& mplist,UINT samplepos) -{ - packet = mplist.front(); -} - -UINT AudioMVP::DeliverMediaSample(UCHAR* buffer, UINT* samplepos) -{ - int written = ::write(fdAudio, buffer + packet.pos_buffer + *samplepos, - packet.length - *samplepos); - if (written == (int)(packet.length - *samplepos)) {*samplepos = 0; return 1;} - if (written > 0) *samplepos += written; - return 0; -} - -void AudioMVP::ResetTimeOffsets() -{ -} diff --git a/audiomvp.h b/audiomvp.h deleted file mode 100644 index b1d9ff6..0000000 --- a/audiomvp.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - Copyright 2004-2005 Chris Tallon - - This file is part of VOMP. - - VOMP 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. - - VOMP 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 VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -// Thanks to Jon Gettler and BtB for all the ioctl information - -#ifndef AUDIOMVP_H -#define AUDIOMVP_H - -#include -#include -#include -#include - -#include "defines.h" -#include "audio.h" - -typedef struct -{ - int parm1; - int parm2; -} aud_sync_parms_t; - -typedef struct -{ - int aud_ctl0; - int aud_ctl1; - int aud_ctl2; -} aud_ctl_regs_t; - -#define AV_SET_AUD_PLAY _IOW('a', 2, int) -#define AV_SET_AUD_PAUSE _IOW('a', 3, int) -#define AV_SET_AUD_UNPAUSE _IOW('a', 4, int) -#define AV_SET_AUD_SRC _IOW('a', 5, int) -#define AV_SET_AUD_MUTE _IOW('a', 6, int) -#define AV_SET_AUD_CHANNEL _IOW('a', 9, int) -#define AV_GET_AUD_INFO _IOR('a', 10, int) -#define AV_SET_AUD_VOLUME _IOW('a', 13, int) -#define AV_GET_AUD_VOLUME _IOR('a', 14, int) -#define AV_SET_AUD_STREAMTYPE _IOW('a', 15, int) -#define AV_SET_AUD_FORMAT _IOW('a', 16, int) -#define AV_GET_AUD_TIMESTAMPS _IOR('a', 21, sync_data_t*) -#define AV_SET_AUD_STC _IOW('a', 22, uint64_t *) -#define AV_SET_AUD_SYNC _IOW('a', 23, int) -#define AV_SET_AUD_DISABLE_SYNC _IOW('a', 24, aud_sync_parms_t*) -#define AV_SET_AUD_RESET _IOW('a', 26, int) -#define AV_SET_AUD_DAC_CLK _IOW('a', 27, int) -#define AV_GET_AUD_REGS _IOW('a', 28, aud_ctl_regs_t*) - - -class AudioMVP : public Audio -{ - public: - AudioMVP(); - ~AudioMVP(); - - int init(UCHAR streamType); - int shutdown(); - - int setStreamType(UCHAR streamType); - int setChannel(); - int setSource(); - int sync(); - int play(); - int stop(); - int pause(); - int unPause(); - int reset(); - int setVolume(int volume); - int mute(); - int unMute(); - bool supportsAc3() { return false; } - - //Writing Data to Audiodevice - virtual void PrepareMediaSample(const MediaPacketList&, UINT samplepos); - virtual UINT DeliverMediaSample(UCHAR* buffer, UINT *samplepos); - virtual long long SetStartOffset(long long curreftime, bool *rsync) { return 0; }; - virtual void ResetTimeOffsets(); - -#ifdef DEV - int test(); -#endif - - private: - int initAllParams(); - UCHAR streamType; - int fdAudio; - - MediaPacket packet; - UINT packetpos; -}; - -#endif diff --git a/boxx.h b/boxx.h index 15248f6..abd97c6 100644 --- a/boxx.h +++ b/boxx.h @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with VOMP. If not, see . */ #ifndef BOXX_H @@ -40,7 +39,6 @@ class Bitmap; class Boxx { - friend class Wwss; public: Boxx(); virtual ~Boxx(); @@ -61,11 +59,11 @@ class Boxx // However, it is useful to be able to make instances of Boxx // Therefore the following stubs are provided. virtual void preDelete() {} - virtual int handleCommand(int x) { return 0; } - virtual void processMessage(Message* m) {} - virtual bool mouseMove(int x, int y); - virtual bool mouseLBDOWN(int x, int y); - virtual bool mouseAndroidScroll(int x, int y,int sx, int sy) { return false; } + virtual int handleCommand(int) { return 0; } + virtual void processMessage(Message*) {} + virtual bool mouseMove(int x, int y); + virtual bool mouseLBDOWN(int x, int y); + virtual bool mouseAndroidScroll(int /* x */, int /* y */, int /* sx */, int /* sy */) { return false; } virtual void deactivateAllControls() {} /* preDelete @@ -110,7 +108,7 @@ class Boxx //Now deprecated //void drawPixel(UINT x, UINT y, const Colour& colour, bool fastdraw=false); void drawBitmap(UINT x, UINT y, const Bitmap& bm, const DisplayRegion & region); - //Now deprecated + //Now deprecated // void drawPixelAlpha(UINT x, UINT y, const Colour& colour,bool fastdraw=false); void drawTVMedia(TVMediaInfo & tvmedia,float x, float y, float width, float height, Corner corner=TopLeft); void drawClippingRectangle(float x, float y, float w, float h); @@ -197,4 +195,3 @@ Obseleted classes: Box, View, Viewman, Widget, others? No code outside boxx should talk about surfaces anymore. Hopefully. */ - diff --git a/command.cc b/command.cc index 40f9815..a77129a 100644 --- a/command.cc +++ b/command.cc @@ -35,7 +35,6 @@ #include "led.h" #include "video.h" #include "audio.h" -#include "mtd.h" #include "vdr.h" #include "vvolume.h" #include "vserverselect.h" @@ -484,12 +483,8 @@ void Command::processMessage(Message* m) } case Message::SCREENSHOT: { -#ifdef VOMP_PLATTFORM_MVP - Osd::getInstance()->screenShot("/out.jpg"); -#else logger->log("Osd", Log::NOTICE, "Screenshot Message arrived"); Osd::getInstance()->screenShot("out.jpg"); -#endif break; } case Message::CONNECTION_LOST: diff --git a/defines.h b/defines.h index 6dfc56b..46e2519 100644 --- a/defines.h +++ b/defines.h @@ -1,5 +1,5 @@ /* - Copyright 2004-2005 Chris Tallon + Copyright 2004-2020 Chris Tallon This file is part of VOMP. @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with VOMP. If not, see . */ #ifndef DEFINES_H @@ -83,7 +82,7 @@ int getClockRealTime(struct timespec *tp); /*#ifdef _MIPS_ARCH #define Surface_TYPE SurfaceDirectFB #else - #define Surface_TYPE SurfaceMVP + #define Surface_TYPE #endif*/ #ifdef __ANDROID__ #define Thread_TYPE ThreadPAndroid @@ -115,7 +114,6 @@ int getClockRealTime(struct timespec *tp); // remotes under /dev/event // HDMI CEC //lirc? - #define Mtd_TYPE MtdRaspberry //this is device dependent #define Led_TYPE LedRaspberry //this is device dependent #define Osd_TYPE OsdOpenVG // This OpenGL ES 2.0, in the moment only for raspberry, but might be splitted for other devices #define OsdStartDev "" @@ -159,18 +157,16 @@ int getClockRealTime(struct timespec *tp); #ifdef VOMP_PLATTFORM_MVP #define Remote_TYPE RemoteMVP #define RemoteStartDev "/dev/rawir" - #define Mtd_TYPE MtdMVP - #define Led_TYPE LedMVP - #define Osd_TYPE OsdMVP + #define Led_TYPE + #define Osd_TYPE #define OsdStartDev "/dev/stbgfx" - #define Audio_TYPE AudioMVP - #define Video_TYPE VideoMVP - #define Surface_TYPE SurfaceMVP //deprecated + #define Audio_TYPE + #define Video_TYPE + #define Surface_TYPE #define DEFAULT_TCP_WINDOWSIZE 2048 /*=2048*/ #define DEFAULT_TCP_WINDOWSIZENR 2 /*=2048*/ #define PLAYER_MAX_STREAMING_BUFFERS 11 // for video in uints of 50000 KB #define PAL_WSS - #define MVP_REMOTE_TYPES #define VOMP_MEDIAPLAYER #define VOMP_LINUX_CLOCK CLOCK_REALTIME @@ -183,7 +179,6 @@ int getClockRealTime(struct timespec *tp); #ifdef VOMP_PLATTFORM_NMT // This was the attempt to port vomp to nmt, it failed but maybe the code is useful at some time #define Remote_TYPE RemoteLirc #define RemoteStartDev "/dev/lircd" - #define Mtd_TYPE MtdNMT #define Led_TYPE LedMVP #define Osd_TYPE OsdDirectFB #define OsdStartDev "" diff --git a/demuxer.h b/demuxer.h index 7a0c1f9..20f544b 100644 --- a/demuxer.h +++ b/demuxer.h @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with VOMP; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with VOMP. If not, see . */ /* @@ -53,7 +52,7 @@ class PESPacket PESPacket(const PESPacket& packet); PESPacket& operator=(const PESPacket& packet); ~PESPacket(); - void init(UCHAR type, UCHAR sub=0); + void init(UCHAR type, UCHAR sub = 0); void truncate(); int write(const UCHAR* buf, int len); @@ -114,9 +113,9 @@ class Demuxer virtual int scan(UCHAR* buf, int len) = 0; virtual int findPTS(UCHAR* buf, int len, ULLONG* dest) = 0; virtual int put(UCHAR* buf, int len) = 0; - virtual void setFrameNum(ULONG frame) {} - virtual void setPacketNum(ULONG packet) {} - virtual ULONG getFrameNumFromPTS(ULLONG pts) {return 0;} + virtual void setFrameNum(ULONG /* frame */) {} + virtual void setPacketNum(ULONG /* packet */) {} + virtual ULONG getFrameNumFromPTS(ULLONG /* pts */) { return 0; } virtual ULONG getPacketNum() {return 0;} bool* getmpAudioChannels(); //Maybe virtual ? diff --git a/ledmvp.cc b/ledmvp.cc deleted file mode 100644 index 6bb36cc..0000000 --- a/ledmvp.cc +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright 2004-2005 Chris Tallon - - This file is part of VOMP. - - VOMP 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. - - VOMP 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 VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include "ledmvp.h" - -LedMVP::LedMVP() -{ - if (instance) return; - initted = 0; - device = 0; -} - -LedMVP::~LedMVP() -{ -} - -int LedMVP::init(int tdevice) -{ - if (initted) return 0; - initted = 1; - device = tdevice; - return 1; -} - -int LedMVP::shutdown() -{ - if (!initted) return 0; - initted = 0; - device = 0; - return 1; -} - -int LedMVP::on() -{ - if (!initted) return 0; - - int result = ioctl(device, IR_SET_LED, 0); - if (result >= 0) return 1; - else return 0; -} - -int LedMVP::off() -{ - if (!initted) return 0; - - int result = ioctl(device, IR_SET_LED, 1); - if (result >= 0) return 1; - else return 0; -} diff --git a/ledmvp.h b/ledmvp.h deleted file mode 100644 index b502216..0000000 --- a/ledmvp.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - Copyright 2004-2005 Chris Tallon - - This file is part of VOMP. - - VOMP 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. - - VOMP 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 VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#ifndef LEDMVP_H -#define LEDMVP_H - -#include -#include - -#include "led.h" - -#define IR_SET_LED _IOW('i',21,int) - -class LedMVP : public Led -{ - public: - LedMVP(); - virtual ~LedMVP(); - - int init(int device); - int shutdown(); - - int on(); - int off(); - - private: - int initted; - int device; -}; - -#endif diff --git a/main.cc b/main.cc index 8bf2536..9b0fff6 100644 --- a/main.cc +++ b/main.cc @@ -1,5 +1,5 @@ /* - Copyright 2004-2005 Chris Tallon + Copyright 2004-2020 Chris Tallon This file is part of VOMP. @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with VOMP. If not, see . */ #include @@ -40,27 +39,8 @@ #include "boxstack.h" #include "command.h" - -#ifdef VOMP_PLATTFORM_MVP - - -#include "mtdmvp.h" -#include "remotemvp.h" -#include "ledmvp.h" -#include "osdmvp.h" -#include "audiomvp.h" -#include "videomvp.h" - -extern "C" -{ - int ticonfig_main(int, char**); -} - -#endif - #ifdef VOMP_PLATTFORM_NMT -#include "mtdnmt.h" #include "remotelirc.h" #include "lednmt.h" #include "osddirectfb.h" @@ -71,7 +51,6 @@ extern "C" #ifdef VOMP_PLATFORM_RASPBERRY -#include "mtdraspberry.h" #include "remotelinux.h" #include "ledraspberry.h" #include "osdopenvg.h" @@ -81,8 +60,6 @@ extern "C" #endif - - #include "wol.h" #include "vsleeptimer.h" @@ -96,7 +73,6 @@ void shutdown(int code); // Global variables -------------------------------------------------------------------------------------------------- Log* logger; Remote* remote; -Mtd* mtd; Led* led; Osd* osd; Timers* timers; @@ -113,14 +89,10 @@ int fdtty; struct vt_mode old_vtmode; #endif -// Linux MVP main function and sighandler +// Linux main function and sighandler #ifndef WIN32 int main(int argc, char** argv) { -#ifdef VOMP_PLATTFORM_MVP - if (strstr(argv[0], "ticonfig")) return ticonfig_main(argc, argv); -#endif - bool daemonize = true; bool debugEnabled = false; bool crashed = false; @@ -156,7 +128,6 @@ int main(int argc, char** argv) timers = new Timers(); vdr = new VDR(); - mtd = new Mtd_TYPE(); remote = new Remote_TYPE(); led = new Led_TYPE(); osd = new Osd_TYPE(); @@ -170,7 +141,7 @@ int main(int argc, char** argv) wol = new Wol(); sleeptimer = new Sleeptimer(); - if (!logger || !remote || !mtd || !led || !osd || !video || !audio || !boxstack || !command || !wol || !sleeptimer) + if (!logger || !remote || !led || !osd || !video || !audio || !boxstack || !command || !wol || !sleeptimer) { printf("Could not create objects. Memory problems?\n"); shutdown(1); @@ -280,11 +251,8 @@ int main(int argc, char** argv) logger->log("Core", Log::EMERG, "Remote module failed to initialise"); shutdown(1); } -#ifdef VOMP_PLATTFORM_MVP - success = led->init(((RemoteMVP*)remote)->getDevice()); -#else + success = led->init(-1); -#endif if (success) { logger->log("Core", Log::INFO, "LED module initialised"); @@ -295,17 +263,6 @@ int main(int argc, char** argv) shutdown(1); } - success = mtd->init(); - if (success) - { - logger->log("Core", Log::INFO, "Mtd module initialised"); - } - else - { - logger->log("Core", Log::EMERG, "Mtd module failed to initialise"); - shutdown(1); - } - success = timers->init(); if (success) { @@ -317,10 +274,7 @@ int main(int argc, char** argv) shutdown(1); } - UCHAR videoFormat = (UCHAR)mtd->getPALorNTSC(); - if (videoFormat == Video::PAL) logger->log("Core", Log::INFO, "Read from MTD: PAL 720x576"); - else if (videoFormat == Video::NTSC) logger->log("Core", Log::INFO, "Read from MTD: NTSC 720x480"); - else logger->log("Core", Log::INFO, "No help from MTD. Assuming NTSC 720x480"); + UCHAR videoFormat = Video::PAL; // PALNTSC FIXME success = video->init(videoFormat); if (success) @@ -466,13 +420,6 @@ void shutdown(int code) logger->log("Core", Log::NOTICE, "Timers module shut down"); } - if (mtd) - { - mtd->shutdown(); - delete mtd; - logger->log("Core", Log::NOTICE, "MTD module shut down"); - } - if (led) { led->shutdown(); @@ -552,18 +499,18 @@ void MILLISLEEP(ULONG a) #endif } -long long getTimeMS() { - struct timespec ts; - clock_gettime(VOMP_LINUX_CLOCK, &ts); - return ts.tv_sec*1000+ts.tv_nsec/1000000LL; +long long getTimeMS() +{ + struct timespec ts; + clock_gettime(VOMP_LINUX_CLOCK, &ts); + return ts.tv_sec * 1000 + ts.tv_nsec / 1000000LL; } int getClockRealTime(struct timespec *tp) { - return clock_gettime(CLOCK_REALTIME, tp); + return clock_gettime(CLOCK_REALTIME, tp); } - int min(UINT a, int b) { if (a > b) return b; @@ -575,4 +522,3 @@ int max(int a, int b) if (a > b) return a; else return b; } - diff --git a/message.h b/message.h index d6a124c..ed903e5 100644 --- a/message.h +++ b/message.h @@ -83,8 +83,6 @@ class Message const static ULONG NEW_PICTURE = 36; const static ULONG NEW_PICTURE_STATIC = 37; const static ULONG REDRAW = 38; - - const static ULONG HACK_MVP_RETURN_FROM_QUARTER = 999; }; #endif diff --git a/mtd.cc b/mtd.cc deleted file mode 100644 index 9a86765..0000000 --- a/mtd.cc +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright 2004-2005 Chris Tallon - - This file is part of VOMP. - - VOMP 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. - - VOMP 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 VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include "mtd.h" - -Mtd* Mtd::instance = NULL; - -Mtd::Mtd() -{ - if (instance) return; - instance = this; -} - -Mtd::~Mtd() -{ - instance = NULL; -} - -Mtd* Mtd::getInstance() -{ - return instance; -} diff --git a/mtd.h b/mtd.h deleted file mode 100644 index 3c8be3a..0000000 --- a/mtd.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - Copyright 2004-2005 Chris Tallon - - This file is part of VOMP. - - VOMP 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. - - VOMP 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 VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#ifndef MTD_H -#define MTD_H - -#include - -class Mtd -{ - public: - Mtd(); - virtual ~Mtd(); - static Mtd* getInstance(); - - virtual int init()=0; - virtual int shutdown()=0; - - virtual short getPALorNTSC()=0; - - protected: - static Mtd* instance; -}; - -#endif diff --git a/mtdmvp.cc b/mtdmvp.cc deleted file mode 100644 index 62be904..0000000 --- a/mtdmvp.cc +++ /dev/null @@ -1,157 +0,0 @@ -/* - Copyright 2004-2005 Chris Tallon - - This file is part of VOMP. - - VOMP 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. - - VOMP 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 VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include "mtdmvp.h" - -#include "log.h" - -MtdMVP::MtdMVP() -{ - if (instance) return; - initted = 0; -} - -MtdMVP::~MtdMVP() -{ -} - -int MtdMVP::init() -{ - if (initted) return 0; - initted = 1; - - FILE* fp = fopen("/proc/mtd", "r"); - if (!fp) - { - Log::getInstance()->log("MTD", Log::DEBUG, "Could not open /proc/mtd"); - initted = 0; - return 0; - } - - char buffer[1024]; - char mtdNumberChar = '\0'; - - while(!feof(fp)) - { - fgets(buffer, 1023, fp); - if (strstr(buffer, "HCW MediaMVP VPD")) - { - mtdNumberChar = buffer[3]; - } - } - fclose(fp); - - if (mtdNumberChar == '\0') - { - Log::getInstance()->log("MTD", Log::DEBUG, "Failed to find correct /dev/mtdX device"); - initted = 0; - return 0; - } - - strcpy(buffer, "/dev/mtd"); - strncat(buffer, &mtdNumberChar, 1); - Log::getInstance()->log("MTD", Log::DEBUG, "Located MTD device: %s", buffer); - - - int fd; - - if ((fd = open(buffer, O_RDONLY)) < 0) - { - Log::getInstance()->log("MTD", Log::DEBUG, "Open fail"); - initted = 0; - return 0; - } - - if (read(fd, data, 8192) < 8192) - { - Log::getInstance()->log("MTD", Log::DEBUG, "Read fail"); - initted = 0; - return 0; - } - - close(fd); - - //logit(); - - return 1; -} - -int MtdMVP::shutdown() -{ - if (!initted) return 0; - initted = 0; - return 1; -} - -short MtdMVP::getPALorNTSC() -{ - return data[2119]; -} - -/* -short MtdMVP::getAspect() -{ - return data[2125]; -} - -short MtdMVP::getFlicker() -{ - return data[2124]; -} - -short MtdMVP::getBootLogoOutput() -{ - return data[2116]; -} - -short MtdMVP::getBootLogoDisplayVideoLeft() -{ - return data[2120]; -} - -short MtdMVP::getBootLogoDisplayVideoUpper() -{ - return data[2121]; -} - -short MtdMVP::getBootLogoDisplayVideoWidth() -{ - return data[2122]; -} - -short MtdMVP::getBootLogoDisplayVideoHeight() -{ - return data[2123]; -} - -void MtdMVP::logit() -{ - Log* logger = Log::getInstance(); - - logger->log("MTD", Log::DEBUG, "Mode: %i", getPALorNTSC()); - logger->log("MTD", Log::DEBUG, "Aspect: %i", getAspect()); - logger->log("MTD", Log::DEBUG, "Flicker: %i", getFlicker()); - logger->log("MTD", Log::DEBUG, "Bootlogo output: %i", getBootLogoOutput()); - logger->log("MTD", Log::DEBUG, "Bootlogo display video left: %i", getBootLogoDisplayVideoLeft()); - logger->log("MTD", Log::DEBUG, "Bootlogo display video upper: %i", getBootLogoDisplayVideoUpper()); - logger->log("MTD", Log::DEBUG, "Bootlogo display video width: %i", getBootLogoDisplayVideoWidth()); - logger->log("MTD", Log::DEBUG, "Bootlogo display video height: %i", getBootLogoDisplayVideoHeight()); -} -*/ diff --git a/mtdmvp.h b/mtdmvp.h deleted file mode 100644 index 1afaf68..0000000 --- a/mtdmvp.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - Copyright 2004-2005 Chris Tallon - - This file is part of VOMP. - - VOMP 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. - - VOMP 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 VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -// Information for this class taken from the mvpmc project - thanks - -/* - discussion on short positions: - http://www.shspvr.com/smf/index.php?topic=3765.30 - -It says: -1 = NTSC/composite -2 = PAL/Scart -3 = PAL/Composite - -But with PAL/Scart/RGB I get a value of 1 - -So, am assuming: -0 = NTSC / composite -1 = PAL / scart rgb -2 = PAL / scart composite -*/ - -#ifndef MTDMVP_H -#define MTDMVP_H - -#include -#include - -#include "mtd.h" - -class MtdMVP : public Mtd -{ - public: - MtdMVP(); - ~MtdMVP(); - - int init(); - int shutdown(); - - short getPALorNTSC(); - - /* - short getAspect(); - short getFlicker(); - short getBootLogoOutput(); - short getBootLogoDisplayVideoLeft(); - short getBootLogoDisplayVideoUpper(); - short getBootLogoDisplayVideoWidth(); - short getBootLogoDisplayVideoHeight(); - - void logit(); - */ - - private: - int initted; - - short data[4096]; -}; - -#endif diff --git a/mtdraspberry.cc b/mtdraspberry.cc deleted file mode 100644 index c46abff..0000000 --- a/mtdraspberry.cc +++ /dev/null @@ -1,51 +0,0 @@ -/* - Copyright 2004-2005 Chris Tallon - - This file is part of VOMP. - - VOMP 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. - - VOMP 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 VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include "mtdraspberry.h" -#include "video.h" - -MtdRaspberry::MtdRaspberry() -{ - initted = 0; -} - -MtdRaspberry::~MtdRaspberry() -{ -} - -int MtdRaspberry::init() -{ - if (initted) return 0; - initted = 1; - return 1; -} - -int MtdRaspberry::shutdown() -{ - if (!initted) return 0; - initted = 0; - return 1; -} - -short MtdRaspberry::getPALorNTSC() -{ - return Video::PAL; //Fixme! -} - diff --git a/mtdraspberry.h b/mtdraspberry.h deleted file mode 100644 index 5a80854..0000000 --- a/mtdraspberry.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - Copyright 2004-2005 Chris Tallon, 2011 Marten Richter - - This file is part of VOMP. - - VOMP 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. - - VOMP 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 VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#ifndef MTDRASPBERRY_H -#define MTDRASPBERRY_H - -#include "mtd.h" - -class MtdRaspberry: public Mtd { -public: - MtdRaspberry(); - virtual ~MtdRaspberry(); - - virtual int init(); - virtual int shutdown(); - - virtual short getPALorNTSC(); - -private: - int initted; -}; - -#endif - diff --git a/mtdwin.cc b/mtdwin.cc deleted file mode 100644 index e9ccdbe..0000000 --- a/mtdwin.cc +++ /dev/null @@ -1,51 +0,0 @@ -/* - Copyright 2004-2005 Chris Tallon - - This file is part of VOMP. - - VOMP 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. - - VOMP 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 VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include "mtdwin.h" -#include "video.h" - -MtdWin::MtdWin() -{ - initted = 0; -} - -MtdWin::~MtdWin() -{ -} - -int MtdWin::init() -{ - if (initted) return 0; - initted = 1; - return 1; -} - -int MtdWin::shutdown() -{ - if (!initted) return 0; - initted = 0; - return 1; -} - -short MtdWin::getPALorNTSC() -{ - return Video::PAL; //Fixme! -} - diff --git a/mtdwin.h b/mtdwin.h deleted file mode 100644 index b0f1733..0000000 --- a/mtdwin.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - Copyright 2004-2005 Chris Tallon - - This file is part of VOMP. - - VOMP 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. - - VOMP 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 VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#ifndef MTDWIN_H -#define MTDWIN_H - -#include "mtd.h" - -class MtdWin : public Mtd -{ - public: - MtdWin(); - ~MtdWin(); - - virtual int init(); - virtual int shutdown(); - -virtual short getPALorNTSC(); - - private: - int initted; -}; - -#endif - diff --git a/objects.mk b/objects.mk index fb45467..686108b 100644 --- a/objects.mk +++ b/objects.mk @@ -12,7 +12,7 @@ OBJ_COMMON = command.o tcp.o dsock.o thread.o timers.o i18n.o vdp6.o vradiorec.o vaudioselector.o vscreensaver.o vopts.o \ wselectlist.o wjpeg.o wsymbol.o wbutton.o wtextbox.o \ woptionpane.o woptionbox.o wremoteconfig.o wtabbar.o led.o \ - remote.o mtd.o osd.o surface.o vpicturebanner.o abstractoption.o \ + remote.o osd.o surface.o vpicturebanner.o abstractoption.o \ eventdispatcher.o vdrrequestpacket.o vdrresponsepacket.o \ vvideolivetv.o vsleeptimer.o playerlivetv.o playerliveradio.o \ wprogressbar.o bitmap.o dvbsubtitles.o tfeed.o vteletextview.o \ @@ -20,10 +20,10 @@ OBJ_COMMON = command.o tcp.o dsock.o thread.o timers.o i18n.o vdp6.o wmovieview.o wseriesview.o tvmedia.o wtvmedia.o wpictureview.o OBJ_RASPBERRY = main.o threadp.o osdvector.o surfacevector.o osdopenvg.o \ - ledraspberry.o mtdraspberry.o videoomx.o audioomx.o imageomx.o \ + ledraspberry.o videoomx.o audioomx.o imageomx.o \ wjpegsimple.o remotelinux.o signal.o -OBJ_WINDOWS = winmain.o threadwin.o remotewin.o ledwin.o mtdwin.o videowin.o \ +OBJ_WINDOWS = winmain.o threadwin.o remotewin.o ledwin.o videowin.o \ audiowin.o windowsosd.o dsallocator.o dssourcefilter.o dssourcepin.o \ wwinvideofilter.o wwinvideoh264filter.o wwinaudiofilter.o \ wwinmp3audiofilter.o wjpegsimple.o diff --git a/osd.h b/osd.h index 0f87900..a3cfef3 100644 --- a/osd.h +++ b/osd.h @@ -14,15 +14,12 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with VOMP. If not, see . */ #ifndef OSD_H #define OSD_H -#include - class Surface; class Osd @@ -34,22 +31,22 @@ class Osd virtual int init(void* device)=0; virtual int shutdown()=0; - virtual int restore(){return 1;}; - virtual int stopUpdate() {return 1;}; + virtual int restore() { return 1; }; + virtual int stopUpdate() { return 1; }; virtual Surface * createNewSurface()=0; // For Boxx - virtual int charSet() {return 1;}; + virtual int charSet() { return 1; }; - bool isInitted() {return initted;}; + bool isInitted() { return initted; }; virtual int getFD()=0; virtual void screenShot(const char* fileName)=0; - virtual int getFontNames(const char *** names,const char *** names_keys){ return 0;}; - virtual void setFont(const char * fontname){}; + virtual int getFontNames(const char*** /* names */,const char*** /* names_keys */) { return 0; }; + virtual void setFont(const char* /* fontname */) {}; - virtual float getPixelAspect() {return 1.f;}; + virtual float getPixelAspect() { return 1.f; }; protected: static Osd* instance; diff --git a/osdmvp.cc b/osdmvp.cc deleted file mode 100644 index 476045d..0000000 --- a/osdmvp.cc +++ /dev/null @@ -1,81 +0,0 @@ -/* - Copyright 2004-2005 Chris Tallon - - This file is part of VOMP. - - VOMP 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. - - VOMP 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 VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include "osdmvp.h" -#include "surfacemvp.h" - -OsdMVP::OsdMVP() -{ - if (instance) return; -} - -OsdMVP::~OsdMVP() -{ - if (initted) shutdown(); -} - -int OsdMVP::getFD() -{ - if (!initted) return 0; - return fdOsd; -} - -Surface * OsdMVP::createNewSurface() -{ - return (Surface*)new SurfaceMVP(); -} - -int OsdMVP::init(void* device) -{ - if (initted) return 0; - - fdOsd = open((char*)device, O_RDWR); - if (!fdOsd) - { - Log::getInstance()->log("OSD", Log::DEBUG, "Could not open OSD device!"); - return 0; - } - - initted = 1; // must set this here or create surface won't work - - SurfaceMVP::initConversionTables(); - - Video* video = Video::getInstance(); - - screen = new SurfaceMVP(Surface::SCREEN); - screen->create(video->getScreenWidth(), video->getScreenHeight()); - screen->display(); - - return 1; -} - -int OsdMVP::shutdown() -{ - if (!initted) return 0; - initted = 0; - delete screen; - close(fdOsd); - return 1; -} - -void OsdMVP::screenShot(const char* fileName) -{ - screen->screenShot(fileName); -} diff --git a/osdmvp.h b/osdmvp.h deleted file mode 100644 index 5c23c63..0000000 --- a/osdmvp.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright 2004-2005 Chris Tallon - - This file is part of VOMP. - - VOMP 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. - - VOMP 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 VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#ifndef OSDMVP_H -#define OSDMVP_H - -#include -#include -#include - -#include "osd.h" -#include "defines.h" -#include "log.h" -#include "surfacemvp.h" -#include "video.h" - -class OsdMVP : public Osd -{ - public: - OsdMVP(); - virtual ~OsdMVP(); - - int init(void* device); - int shutdown(); - - Surface * createNewSurface(); - - int getFD(); - - void screenShot(const char* fileName); - - private: -}; - -#endif diff --git a/osdopengl.cc b/osdopengl.cc index 9d68a41..61aa6b0 100644 --- a/osdopengl.cc +++ b/osdopengl.cc @@ -18,26 +18,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - #include "osdopengl.h" -#include "mtd.h" #include "videoomx.h" #include "surfaceopengl.h" - #include "message.h" #include "command.h" - #define BACKBUFFER_WIDTH 1280 #define BACKBUFFER_HEIGHT 720 - - - - - - OsdOpenGL::OsdOpenGL() { glmutex.Lock(); diff --git a/osdopenvg.cc b/osdopenvg.cc index 18a1dc2..3450472 100644 --- a/osdopenvg.cc +++ b/osdopenvg.cc @@ -20,7 +20,6 @@ #include "osdopenvg.h" -#include "mtd.h" #include "videoomx.h" #include "surface.h" diff --git a/osdvector.h b/osdvector.h index 9babaa6..0628e08 100644 --- a/osdvector.h +++ b/osdvector.h @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with VOMP. If not, see . */ @@ -220,7 +219,7 @@ class OsdVector : public Osd Surface * createNewSurface(); void Blank(); - virtual void updateBackgroundColor(DrawStyle bg) {}; + virtual void updateBackgroundColor(DrawStyle /* bg */) {}; void updateOrAddSurface(const SurfaceVector *surf,float x,float y,float height,float width, std::vector& commands); diff --git a/osdwinpixel.cc b/osdwinpixel.cc index d7da2bc..87314bf 100644 --- a/osdwinpixel.cc +++ b/osdwinpixel.cc @@ -22,7 +22,6 @@ #ifndef GRADIENT_DRAWING #include "osdwinpixel.h" -#include "mtd.h" #include "videowin.h" #include "surfacewin.h" diff --git a/osdwinvector.cc b/osdwinvector.cc index 87b4002..8ad49bc 100644 --- a/osdwinvector.cc +++ b/osdwinvector.cc @@ -20,7 +20,6 @@ #include "osdwinvector.h" -#include "mtd.h" #include "videowin.h" #include "surfacewin.h" diff --git a/remote.h b/remote.h index 9ebc4e4..61c2892 100644 --- a/remote.h +++ b/remote.h @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with VOMP. If not, see . */ #ifndef REMOTE_H @@ -69,7 +68,7 @@ class Remote: public AbstractOption void EnterLearnMode(UCHAR command); void ResetToDefault(); - virtual void changePowerState(bool poweron) {}; //informs the remote control, that about vomp's power state, this is important e.g. for cec + virtual void changePowerState(bool /* poweron */) {}; //informs the remote control, that about vomp's power state, this is important e.g. for cec const static ULONG NOLEARNMODE = 256; // Not buttons diff --git a/remotelinux.cc b/remotelinux.cc index 665c23f..c912071 100644 --- a/remotelinux.cc +++ b/remotelinux.cc @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with VOMP. If not, see . */ #include "remotelinux.h" @@ -937,7 +936,7 @@ void RemoteLinux::cecKeyPress(void*param, const cec_keypress* key) if (key->duration==0) ((RemoteLinux*)Remote::getInstance())->incomingCECkey(key->keycode); } -void RemoteLinux::cecCommand(void *param, const cec_command* command) +void RemoteLinux::cecCommand(void* /* param */, const cec_command* command) { Log::getInstance()->log("Remote", Log::DEBUG, "CECCommand: %d",command->opcode); switch (command->opcode) { @@ -970,7 +969,7 @@ void RemoteLinux::cecCommand(void *param, const cec_command* command) }; } -void RemoteLinux::cecConfigurationChanged(void *param, const libcec_configuration* config) +void RemoteLinux::cecConfigurationChanged(void* /* param */, const libcec_configuration* config) { Log::getInstance()->log("Remote", Log::DEBUG, "CECConfig:"/*,config->string()*/); } @@ -1032,7 +1031,7 @@ int RemoteLinux::cecConfigurationChanged(void *param, const libcec_configuration #endif -void RemoteLinux::cecSourceActivated(void*param, const cec_logical_address address, const uint8_t activated) +void RemoteLinux::cecSourceActivated(void* /* param */, const cec_logical_address address, const uint8_t activated) { Log::getInstance()->log("Remote", Log::DEBUG, "CECSourceActivated: %d %d", address, activated); if (activated==1) { diff --git a/remotemvp.cc b/remotemvp.cc deleted file mode 100644 index 63d44e6..0000000 --- a/remotemvp.cc +++ /dev/null @@ -1,138 +0,0 @@ -/* - Copyright 2004-2005 Chris Tallon - - This file is part of VOMP. - - VOMP 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. - - VOMP 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 VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include "remotemvp.h" - -#include "log.h" - -RemoteMVP::RemoteMVP() -{ - if (instance) return; - initted = 0; - device = 0; - tv.tv_sec = 0; - tv.tv_usec = 0; -} - -RemoteMVP::~RemoteMVP() -{ -} - -int RemoteMVP::init(const char* devName) -{ - if (initted) return 0; - initted = 1; - - device = open(devName, O_RDONLY); - if (device < 0) - { - initted = 0; - return 0; - } - - return 1; -} - -int RemoteMVP::shutdown() -{ - if (!initted) return 0; - initted = 0; - close(device); - device = 0; - return 1; -} - -int RemoteMVP::getDevice() -{ - if (!initted) return 0; - return device; -} - -UCHAR RemoteMVP::getButtonPress(int waitType) -{ - /* how = 0 - block - how = 1 - start new wait - how = 2 - continue wait - how = 3 - no wait - */ - - unsigned long input; - struct timeval* passToSelect = NULL; - int retval; - fd_set readfds; - - if (waitType == 0) - { - passToSelect = NULL; - } - else if (waitType == 1) - { - tv.tv_sec = 1; - tv.tv_usec = 000000; - passToSelect = &tv; - } - else if (waitType == 2) - { - if ((tv.tv_sec == 0) && (tv.tv_usec == 0)) // protection in case timer = 0 - { - tv.tv_sec = 1; - tv.tv_usec = 000000; - } - passToSelect = &tv; - } - else if (waitType == 3) - { - tv.tv_sec = 0; - tv.tv_usec = 0; - passToSelect = &tv; - } - FD_ZERO(&readfds); - FD_SET(device, &readfds); - - retval = select(device + 1, &readfds, NULL, NULL, &tv); - // 0 = nothing happened - // 1 = data arrived (actually num of descriptors that changed) - // other value = signal or error - if (retval == 0) return NA_NONE; - if (retval == -1) return NA_SIGNAL; - - int count = read(device, &input, 4); - if (count == 4) - { - input = (0X00FF0000 & input) >> 16; - Log::getInstance()->log("Remote", Log::DEBUG, "Button %i", input); - - if (remoteType == OLDREMOTE) - { - if (input == VOLUMEDOWN) return DF_LEFT; - if (input == VOLUMEUP) return DF_RIGHT; - if (input == CHANNELUP) return DF_UP; - if (input == CHANNELDOWN) return DF_DOWN; - } - - return (UCHAR) TranslateHWC(input); - } - return NA_UNKNOWN; -} - -void RemoteMVP::clearBuffer() -{ - while(getButtonPress(3) != NA_NONE); -} diff --git a/remotemvp.h b/remotemvp.h deleted file mode 100644 index ee667d0..0000000 --- a/remotemvp.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright 2004-2005 Chris Tallon - - This file is part of VOMP. - - VOMP 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. - - VOMP 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 VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#ifndef REMOTEMVP_H -#define REMOTEMVP_H - -#include -#include -#include - -#include "remote.h" -#include "defines.h" - -class RemoteMVP : public Remote -{ - public: - RemoteMVP(); - ~RemoteMVP(); - - int init(const char *devName); - int shutdown(); - int getDevice(); - UCHAR getButtonPress(int how); - void clearBuffer(); - - private: - int initted; - int device; - struct timeval tv; -}; - -#endif diff --git a/select-platform b/select-platform index f74cc4d..de8d02d 100755 --- a/select-platform +++ b/select-platform @@ -7,5 +7,5 @@ elif grep -q BCM2709 /proc/cpuinfo ; then elif grep -q BCM2835 /proc/cpuinfo ; then echo "raspberry" else - echo "mvp" + echo "" fi diff --git a/stream.cc b/stream.cc index 333164b..206fd26 100644 --- a/stream.cc +++ b/stream.cc @@ -83,10 +83,9 @@ int Stream::put(const UCHAR* inbuf, int len, UCHAR type,unsigned int index) newPacket.dts=0; newPacket.synched=false; newPacket.index=index; -#ifndef VOMP_PLATTFORM_MVP newPacket.disconti=false; newPacket.presentation_time=0; -#endif + if (type!=MPTYPE_MPEG_AUDIO_LAYER3) {//no PES //Extract the pts... bool hasdts=false; @@ -105,14 +104,12 @@ int Stream::put(const UCHAR* inbuf, int len, UCHAR type,unsigned int index) ( (ULLONG)(inbuf[18] & 0xFE) >> 1 ); hasdts=true; } -#ifndef VOMP_PLATTFORM_MVP //ok we have the pts now convert it to a continously time code in 100ns units if (hasdts && draintarget->dtsTimefix()) newPacket.presentation_time=(ULLONG)(newPacket.dts*10000LL/90LL); else newPacket.presentation_time=(ULLONG)(newPacket.pts*10000LL/90LL); //newPacket.presentation_time-=draintarget->SetStartOffset((ULLONG)(newPacket.pts*10000LL/90LL),&newPacket.disconti); newPacket.presentation_time-=draintarget->SetStartOffset((ULLONG)(newPacket.pts*10000LL/90LL),&newPacket.disconti); -#endif } } diff --git a/surface.h b/surface.h index bb3a6f9..a826d69 100644 --- a/surface.h +++ b/surface.h @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with VOMP. If not, see . */ #ifndef SURFACE_H @@ -51,10 +50,11 @@ class DisplayRegion; class Surface { - friend class Wwss; // classes that need surface access, their usage is forbidden for vector based + // classes that need surface access, their usage is forbidden for vector based friend class WJpegComplex;// implementations of osd friend class VColourTuner; - public: + +public: Surface(int id = 0); virtual ~Surface(); @@ -77,7 +77,7 @@ class Surface virtual int drawTextCentre(const char* text, int x, int y, const DrawStyle& c); #endif - virtual void drawJpeg(const char *fileName,int x, int y,int *width, int *height) {} + virtual void drawJpeg(const char* /* fileName */, int /* x */, int /* y */, int* /* width */, int* /* height */) {} virtual int create(UINT width, UINT height)=0; virtual void display()=0; @@ -96,11 +96,8 @@ class Surface virtual void startFastDraw() {}; virtual void endFastDraw() {}; - virtual void drawTTChar(int ox, int oy,int x, int y, cTeletextChar c); static Colour enumTeletextColorToCoulour(enumTeletextColor ttcol); - - // virtual int blt(int fd, unsigned long shandle, int sx, int sy, int width, int height, unsigned long dhandle, int dx, int dy)=0; @@ -114,7 +111,6 @@ class Surface static osd_font_t* font; #endif - virtual void drawPixel(int x, int y, unsigned int c, bool fastdraw=false)=0; // deprecated preparation for vector based drawing, only allowed to be called inside implementation virtual void drawPixel(int x, int y, Colour& c, bool fastdraw=false)=0; // deprecated preparation for vector based drawing, only allowed to be called inside implementation diff --git a/surfacemvp.cc b/surfacemvp.cc deleted file mode 100644 index a710d5d..0000000 --- a/surfacemvp.cc +++ /dev/null @@ -1,498 +0,0 @@ -/* - Copyright 2004-2005 Chris Tallon - Portions copyright 2004 Jon Gettler - - This file is part of VOMP. - - VOMP 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. - - VOMP 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 VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include "surfacemvp.h" - -#include "osd.h" -#include "bitmap.h" -#include "log.h" - -SurfaceMVP::SurfaceMVP(int id) -: Surface(id) -{ - fdOsd = Osd::getInstance()->getFD(); - memset(&surface, 0, sizeof(osd_surface_t)); - memset(&surface.sfc, 0, sizeof(stbgfx_sfc_t)); - memset(&surface.map, 0, sizeof(stbgfx_map_t)); -} - -SurfaceMVP::~SurfaceMVP() -{ - for (int i = 0; i < 3; i++) - { - if (surface.base[i]) munmap(surface.base[i], surface.map.map[i].size); - } - - int a; - - a = ioctl(fdOsd, GFX_FB_SFC_UNMAP, surface.sfc.handle); - if (a) Log::getInstance()->log("Surface", Log::ERR, "Surface unmap failed"); - - a = ioctl(fdOsd, GFX_FB_SFC_FREE, surface.sfc.handle); - if (a) Log::getInstance()->log("Surface", Log::ERR, "Surface destroy failed"); - -} - -int SurfaceMVP::create(UINT width, UINT height) -{ - int r = 0; - int displayNumber = 0; // mvpmc iterates 0->15 till it gets one that works? - - surface.sfc.width = width; - surface.sfc.height = height; - surface.sfc.flags = 0x3f1533; - - surface.sfc.unknown = -1; - -// r = ioctl(fdOsd, GFX_FB_SET_OSD, &displayNumber); -// if (r) return 0; - - r = ioctl(fdOsd, GFX_FB_OSD_SURFACE, &displayNumber); - if (r) return 0; - - r = ioctl(fdOsd, GFX_FB_SFC_ALLOC, &surface.sfc); - if (r) return 0; - - surface.map.map[0].unknown = surface.sfc.handle; - r = ioctl(fdOsd, GFX_FB_MAP, &surface.map); - if (r) return 0; - - surface.base[0] = (unsigned char *)mmap(NULL, surface.map.map[0].size, PROT_READ|PROT_WRITE, MAP_SHARED, fdOsd, surface.map.map[0].addr); - if (surface.base[0] == MAP_FAILED) return 0; - - surface.base[1] = (unsigned char *)mmap(NULL, surface.map.map[1].size, PROT_READ|PROT_WRITE, MAP_SHARED, fdOsd, surface.map.map[1].addr); - if (surface.base[1] == MAP_FAILED) return 0; - - surface.base[2] = (unsigned char *)mmap(NULL, surface.map.map[2].size, PROT_READ|PROT_WRITE, MAP_SHARED, fdOsd, surface.map.map[2].addr); - if (surface.base[2] == MAP_FAILED) return 0; - -// surface.display.num = displayNumber; -// r = ioctl(fdOsd, GFX_FB_MOVE_DISPLAY, &surface.display); -// if (r) return 0; - -// r = ioctl(fdOsd, GFX_FB_SET_DISPLAY, &surface.display); -// if (r) return 0; - - return 1; -} - -void SurfaceMVP::display() -{ - unsigned long fb_descriptor[2]; - - fb_descriptor[0] = surface.sfc.handle; - fb_descriptor[1] = 1; - - ioctl(fdOsd, GFX_FB_ATTACH, fb_descriptor); -} - -unsigned long SurfaceMVP::getSurfaceHandle() -{ - return surface.sfc.handle; -} - -// ---------------------------------------------------------------------------- - -// Now for the drawing functions - -/* - * RGB to YUV conversion tables - */ -int SurfaceMVP::conv_YB[256]; -int SurfaceMVP::conv_YG[256]; -int SurfaceMVP::conv_YR[256]; -int SurfaceMVP::conv_UB[256]; -int SurfaceMVP::conv_UG[256]; -int SurfaceMVP::conv_UR[256]; -int SurfaceMVP::conv_VB[256]; -int SurfaceMVP::conv_VG[256]; -int SurfaceMVP::conv_VR[256]; - -int SurfaceMVP::conv_BY[256]; -int SurfaceMVP::conv_GY[256]; -int SurfaceMVP::conv_RY[256]; -int SurfaceMVP::conv_BU[256]; -int SurfaceMVP::conv_GU[256]; -int SurfaceMVP::conv_RU[256]; -int SurfaceMVP::conv_BV[256]; -int SurfaceMVP::conv_GV[256]; -int SurfaceMVP::conv_RV[256]; - -/* - * gfx_init() - initialize the RGB to YUV conversion tables - */ -void SurfaceMVP::initConversionTables(int rfactor, int gfactor, int bfactor) - { - int i; - double drfactor=(double)rfactor/(double)100; - double dgfactor=(double)gfactor/(double)100; - double dbfactor=(double)bfactor/(double)100; - - for (i=0; i<256; i++) { - conv_YB[i] = (int)(0.299 * (double)i *dbfactor); - conv_BY[i] = i; - } - for (i=0; i<256; i++) { - conv_YG[i] = (int)(0.587 * (double)i * dgfactor); - conv_GY[i] = i; - } - for (i=0; i<256; i++) { - conv_YR[i] = (int)(0.114 * (double)i *drfactor); - conv_RY[i] = i; - } - - for (i=0; i<256; i++) { - conv_UB[i] = (int)(0.5 * (double)i *dbfactor); - conv_BU[i] = (int)(1.732 * (i - 128)); - } - for (i=0; i<256; i++) { - conv_UG[i] = (int)(-0.33126 * (double)i*dgfactor); - conv_GU[i] = (int)(-0.338 * (i - 128)); - } - for (i=0; i<256; i++) { - conv_UR[i] = (int)(-0.16874 * (double)i *drfactor); - conv_RU[i] = 0; - } - - for (i=0; i<256; i++) { - conv_VB[i] = (int)(-0.08131 * (double)i *dbfactor); - conv_BV[i] = 0; - } - for (i=0; i<256; i++) { - conv_VG[i] = (int)(-0.41869 * (double)i * dgfactor); - conv_GV[i] = (int)(-0.698 * (i - 128)); - } - for (i=0; i<256; i++) { - conv_VR[i] = (int)(0.5 * (double)i * drfactor); - conv_RV[i] = (int)(1.370 * ((double)i - 128)); - } -} - -int SurfaceMVP::fillblt(int x, int y, int width, int height, const DrawStyle& c) -{ - osd_fillblt_t fblt; - - fblt.handle = surface.sfc.handle; - fblt.x = x; - fblt.y = y; - fblt.width = width; - fblt.height = height; - fblt.colour = c.rgba(); - - return ioctl(fdOsd, GFX_FB_OSD_FILLBLT, &fblt); -} - -void SurfaceMVP::drawPixel(int x, int y, unsigned int c, bool fastdraw) -{ - int offset; - unsigned char r, g, b, a, Y, U, V; - unsigned int line, remainder; - - if ((x >= (int)surface.sfc.width) || (y >= (int)surface.sfc.height)) - return; - - c2rgba(c, &r, &g, &b, &a); - - rgb2yuv(r, g, b, &Y, &U, &V); - - remainder = (surface.sfc.width % 4); - if (remainder == 0) - line = surface.sfc.width; - else - line = surface.sfc.width + (4 - remainder); - - offset = (y * line) + x; - - *(surface.base[0] + offset) = Y; - *(surface.base[1] + (offset & 0xfffffffe)) = U; - *(surface.base[1] + (offset & 0xfffffffe) + 1) = V; - *(surface.base[2] + offset) = a; -} - -void SurfaceMVP::drawPixel(int x, int y, Colour& c, bool fastdraw) -{ - int offset; - unsigned char Y, U, V; - unsigned int line, remainder; - - if ((x >= (int)surface.sfc.width) || (y >= (int)surface.sfc.height)) - return; - - - rgb2yuv(c.red, c.green, c.blue, &Y, &U, &V); - - remainder = (surface.sfc.width % 4); - if (remainder == 0) - line = surface.sfc.width; - else - line = surface.sfc.width + (4 - remainder); - - offset = (y * line) + x; - - *(surface.base[0] + offset) = Y; - *(surface.base[1] + (offset & 0xfffffffe)) = U; - *(surface.base[1] + (offset & 0xfffffffe) + 1) = V; - *(surface.base[2] + offset) = 0xff; -} - -void SurfaceMVP::drawHorzLine(int x1, int x2, int y, const DrawStyle& c) -{ - fillblt(x1, y, x2-x1, 1, c); -} - -void SurfaceMVP::drawVertLine(int x, int y1, int y2, const DrawStyle& c) -{ - fillblt(x, y1, 1, y2-y1, c); -} - -void SurfaceMVP::drawBitmap(int x, int y, const Bitmap& bm,const DisplayRegion & region) // region should not matter for SD -{ - UINT bmw = bm.getWidth(); UINT bmh = bm.getHeight(); - if (bmw == 0 || bmh == 0) return; - if ((x >= (int)surface.sfc.width) || (y >= (int)surface.sfc.height)) return; - int remainder = (surface.sfc.width % 4); - UINT line; - if (remainder == 0) - line = surface.sfc.width; - else - line = surface.sfc.width + (4 - remainder); - const std::vector& bmdata = bm.rawData(); - const std::vector& Y = bm.palette.getYVector(); - const std::vector& Cr = bm.palette.getCrVector(); - const std::vector& Cb = bm.palette.getCbVector(); - const std::vector& A = bm.palette.getAVector(); - UINT b_offset = 0; - UINT s_offset = x + y*line; - UINT plotWidth = bmw; - UINT plotHeight = bmh; - if (x + plotWidth - 1 > surface.sfc.width) - plotWidth = surface.sfc.width - x + 1; - if (y + plotHeight - 1 > surface.sfc.height) - plotHeight = surface.sfc.height - y + 1; - for (UINT j = 0; j < plotHeight; ++j) - { - UINT i = 0; - if (x & 1) // odd x - need to plot first column separately - { - UCHAR index = bmdata[b_offset]; - *(surface.base[0] + s_offset) = Y[index]; - *(surface.base[1] + s_offset - 1) = Cb[index]; - *(surface.base[1] + s_offset) = Cr[index]; - *(surface.base[2] + s_offset) = A[index]; - i = 1; - } - // Now, plot pairs of pixels with averaged chroma values - while (i < plotWidth - 1) - { - UCHAR index1 = bmdata[b_offset + i]; - UCHAR index2 = bmdata[b_offset + i + 1]; - *(surface.base[0] + s_offset + i) = Y[index1]; - *(surface.base[0] + s_offset + i + 1) = Y[index2]; - *(surface.base[1] + s_offset + i) = (Cb[index1] + Cb[index2]) / 2; - *(surface.base[1] + s_offset + i + 1) = (Cr[index1] + Cr[index2]) / 2; - *(surface.base[2] + s_offset + i) = A[index1]; - *(surface.base[2] + s_offset + i + 1) = A[index2]; - i += 2; - } - if (i == plotWidth - 1) // One column left to do - { - UCHAR index = bmdata[b_offset + i]; - *(surface.base[0] + s_offset + i) = Y[index]; - *(surface.base[1] + s_offset + i) = Cb[index]; - *(surface.base[1] + s_offset + i + 1) = Cr[index]; - *(surface.base[2] + s_offset + i) = A[index]; - } - s_offset += line; - b_offset += bmw; - } -} - - /* surface update to screen needs: - source x distance into this surface - source y distance into this surface - width of update - height of update - destination x on screen - destination y on screen - */ -int SurfaceMVP::updateToScreen(int sx, int sy, int w, int h, int dx, int dy) // FIXME new, replace others with this FIXME -{ - return blt(fdOsd, surface.sfc.handle, sx, sy, w, h, ((SurfaceMVP*)screen)->getSurfaceHandle(), dx, dy); -} - -int SurfaceMVP::blt(int fd, unsigned long shandle, int sx, int sy, int width, int height, unsigned long dhandle, int dx, int dy) -{ - osd_bitblt_t fblt; - memset(&fblt, 0, sizeof(fblt)); - - fblt.dst_handle = dhandle; - fblt.dst_x = dx; - fblt.dst_y = dy; - - fblt.src_handle = shandle; - fblt.src_x = sx; - fblt.src_y = sy; - - fblt.width = width; - fblt.height = height; - - fblt.u1 = 1; - fblt.u2 = 0; - fblt.u3 = 0x0f; - - return ioctl(fd, GFX_FB_OSD_BITBLT, &fblt); -} - -void SurfaceMVP::screenShot(const char* fileName) -{ - Log* logger = Log::getInstance(); - - FILE* outfile = fopen(fileName, "w"); - if (outfile == NULL) - { - logger->log("Surface", Log::ERR, "Can't open JPEG"); - return; - } - logger->log("Surface", Log::DEBUG, "File opened %u %u", surface.sfc.height, surface.sfc.width); - - struct jpeg_compress_struct cinfo; - struct jpeg_error_mgr jerr; - cinfo.err = jpeg_std_error(&jerr); - jpeg_create_compress(&cinfo); - jpeg_stdio_dest(&cinfo, outfile); - cinfo.image_width = surface.sfc.width; - cinfo.image_height = surface.sfc.height; - cinfo.input_components = 3; - cinfo.in_color_space = JCS_RGB; - jpeg_set_defaults(&cinfo); - jpeg_start_compress(&cinfo, TRUE); - - - unsigned char row[surface.sfc.width * 3]; - unsigned char* prow = (unsigned char*)&row; - unsigned char r, g, b; - - while (cinfo.next_scanline < cinfo.image_height) - { - for(unsigned int i = 0; i < surface.sfc.width; i++) - { - readPixel(i, cinfo.next_scanline, &r, &g, &b); - row[i * 3] = r; - row[(i * 3) + 1] = g; - row[(i * 3) + 2] = b; - } - jpeg_write_scanlines(&cinfo, (JSAMPLE **)&prow, 1); - } - - jpeg_finish_compress(&cinfo); - jpeg_destroy_compress(&cinfo); - fclose(outfile); - logger->log("Surface", Log::DEBUG, "Jpeg saved"); -} - -void SurfaceMVP::readPixel(int x, int y, unsigned char* r, unsigned char* g, unsigned char* b) -{ - int offset; - unsigned char a, Y, U, V; - unsigned int line, remainder; - - if (((unsigned int)x >= surface.sfc.width) || ((unsigned int)y >= surface.sfc.height)) return; - - remainder = (surface.sfc.width % 4); - if (remainder == 0) - line = surface.sfc.width; - else - line = surface.sfc.width + (4 - remainder); - - offset = (y * line) + x; - - Y = *(surface.base[0] + offset); - U = *(surface.base[1] + (offset & 0xfffffffe)); - V = *(surface.base[1] + (offset & 0xfffffffe) + 1); - a = *(surface.base[2] + offset); - - yuv2rgb(Y, U, V, r, g, b); -} - -void SurfaceMVP::yuv2rgb(int y, int u, int v, unsigned char* pr, unsigned char* pg, unsigned char* pb) -{ - // from http://www.fourcc.org/index.php?http%3A//www.fourcc.org/fccyvrgb.php - -// unsigned int pixel32; -// unsigned char *pixel = (unsigned char *)&pixel32; - int r, g, b; - - - /* - One formula I found: (not the right one) - - R = 1.164(Y - 16) + 1.596(Cr - 128) - G = 1.164(Y - 16) - 0.813(Cr - 128) - 0.391(Cb - 128) - B = 1.164(Y - 16) + 2.018(Cb - 128) - - - r = (1.164 * (y - 16)) - + (2.018 * (v - 128)); - g = (1.164 * (y - 16)) - - (0.813 * (u - 128)) - - (0.391 * (v - 128)); - b = (1.164 * (y - 16)) - + (1.596 * (u - 128)); - - - Another formula I found: (seems to work) - - R = Y + 1.370705 (V-128) - G = Y - 0.698001 (V-128) - 0.337633 (U-128) - B = Y + 1.732446 (U-128) - */ - - r = (int)( y + (1.370705 * (v-128)) ); - g = (int)( y - (0.698001 * (v-128)) - (0.337633 * (u-128)) ); - b = (int)( y + (1.732446 * (u-128)) ); - - // Even with proper conversion, some values still need clipping. - if (r > 255) r = 255; - if (g > 255) g = 255; - if (b > 255) b = 255; - if (r < 0) r = 0; - if (g < 0) g = 0; - if (b < 0) b = 0; - - // Values only go from 0-220.. Why? -// pixel[0] = r * 220 / 256; -// pixel[1] = g * 220 / 256; -// pixel[2] = b * 220 / 256; -// pixel[3] = 0; - - *pr = (unsigned char) (r * 220 / 256); - *pg = (unsigned char) (g * 220 / 256); - *pb = (unsigned char) (b * 220 / 256); - - /* Debug - //printf("yuv2rgb(%i, %i, %i) -> %i, %i, %i (0x%x)\n", - y, u, v, - pixel[0], pixel[1], pixel[2], - pixel32); - */ - -// return pixel32; -} diff --git a/surfacemvp.h b/surfacemvp.h deleted file mode 100644 index a0c4807..0000000 --- a/surfacemvp.h +++ /dev/null @@ -1,250 +0,0 @@ -/* - Copyright 2004-2005 Chris Tallon - Portions copyright 2004 Jon Gettler - - This file is part of VOMP. - - VOMP 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. - - VOMP 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 VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#ifndef SURFACEMVP_H -#define SURFACEMVP_H - -#include -#include -#include -#include -#include - -extern "C" -{ - #include -} - -#include "defines.h" -#include "surface.h" - -// Structures for surface management - -typedef struct -{ - unsigned long num; - unsigned long unknown[4]; - unsigned long width; - unsigned long height; - char unknown2; -} stbgfx_display_t; - -typedef struct -{ - unsigned long unknown; - unsigned long win_unknown; - unsigned long addr; - unsigned long size; - unsigned long unknown2; - unsigned long width; - unsigned long height; - unsigned long unknown3; - unsigned long unknown4; - unsigned long width2; - unsigned long unknown5; - unsigned long unknown6; -} stbgfx_map_item_t; - -typedef struct { - stbgfx_map_item_t map[3]; - unsigned long other[2]; -} stbgfx_map_t; - -typedef struct -{ - unsigned long handle; /* surface handle */ - unsigned long width; - unsigned long height; - unsigned long flags; - long unknown; //unsigned long - unsigned long depth; /* number of subplanes */ -} stbgfx_sfc_t; - -typedef struct -{ - stbgfx_display_t display; - stbgfx_map_t map; - stbgfx_sfc_t sfc; - unsigned char *base[3]; -} osd_surface_t; - - -// Structures for surface drawing - -typedef struct -{ - unsigned long handle; - unsigned long x; - unsigned long y; - unsigned long width; - unsigned long height; - unsigned long colour; -} osd_fillblt_t; - -typedef struct { - unsigned long dst_handle; - unsigned long dst_x; - unsigned long dst_y; - unsigned long width; - unsigned long height; - unsigned long src_handle; - unsigned long src_x; - unsigned long src_y; - unsigned long u1; - unsigned long u2; - unsigned char u3; -} osd_bitblt_t; - -// Surface ioctls - -#define GFX_FB_SFC_ALLOC _IOWR(0xfb,1,int*) -#define GFX_FB_SFC_FREE _IOW(0xfb,2,int) -#define GFX_FB_MAP _IOWR(0xfb,3,int*) -#define GFX_FB_SFC_UNMAP _IOW(0xfb,4,int) -#define GFX_FB_SET_PAL_1 _IOWR(0xfb,5,int*) -#define GFX_FB_SET_PAL_2 _IOW(0xfb,6,int*) -#define GFX_FB_OSD_SURFACE _IO(0xfb,7) -#define GFX_FB_SFC_SET_SHARE _IOW(0xfb,8,int) -#define GFX_FB_OSD_CUR_SETATTR _IOW(0xfb,9,int*) -#define GFX_FB_ATTACH _IOW(0xfb,11,int) -#define GFX_FB_SFC_DETACH _IOW(0xfb,12,int*) -#define GFX_FB_MOVE_DISPLAY _IOWR(0xfb,13,int) -#define GFX_FB_SET_DISPLAY _IOW(0xfb,14,int) -#define GFX_FB_OSD_CUR_MOVE_1 _IOW(0xfb,15,int*) -#define GFX_FB_OSD_CUR_MOVE_2 _IOW(0xfb,16,int) -#define GFX_FB_SET_OSD _IOW(0xfb,18,int) -#define GFX_FB_SET_DISP_CTRL _IOW(0xfb,21,int*) -#define GFX_FB_GET_DISP_CTRL _IOWR(0xfb,22,int*) -#define GFX_FB_SET_VIS_DEV_CTL _IOWR(0xfb,23,int*) -#define GFX_FB_GET_VIS_DEV_CTL _IOWR(0xfb,24,int*) -#define GFX_FB_OSD_BITBLT _IOW(0xfb,51,osd_bitblt_t*) -#define GFX_FB_OSD_FILLBLT _IOW(0xfb,53,osd_fillblt_t*) -#define GFX_FB_OSD_ADVFILLBLT _IOW(0xfb,54,osd_afillblt_t*) -#define GFX_FB_OSD_BLEND _IOW(0xfb,55,int*) -#define GFX_FB_OSD_ADVBLEND _IOW(0xfb,56,int*) -#define GFX_FB_OSD_RESIZE _IOW(0xfb,58,int*) -#define GFX_FB_ENGINE_WAIT _IOW(0xfb,60,int) -#define GFX_FB_RESET_ENGINE _IO(0xfb,61) -#define GFX_FB_SET_ENGINE_MODE _IOW(0xfb,62,int) -#define GFX_FB_GET_ENGINE_MODE _IO(0xfb,63) -#define GFX_FB_GET_SFC_INFO _IO(0xfb,64,int*) -#define GFX_FB_OSD_SFC_CLIP _IOW(0xfb,65,osd_clip_rec_t*) -#define GFX_FB_OSD_COLOURKEY _IOW(0xfb,67,int*) -#define GFX_FB_GET_SFC_PSEUDO _IOWR(0xfb,68,int*) - -class SurfaceMVP : public Surface -{ - public: - SurfaceMVP(int id = 0); - virtual ~SurfaceMVP(); - - int create(UINT width, UINT height); - void display(); - unsigned long getSurfaceHandle(); - - int fillblt(int x, int y, int width, int height, const DrawStyle& c); - - void drawHorzLine(int x1, int x2, int y, const DrawStyle& c); - void drawVertLine(int x, int y1, int y2, const DrawStyle& c); - void drawBitmap(int x, int y, const Bitmap& bm, const DisplayRegion& region); - int updateToScreen(int sx, int sy, int w, int h, int dx, int dy); - void readPixel(int x, int y, unsigned char* r, unsigned char* g, unsigned char* b); - void screenShot(const char* fileName); - - static void initConversionTables() - { - initConversionTables(100,100,100); - } - //init tables with factors for R,G,B - each in percent - static void initConversionTables(int r, int g, int b); - - int blt(int fd, unsigned long shandle, int sx, int sy, int width, int height, unsigned long dhandle, int dx, int dy); - - private: - int fdOsd; - osd_surface_t surface; - - void yuv2rgb(int y, int u, int v, unsigned char* pr, unsigned char* pg, unsigned char* pb); - /* - * rgb2yuv() - convert an RGB pixel to YUV - */ - inline void rgb2yuv(unsigned char r, unsigned char g, unsigned char b, unsigned char *y, unsigned char *u, unsigned char *v) - { - int Y, U, V; - - Y = conv_YB[b] + conv_YG[g] + conv_YR[r]; - U = conv_UB[b] + conv_UG[g] + conv_UR[r] + 128; - V = conv_VB[b] + conv_VG[g] + conv_VR[r] + 128; - - if (Y > 255) - Y = 255; - else if (Y < 0) - Y = 0; - if (U > 255) - U = 255; - else if (U < 0) - U = 0; - if (V > 255) - V = 255; - else if (V < 0) - V = 0; - - *y = Y; - *u = U; - *v = V; - } - - - // Implicit inlines - void c2rgba(unsigned long c, unsigned char *r, unsigned char *g, unsigned char *b, unsigned char *a) - { - *a = (c & 0xff000000) >> 24; - *r = (c & 0x00ff0000) >> 16; - *g = (c & 0x0000ff00) >> 8; - *b = (c & 0x000000ff); - } - - static int conv_YB[256]; - static int conv_YG[256]; - static int conv_YR[256]; - static int conv_UB[256]; - static int conv_UG[256]; - static int conv_UR[256]; - static int conv_VB[256]; - static int conv_VG[256]; - static int conv_VR[256]; - - static int conv_BY[256]; - static int conv_GY[256]; - static int conv_RY[256]; - static int conv_BU[256]; - static int conv_GU[256]; - static int conv_RU[256]; - static int conv_BV[256]; - static int conv_GV[256]; - static int conv_RV[256]; - protected: - void drawPixel(int x, int y, unsigned int c, bool fastdraw=false); - void drawPixel(int x, int y, Colour& c, bool fastdraw=false); - -}; - -#endif diff --git a/surfacevector.h b/surfacevector.h index 71c07bc..a052452 100644 --- a/surfacevector.h +++ b/surfacevector.h @@ -14,18 +14,16 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with VOMP. If not, see . */ #ifndef SURFACEVECTOR_H #define SURFACEVECTOR_H -#include "surface.h" -#include "osdvector.h" - #include +#include "surface.h" +#include "osdvector.h" class SurfaceVector : public Surface { @@ -41,10 +39,10 @@ class SurfaceVector : public Surface int drawTextRJ(const char* text, int x, int y, const DrawStyle& c); int drawTextCentre(const char* text, int x, int y, const DrawStyle& c); - void drawJpeg(const char *fileName,int x, int y,int *width, int *height); + void drawJpeg(const char* fileName, int x, int y, int* width, int* height); // set width and height to zero, if the original size is wanted, if one index is non zero, // the images is scaled with correct aspect ratio, if both are non zero both are scaled - void drawTVMedia(TVMediaInfo & tvmedia,float x, float y, float width, float height, Corner corner=TopLeft); + void drawTVMedia(TVMediaInfo & tvmedia,float x, float y, float width, float height, Corner corner = TopLeft); // set w and h to 0, for unsetting clipping, use correct x and y parameter so that cleanup of commands works void drawClippingRectangle(float x, float y, float w, float h); @@ -54,26 +52,23 @@ class SurfaceVector : public Surface int fillblt(int x, int y, int width, int height, const DrawStyle& c); void drawHorzLine(int x1, int x2, int y, const DrawStyle& c); void drawVertLine(int x, int y1, int y2, const DrawStyle& c); - void drawBitmap(int x, int y, const Bitmap& bm,const DisplayRegion & region); - void drawPoint(int x, int y, DrawStyle& c, bool fastdraw=false); // This draws a point, must not be a pixel - void drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int height,unsigned int width, DrawStyle& nextColour); + void drawBitmap(int x, int y, const Bitmap& bm, const DisplayRegion& region); + void drawPoint(int x, int y, DrawStyle& c, bool fastdraw = false); // This draws a point, must not be a pixel + void drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int height, unsigned int width, DrawStyle& nextColour); int updateToScreen(int sx, int sy, int w, int h, int dx, int dy); - /* This is for system which need a locking of the drawing surface to speed up drawing */ void startFastDraw(); - void endFastDraw() ; - + void endFastDraw(); void drawTTChar(int ox, int oy,int x, int y, cTeletextChar c); - void readPixel(int x, int y, unsigned char* r, unsigned char* g, unsigned char* b){}; - void screenShot(const char* fileName){}; + void readPixel(int /* x */, int /* y */, unsigned char* /* r */, unsigned char* /* g */, unsigned char* /* b */) {}; + void screenShot(const char* fileName) {}; protected: - - int removeCommands(float x,float y,float width,float height); + int removeCommands(float x, float y, float width, float height); std::vector commands; int swidth, sheight; @@ -82,16 +77,6 @@ class SurfaceVector : public Surface void drawPixel(int x, int y, unsigned int c, bool fastdraw){}; // these are not supported! void drawPixel(int x, int y, Colour& c, bool fastdraw){}; - - }; - - - - - - - - #endif diff --git a/vcolourtuner.cc b/vcolourtuner.cc index 7f77428..7112da3 100644 --- a/vcolourtuner.cc +++ b/vcolourtuner.cc @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with VOMP. If not, see . */ #include "vcolourtuner.h" @@ -30,11 +29,6 @@ #include "log.h" #include "mediaoptions.h" -#ifdef VOMP_PLATTFORM_MVP -#include "surfacemvp.h" -#endif - - #define PICTUREFILE "/colourtest.jpg" int VColourTuner::rfactor=100; diff --git a/vepg.cc b/vepg.cc index 689300c..bc2285c 100644 --- a/vepg.cc +++ b/vepg.cc @@ -465,34 +465,6 @@ int VEpg::handleCommand(int command) case Remote::BACK: case Remote::GUIDE: { - -#ifdef VOMP_PLATTFORM_MVP -/* -new video modes system doesn't work properly on MVP -It seems to always set wanted mode to 1 which is "full screen" -but translates to Video::LETERBOX on MVP - -Mode 0 in new system is "None", but is Video::NORMAL for MVP - -VideoMVP::setMode(LETTERBOX) while in 16x9 mode is invalid - -Anyway, bool Video::setVideoDisplay(VideoDisplay display) calls with Video::mode -not applyMode, so wouldn't work for two reasons - -VVideoLiveTV has the memory of what mode, NORMAL / LETTERBOX we were in before -we went to QUARTER. Hack this in to get a message there. -*/ - - if (parent) // ptr check done in case being tested from videorec - { - Message* m = new Message(); // Must be done after this view deleted - m->from = this; - m->to = parent; - m->message = Message::HACK_MVP_RETURN_FROM_QUARTER; - Command::getInstance()->postMessageNoLock(m); - } -#endif - return 4; } case Remote::CHANNELUP: diff --git a/video.h b/video.h index 8056ea6..14db2fc 100644 --- a/video.h +++ b/video.h @@ -27,19 +27,19 @@ #include "abstractoption.h" enum VideoMode { - None, - Fullscreen, - Window, //Not supported on legacy hardware like mvp - Quarter, - Eighth + None, + Fullscreen, + Window, //Not supported on legacy hardware like mvp + Quarter, + Eighth }; // New video api typedef struct _VideoDisplay { - enum VideoMode mode; - enum VideoMode fallbackMode; - UINT x,y; - UINT width,height; + enum VideoMode mode; + enum VideoMode fallbackMode; + UINT x,y; + UINT width,height; } VideoDisplay; class Video: public DrainTarget, public AbstractOption @@ -54,8 +54,8 @@ class Video: public DrainTarget, public AbstractOption virtual int shutdown()=0; virtual int setFormat(UCHAR format)=0; virtual UCHAR getSupportedFormats() { return COMPOSITERGB | SVIDEO;}; // if it returns zero there are no different formats - virtual UINT supportedTVsize() { return 0;}; // if no selection is allowed - virtual UCHAR supportedTVFormats() { return 0;}; // if no selection is allowed + virtual UINT supportedTVsize() { return 0; }; // if no selection is allowed + virtual UCHAR supportedTVFormats() { return 0; }; // if no selection is allowed virtual int setConnection(UCHAR connection)=0; virtual int setAspectRatio(UCHAR aspectRatio, int tparx,int tpary)=0; // This one does the pin 8 scart widescreen switching @@ -81,27 +81,27 @@ class Video: public DrainTarget, public AbstractOption virtual bool displayIFrame(const UCHAR* buffer, UINT length)=0; virtual int EnterIframePlayback() {return 1;}; // Must not be implemented - virtual bool supportsh264(){return false;}; - virtual bool supportsmpeg2(){return true;}; - virtual void seth264mode(bool ish264) {h264=ish264;}; - virtual int getTeletextBufferFaktor(){return 1;}; + virtual bool supportsh264() { return false; }; + virtual bool supportsmpeg2() { return true; }; + virtual void seth264mode(bool ish264) { h264 = ish264; }; + virtual int getTeletextBufferFaktor() { return 1; }; - virtual bool independentAVStartUp() {return true;}; + virtual bool independentAVStartUp() { return true; }; - //Tells, if the device allows an independent startup of audio and video - // this needs internal buffers in device and is possible for windows and mvp + //Tells, if the device allows an independent startup of audio and video + // this needs internal buffers in device and is possible for windows and mvp - virtual bool PTSIFramePlayback() {return false;}; - // Tells, if the iframe playback is realized using a manipulation of the pts of the packets - //android does it like this... + virtual bool PTSIFramePlayback() { return false; }; + // Tells, if the iframe playback is realized using a manipulation of the pts of the packets + //android does it like this... - virtual bool blockingDrainTarget() { return false;}; - // if the draintargets blocks, the feed has to be stop when pausing + virtual bool blockingDrainTarget() { return false; }; + // if the draintargets blocks, the feed has to be stop when pausing - virtual void turnVideoOn(){}; - virtual void turnVideoOff(){}; + virtual void turnVideoOn() {}; + virtual void turnVideoOff() {}; // virtual ULLONG frameNumberToTimecode(ULONG timecode) { return 0; };//Obsolete and not HD compatible #ifdef DEV @@ -173,7 +173,7 @@ class Video: public DrainTarget, public AbstractOption protected: - virtual int setPosition(int x, int y){return 0;}; //legacy api do not use, use setVideoDisplay instead + virtual int setPosition(int /* x */, int /* y */) { return 0; }; // legacy api do not use, use setVideoDisplay instead static Video* instance; int initted; int fdVideo; @@ -185,7 +185,7 @@ class Video: public DrainTarget, public AbstractOption int parx,pary; UCHAR mode; - bool h264; + bool h264; UINT screenWidth; UINT screenHeight; diff --git a/videomvp.cc b/videomvp.cc deleted file mode 100644 index 0eead37..0000000 --- a/videomvp.cc +++ /dev/null @@ -1,407 +0,0 @@ -/* - Copyright 2004-2005 Chris Tallon - - This file is part of VOMP. - - VOMP 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. - - VOMP 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 VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include "videomvp.h" - -// temp -#include "log.h" - -VideoMVP::VideoMVP() -{ - if (instance) return; -} - -VideoMVP::~VideoMVP() -{ - instance = NULL; -} - -int VideoMVP::init(UCHAR tformat) -{ - if (initted) return 0; - initted = 1; - - if ((fdVideo = open("/dev/vdec_dev", O_WRONLY)) < 0) return 0; - - if (!setFormat(tformat)) { shutdown(); return 0; } - if (!setConnection(COMPOSITERGB)) { shutdown(); return 0; } - if (!setAspectRatio(ASPECT4X3,12,11)) { shutdown(); return 0; } - if (!setMode(NORMAL)) { shutdown(); return 0; } - if (!setSource()) { shutdown(); return 0; } - if (!attachFrameBuffer()) { shutdown(); return 0; } - - setTVsize(ASPECT4X3); - - if (format == PAL) setLetterboxBorder("38"); - else setLetterboxBorder("31"); - - stop(); - - - return 1; -} - -void VideoMVP::setLetterboxBorder(char* border) -{ - FILE* fdlbox = fopen("/proc/lbox_border", "w"); - if (!fdlbox) return; - fputs(border, fdlbox); - fclose(fdlbox); -} - -int VideoMVP::setTVsize(UCHAR ttvsize) -{ - tvsize = ttvsize; - - // Override the aspect ratio usage, temporarily use to set the video chip mode - if (!setAspectRatio(tvsize,parx,pary)) { shutdown(); return 0; } - close(fdVideo); - if ((fdVideo = open("/dev/vdec_dev", O_WRONLY)) < 0) return 0; - if (!setSource()) { shutdown(); return 0; } - if (!attachFrameBuffer()) { shutdown(); return 0; } - - // Reopening the fd causes the scart aspect line to go back to 4:3 - // Set this again to the same as the tv screen size - if (!setAspectRatio(tvsize,parx,pary)) { shutdown(); return 0; } - - // mode == LETTERBOX is invalid if the TV is widescreen - if (tvsize == ASPECT16X9) setMode(NORMAL); - - return 1; -} - -int VideoMVP::setDefaultAspect() -{ - return setAspectRatio(tvsize,parx,pary); -} - -int VideoMVP::shutdown() -{ - if (!initted) return 0; - initted = 0; - close(fdVideo); - return 1; -} - -int VideoMVP::checkSCART() -{ - // Returns 3 for SCART Composite out - // Returns 3 for SCART S-Video out - // Returns 2 for SCART RGB out - // Returns 3 for SCART not plugged in - - // So, as you can have RGB and composite out simultaneously, - // and it can't detect S-Video, what is the point of this? - - int scart; - if (ioctl(fdVideo, AV_CHK_SCART, &scart) != 0) return -10; - - return scart; -} - -int VideoMVP::setFormat(UCHAR tformat) -{ - if (!initted) return 0; - if ((tformat != PAL) && (tformat != NTSC)) return 0; - format = tformat; - - if (ioctl(fdVideo, AV_SET_VID_DISP_FMT, format) != 0) return 0; - - if (format == NTSC) - { - screenWidth = 720; - screenHeight = 480; - } - if (format == PAL) - { - screenWidth = 720; - screenHeight = 576; - } - - return 1; -} - -int VideoMVP::setConnection(UCHAR tconnection) -{ - if (!initted) return 0; - if ((tconnection != COMPOSITERGB) && (tconnection != SVIDEO)) return 0; - connection = tconnection; - - if (ioctl(fdVideo, AV_SET_VID_OUTPUT, connection) != 0) return 0; - return 1; -} - -int VideoMVP::setAspectRatio(UCHAR taspectRatio, int tparx,int tpary) -{ - if (!initted) return 0; - parx=tparx; - pary=tpary; - if ((taspectRatio != ASPECT4X3) && (taspectRatio != ASPECT16X9)) return 0; - aspectRatio = taspectRatio; - - Log::getInstance()->log("Video", Log::DEBUG, "Setting aspect to %i", aspectRatio); - - if (ioctl(fdVideo, AV_SET_VID_RATIO, aspectRatio) != 0) return 0; - return 1; -} - -int VideoMVP::setMode(UCHAR tmode) -{ - if (!initted) return 0; - - if ((tmode == LETTERBOX) && (tvsize == ASPECT16X9)) return 0; // invalid mode - - if ((tmode != NORMAL) && (tmode != LETTERBOX) && (tmode != UNKNOWN2) && (tmode != QUARTER) && (tmode != EIGHTH) - && (tmode != ZOOM) && (tmode != UNKNOWN6)) return 0; - if (tmode==NORMAL || tmode == LETTERBOX || tmode == QUARTER) mode = tmode; - if (ioctl(fdVideo, AV_SET_VID_MODE, mode) != 0) return 0; - return 1; -} - -int VideoMVP::signalOff() -{ - if (ioctl(fdVideo, AV_SET_VID_DENC, 0) != 0) return 0; - return 1; -} - -int VideoMVP::signalOn() -{ - if (ioctl(fdVideo, AV_SET_VID_DENC, 1) != 0) return 0; - return 1; -} - -int VideoMVP::setSource() -{ - if (!initted) return 0; - - // What does this do... - if (ioctl(fdVideo, AV_SET_VID_SRC, 1) != 0) return 0; - return 1; -} - -int VideoMVP::setPosition(int x, int y) -{ - if (!initted) return 0; - -// vid_pos_regs_t pos_d; -// pos_d.x = x; -// pos_d.y = y; - - vid_pos_regs_t pos_d; - - memset(&pos_d, 0, sizeof(pos_d)); - - pos_d.dest.y = y; - pos_d.dest.x = x; -/* -typedef struct { - int w; - int h; - int scale; - int x1; - int y; - int x; - int y2; - int x3; - int y3; - int x4; - int y4; -} vid_pos_regs_t; -*/ - -/* - pos_d.w = 100; - pos_d.h = 30; - pos_d.scale = 2; - pos_d.x1 = 0; - pos_d.y = 100; // Top left X - pos_d.x = 50; // Top left Y - pos_d.y2 = 30; - pos_d.x3 = 60; - pos_d.y3 = 90; - pos_d.x4 = 120; - pos_d.y4 = 150; -*/ - - if (ioctl(fdVideo, AV_SET_VID_POSITION, &pos_d) != 0) return 0; - return 1; -} - -int VideoMVP::sync() -{ - if (!initted) return 0; - - if (ioctl(fdVideo, AV_SET_VID_SYNC, 2) != 0) return 0; - return 1; -} - -int VideoMVP::play() -{ - if (!initted) return 0; - - if (ioctl(fdVideo, AV_SET_VID_PLAY, 0) != 0) return 0; - return 1; -} - -int VideoMVP::stop() -{ - if (!initted) return 0; - - if (ioctl(fdVideo, AV_SET_VID_STOP, 0) != 0) return 0; - return 1; -} - -int VideoMVP::reset() -{ - if (!initted) return 0; - - if (ioctl(fdVideo, AV_SET_VID_RESET, 0x11) != 0) return 0; - return 1; -} - -int VideoMVP::pause() -{ - if (!initted) return 0; - - if (ioctl(fdVideo, AV_SET_VID_PAUSE, 0) != 0) return 0; - return 1; -} - -int VideoMVP::unPause() // FIXME get rid - same as play!! -{ - if (!initted) return 0; - if (ioctl(fdVideo, AV_SET_VID_PLAY, 0) != 0) return 0; - return 1; -} - -int VideoMVP::fastForward() -{ - if (!initted) return 0; - - if (ioctl(fdVideo, AV_SET_VID_FFWD, 1) != 0) return 0; - return 1; -} - -int VideoMVP::unFastForward() -{ - if (!initted) return 0; - -// if (ioctl(fdVideo, AV_SET_VID_RESET, 0x11) != 0) return 0; // don't need this. - - if (ioctl(fdVideo, AV_SET_VID_PLAY, 0) != 0) return 0; - return 1; -} - -int VideoMVP::attachFrameBuffer() -{ - if (!initted) return 0; - - if (ioctl(fdVideo, AV_SET_VID_FB, 0) != 0) return 0; - return 1; -} - -int VideoMVP::blank(void) -{ - if (ioctl(fdVideo, AV_SET_VID_FB, 1) != 0) return 0; - if (ioctl(fdVideo, AV_SET_VID_FB, 0) != 0) return 0; - return 1; -} - -ULLONG VideoMVP::getCurrentTimestamp() -{ - sync_data_t timestamps; - if (ioctl(fdVideo, AV_GET_VID_TIMESTAMPS, ×tamps) == 0) - { - // FIXME are these the right way around? - - timestamps.stc = (timestamps.stc >> 31 ) | (timestamps.stc & 1); - timestamps.pts = (timestamps.pts >> 31 ) | (timestamps.pts & 1); - - return timestamps.stc; - } - else - { - return 0; - } -} - -ULONG VideoMVP::timecodeToFrameNumber(ULLONG timecode) -{ - if (format == PAL) return (ULONG)(((double)timecode / (double)90000) * (double)25); - else return (ULONG)(((double)timecode / (double)90000) * (double)30); -} - -#ifdef DEV -int VideoMVP::test() -{ - return 0; - -// ULLONG stc = 0; -// return ioctl(fdVideo, AV_SET_VID_STC, &stc); -/* - // reset(); - return 1; -*/ -} - -int VideoMVP::test2() -{ - return 0; -} -#endif - -void VideoMVP::PrepareMediaSample(const MediaPacketList& mplist,UINT samplepos) -{ - MediaPacketList::const_iterator iter = mplist.begin(); - deliver_start = iter->pos_buffer + samplepos; - mediapacket_len[0] = deliver_length = iter->length; - deliver_count = 1; - while (++iter != mplist.end() && - iter->pos_buffer == deliver_start + deliver_length) - { - deliver_length += iter->length; - mediapacket_len[deliver_count] = iter->length; - ++deliver_count; - if (deliver_length >= WRITE_LENGTH || - deliver_count == WRITE_PACKETS) break; - } -} - -UINT VideoMVP::DeliverMediaSample(UCHAR* buffer, UINT* samplepos) -{ - int written = ::write(fdVideo, buffer + deliver_start, deliver_length); - if (written == (int)deliver_length) { *samplepos = 0; return deliver_count;} - if (written <= 0) return 0; - // Handle a partial write. Is this possible? Should we bother? - UINT i = 0; - while ((written -= mediapacket_len[i]) >= 0) i++; - *samplepos = mediapacket_len[i] + written; - return i; -} - -void VideoMVP::ResetTimeOffsets() -{ -} - -bool VideoMVP::displayIFrame(const UCHAR* buffer, UINT length) -{ - write(fdVideo, buffer, length); - return true; -} diff --git a/videomvp.h b/videomvp.h deleted file mode 100644 index 7e9d440..0000000 --- a/videomvp.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - Copyright 2004-2005 Chris Tallon - - This file is part of VOMP. - - VOMP 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. - - VOMP 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 VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -// Thanks to Jon Gettler and BtB of the MVPMC project for all the hardware information - - -#ifndef VIDEOMVP_H -#define VIDEOMVP_H - -// FIXME - check why so many things include unistd - -#include -#include -#include -#include -#include - -#include - -#include "defines.h" -#include "video.h" - -typedef struct -{ - int nleft; - int state; -} vid_state_regs_t; - -typedef struct -{ - uint64_t stc; - uint64_t pts; -} sync_data_t; - -typedef struct -{ - int y; - int x; - int w; - int h; -} vid_rect_t; - -typedef struct -{ - vid_rect_t src; - vid_rect_t dest; -} vid_pos_regs_t; - -struct vid_regs -{ - UCHAR dummy[44]; -}; - -#define AV_SET_VID_STOP _IOW('v', 21, int) -#define AV_SET_VID_PLAY _IOW('v', 22, int) -#define AV_SET_VID_FREEZE _IOW('v', 23, int) -#define AV_SET_VID_RESUME _IOW('v', 24, int) -#define AV_SET_VID_SRC _IOW('v', 25, int) -#define AV_SET_VID_FB _IOW('v', 26, int) -#define AV_GET_VID_STATE _IOR('v', 27, vid_state_regs_t*) -#define AV_SET_VID_PAUSE _IOW('v', 28, int) -#define AV_SET_VID_FFWD _IOW('v', 29, int) -#define AV_SET_VID_SLOMO _IOW('v', 30, int) -#define AV_SET_VID_BLANK _IOW('v', 32, int) -#define AV_SET_VID_POSITION _IOW('v', 36, vid_pos_regs_t*) -#define AV_SET_VID_SCALE_ON _IOW('v', 37, int) -#define AV_SET_VID_SCALE_OFF _IOW('v', 38, int) -#define AV_GET_VID_TIMESTAMPS _IOR('v', 39, sync_data_t*) -#define AV_SET_VID_STC _IOW('v', 40, uint64_t*) -#define AV_SET_VID_RATIO _IOW('v', 41, int) -#define AV_SET_VID_SYNC _IOW('v', 42, int) -#define AV_SET_VID_DISABLE_SYNC _IOW('v', 43, int) -#define AV_SET_VID_DISP_FMT _IOW('v', 45, int) -#define AV_SET_VID_RESET _IOW('v', 51, int) -#define AV_SET_VID_OUTPUT _IOW('v', 57, int) -#define AV_SET_VID_MODE _IOW('v', 58, int) -#define AV_GET_VID_REGS _IOR('v', 61, struct vid_regs*) -#define AV_SET_VID_COLORBAR _IOW('v', 62, int) -#define AV_SET_VID_DENC _IOW('v', 63, int) -#define AV_CHK_SCART _IOW('v', 64, int) - -#define WRITE_LENGTH (32*1024) // Consume up to 32K at a time from Stream -#define WRITE_PACKETS 16 // But no more than 16 packets - -class VideoMVP : public Video -{ - public: - VideoMVP(); - virtual ~VideoMVP(); - - int init(UCHAR format); - int shutdown(); - - UCHAR getSupportedFormats() { return COMPOSITERGB | SVIDEO;}; - UINT supportedTVsize() { return ASPECT4X3|ASPECT16X9;}; - UCHAR supportedTVFormats() { return 0;}; // We cannot change this here - - int setFormat(UCHAR format); - int setConnection(UCHAR connection); - int setAspectRatio(UCHAR aspectRatio, int tparx,int tpary); // This one does the pin 8 scart widescreen switching - int setMode(UCHAR mode); - int setTVsize(UCHAR size); // Is the TV a widescreen? - int setDefaultAspect(); - int setSource(); - int sync(); - int play(); - int stop(); - int pause(); - int unPause(); - int fastForward(); - int unFastForward(); - int reset(); - int blank(); - int signalOn(); - int signalOff(); - int attachFrameBuffer(); // What does this do? - ULONG timecodeToFrameNumber(ULLONG timecode); - ULLONG getCurrentTimestamp(); - bool displayIFrame(const UCHAR* buffer, UINT length); - - // Writing Data to Videodevice - virtual void PrepareMediaSample(const MediaPacketList&, UINT samplepos); - virtual UINT DeliverMediaSample( UCHAR* buffer, UINT* samplepos); - virtual long long SetStartOffset(long long curreftime, bool *rsync) - { return 0; }; - virtual void ResetTimeOffsets(); - -#ifdef DEV - int test(); - int test2(); -#endif - - - protected: - int setPosition(int x, int y); // legacy api do not use - - private: - int checkSCART(); - void setLetterboxBorder(char* border); - - UINT deliver_start, deliver_length, deliver_count; - UINT mediapacket_len[WRITE_PACKETS]; -}; - -#endif diff --git a/videoomx.cc b/videoomx.cc index 31fcf5f..f9d5c30 100644 --- a/videoomx.cc +++ b/videoomx.cc @@ -20,7 +20,6 @@ #include "videoomx.h" #include "audioomx.h" -#include "mtdraspberry.h" #include "demuxer.h" #include "vdr.h" #include "woptionpane.h" diff --git a/vopts.cc b/vopts.cc index 7498e58..fa196f8 100644 --- a/vopts.cc +++ b/vopts.cc @@ -65,18 +65,13 @@ VOpts::VOpts() WOptionPane* wop; // --- edit options start here -#ifdef MVP_REMOTE_TYPES - static const char* options1[] = {"Old", "New"}; -#endif static const char* options5[] = {"Chop sides", "Letterbox"}; static const char* options6[] = {"On", "Off", "Last state"}; static const char* options7[] = {"All", "FTA only"}; static const char* options15[] = {"Alphabetical", "Chronological"}; static const char* options13[] = {"Auto","1024", "2048", "4096", "8192", "16384", "32768", "65536"}; -#ifdef PAL_WSS - static const char* options14[] = {"No", "Yes"}; -#endif + static const char* options18[] = {"Off", "On"}; #ifdef ADVANCED_MENUES static const char* options19[] = { "Advanced","Classic"}; @@ -99,11 +94,6 @@ VOpts::VOpts() wop = new WOptionPane(); tabbar.addTab(tr("General"), wop); panes[0] = wop; -#ifdef MVP_REMOTE_TYPES - option = new Option(1, "Remote control type", "General", "Remote type", Option::TYPE_TEXT, 2, 0, 0, options1); - options.push_back(option); - wop->addOptionLine(option); -#endif option = new Option(2, "Language", "General", "LangCode", Option::TYPE_KEYED_TEXT, LangCode.size(), 0, 0, options2, options2keys); options.push_back(option); wop->addOptionLine(option); @@ -250,11 +240,6 @@ VOpts::VOpts() option = new Option(13, "TCP receive window size", "Advanced", "TCP receive window", Option::TYPE_TEXT, 8, /*1*/DEFAULT_TCP_WINDOWSIZENR, 0, options13); options.push_back(option); wop->addOptionLine(option); -#ifdef PAL_WSS - option = new Option(14, "Use WSS (PAL only)", "General", "WSS", Option::TYPE_TEXT, 2, 0, 0, options14); - options.push_back(option); - wop->addOptionLine(option); -#endif const char * * fontnames; const char * * fontnames_keys; int numfonts=Osd::getInstance()->getFontNames(&fontnames,&fontnames_keys); @@ -373,18 +358,6 @@ void VOpts::doSave() { case 1: { -#ifdef MVP_REMOTE_TYPES - if (options[i]->userSetChoice == 1) - { - Log::getInstance()->log("Options", Log::DEBUG, "Setting New Remote"); - Remote::getInstance()->setRemoteType(Remote::NEWREMOTE); - } - else - { - Log::getInstance()->log("Options", Log::DEBUG, "Setting Old Remote"); - Remote::getInstance()->setRemoteType(Remote::OLDREMOTE); - } -#endif break; } case 2: diff --git a/vvideolivetv.cc b/vvideolivetv.cc index 8255263..62d2189 100644 --- a/vvideolivetv.cc +++ b/vvideolivetv.cc @@ -101,28 +101,7 @@ VVideoLiveTV::VVideoLiveTV(ChannelList* tchanList, ULONG initialChannelNumber, V createBuffer(); DrawStyle transparent(0, 0, 0, 0); setBackgroundColour(transparent); -#ifdef PAL_WSS - dowss = false; - char* optionWSS = vdr->configLoad("General", "WSS"); - if (optionWSS) - { - if (strstr(optionWSS, "Yes")) dowss = true; - delete[] optionWSS; - } - Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Do WSS: %u", dowss); - if (dowss) - { - wss.setFormat(video->getFormat()); - wss.setWide(true); - add(&wss); - - wssRegion.x = 0; - wssRegion.y = 6; - wssRegion.w = video->getScreenWidth(); - wssRegion.h = 2; - } -#endif // This variable is set to true if the user pressed OK to bring the OSD on screen // This is only used on old remotes to stop up/down buttons being used for osd-epg scrolling okTriggeredOSD = false; @@ -145,8 +124,6 @@ VVideoLiveTV::VVideoLiveTV(ChannelList* tchanList, ULONG initialChannelNumber, V osdposterbanner.setVisible(false); add(&osdposterbanner); - - osd.setBackgroundColour(DrawStyle::OSDBACKGROUND); osd.setPosition(0, video->getScreenHeight() - 150); osd.setSize(video->getScreenWidth(), 150); @@ -155,26 +132,26 @@ VVideoLiveTV::VVideoLiveTV(ChannelList* tchanList, ULONG initialChannelNumber, V int channellogomove=0; int boxdiff=166; - if (osdv) { - //osdChannelLogo.setBackgroundColour(DrawStyle::OSDBACKGROUND); - osdChannelLogo.setPosition(30,5); - osdChannelLogo.setSize(60,60); - osdChannelLogo.setTVMedia(info, WTVMedia::ZoomVertical); - osd.add(&osdChannelLogo); - channellogomove=30-5; - boxdiff=145; + if (osdv) + { + //osdChannelLogo.setBackgroundColour(DrawStyle::OSDBACKGROUND); + osdChannelLogo.setPosition(30,5); + osdChannelLogo.setSize(60,60); + osdChannelLogo.setTVMedia(info, WTVMedia::ZoomVertical); + osd.add(&osdChannelLogo); + channellogomove = 30-5; + boxdiff = 145; } - //clock.setBackgroundColour(DrawStyle::OSDBACKGROUND); clock.setPosition(osd.getWidth() - 100, 4); clock.setSize(90, 30); osd.add(&clock); //osdChanNum.setBackgroundColour(DrawStyle::OSDBACKGROUND); - osdChanNum.setPosition(60+channellogomove, 4); - osdChanNum.setSize((numberWidth*10) + 22, getFontHeight()+5); // 10 px = width of number chars in font - osd.add(&osdChanNum); + osdChanNum.setPosition(60 + channellogomove, 4); + osdChanNum.setSize((numberWidth * 10) + 22, getFontHeight() + 5); // 10 px = width of number chars in font + osd.add(&osdChanNum); //osdChanName.setBackgroundColour(DrawStyle::OSDBACKGROUND); osdChanName.setPosition(osdChanNum.getX2() + 10, 4); @@ -233,51 +210,50 @@ VVideoLiveTV::VVideoLiveTV(ChannelList* tchanList, ULONG initialChannelNumber, V sl.setSize(480, 58); osd.add(&sl); - - bufferBar.setPosition(osd.getWidth() - 90, 70); bufferBar.setSize(40, 20); bufferBar.setVisible(true); osd.add(&bufferBar); - if (!osdv) { - sAspectRatio.setPosition(osd.getWidth() - 90, 40); - sAspectRatio.nextColour = DrawStyle::LIVETVSYMBOLS; - sAspectRatio.setVisible(false); - osd.add(&sAspectRatio); - - sAudioChannels.setPosition(osd.getWidth() - 130, 40); - sAudioChannels.nextColour = DrawStyle::LIVETVSYMBOLS; - sAudioChannels.setVisible(false); - osd.add(&sAudioChannels); + if (!osdv) + { + sAspectRatio.setPosition(osd.getWidth() - 90, 40); + sAspectRatio.nextColour = DrawStyle::LIVETVSYMBOLS; + sAspectRatio.setVisible(false); + osd.add(&sAspectRatio); + + sAudioChannels.setPosition(osd.getWidth() - 130, 40); + sAudioChannels.nextColour = DrawStyle::LIVETVSYMBOLS; + sAudioChannels.setVisible(false); + osd.add(&sAudioChannels); } - if (osdv) { - TVMediaInfo ninfo; - ninfo.setStaticArtwork(sa_txtoff); - txtlogo.setPosition(54+4*boxdiff,104); - txtlogo.setSize(22,20); - txtlogo.setTVMedia(ninfo, WTVMedia::ZoomVertical); - osd.add(&txtlogo); - - ninfo.setStaticArtwork(sa_dolbyoff); - dolbylogo.setPosition(54+4*boxdiff+15,104); - dolbylogo.setSize(22,20); - dolbylogo.setTVMedia(ninfo, WTVMedia::ZoomVertical); - osd.add(&dolbylogo); - - ninfo.setStaticArtwork(sa_sd576i); - reslogo.setPosition(54+4*boxdiff+30,104); - reslogo.setSize(22,20); - reslogo.setTVMedia(ninfo, WTVMedia::ZoomVertical); - osd.add(&reslogo); - - reslogo.setVisible(false); - dolbylogo.setVisible(false); - txtlogo.setVisible(false); + if (osdv) + { + TVMediaInfo ninfo; + ninfo.setStaticArtwork(sa_txtoff); + txtlogo.setPosition(54+4*boxdiff,104); + txtlogo.setSize(22,20); + txtlogo.setTVMedia(ninfo, WTVMedia::ZoomVertical); + osd.add(&txtlogo); + + ninfo.setStaticArtwork(sa_dolbyoff); + dolbylogo.setPosition(54+4*boxdiff+15,104); + dolbylogo.setSize(22,20); + dolbylogo.setTVMedia(ninfo, WTVMedia::ZoomVertical); + osd.add(&dolbylogo); + + ninfo.setStaticArtwork(sa_sd576i); + reslogo.setPosition(54+4*boxdiff+30,104); + reslogo.setSize(22,20); + reslogo.setTVMedia(ninfo, WTVMedia::ZoomVertical); + osd.add(&reslogo); + + reslogo.setVisible(false); + dolbylogo.setVisible(false); + txtlogo.setVisible(false); } - //textUnavailable.setBackgroundColour(DrawStyle::OSDBACKGROUND); textUnavailable.setPosition(60, 30); textUnavailable.setSize(osd.getWidth() - 120, 30); @@ -285,14 +261,12 @@ VVideoLiveTV::VVideoLiveTV(ChannelList* tchanList, ULONG initialChannelNumber, V textUnavailable.setVisible(false); add(&textUnavailable); - - vdisplay.mode=Fullscreen; - vdisplay.fallbackMode=Fullscreen; - vdisplay.x=0; - vdisplay.y=0; - vdisplay.width=0; - vdisplay.height=0; - + vdisplay.mode = Fullscreen; + vdisplay.fallbackMode = Fullscreen; + vdisplay.x = 0; + vdisplay.y = 0; + vdisplay.width = 0; + vdisplay.height = 0; } void VVideoLiveTV::preDelete() @@ -305,10 +279,10 @@ VVideoLiveTV::~VVideoLiveTV() delete player; video->setDefaultAspect(); delData(); - OsdVector* osdv=dynamic_cast(Osd::getInstance()); + OsdVector* osdv = dynamic_cast(Osd::getInstance()); if (osdv) { - osdv->updateBackgroundColor(DrawStyle::WALLPAPER); + osdv->updateBackgroundColor(DrawStyle::WALLPAPER); } } @@ -323,7 +297,6 @@ void VVideoLiveTV::delData() } eventList->clear(); delete eventList; - } } @@ -350,21 +323,27 @@ int VVideoLiveTV::handleCommand(int command) // NEW REMOTE ONLY - navigate EPG, bring it onscreen if it's not there case Remote::UP: { - if (Remote::getInstance()->mayHaveFewButtons()) { - if (okTriggeredOSD) doUpDown(false); - else doChanUpDown(UP); - } else { - doUpDown(false); - } + if (Remote::getInstance()->mayHaveFewButtons()) + { + if (okTriggeredOSD) doUpDown(false); + else doChanUpDown(UP); + } + else + { + doUpDown(false); + } return 2; } case Remote::DOWN: { - if (Remote::getInstance()->mayHaveFewButtons()) { - if (okTriggeredOSD) doUpDown(true); - else doChanUpDown(DOWN); - } else { - doUpDown(true); + if (Remote::getInstance()->mayHaveFewButtons()) + { + if (okTriggeredOSD) doUpDown(true); + else doChanUpDown(DOWN); + } + else + { + doUpDown(true); } return 2; } @@ -573,24 +552,23 @@ void VVideoLiveTV::doOK() void VVideoLiveTV::doSummary() { - displayOSD(false); - Channel* currentChannel = (*chanList)[osdChannelIndex]; - eventList = VDR::getInstance()->getChannelSchedule(currentChannel->number); - if (!eventList) - { - return; - } - sort(eventList->begin(), eventList->end(), EventSorter()); - - if (eventList->size() < 1) return; - Event* event = (*eventList)[0]; - event->loadinfos(currentChannel->number); + displayOSD(false); + Channel* currentChannel = (*chanList)[osdChannelIndex]; + eventList = VDR::getInstance()->getChannelSchedule(currentChannel->number); + if (!eventList) + { + return; + } + sort(eventList->begin(), eventList->end(), EventSorter()); - VEpgSummary* vr = new VEpgSummary(event,currentChannel); - vr->draw(); - boxstack->add(vr); - boxstack->update(vr); + if (eventList->size() < 1) return; + Event* event = (*eventList)[0]; + event->loadinfos(currentChannel->number); + VEpgSummary* vr = new VEpgSummary(event,currentChannel); + vr->draw(); + boxstack->add(vr); + boxstack->update(vr); } void VVideoLiveTV::doKey(int command) @@ -646,7 +624,7 @@ void VVideoLiveTV::doTeletext(bool subtitlemode) { if (streamType !=VDR::VIDEO) return; (static_cast(player))->tellSubtitlesOSDVisible(true); - bool exists=true; + bool exists = true; // Cancel keying if (keying) @@ -662,18 +640,22 @@ void VVideoLiveTV::doTeletext(bool subtitlemode) if (osd.getVisible()) clearScreen(); // Draw the teletxt VTeletextView *vtxv=((PlayerLiveTV*)player)->getTeletextDecoder()->getTeletxtView(); - if (vtxv==NULL) { - vtxv= new VTeletextView(((PlayerLiveTV*)player)->getTeletextDecoder(),this, (PlayerLiveTV*)player); - ((PlayerLiveTV*)player)->getTeletextDecoder()->registerTeletextView(vtxv); - exists=false; + if (vtxv==NULL) + { + vtxv= new VTeletextView(((PlayerLiveTV*)player)->getTeletextDecoder(),this, (PlayerLiveTV*)player); + ((PlayerLiveTV*)player)->getTeletextDecoder()->registerTeletextView(vtxv); + exists=false; } + vtxv->setSubtitleMode(subtitlemode); vtxv->draw(); draw(); - if (!exists) { - BoxStack::getInstance()->add(vtxv); + if (!exists) + { + BoxStack::getInstance()->add(vtxv); } + BoxStack::getInstance()->update(this); BoxStack::getInstance()->update(vtxv); } @@ -684,7 +666,6 @@ void VVideoLiveTV::doAudioSelector() Timers::getInstance()->cancelTimer(this, 1); //This causes a deadlock with the timertrhread itself is locked - // Cancel keying if (keying) { @@ -732,18 +713,20 @@ void VVideoLiveTV::doEPG() { if (osd.getVisible()) clearScreen(); - if (!Command::getInstance()->advMenues()) { - - VEpg* vepg = new VEpg(this, currentChannelIndex, chanList); - vepg->draw(); - boxstack->add(vepg); - boxstack->update(vepg); - } else { - Channel* currentChannel = (*chanList)[osdChannelIndex]; - VEpgListAdvanced *vepg= new VEpgListAdvanced(this, chanList, currentChannel->number); - vepg->draw(); - boxstack->add(vepg); - boxstack->update(vepg); + if (!Command::getInstance()->advMenues()) + { + VEpg* vepg = new VEpg(this, currentChannelIndex, chanList); + vepg->draw(); + boxstack->add(vepg); + boxstack->update(vepg); + } + else + { + Channel* currentChannel = (*chanList)[osdChannelIndex]; + VEpgListAdvanced *vepg= new VEpgListAdvanced(this, chanList, currentChannel->number); + vepg->draw(); + boxstack->add(vepg); + boxstack->update(vepg); } } @@ -814,10 +797,13 @@ void VVideoLiveTV::displayOSD(bool newNowNextData) toupdate=*osd.getRegion(); - if (osdposterbanner.getVisible()) { - boxstack->update(this); - } else { - boxstack->update(this, &toupdate); + if (osdposterbanner.getVisible()) + { + boxstack->update(this); + } + else + { + boxstack->update(this, &toupdate); } bool setTimer = true; @@ -879,21 +865,21 @@ void VVideoLiveTV::timercall(int ref) { if (keying) { - Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Timer Call 1 key start."); + Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Timer Call 1 key start."); UINT newChannel = 0; for(int i = keying - 1; i >= 0; i--) newChannel += keyingInput[i] * (ULONG)pow(10., i); Message* m = new Message(); m->message = Message::CHANNEL_CHANGE; m->to = this; - m->parameter.num = newChannel; + m->parameter.num = newChannel; m->tag = 1; // signal to call displayOSD(); Command::getInstance()->postMessageFromOuterSpace(m); Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Timer Call 1 key end."); } else { - Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Timer Call 1 not key start."); + Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Timer Call 1 not key start."); // We have received a timer, we are not keying. If still prebuffering, don't remove the bar if (preBuffering < 100) { @@ -913,14 +899,14 @@ void VVideoLiveTV::timercall(int ref) else boxstack->update(this, osd.getRegion()); Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Timer Call 1 notkey 3."); - PlayerLiveTV* playerlivetv = dynamic_cast(player); - if (playerlivetv) playerlivetv->tellSubtitlesOSDVisible(false); + PlayerLiveTV* playerlivetv = dynamic_cast(player); + if (playerlivetv) playerlivetv->tellSubtitlesOSDVisible(false); Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Timer Call 1 notkey end."); } } else if (ref == 2) { - Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Timer Call 2 start."); + Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Timer Call 2 start."); setClock(); if (osd.getVisible()) { @@ -934,12 +920,13 @@ void VVideoLiveTV::timercall(int ref) bool VVideoLiveTV::channelChange(UCHAR changeType, UINT newData) { UINT newChannel = 0; - if (streamType ==VDR::VIDEO) { - VTeletextView *vtxt=((PlayerLiveTV*)player)->getTeletextDecoder()->getTeletxtView(); - if (vtxt ) { - BoxStack::getInstance()->remove(vtxt); - - } + if (streamType == VDR::VIDEO) + { + VTeletextView *vtxt=((PlayerLiveTV*)player)->getTeletextDecoder()->getTeletxtView(); + if (vtxt) + { + BoxStack::getInstance()->remove(vtxt); + } } if (changeType == INDEX) { @@ -993,34 +980,38 @@ bool VVideoLiveTV::channelChange(UCHAR changeType, UINT newData) bufferBar.setPercent(0); - if (!osdv) { - sAudioChannels.setVisible(false); - sAspectRatio.setVisible(false); - } else { - reslogo.setVisible(false); - dolbylogo.setVisible(false); - txtlogo.setVisible(false); + if (!osdv) + { + sAudioChannels.setVisible(false); + sAspectRatio.setVisible(false); + } + else + { + reslogo.setVisible(false); + dolbylogo.setVisible(false); + txtlogo.setVisible(false); } // Remove other stuff if (textUnavailable.getVisible()) { textUnavailable.setVisible(false); - } - if (osdv) { - TVMediaInfo info; - Channel* currentChannel = (*chanList)[currentChannelIndex]; - if (currentChannel) { - info.setChannelLogo(currentChannel->number); - if (streamType == VDR::RADIO) { - radioChannelLogo.setTVMedia(info, WTVMedia::ZoomVertical); - radioChannelLogo.setVisible(true); - } - osdChannelLogo.setTVMedia(info, WTVMedia::ZoomVertical); - - } + if (osdv) + { + TVMediaInfo info; + Channel* currentChannel = (*chanList)[currentChannelIndex]; + if (currentChannel) + { + info.setChannelLogo(currentChannel->number); + if (streamType == VDR::RADIO) + { + radioChannelLogo.setTVMedia(info, WTVMedia::ZoomVertical); + radioChannelLogo.setVisible(true); + } + osdChannelLogo.setTVMedia(info, WTVMedia::ZoomVertical); + } } draw(); @@ -1034,33 +1025,42 @@ void VVideoLiveTV::processMessage(Message* m) if (m->message == Message::MOUSE_LBDOWN) { //check if press is outside this view! then simulate cancel - int x = (m->parameter.num >> 16) - osd.getScreenX(); - int y = (m->parameter.num & 0xFFFF) - osd.getScreenY(); - if (osd.getVisible()) { - + int x = (m->parameter.num >> 16) - osd.getScreenX(); + int y = (m->parameter.num & 0xFFFF) - osd.getScreenY(); + if (osd.getVisible()) + { if ((boxRed.getX()<=x) && (boxRed.getX()+(int)boxRed.getWidth()>=x ) && - (boxRed.getY()<=y) && (boxRed.getY()+(int)boxRed.getHeight()>=y )) { - BoxStack::getInstance()->handleCommand(Remote::RED); - } else if ((boxGreen.getX()<=x) && (boxGreen.getX()+(int)boxGreen.getWidth()>=x ) && - (boxGreen.getY()<=y) && (boxGreen.getY()+(int)boxGreen.getHeight()>=y)){ - BoxStack::getInstance()->handleCommand(Remote::GREEN); - } else if ((boxYellow.getX()<=x) && (boxYellow.getX()+(int)boxYellow.getWidth()>=x ) && - (boxYellow.getY()<=y) && (boxYellow.getY()+(int)boxYellow.getHeight()>=y )){ - BoxStack::getInstance()->handleCommand(Remote::YELLOW); - } else if ((boxBlue.getX()<=x) && (boxBlue.getX()+(int)boxBlue.getWidth()>=x ) && - (boxBlue.getY()<=y) && (boxBlue.getY()+(int)boxBlue.getHeight()>=y )){ - BoxStack::getInstance()->handleCommand(Remote::BLUE); - } else { - BoxStack::getInstance()->handleCommand(Remote::OK); //simulate rok press + (boxRed.getY()<=y) && (boxRed.getY()+(int)boxRed.getHeight()>=y )) + { + BoxStack::getInstance()->handleCommand(Remote::RED); + } + else if ((boxGreen.getX()<=x) && (boxGreen.getX()+(int)boxGreen.getWidth()>=x ) && + (boxGreen.getY()<=y) && (boxGreen.getY()+(int)boxGreen.getHeight()>=y)) + { + BoxStack::getInstance()->handleCommand(Remote::GREEN); + } + else if ((boxYellow.getX()<=x) && (boxYellow.getX()+(int)boxYellow.getWidth()>=x ) && + (boxYellow.getY()<=y) && (boxYellow.getY()+(int)boxYellow.getHeight()>=y )){ + BoxStack::getInstance()->handleCommand(Remote::YELLOW); + } + else if ((boxBlue.getX()<=x) && (boxBlue.getX()+(int)boxBlue.getWidth()>=x ) && + (boxBlue.getY()<=y) && (boxBlue.getY()+(int)boxBlue.getHeight()>=y )) + { + BoxStack::getInstance()->handleCommand(Remote::BLUE); + } + else + { + BoxStack::getInstance()->handleCommand(Remote::OK); //simulate rok press } - - } else { - BoxStack::getInstance()->handleCommand(Remote::OK); //simulate rok press + } + else + { + BoxStack::getInstance()->handleCommand(Remote::OK); //simulate rok press } } else if (m->message == Message::CHANNEL_CHANGE) { - channelChange(NUMBER, m->parameter.num); + channelChange(NUMBER, m->parameter.num); osdChannelIndex = currentChannelIndex; if (m->tag == 1) displayOSD(true); } @@ -1074,26 +1074,32 @@ void VVideoLiveTV::processMessage(Message* m) } else if (m->message == Message::AUDIO_CHANGE_CHANNEL) { - Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Received change audio channel to %x", m->parameter.num); - player->setAudioChannel((m->parameter.num & 0xFFFF), (m->parameter.num & 0xFF0000) >> 16, (m->parameter.num & 0xFF000000) >> 24); + Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Received change audio channel to %x", m->parameter.num); + player->setAudioChannel((m->parameter.num & 0xFFFF), (m->parameter.num & 0xFF0000) >> 16, (m->parameter.num & 0xFF000000) >> 24); } else if (m->message == Message::SUBTITLE_CHANGE_CHANNEL) { - if (streamType !=VDR::VIDEO) return; - Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Received change subtitle channel to %x", m->parameter.num); - int type=((m->parameter.num & 0xFF0000)>>16); - switch (type) { - case 0x10: { //dvbsubtitle - if (streamType == VDR::VIDEO){ - player->setSubtitleChannel((m->parameter.num & 0xFFFF)); - (static_cast(player))->turnSubtitlesOn(true); - VTeletextView *vtxt=((PlayerLiveTV*)player)->getTeletextDecoder()->getTeletxtView(); - if (vtxt && vtxt->isInSubtitleMode()) { - BoxStack::getInstance()->remove(vtxt); - } + if (streamType != VDR::VIDEO) return; + Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Received change subtitle channel to %x", m->parameter.num); + int type = (m->parameter.num & 0xFF0000) >> 16; + switch (type) + { + case 0x10: + { + //dvbsubtitle + if (streamType == VDR::VIDEO) + { + player->setSubtitleChannel((m->parameter.num & 0xFFFF)); + (static_cast(player))->turnSubtitlesOn(true); + VTeletextView *vtxt=((PlayerLiveTV*)player)->getTeletextDecoder()->getTeletxtView(); + if (vtxt && vtxt->isInSubtitleMode()) + { + BoxStack::getInstance()->remove(vtxt); } - } break; - case 0xFF: { //nosubtitles + } + } break; + case 0xFF: + { //nosubtitles if (streamType == VDR::VIDEO){ (static_cast(player))->turnSubtitlesOn(false); VTeletextView *vtxt=((PlayerLiveTV*)player)->getTeletextDecoder()->getTeletxtView(); @@ -1101,20 +1107,22 @@ void VVideoLiveTV::processMessage(Message* m) BoxStack::getInstance()->remove(vtxt); } } - } break; - case 0x11: { //videotext + } + break; + case 0x11: + { //videotext (static_cast(player))->turnSubtitlesOn(false); doTeletext(true); ((PlayerLiveTV*)player)->getTeletextDecoder()->setPage((m->parameter.num & 0xFFFF)); - } break; - }; - if (vas) { - BoxStack::getInstance()->update(vas); - //BoxStack::getInstance()->update(&osd); //eveil error - } - BoxStack::getInstance()->update(this, osd.getRegion()); + } break; + }; - + if (vas) + { + BoxStack::getInstance()->update(vas); + //BoxStack::getInstance()->update(&osd); //eveil error + } + BoxStack::getInstance()->update(this, osd.getRegion()); } else if (m->message == Message::PLAYER_EVENT) { @@ -1136,16 +1144,6 @@ void VVideoLiveTV::processMessage(Message* m) case PlayerLiveTV::ASPECT43: { -#ifdef PAL_WSS - if ((video->getTVsize() == Video::ASPECT16X9) && dowss) - { - Log::getInstance()->log("VVideoRec", Log::DEBUG, "Received do WSS 43"); - wss.setWide(false); - wss.draw(); - BoxStack::getInstance()->update(this, &wssRegion); - } -#endif - OsdVector* osdv=dynamic_cast(Osd::getInstance()); if (osdv) { @@ -1165,16 +1163,6 @@ void VVideoLiveTV::processMessage(Message* m) } case PlayerLiveTV::ASPECT169: { -#ifdef PAL_WSS - if ((video->getTVsize() == Video::ASPECT16X9) && dowss) - { - Log::getInstance()->log("VVideoRec", Log::DEBUG, "Received do WSS 169"); - wss.setWide(true); - wss.draw(); - BoxStack::getInstance()->update(this, &wssRegion); - } -#endif - sAspectRatio.nextSymbol = WSymbol::VIDEOASPECT169; sAspectRatio.setVisible(true); @@ -1215,13 +1203,6 @@ void VVideoLiveTV::processMessage(Message* m) } } } -#ifdef VOMP_PLATTFORM_MVP -// See vepg.cc ~ line 480 - else if (m->message == Message::HACK_MVP_RETURN_FROM_QUARTER) - { - video->setMode(videoMode); - } -#endif } void VVideoLiveTV::doAudioChannelSymbol() diff --git a/vvideolivetv.h b/vvideolivetv.h index bdf4b39..22077df 100644 --- a/vvideolivetv.h +++ b/vvideolivetv.h @@ -36,10 +36,6 @@ #include "osdreceiver.h" #include "wtvmedia.h" -#ifdef PAL_WSS -#include "wwss.h" -#endif - class VChannelList; class Video; class VChannelList; @@ -124,11 +120,6 @@ class VVideoLiveTV : public Boxx, public TimerReceiver, public OSDReceiver void showUnavailable(); VAudioSelector* vas; -#ifdef PAL_WSS - Wwss wss; - Region wssRegion; - bool dowss; -#endif Boxx osd; WTextbox clock; diff --git a/vvideorec.cc b/vvideorec.cc index 0fc6e07..6acb8b4 100644 --- a/vvideorec.cc +++ b/vvideorec.cc @@ -114,28 +114,7 @@ VVideoRec::VVideoRec(Recording* rec, bool ish264) barGenHold = false; barScanHold = false; barVasHold = false; -#ifdef PAL_WSS - dowss = false; - char* optionWSS = vdr->configLoad("General", "WSS"); - if (optionWSS) - { - if (strstr(optionWSS, "Yes")) dowss = true; - delete[] optionWSS; - } - Log::getInstance()->log("VVideoRec", Log::DEBUG, "Do WSS: %u", dowss); - if (dowss) - { - wss.setFormat(video->getFormat()); - wss.setWide(true); - add(&wss); - - wssRegion.x = 0; - wssRegion.y = 0; - wssRegion.w = video->getScreenWidth(); - wssRegion.h = 300; - } -#endif vdisplay.mode=Fullscreen; vdisplay.fallbackMode=Fullscreen; vdisplay.x=0; @@ -564,28 +543,10 @@ void VVideoRec::processMessage(Message* m) } case Player::ASPECT43: { -#ifdef PAL_WSS - if (dowss) - { - Log::getInstance()->log("VVideoRec", Log::DEBUG, "Received do WSS 43"); - wss.setWide(false); - wss.draw(); - boxstack->update(this, &wssRegion); - } -#endif break; } case Player::ASPECT169: { -#ifdef PAL_WSS - if (dowss) - { - Log::getInstance()->log("VVideoRec", Log::DEBUG, "Received do WSS 169"); - wss.setWide(true); - wss.draw(); - boxstack->update(this, &wssRegion); - } -#endif break; } } diff --git a/vvideorec.h b/vvideorec.h index 99bebb3..6c2823c 100644 --- a/vvideorec.h +++ b/vvideorec.h @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with VOMP. If not, see . */ #ifndef VVIDEOREC_H @@ -31,10 +30,6 @@ #include "video.h" -#ifdef PAL_WSS -#include "wwss.h" -#endif - class VDR; class Timers; class Player; @@ -46,8 +41,6 @@ class VInfo; class Bitmap; - - //#include "vepg.h" // for testing EPG in NTSC with a NTSC test video class VVideoRec : public Boxx, public TimerReceiver, public OSDReceiver @@ -104,12 +97,7 @@ class VVideoRec : public Boxx, public TimerReceiver, public OSDReceiver UINT startMargin; UINT endMargin; - int lastbar; -#ifdef PAL_WSS - Wwss wss; - Region wssRegion; - bool dowss; -#endif + int lastbar; VInfo* vsummary; }; diff --git a/winmain.cc b/winmain.cc index 08bfbfa..0097303 100644 --- a/winmain.cc +++ b/winmain.cc @@ -33,7 +33,6 @@ #include "log.h" #include "remotewin.h" #include "ledwin.h" -#include "mtdwin.h" #include "timers.h" #include "videowin.h" #include "audiowin.h" @@ -56,7 +55,6 @@ void shutdown(int code); int debugEnabled = 0; Log* logger; Remote* remote; -Mtd* mtd; Led* led; Osd* osd; Timers* timers; @@ -159,7 +157,6 @@ INT WINAPI WinMain( HINSTANCE hinst , HINSTANCE previnst, LPSTR cmdline, int cmd logger = new Log(); remote = new RemoteWin(); - mtd = new MtdWin(); led = new LedWin(); timers = new Timers(); osd = new Osd_TYPE(); @@ -171,7 +168,7 @@ INT WINAPI WinMain( HINSTANCE hinst , HINSTANCE previnst, LPSTR cmdline, int cmd wol = new Wol(); sleeptimer = new Sleeptimer(); - if (!logger || !remote || !mtd || !led || !osd || !video || !audio || !boxstack || !command || !sleeptimer) + if (!logger || !remote || !led || !osd || !video || !audio || !boxstack || !command || !sleeptimer) { ERROR_MSG("Could not create objects. Memory problems?\n"); shutdown(1); @@ -222,19 +219,6 @@ INT WINAPI WinMain( HINSTANCE hinst , HINSTANCE previnst, LPSTR cmdline, int cmd return 0; } - success = mtd->init(); - if (success) - { - logger->log("Core", Log::INFO, "Mtd module initialised"); - } - else - { - logger->log("Core", Log::EMERG, "Mtd module failed to initialise"); - shutdown(1); - WSACleanup(); - return 0; - } - success = timers->init(); if (success) { @@ -248,10 +232,7 @@ INT WINAPI WinMain( HINSTANCE hinst , HINSTANCE previnst, LPSTR cmdline, int cmd return 0; } - UCHAR videoFormat = (UCHAR)mtd->getPALorNTSC(); - if (videoFormat == Video::PAL) logger->log("Core", Log::INFO, "Read from MTD: PAL 720x576"); - else if (videoFormat == Video::NTSC) logger->log("Core", Log::INFO, "Read from MTD: NTSC 720x480"); - else logger->log("Core", Log::INFO, "No help from MTD. Assuming NTSC 720x480"); + UCHAR videoFormat = Video::PAL; // PALNTSC FIXME. success = video->init(videoFormat); if (success) @@ -890,13 +871,6 @@ void shutdown(int code) logger->log("Core", Log::NOTICE, "Timers module shut down"); } - if (mtd) - { - mtd->shutdown(); - delete mtd; - logger->log("Core", Log::NOTICE, "MTD module shut down"); - } - if (led) { led->shutdown(); diff --git a/wseriesview.h b/wseriesview.h index 0b9f715..3d25209 100644 --- a/wseriesview.h +++ b/wseriesview.h @@ -14,12 +14,11 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + along with VOMP. If not, see . */ #ifndef WSERIESVIEW_H -#define WSERIESIEW_H +#define WSERIESVIEW_H #include #include @@ -28,8 +27,6 @@ #include "wtextbox.h" #include "seriesinfo.h" -class Colour; - class WSeriesView : public WTextbox { public: diff --git a/wwss.cc b/wwss.cc deleted file mode 100644 index 2f9cc9c..0000000 --- a/wwss.cc +++ /dev/null @@ -1,324 +0,0 @@ -/* - Copyright 2006 Chris Tallon - - This file is part of VOMP. - - VOMP 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. - - VOMP 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 VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include "wwss.h" - -#include "colour.h" -#include "video.h" - -Wwss::Wwss() -{ - format = Video::NTSC; -} - -Wwss::~Wwss() -{ -} - -void Wwss::setFormat(UCHAR tformat) -{ - format = tformat; -} - -UINT Wwss::gcd(UINT a, UINT b) -{ - UINT t; - while (b != 0) - { - t = b; - b = a % b; - a = t; - } - return a; -} - -UINT Wwss::lcm(UINT a, UINT b) -{ - return (a / gcd(a, b)) * b; -} - -void Wwss::setWide(bool twide) -{ - wide = twide; -} - -void Wwss::draw() -{ - if (format == Video::PAL) drawPAL(); - // else if (format == Video::NTSC) drawNTSC(); -} - -void Wwss::drawPAL() -{ - // The aspect43 and aspect169 codes are not what they should be according to the docs, but these are what work... - // (1 = 111000, = 0 000111) - static UCHAR runIn[] = {1,1,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1}; // 29 pos 0 - static UCHAR startCode[] = {0,0,0,1,1,1,1,0,0,0,1,1,1,1,0,0,0,0,0,1,1,1,1,1}; // 24 pos 29 - static UCHAR aspect43[] = {0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,1,1,1,0,0,0}; // = 0001 4:3 full frame // 24 pos 53 - static UCHAR aspect169[] = {1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,0,0,0,1,1,1}; // = 1110 16:9 anamorphic // 24 pos 53 - static UCHAR theRest[] = {0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1, // 60 pos 77 - 0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1, - 0,0,0,1,1,1,0,0,0,1,1,1}; - /* - Real PAL pixel frequency: 13.5 MHz - WSS element frequency: 5 MHz - = 2.7 pal pixels per wss element - * 137 wss elements = 369.9 pal pixels (total code width) (round to 370..) - - There is also a 11us gap at the start of the pal raster, but since I don't really have any - idea where our 720 pixels start in the raster I can't calculate an offset. - - PAL line 23 seems to be MVP line 6. - */ - - const UINT Ns = 137; // Num pix src - const UINT Nd = 370; // Num pix dst 359->395 does something. not the right thing, but something. - UINT Nl = lcm(Ns, Nd); // Num pix in lcm - UINT Ss = Nl / Ns; // Source split (how many lcm px = 1 src px) - UINT Sd = Nl / Nd; // Dst split - UCHAR src[Ns]; - - memcpy(&src[0], runIn, 29); - memcpy(&src[29], startCode, 24); - if (wide) memcpy(&src[53], aspect169, 24); - else memcpy(&src[53], aspect43, 24); - memcpy(&src[77], theRest, 60); - - float dst[Nd]; - UINT lcmpxbase = 0; - - for(UINT t = 0; t < Nd; t++) // for every destination pixel - { - dst[t] = 0; - for(UINT lcmpx = lcmpxbase; lcmpx < (lcmpxbase + Sd); lcmpx++) - { - if (src[lcmpx / Ss]) dst[t] += (float)1/Sd; - } - lcmpxbase += Sd; - } - - Colour c; - UINT value; - - Surface* mysurface = getSurface(); - for(UINT q = 0; q < Nd; q++) - { - value = (UINT)(dst[q] * 182); // Apparently this is a better number than 255 for the colour value - c.set(value, value, value); - mysurface->drawPixel(q, 6, c); - } -} - -void Wwss::drawNTSC() -{ - /* - static UCHAR startCode[] = {1,0,0,0,0,0,0}; - static UCHAR aspect43[] = {0}; - static UCHAR aspect169[] = {1}; - static UCHAR theRest[] = {0,0,0,0,0,0,0,0}; - static UCHAR crc43[] = {0,0,0,0,0,0}; - static UCHAR crc169[] = {0,0,1,1,0,0}; - */ - /* - Real NTSC pixel frequency: 13.5 MHz - WSS bit frequency: 447.443125 kHz - = 30.1714 NTSC pixels per wss bit - * 22 wss bits = 663.7715 NTSC pixels (total code width) (round to 664..) - - There is also a 11.2us gap at the start of the pal raster, but since I don't really have any - idea where our 720 pixels start in the raster I can't calculate an offset. - - PAL line 23 seems to be MVP line 6. - */ - - const UINT Ns = 22; // Num pix src - const UINT Nd = 664; // Num pix dst - // const UINT Nd = 518; // Num pix dst - UINT Nl = lcm(Ns, Nd); // Num pix in lcm - UINT Ss = Nl / Ns; // Source split (how many lcm px = 1 src px) - UINT Sd = Nl / Nd; // Dst split - // UCHAR src[Ns]; - - /* - memcpy(&src[0], startCode, 7); - if (wide) memcpy(&src[7], aspect169, 1); - else memcpy(&src[7], aspect43, 1); - memcpy(&src[8], theRest, 8); - if (wide) memcpy(&src[16], crc169, 6); - else memcpy(&src[16], crc43, 6); - */ - - static UCHAR src[22] = {1,0, 0,0,0,0,1,1, 0,0,0,0, 0,0,0,0, 0,0,1,0,0,1 }; - - - float dst[Nd]; - UINT lcmpxbase = 0; - - for(UINT t = 0; t < Nd; t++) // for every destination pixel - { - dst[t] = 0; - for(UINT lcmpx = lcmpxbase; lcmpx < (lcmpxbase + Sd); lcmpx++) - { - if (src[lcmpx / Ss]) dst[t] += (float)1/Sd; - } - lcmpxbase += Sd; - } - - Colour c; - UINT value; - - // This one is the real one - /* - Surface* mysurface = getSurface(); - for(UINT q = 0; q < Nd; q++) - { - value = (UINT)(dst[q] * 182); // Apparently this is a better number than 255 for the colour value - c.set(value, value, value); - mysurface->drawPixel(q, 6, c); - } - */ - - // This one is testing active - Surface* mysurface = getSurface(); - for(int yy = 0; yy < 100; yy++) - { - for(UINT q = 0; q < Nd; q++) - { - value = (UINT)(dst[q] * 182); // Apparently this is a better number than 255 for the colour value - c.set(value, value, value); - mysurface->drawPixel(q+0, yy, c); - } - } -} - -/* -x6 + x + 1 - -1x6 + 0x5 + 0x4 + 0x3 + 0x2 + 1x1 + 1x0 -= -1 0 0 0 0 1 1 -= -1000011 -key width = 6 - -static UCHAR startCode[] = {1,0}; -static UCHAR aspect43[] = {0,0}; -static UCHAR aspect169[] = {1,0}; -static UCHAR theRest[] = {0,0,0,0,0,0,0,0,0,0,0,0}; -static UCHAR crc43[] = {0,0,0,0,0,0}; -static UCHAR crc169[] = {0,0,1,0,0,1}; - -Message 4:3 - -1000000000000000 - -Message 4:3 augmented - -1000000000000000000000 - -Key - -1000011 - - -Ho ho, polynomial long division. Yeeeeaaahhh I remember -doing *that*. Of course I do. If you know of a faster, -easier, more reliable way of doing this, please let me know. - - - 100 - ________________________ -1000011 ) 1000000000000000000000 - 1000011 - ------- - 0000110 - 0000000 - ------- - 0001100 - - - - - - -Message 16:9 - -1010000000000000 - -Message 4:3 augmented - -1010000000000000000000 - -Key - -1000011 - - 1010011110100011 - ________________________ -1000011 ) 1010000000000000000000 - 1000011 - ------- - 0100110 - 0000000 - ------- - 1001100 - 1000011 - ------- - 0011110 - 0000000 - ------- - 0111100 - 0000000 - ------- - 1111000 - 1000011 - ------- - 1110110 - 1000011 - ------- - 1101010 - 1000011 - ------- - 1010010 - 1000011 - ------- - 0100010 - 0000000 - ------- - 1000100 - 1000011 - ------- - 0001110 - 0000000 - ------- - 0011100 - 0000000 - ------- - 0111000 - 0000000 - ------- - 1110000 - 1000011 - ------- - 1100110 - 1000011 - ------- - 100101 -*/ diff --git a/wwss.h b/wwss.h deleted file mode 100644 index 0928735..0000000 --- a/wwss.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright 2006 Chris Tallon - - This file is part of VOMP. - - VOMP 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. - - VOMP 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 VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#ifndef WWSS_H -#define WWSS_H - -#include -#include - -#include "boxx.h" -#include "defines.h" - -class Wwss : public Boxx -{ - public: - Wwss(); - virtual ~Wwss(); - void draw(); - void setWide(bool wide); - void setFormat(UCHAR tformat); - - private: - UINT gcd(UINT a, UINT b); - UINT lcm(UINT a, UINT b); - void drawNTSC(); - void drawPAL(); - - bool wide; - UCHAR format; // same as video - 0=NTSC,1=PAL -}; - -#endif -- 2.39.5