From 4b54815bea713f493dc6cf136947ecab7e6ecb5a Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Thu, 9 Feb 2017 21:39:15 +0000 Subject: [PATCH] Hack/fix video mode switching on MVP --- GNUmakefile | 4 ++-- message.h | 2 ++ vepg.cc | 28 ++++++++++++++++++++++++++++ video.cc | 3 +++ videomvp.cc | 3 +-- vvideolivetv.cc | 7 +++++++ 6 files changed, 43 insertions(+), 4 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 7251d23..55d7829 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -142,10 +142,10 @@ install-dev: cp vompclient target-mvp-dev/vompclient debug: - ../../gdb/gdb-6.7/gdb/gdb target-mvp/vompclient target-mvp/core.* + ../../gdb/gdb-7.12.1/gdb/gdb target-mvp/vompclient target-mvp/core.* debug2: - ../../gdb/gdb-6.7/gdb/gdb target-mvp-dev/vompclient target-mvp-dev/core.* + ../../gdb/gdb-7.12.1/gdb/gdb target-mvp-dev/vompclient target-mvp-dev/core.* dev: CXXFLAGS := $(CXXFLAGS_DEV) dev: vompclient diff --git a/message.h b/message.h index 799e505..ccddee0 100644 --- a/message.h +++ b/message.h @@ -82,6 +82,8 @@ class Message const static ULONG MOUSE_SCROLL = 35; const static ULONG NEW_PICTURE = 36; const static ULONG NEW_PICTURE_STATIC = 37; + + const static ULONG HACK_MVP_RETURN_FROM_QUARTER = 999; }; #endif diff --git a/vepg.cc b/vepg.cc index dac571d..bd5e4e7 100644 --- a/vepg.cc +++ b/vepg.cc @@ -465,6 +465,34 @@ 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.cc b/video.cc index 5ab6330..8f8d5f6 100644 --- a/video.cc +++ b/video.cc @@ -63,7 +63,10 @@ bool Video::setVideoDisplay(VideoDisplay display) } switch (applyMode) { case Fullscreen: { +#ifndef VOMP_PLATTFORM_MVP + // Can't run this on a MVP. See vepg.cc ~ line 480 setMode(mode); +#endif } break; case Quarter: { setMode(QUARTER); diff --git a/videomvp.cc b/videomvp.cc index 460fe46..0eead37 100644 --- a/videomvp.cc +++ b/videomvp.cc @@ -170,8 +170,7 @@ int VideoMVP::setMode(UCHAR tmode) if ((tmode != NORMAL) && (tmode != LETTERBOX) && (tmode != UNKNOWN2) && (tmode != QUARTER) && (tmode != EIGHTH) && (tmode != ZOOM) && (tmode != UNKNOWN6)) return 0; - if (tmode==NORMAL || tmode == LETTERBOX) mode = tmode; - + if (tmode==NORMAL || tmode == LETTERBOX || tmode == QUARTER) mode = tmode; if (ioctl(fdVideo, AV_SET_VID_MODE, mode) != 0) return 0; return 1; } diff --git a/vvideolivetv.cc b/vvideolivetv.cc index 32dda9b..3055f68 100644 --- a/vvideolivetv.cc +++ b/vvideolivetv.cc @@ -1215,6 +1215,13 @@ 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() -- 2.39.2