From 75e8272f38e38c48db9fb5d357cb5c7343ef1d59 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Sun, 4 Dec 2005 20:24:55 +0000 Subject: [PATCH] Return to correct video mode after EPG. UP/DOWN trigger VLB --- vdr.cc | 6 +++++- vepg.cc | 7 +++---- video.cc | 5 +++++ video.h | 2 +- vvideolive.cc | 23 +++++++++++++++++------ vvideolive.h | 1 + 6 files changed, 32 insertions(+), 12 deletions(-) diff --git a/vdr.cc b/vdr.cc index 696750b..6eb863a 100644 --- a/vdr.cc +++ b/vdr.cc @@ -510,11 +510,15 @@ int VDR::stopStreaming() return 0; } +printf("sent request\n"); + if (!getPacket()) { pthread_mutex_unlock(&mutex); return 0; } +printf("got reply\n"); + int toReturn = (int)extractULONG(); freePacket(); @@ -634,7 +638,7 @@ EventList* VDR::getChannelSchedule(ULONG number) } EventList* VDR::getChannelSchedule(ULONG number, time_t start, ULONG duration) -{ +{ // retrieve event list (vector of events) from vdr within filter window. duration is in seconds if (!connected) return 0; diff --git a/vepg.cc b/vepg.cc index a28b53b..014a90c 100644 --- a/vepg.cc +++ b/vepg.cc @@ -297,14 +297,13 @@ int VEpg::handleCommand(int command) case Remote::BACK: case Remote::GUIDE: { - // return to normal TV mode TODO vvideolive should handle this (via message?) - Video::getInstance()->setMode(Video::NORMAL); + // return to normal TV mode videoLive->setEpgMode(FALSE); return 4; } case Remote::CHANNELUP: { - // change up channel on live TV TODO vvideolive should handle this + // change up channel on live TV Message* m = new Message(); m->from = this; m->to = videoLive; @@ -313,7 +312,7 @@ int VEpg::handleCommand(int command) return 2; } case Remote::CHANNELDOWN: - { // change down channel on live TV TODO vvideolive should handle this + { // change down channel on live TV Message* m = new Message(); m->from = this; m->to = videoLive; diff --git a/video.cc b/video.cc index ba073d8..c0fc1b5 100644 --- a/video.cc +++ b/video.cc @@ -189,6 +189,11 @@ int Video::setMode(UCHAR tmode) return 1; } +int Video::getMode() +{ + return mode; +} + int Video::signalOff() { if (ioctl(fdVideo, AV_SET_VID_DENC, 0) != 0) return 0; diff --git a/video.h b/video.h index f1d2180..a8106f0 100644 --- a/video.h +++ b/video.h @@ -114,7 +114,7 @@ class Video int test2(); #endif - + int getMode(); int getFD(); UCHAR getFormat(); UINT getScreenWidth(); diff --git a/vvideolive.cc b/vvideolive.cc index 8dfd9c6..5bc2cdb 100644 --- a/vvideolive.cc +++ b/vvideolive.cc @@ -34,6 +34,7 @@ VVideoLive::VVideoLive(ChannelList* tchanList, ULONG tstreamType) unavailableView = NULL; streamType = tstreamType; epgmode=false; + videoMode = Video::getInstance()->getMode(); if (streamType == VDR::RADIO) player = new PlayerVideo(Command::getInstance(), 0, 1); else player = new PlayerVideo(Command::getInstance(), 0, 0); @@ -80,6 +81,13 @@ int VVideoLive::handleCommand(int command) else stop(); return 4; } + // Take up and down from new remote and do live banner + case Remote::UP: + case Remote::DOWN: + { + doBanner(true); + return 2; + } case Remote::DF_UP: case Remote::CHANNELUP: { @@ -292,16 +300,13 @@ void VVideoLive::play(int noShowVLB) void VVideoLive::stop(int noRemoveVLB) { -printf("1\n"); if (unavailable) return; -printf("2\n"); if (!noRemoveVLB && VLiveBanner::getInstance()) viewman->removeView(VLiveBanner::getInstance()); // if live banner is present, remove it. won't cause damage if its not present -printf("3\n"); player->stop(); -printf("4\n"); + Log::getInstance()->log("VVideoLive", Log::DEBUG, "Delay starts here due to time taken by plugin to stop"); vdr->stopStreaming(); -printf("5\n"); + Log::getInstance()->log("VVideoLive", Log::DEBUG, "Delay ends here due to time taken by plugin to stop"); } UINT VVideoLive::upChannel() @@ -348,5 +353,11 @@ void VVideoLive::showEPG() void VVideoLive::setEpgMode(bool mode) { epgmode = mode; -} + // Ok so we do need this function + // but FIXME improve this, integrate with live mode switching from remote + if (mode == FALSE) + { + Video::getInstance()->setMode(videoMode); + } +} diff --git a/vvideolive.h b/vvideolive.h index 0f496b4..2d865c6 100644 --- a/vvideolive.h +++ b/vvideolive.h @@ -92,6 +92,7 @@ class VVideoLive : public View int xpos; bool epgmode; void showEPG(); + int videoMode; }; #endif -- 2.39.2