Ticket #4901: 4901-v1.patch
| File 4901-v1.patch, 4.3 KB (added by , 18 years ago) |
|---|
-
libs/libmythtv/NuppelVideoPlayer.cpp
6971 6971 ClearAfterSeek(true); 6972 6972 } 6973 6973 6974 static QString toString(const QRect &rect) 6975 { 6976 return QString("@%1,%2 %3x%4") 6977 .arg(rect.x()).arg(rect.y()).arg(rect.width()).arg(rect.height()); 6978 } 6979 6974 6980 void NuppelVideoPlayer::DisplayDVDButton(void) 6975 6981 { 6976 6982 if (!ringBuffer->InDVDMenuOrStillFrame() || !osd) … … 7030 7036 } 7031 7037 7032 7038 // scale highlight image to match OSD size, if required 7033 // TODO FIXME This is pretty bogus, it does not adjust for zooming 7034 // or scaling at all, nor does it account for OSD renderers 7035 // where the OSD resolution != video resolution. 7036 float hmult = osd->GetSubtitleBounds().width() / 7037 (float) video_disp_dim.width(); 7038 float vmult = osd->GetSubtitleBounds().height() / 7039 (float) video_disp_dim.height(); 7039 QRect subbounds = osd->GetSubtitleBounds(); 7040 QRect total, visible; 7041 float visibleAspect, fontScale, themeAspect; 7042 videoOutput->GetOSDBounds( 7043 total, visible, visibleAspect, fontScale, themeAspect); 7040 7044 7041 if ((hmult < 0.99) || (hmult > 1.01) || (vmult < 0.99) || (vmult > 1.01)) 7045 VERBOSE(VB_IMPORTANT, "osd subtitle: " << toString(subbounds)); 7046 VERBOSE(VB_IMPORTANT, "osd total: " << toString(total)); 7047 VERBOSE(VB_IMPORTANT, "osd visible: " << toString(visible)); 7048 VERBOSE(VB_IMPORTANT, "vid total: " << 7049 toString(QRect(QPoint(0,0),video_disp_dim))); 7050 cout<<endl; 7051 7052 float hmult = 1.0f, vmult = 1.0f; 7053 if (video_disp_dim.width() > 0) 7054 hmult = total.width() / (float) video_disp_dim.width(); 7055 if (video_disp_dim.height() > 0) 7056 vmult = total.height() / (float) video_disp_dim.height(); 7057 7058 VERBOSE(VB_IMPORTANT, QString("hmult: %1 vmult: %2") 7059 .arg(hmult).arg(vmult)); 7060 7061 if ((hmult < 0.99) || (hmult > 1.01) || 7062 (vmult < 0.99) || (vmult > 1.01)) 7042 7063 { 7043 7064 btnX = (int) (btnX * hmult); 7044 7065 btnY = (int) (btnY * vmult); … … 7047 7068 7048 7069 hl_button = hl_button.smoothScale(w, h); 7049 7070 } 7050 else 7071 else 7072 { 7051 7073 hmult = vmult = 1.0; 7074 } 7052 7075 7076 int xoff = 0, yoff = 0; 7077 if (visible != total) 7078 { 7079 xoff = total.left() - visible.left(); 7080 yoff = total.top() - visible.top(); 7081 } 7082 7083 btnX = max(0, (int)btnX + xoff); 7084 btnY = max(0, (int)btnY + yoff); 7085 7053 7086 OSDTypeImage* image = new OSDTypeImage(); 7054 7087 image->SetPosition(QPoint(btnX, btnY), hmult, vmult); 7055 7088 image->Load(hl_button); -
libs/libmythtv/videooutbase.cpp
705 705 // { return ((1.0f - r) * a) + (r * b); } 706 706 707 707 /** 708 * \fn VideoOutput::GetVisibleOSDBounds(float&,float& ) const708 * \fn VideoOutput::GetVisibleOSDBounds(float&,float&,float) const 709 709 * \brief Returns visible portions of total OSD bounds 710 710 * \param visible_aspect physical aspect ratio of bounds returned 711 711 * \param font_scaling scaling to apply to fonts -
libs/libmythtv/videooutbase.h
74 74 virtual void Zoom(ZoomDirection direction); 75 75 76 76 virtual void GetDrawSize(int &xoff, int &yoff, int &width, int &height); 77 virtual void GetOSDBounds(QRect & visible, QRect &total,78 float & pixelAspect, float &fontScale,79 float theme aspect) const;77 virtual void GetOSDBounds(QRect &total, QRect &visible, 78 float &visibleAspect, float &fontScale, 79 float themeAspect) const; 80 80 81 81 /// \brief Returns current display's frame refresh period in microseconds. 82 82 /// e.g. 1000000 / frame_rate_in_Hz
