From dc97d34dd65f9356adcc767ab7fc8544001c9602 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 3 Oct 2014 15:54:49 +0200 Subject: [PATCH] Add more flexible video display options --- boxstack.cc | 32 ++++++++++++++++++++++++ boxstack.h | 11 ++++++--- boxx.cc | 24 ++++++++++++++++++ boxx.h | 5 ++++ colour.cc | 11 +++++++++ colour.h | 1 + message.h | 2 +- playermedia.cc | 2 +- vepg.cc | 16 ++++++------ vepglistadvanced.cc | 12 ++++----- vepgsummary.cc | 12 +++++++-- video.cc | 28 +++++++++++++++++++++ video.h | 27 ++++++++++++++++++++- videomvp.cc | 2 +- videomvp.h | 5 +++- videoomx.cc | 59 ++++++++++++++++++++++++++++++++++++--------- videoomx.h | 6 +++++ videowin.cc | 2 +- videowin.h | 5 +++- vvideolivetv.cc | 13 +++++----- vvideorec.cc | 6 +++++ 21 files changed, 235 insertions(+), 46 deletions(-) diff --git a/boxstack.cc b/boxstack.cc index 455439f..cf7890a 100644 --- a/boxstack.cc +++ b/boxstack.cc @@ -63,6 +63,13 @@ int BoxStack::shutdown() return 1; } +int BoxStack::addVideoDisplay(Boxx* box,VideoDisplay vd) +{ + videoStack.push(pair(box,vd)); + Video::getInstance()->setVideoDisplay(vd); + return 1; +} + int BoxStack::add(Boxx* v) { if (!initted) return 0; @@ -77,6 +84,11 @@ int BoxStack::add(Boxx* v) return 0; } boxes[numBoxes++] = v; + VideoDisplay vd; + if (v->getVideoDisplay(vd)) { + Log::getInstance()->log("BoxStack", Log::DEBUG, "Add video display"); + addVideoDisplay(v,vd); + } boxLock.Unlock(); @@ -90,6 +102,7 @@ int BoxStack::add(Boxx* v) int BoxStack::remove(Boxx* toDelete) { if (!initted) return 0; + VideoDisplay *display = NULL; boxLock.Lock(); Log::getInstance()->log("BoxStack", Log::DEBUG, "Locked for remove"); @@ -152,6 +165,10 @@ toDelete->preDelete(); Command::getInstance()->postMessageNoLock(m); } + if (!videoStack.empty() && videoStack.top().first==toDelete) { + videoStack.pop(); + if (!videoStack.empty()) display=&videoStack.top().second; + } boxLock.Unlock(); Log::getInstance()->log("BoxStack", Log::DEBUG, "Unlocked for remove"); @@ -160,6 +177,11 @@ toDelete->preDelete(); // as this box is not in the stack any more, there is no chance for a second delete Log::getInstance()->log("BoxStack", Log::DEBUG, "remove: going to delete boxx %p, num %d", toDelete, numBoxes); delete toDelete; + if (display) { + Log::getInstance()->log("BoxStack", Log::DEBUG, "setVideoDisplay %d %d %d %d %d %d", display->mode, display->fallbackMode, + display->x, display->y, display->width, display->height); + Video::getInstance()->setVideoDisplay(*display); + } return 1; } @@ -431,6 +453,7 @@ void BoxStack::removeAll() // This is pretty silly now that preDelete needs mutex unlocked Boxx* toDel = NULL; + VideoDisplay *display = NULL; while(numBoxes > 1) { @@ -461,12 +484,21 @@ void BoxStack::removeAll() toDel = NULL; } + if (!videoStack.empty() && videoStack.top().first==toDel) { + videoStack.pop(); + if (!videoStack.empty()) display=&videoStack.top().second; + } boxLock.Unlock(); //AVO: do the delete outside the lock to allow for recursive deletes Log::getInstance()->log("BoxStack", Log::DEBUG, "going to delete boxx %p, num=%d", toDel, numBoxes); + if (display) Video::getInstance()->setVideoDisplay(*display); + + if (toDel) delete toDel; } + + } int BoxStack::handleCommand(int command) diff --git a/boxstack.h b/boxstack.h index b0b7156..e730dff 100644 --- a/boxstack.h +++ b/boxstack.h @@ -25,6 +25,7 @@ #include #include #include +#include #ifndef WIN32 #include @@ -35,13 +36,12 @@ #include "boxx.h" #include "region.h" #include "message.h" +#include "video.h" -//using namespace std; -//using namespace __gnu_cxx; // needed for newer compilers? - -typedef list RegionList; +typedef std::list RegionList; +typedef std::stack > VideoDisplayStack; class BoxStack { @@ -71,12 +71,15 @@ class BoxStack Boxx* boxes[20]; int numBoxes; + VideoDisplayStack videoStack; + Mutex boxLock; void deleteBox(int z); void repaintRevealed(int x, Region r); void boxSplit(Region r, int start, int end, int direction, RegionList& rl); + int addVideoDisplay(Boxx*,VideoDisplay); }; #endif diff --git a/boxx.cc b/boxx.cc index da74206..fd697bc 100644 --- a/boxx.cc +++ b/boxx.cc @@ -40,6 +40,8 @@ Boxx::Boxx() area.w = 0; area.h = 0; + vdisplay.mode = None; + paraVSpace = 6; // default gap for drawPara backgroundColourSet = false; @@ -134,6 +136,16 @@ void Boxx::setBackgroundColour(const DrawStyle& Tcolour) backgroundColourSet = true; } +void Boxx::setVideoBackground() +{ + vdisplay.mode=Window; + vdisplay.fallbackMode=Fullscreen; + vdisplay.x=getScreenX(); + vdisplay.y=getScreenY(); + vdisplay.width=getWidth(); + vdisplay.height=getHeight(); +} + void Boxx::setVisible(bool isVisible) { visible = isVisible; @@ -247,6 +259,18 @@ void Boxx::getRootBoxRegion(Region* r) r->h = area.h; } +bool Boxx::getVideoDisplay(VideoDisplay &vd) +{ + for(vector::iterator i = children.begin(); i != children.end(); i++) + { + if ((*i)->getVideoDisplay(vd)) return true; + } + + if (vdisplay.mode==None) return false; + vd=vdisplay; + return true; +} + // Level 1 drawing functions void Boxx::fillColour(const DrawStyle& colour) diff --git a/boxx.h b/boxx.h index 76342e4..5cf60ef 100644 --- a/boxx.h +++ b/boxx.h @@ -32,6 +32,7 @@ using namespace std; #include "surface.h" +#include "video.h" #include "tvmedia.h" #include "osdvector.h" @@ -53,6 +54,7 @@ class Boxx void setGap(UINT gap); void setBackgroundColour(const DrawStyle& colour); void setVisible(bool isVisible); + void setVideoBackground(); // The following are supposed to be abstract functions @@ -91,6 +93,8 @@ class Boxx Region getRegionR(); // Same but as an object void getRootBoxRegion(Region*); + bool getVideoDisplay(VideoDisplay &vd); + // Drawing functions level 1 void fillColour(const DrawStyle & colour); int drawPara(const char* text, int x, int y, const DrawStyle& colour, unsigned int skiplines=0); @@ -144,6 +148,7 @@ class Boxx Boxx* parent; Region area; vector children; + VideoDisplay vdisplay; void setParent(Boxx*); void blt(Region& r); diff --git a/colour.cc b/colour.cc index e062148..05e6f24 100644 --- a/colour.cc +++ b/colour.cc @@ -30,6 +30,7 @@ DrawStyle DrawStyle::BLUE(0, 0, 255); DrawStyle DrawStyle::YELLOW(255, 255, 0); DrawStyle DrawStyle::VIDEOBLUE(0, 0, 150); DrawStyle DrawStyle::VIEWBACKGROUND(0, 0, 100); +DrawStyle DrawStyle::VIEWTRANSPARENTBACKGROUND(0, 0, 100, 128); DrawStyle DrawStyle::TABVIEWBACKGROUND(0, 0, 120); DrawStyle DrawStyle::TITLEBARBACKGROUND(0, 0, 200); DrawStyle DrawStyle::SELECTHIGHLIGHT(240, 250, 80); @@ -57,6 +58,7 @@ Real colours DrawStyle::YELLOW=DrawStyle(255, 255, 0); DrawStyle::VIDEOBLUE=DrawStyle(0, 0, 150); DrawStyle::VIEWBACKGROUND=DrawStyle(0, 0, 100); + DrawStyle::VIEWTRANSPARENTBACKGROUND=DrawStyle(0, 0, 100, 128); DrawStyle::TABVIEWBACKGROUND=DrawStyle(0, 0, 120); DrawStyle::TITLEBARBACKGROUND=DrawStyle(0, 0, 200); DrawStyle::SELECTHIGHLIGHT=DrawStyle(240, 250, 80); @@ -169,6 +171,15 @@ Real colours DrawStyle::VIEWBACKGROUND.x2=0.0; DrawStyle::VIEWBACKGROUND.y2=1.0; + DrawStyle::VIEWTRANSPARENTBACKGROUND=DrawStyle(0, 0, 100, 128); + DrawStyle::VIEWTRANSPARENTBACKGROUND.grad_col[0]=Colour(0,0,160,128); + DrawStyle::VIEWTRANSPARENTBACKGROUND.num_colors=1; + DrawStyle::VIEWTRANSPARENTBACKGROUND.ft=DrawStyle::GradientLinear; + DrawStyle::VIEWTRANSPARENTBACKGROUND.x1=0.0; + DrawStyle::VIEWTRANSPARENTBACKGROUND.y1=0.0; + DrawStyle::VIEWTRANSPARENTBACKGROUND.x2=0.0; + DrawStyle::VIEWTRANSPARENTBACKGROUND.y2=1.0; + DrawStyle::TABVIEWBACKGROUND=DrawStyle(0, 0, 120); diff --git a/colour.h b/colour.h index 9b620f8..28eaf01 100644 --- a/colour.h +++ b/colour.h @@ -93,6 +93,7 @@ public: static DrawStyle DARKGREY; static DrawStyle VIDEOBLUE; static DrawStyle VIEWBACKGROUND; + static DrawStyle VIEWTRANSPARENTBACKGROUND; static DrawStyle TABVIEWBACKGROUND; static DrawStyle TITLEBARBACKGROUND; static DrawStyle SELECTHIGHLIGHT; diff --git a/message.h b/message.h index a8d10d3..c115772 100644 --- a/message.h +++ b/message.h @@ -58,7 +58,7 @@ class Message const static ULONG ADD_VIEW = 12; const static ULONG REDRAW_LANG = 14; const static ULONG EPG = 16; - const static ULONG EPG_CLOSE = 17; + //const static ULONG EPG_CLOSE = 17; // Not needed anymore const static ULONG CHANGED_OPTIONS = 18; const static ULONG CONNECTION_LOST = 19; const static ULONG MOVE_RECORDING = 20; diff --git a/playermedia.cc b/playermedia.cc index 7cd314b..8c79329 100644 --- a/playermedia.cc +++ b/playermedia.cc @@ -649,7 +649,7 @@ void PlayerMedia::call(void* caller) int ypos=(video->getScreenHeight()-demuxer->getVerticalSize())/2; if (ypos < 0) ypos=0; logger->log("PlayerMedia", Log::DEBUG, "setting pos x=%d,y=%d",xpos,ypos); - video->setPosition(xpos,ypos); + //video->setPosition(xpos,ypos); // needs to be fixed } if (video->getTVsize() == Video::ASPECT4X3) diff --git a/vepg.cc b/vepg.cc index 94605e9..76662f2 100644 --- a/vepg.cc +++ b/vepg.cc @@ -173,6 +173,13 @@ VEpg::VEpg(void* tparent, UINT tcurrentChannelIndex, ChannelList* tchanList) ltime = prevHour(<ime); // set ltime to previous hour TODO make this half hour? time(&selTime); // set selTime to now updateEventList(); // get list of programmes + + vdisplay.mode=Window; + vdisplay.fallbackMode=Quarter; + vdisplay.x=Video::getInstance()->getScreenWidth()/2; + vdisplay.y=10; + vdisplay.width=Video::getInstance()->getScreenWidth()/2; + vdisplay.height=Video::getInstance()->getScreenHeight()/2; } void VEpg::preDelete() @@ -454,15 +461,6 @@ int VEpg::handleCommand(int command) case Remote::BACK: case Remote::GUIDE: { - // return to normal TV mode - 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::EPG_CLOSE; - Command::getInstance()->postMessageNoLock(m); - } return 4; } case Remote::CHANNELUP: diff --git a/vepglistadvanced.cc b/vepglistadvanced.cc index f10f17d..cd2bcc4 100644 --- a/vepglistadvanced.cc +++ b/vepglistadvanced.cc @@ -50,10 +50,10 @@ VEpgListAdvanced::VEpgListAdvanced(VVideoLiveTV *tvideolive, ChannelList* tchanL mode = OneChannel; - setSize(640, 500); //old setSize(570, 420); + setSize(640+40, 500+40); //old setSize(570, 420); createBuffer(); - setPosition(40, 40); + setPosition(20, 20); setTitleBarOn(1); setTitleBarColour(DrawStyle::TITLEBARBACKGROUND); @@ -70,7 +70,8 @@ VEpgListAdvanced::VEpgListAdvanced(VVideoLiveTV *tvideolive, ChannelList* tchanL epg.setSize(area.w -slarea.x -slarea.w -10, area.h - 30 - 15 - 30); add(&epg); epg.setText(""); - epg.setBackgroundColour(DrawStyle::VIEWBACKGROUND); + epg.setVideoBackground(); + epg.setBackgroundColour(DrawStyle::VIEWTRANSPARENTBACKGROUND); epgTVmedia.setPosition(epg.getRegionR().w-100-10,10); epgTVmedia.setSize(100,150/Osd::getInstance()->getPixelAspect()); @@ -279,7 +280,6 @@ void VEpgListAdvanced::doRecord() current->duration, current->title); VEpgSetTimer* vs = new VEpgSetTimer(current, chan); vs->draw(); - BoxStack *boxstack=BoxStack::getInstance(); boxstack->add(vs); boxstack->update(vs); } @@ -288,9 +288,7 @@ void VEpgListAdvanced::doRecord() void VEpgListAdvanced::doGrid() { - Video* video=Video::getInstance(); - video->setMode(Video::QUARTER); - video->setPosition(170, 5); //TODO add stack for these changes + if (mode!=OneChannel) { Channel * chan=(*chanList)[ sl.getCurrentOptionData()]; channelNumber = chan->number; diff --git a/vepgsummary.cc b/vepgsummary.cc index 796a700..9784513 100644 --- a/vepgsummary.cc +++ b/vepgsummary.cc @@ -48,7 +48,7 @@ VEpgSummary::VEpgSummary(Event *tevent, Channel* tchannel) if (Video::getInstance()->getFormat() == Video::PAL) { - setSize(640, 500); + setSize(640+40, 500+40); createBuffer(); } else @@ -56,7 +56,7 @@ VEpgSummary::VEpgSummary(Event *tevent, Channel* tchannel) setSize(560, 400); createBuffer(); } - setPosition(40, 40); + setPosition(20, 20); setTitleBarOn(1); setBorderOn(1); @@ -86,34 +86,42 @@ VEpgSummary::VEpgSummary(Event *tevent, Channel* tchannel) summary->setText(summary_text.c_str()); OsdVector *osdv=dynamic_cast(Osd::getInstance()); + summary->setBackgroundColour(DrawStyle::VIEWTRANSPARENTBACKGROUND); tabbar.addTab(tr("EPG"), summary); + summary->setVideoBackground(); WMovieView *movieview=NULL; WSeriesView *seriesview=NULL; if (event->movieInfo) { movieview = new WMovieView(event->movieInfo); movieview->setParaMode(true); + movieview->setBackgroundColour(DrawStyle::VIEWTRANSPARENTBACKGROUND); tabbar.addTab(tr("TheTVDB Info"), movieview); if (osdv) { if (event->movieInfo->actors.size() > 0 && osdv) { WActorGallery *gallery= new WActorGallery(event->movieInfo->actors); + gallery->setBackgroundColour(DrawStyle::VIEWTRANSPARENTBACKGROUND); tabbar.addTab(tr("Cast"),gallery); } WArtworkGallery *artgallery= new WArtworkGallery(*event->movieInfo); + artgallery->setBackgroundColour(DrawStyle::VIEWTRANSPARENTBACKGROUND); tabbar.addTab(tr("Gallery"),artgallery); } } else if (event->seriesInfo) { seriesview = new WSeriesView(event->seriesInfo); seriesview->setParaMode(true); + seriesview->setBackgroundColour(DrawStyle::VIEWTRANSPARENTBACKGROUND); tabbar.addTab(tr("TheTVDB Info"), seriesview); if (osdv) { if (event->seriesInfo->actors.size() > 0 && osdv) { WActorGallery *gallery= new WActorGallery(event->seriesInfo->actors); + gallery->setBackgroundColour(DrawStyle::VIEWTRANSPARENTBACKGROUND); tabbar.addTab(tr("Cast"),gallery); } WArtworkGallery *artgallery= new WArtworkGallery(*event->seriesInfo); + artgallery->setBackgroundColour(DrawStyle::VIEWTRANSPARENTBACKGROUND); tabbar.addTab(tr("Gallery"),artgallery); } diff --git a/video.cc b/video.cc index 2c8bb56..ae406e9 100644 --- a/video.cc +++ b/video.cc @@ -52,6 +52,34 @@ Video* Video::getInstance() { return instance; } + +// For legacy implementations +bool Video::setVideoDisplay(VideoDisplay display) +{ + VideoMode applyMode=display.mode; + if (display.mode==Window || display.mode == None) { + if (display.fallbackMode == None || display.fallbackMode == Window) return false; // No Effect + applyMode=display.fallbackMode; + } + switch (applyMode) { + case Fullscreen: { + setMode(mode); + } break; + case Quarter: { + setMode(QUARTER); + setPosition(display.x/2, display.y/2); + }break; + case Eighth: { + setMode(EIGHTH); + setPosition(display.x/2, display.y/2); + } break; + case Window: + case None: return false; break; //Stupid + } + return true; + +} + /* void Video::setInstance(Video* inst) { diff --git a/video.h b/video.h index 5624421..3dcc0ce 100644 --- a/video.h +++ b/video.h @@ -34,6 +34,22 @@ typedef struct _hmsf UINT frames; } hmsf; +enum VideoMode { + 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; +} VideoDisplay; + class Video: public DrainTarget, public AbstractOption { public: @@ -56,7 +72,6 @@ class Video: public DrainTarget, public AbstractOption virtual void executePendingModeChanges() {}; // This is called if you change the output mode and the device take a while for reinitialization virtual int setDefaultAspect()=0; virtual int setSource()=0; - virtual int setPosition(int x, int y)=0; virtual int sync()=0; virtual int play()=0; virtual int stop()=0; @@ -109,6 +124,10 @@ class Video: public DrainTarget, public AbstractOption virtual UCHAR getTVsize() { return tvsize; } + virtual bool setVideoDisplay(VideoDisplay display); + + + //hmsf framesToHMSF(ULONG frames,double fps); // UINT getFPS(); //removed @@ -161,7 +180,12 @@ class Video: public DrainTarget, public AbstractOption const static UCHAR ZOOM = 5; const static UCHAR UNKNOWN6 = 6; + + + protected: + + virtual int setPosition(int x, int y){return 0;}; //legacy api do not use, use setVideoDisplay instead static Video* instance; int initted; int fdVideo; @@ -172,6 +196,7 @@ class Video: public DrainTarget, public AbstractOption UCHAR aspectRatio; int parx,pary; UCHAR mode; + bool h264; UINT screenWidth; diff --git a/videomvp.cc b/videomvp.cc index 8820fe9..460fe46 100644 --- a/videomvp.cc +++ b/videomvp.cc @@ -170,7 +170,7 @@ int VideoMVP::setMode(UCHAR tmode) if ((tmode != NORMAL) && (tmode != LETTERBOX) && (tmode != UNKNOWN2) && (tmode != QUARTER) && (tmode != EIGHTH) && (tmode != ZOOM) && (tmode != UNKNOWN6)) return 0; - mode = tmode; + if (tmode==NORMAL || tmode == LETTERBOX) mode = tmode; if (ioctl(fdVideo, AV_SET_VID_MODE, mode) != 0) return 0; return 1; diff --git a/videomvp.h b/videomvp.h index 7b093c4..7e9d440 100644 --- a/videomvp.h +++ b/videomvp.h @@ -119,7 +119,6 @@ class VideoMVP : public Video int setTVsize(UCHAR size); // Is the TV a widescreen? int setDefaultAspect(); int setSource(); - int setPosition(int x, int y); int sync(); int play(); int stop(); @@ -148,6 +147,10 @@ class VideoMVP : public Video int test2(); #endif + + protected: + int setPosition(int x, int y); // legacy api do not use + private: int checkSCART(); void setLetterboxBorder(char* border); diff --git a/videoomx.cc b/videoomx.cc index 6298602..a1017d9 100644 --- a/videoomx.cc +++ b/videoomx.cc @@ -539,11 +539,49 @@ int VideoOMX::setAspectRatio(UCHAR taspectRatio, int tparx,int tpary) int VideoOMX::setMode(UCHAR tmode) { if (!initted) return 0; - mode=tmode; + if (tmode==LETTERBOX || tmode==NORMAL) mode=tmode; updateMode(); return 1; } +bool VideoOMX::setVideoDisplay(VideoDisplay display) +{ + if (!initted) return false; + switch (display.mode) + { + case None: return true; //?? + case Fullscreen: { + windowed = false; + + } break; + case Quarter: { + windowed =true; + xpos = ((float) display.x) / ((float) screenWidth); + ypos = ((float) display.y) / ((float) screenHeight); + width = 0.5f; + height = 0.5f; + } break; + + case Eighth: { + windowed =true; + xpos = ((float) display.x) / ((float) screenWidth); + ypos = ((float) display.y) / ((float) screenHeight); + width = 0.25f; + height = 0.25f; + } break; + + case Window: { + windowed =true; + xpos = ((float) display.x) / ((float) screenWidth); + ypos = ((float) display.y) / ((float) screenHeight); + width = ((float) display.width) / ((float) screenWidth); + height = ((float) display.height) / ((float) screenHeight); + }break; + } + updateMode(); + return true; +} + void VideoOMX::updateMode() { @@ -586,7 +624,7 @@ void VideoOMX::updateMode() dispconf.set = OMX_DISPLAY_SET_FULLSCREEN; - if (mode != QUARTER && mode != EIGHTH) { + if (!windowed) { //Set Fullscreen dispconf.fullscreen = OMX_TRUE; } else { @@ -602,7 +640,7 @@ void VideoOMX::updateMode() } dispconf.set = OMX_DISPLAY_SET_MODE; - if (mode != QUARTER && mode != EIGHTH) { + if (!windowed) { dispconf.mode = (mode == NORMAL) ? OMX_DISPLAY_MODE_FILL : OMX_DISPLAY_MODE_LETTERBOX; } else { @@ -617,7 +655,7 @@ void VideoOMX::updateMode() return; } - if (mode == QUARTER || mode == EIGHTH) { + if (windowed) { unsigned int display_width, display_height; display_width = display_height = 0; if (graphics_get_display_size(0, &display_width, &display_height) @@ -633,13 +671,12 @@ void VideoOMX::updateMode() = (int) (xpos * ((float) display_width)); dispconf.dest_rect.y_offset = (int) (ypos * ((float) display_height)); - if (mode == QUARTER) { - dispconf.dest_rect.width = display_width >> 1; - dispconf.dest_rect.height = display_height >> 1; - } else if (mode == EIGHTH) { - dispconf.dest_rect.width = display_width >> 2; - dispconf.dest_rect.height = display_height >> 2; - } + dispconf.dest_rect.width = (int) (width * ((float) display_width)); + dispconf.dest_rect.height = (int) (height * ((float) display_height)); + Log::getInstance()->log("Video", Log::DEBUG, + "Set dest_rect as %d %d %d %d", dispconf.dest_rect.x_offset,dispconf.dest_rect.y_offset, + dispconf.dest_rect.width , dispconf.dest_rect.height); + error = OMX_SetParameter(omx_vid_rend, OMX_IndexConfigDisplayRegion, &dispconf); if (error != OMX_ErrorNone) { diff --git a/videoomx.h b/videoomx.h index 8e72a51..69fd5ee 100644 --- a/videoomx.h +++ b/videoomx.h @@ -85,6 +85,7 @@ class VideoOMX : public Video 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); + bool setVideoDisplay(VideoDisplay display); int setTVsize(UCHAR size); // Is the TV a widescreen? UCHAR getTVsize(); @@ -288,9 +289,12 @@ class VideoOMX : public Video bool omx_mpeg2; bool omx_h264; float xpos,ypos; + float width, height; + bool windowed; int deinterlace; void updateMode();//called internally to adjust for different parameters void selectVideoMode(int interlaced); + UCHAR tvsystem; bool signalon; bool pendingmodechange; @@ -300,6 +304,8 @@ class VideoOMX : public Video + + bool firstsynched; diff --git a/videowin.cc b/videowin.cc index dcde4aa..2b1de80 100644 --- a/videowin.cc +++ b/videowin.cc @@ -203,7 +203,7 @@ int VideoWin::setMode(UCHAR tmode) if ((tmode != NORMAL) && (tmode != LETTERBOX) && (tmode != UNKNOWN2) && (tmode != QUARTER) && (tmode != EIGHTH) && (tmode != ZOOM) && (tmode != UNKNOWN6)) return 0; - mode = tmode; + if (tmode==NORMAL || tmode == LETTERBOX) mode = tmode; videoposx=0; videoposy=0; AdjustWindow(); diff --git a/videowin.h b/videowin.h index 7e43236..7919973 100644 --- a/videowin.h +++ b/videowin.h @@ -72,7 +72,6 @@ public: int setTVsize(UCHAR size); // Is the TV a widescreen? int setDefaultAspect(); int setSource(); - int setPosition(int x, int y); int sync(); int play(); int dsplay(); @@ -163,6 +162,10 @@ public: int test(); int test2(); #endif +protected: + int setPosition(int x, int y); // legacy api remove +#error Port the new api + private: int EnterIframePlayback(); #ifdef NEW_DS_MECHANISMENS diff --git a/vvideolivetv.cc b/vvideolivetv.cc index 5d84cac..96bcdf9 100644 --- a/vvideolivetv.cc +++ b/vvideolivetv.cc @@ -272,6 +272,13 @@ VVideoLiveTV::VVideoLiveTV(ChannelList* tchanList, ULONG initialChannelNumber, V Region r1 = summary.getRegionR(); Region r2 = osd.getRegionR(); osdSummaryRegion = r1 + r2; + + vdisplay.mode=Fullscreen; + vdisplay.fallbackMode=Fullscreen; + vdisplay.x=0; + vdisplay.y=0; + vdisplay.width=0; + vdisplay.height=0; } void VVideoLiveTV::preDelete() @@ -731,8 +738,6 @@ void VVideoLiveTV::doEPG() if (osd.getVisible()) clearScreen(); if (!Command::getInstance()->advMenues()) { - video->setMode(Video::QUARTER); - video->setPosition(170, 5); //TODO need to deal with 4:3 switching VEpg* vepg = new VEpg(this, currentChannelIndex, chanList); vepg->draw(); @@ -1076,10 +1081,6 @@ void VVideoLiveTV::processMessage(Message* m) osdChannelIndex = currentChannelIndex; if (m->tag == 1) displayOSD(true); } - else if (m->message == Message::EPG_CLOSE) - { - video->setMode(videoMode); - } else if (m->message == Message::CHILD_CLOSE) { if (m->from == vas) diff --git a/vvideorec.cc b/vvideorec.cc index e813b63..1aee6d4 100644 --- a/vvideorec.cc +++ b/vvideorec.cc @@ -131,6 +131,12 @@ VVideoRec::VVideoRec(Recording* rec, bool ish264) wssRegion.h = 300; } #endif + vdisplay.mode=Fullscreen; + vdisplay.fallbackMode=Fullscreen; + vdisplay.x=0; + vdisplay.y=0; + vdisplay.width=0; + vdisplay.height=0; } void VVideoRec::preDelete() -- 2.39.5