MythTV  master
videooutwindow.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) Daniel Kristjansson, Jens Rehaag 2008
3  *
4  * This class encapsulates some of the video framing information,
5  * so that a VideoOutput class can have multiple concurrent video
6  * windows displayed at any one time.
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 // Qt
24 #include <QApplication>
25 
26 // MythtTV
27 #include "mythconfig.h"
28 #include "mythmiscutil.h"
29 #include "osd.h"
30 #include "mythplayer.h"
31 #include "videodisplayprofile.h"
32 #include "decoderbase.h"
33 #include "mythcorecontext.h"
34 #include "videooutwindow.h"
35 
36 // Std
37 #include <cmath>
38 
39 #define LOC QString("VideoWin: ")
40 
41 #define SCALED_RECT(SRC, SCALE) QRect{ static_cast<int>((SRC).left() * (SCALE)), \
42  static_cast<int>((SRC).top() * (SCALE)), \
43  static_cast<int>((SRC).width() * (SCALE)), \
44  static_cast<int>((SRC).height() * (SCALE)) }
45 
46 static float fix_aspect(float raw);
47 static float snap(float value, float snapto, float diff);
48 
54 
56 {
57  m_dbPipSize = gCoreContext->GetNumSetting("PIPSize", 26);
58 
59  m_dbMove = QPoint(gCoreContext->GetNumSetting("xScanDisplacement", 0),
60  gCoreContext->GetNumSetting("yScanDisplacement", 0));
61  m_dbUseGUISize = gCoreContext->GetBoolSetting("GuiSizeForTV", false);
62 }
63 
64 void VideoOutWindow::ScreenChanged(QScreen */*screen*/)
65 {
67  MoveResize();
68 }
69 
71 {
72  // PopulateGeometry will update m_devicePixelRatio
75  MoveResize();
76 }
77 
79 {
80  if (!m_display)
81  return;
82 
83  QScreen *screen = m_display->GetCurrentScreen();
84  if (!screen)
85  return;
86 
87 #ifdef Q_OS_MACOS
88  m_devicePixelRatio = screen->devicePixelRatio();
89 #endif
90 
92  {
93  m_screenGeometry = screen->virtualGeometry();
94  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Window using all screens %1x%2")
95  .arg(m_screenGeometry.width()).arg(m_screenGeometry.height()));
96  return;
97  }
98 
99  m_screenGeometry = screen->geometry();
100  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Window using screen %1 %2x%3")
101  .arg(screen->name()).arg(m_screenGeometry.width()).arg(m_screenGeometry.height()));
102 }
103 
115 {
116  // for 'portrait' mode, rotate the 'screen' dimensions
117  float tempdisplayaspect = m_displayAspect;
118  bool rotate = (m_rotation == 90) || (m_rotation == -90);
119  if (rotate)
120  Rotate();
121 
122  // Preset all image placement and sizing variables.
123  m_videoRect = QRect(QPoint(0, 0), m_videoDispDim);
125 
126  // Apply various modifications
130 
131  // Interactive TV (MHEG) embedding
132  if (m_itvResizing)
134 
135  // and switch back
136  if (rotate)
137  Rotate();
138  m_displayAspect = tempdisplayaspect;
139 
141 
142  // TODO fine tune when these are emitted - it is not enough to just check whether the values
143  // have changed
148 }
149 
160 {
161  m_dbMove = QPoint(m_dbMove.y(), m_dbMove.x());
162  float temp = m_dbHorizScale;
164  m_dbVertScale = temp;
165  temp = m_manualHorizScale;
167  m_manualVertScale = temp;
168  m_manualMove = QPoint(m_manualMove.y(), m_manualMove.x());
170 
171  m_displayVisibleRect = QRect(QPoint(m_displayVisibleRect.top(), m_displayVisibleRect.left()),
172  QSize(m_displayVisibleRect.height(), m_displayVisibleRect.width()));
173  m_displayVideoRect = QRect(QPoint(m_displayVideoRect.top(), m_displayVideoRect.left()),
174  QSize(m_displayVideoRect.height(), m_displayVideoRect.width()));
183 }
184 
195 {
196  if (m_dbVertScale > 0)
197  {
198  // Veritcal overscan. Move the Y start point in original image.
199  float tmp = 1.0F - 2.0F * m_dbVertScale;
200  m_videoRect.moveTop(qRound(m_videoRect.height() * m_dbVertScale));
201  m_videoRect.setHeight(qRound(m_videoRect.height() * tmp));
202 
203  // If there is an offset, apply it now that we have a room.
204  int yoff = m_dbMove.y();
205  if (yoff > 0)
206  {
207  // To move the image down, move the start point up.
208  // Don't offset the image more than we have overscanned.
209  yoff = min(m_videoRect.top(), yoff);
210  m_videoRect.moveTop(m_videoRect.top() - yoff);
211  }
212  else if (yoff < 0)
213  {
214  // To move the image up, move the start point down.
215  // Don't offset the image more than we have overscanned.
216  if (abs(yoff) > m_videoRect.top())
217  yoff = 0 - m_videoRect.top();
218  m_videoRect.moveTop(m_videoRect.top() - yoff);
219  }
220  }
221  else if (m_dbVertScale < 0)
222  {
223  // Vertical underscan. Move the starting Y point in the display window.
224  // Use the abolute value of scan factor.
225  float vscanf = fabs(m_dbVertScale);
226  float tmp = 1.0F - 2.0F * vscanf;
227 
228  m_displayVideoRect.moveTop(qRound(m_displayVisibleRect.height() * vscanf) + m_displayVisibleRect.top());
229  m_displayVideoRect.setHeight(qRound(m_displayVisibleRect.height() * tmp));
230 
231  // Now offset the image within the extra blank space created by
232  // underscanning. To move the image down, increase the Y offset
233  // inside the display window.
234  int yoff = m_dbMove.y();
235  if (yoff > 0)
236  {
237  // Don't offset more than we have underscanned.
238  yoff = min(m_displayVideoRect.top(), yoff);
239  m_displayVideoRect.moveTop(m_displayVideoRect.top() + yoff);
240  }
241  else if (yoff < 0)
242  {
243  // Don't offset more than we have underscanned.
244  if (abs(yoff) > m_displayVideoRect.top())
245  yoff = 0 - m_displayVideoRect.top();
246  m_displayVideoRect.moveTop(m_displayVideoRect.top() + yoff);
247  }
248  }
249 
250  // Horizontal.. comments, same as vertical...
251  if (m_dbHorizScale > 0)
252  {
253  float tmp = 1.0F - 2.0F * m_dbHorizScale;
254  m_videoRect.moveLeft(qRound(m_videoDispDim.width() * m_dbHorizScale));
255  m_videoRect.setWidth(qRound(m_videoDispDim.width() * tmp));
256 
257  int xoff = m_dbMove.x();
258  if (xoff > 0)
259  {
260  xoff = min(m_videoRect.left(), xoff);
261  m_videoRect.moveLeft(m_videoRect.left() - xoff);
262  }
263  else if (xoff < 0)
264  {
265  if (abs(xoff) > m_videoRect.left())
266  xoff = 0 - m_videoRect.left();
267  m_videoRect.moveLeft(m_videoRect.left() - xoff);
268  }
269  }
270  else if (m_dbHorizScale < 0)
271  {
272  float hscanf = fabs(m_dbHorizScale);
273  float tmp = 1.0F - 2.0F * hscanf;
274 
275  m_displayVideoRect.moveLeft(qRound(m_displayVisibleRect.width() * hscanf) + m_displayVisibleRect.left());
276  m_displayVideoRect.setWidth(qRound(m_displayVisibleRect.width() * tmp));
277 
278  int xoff = m_dbMove.x();
279  if (xoff > 0)
280  {
281  xoff = min(m_displayVideoRect.left(), xoff);
282  m_displayVideoRect.moveLeft(m_displayVideoRect.left() + xoff);
283  }
284  else if (xoff < 0)
285  {
286  if (abs(xoff) > m_displayVideoRect.left())
287  xoff = 0 - m_displayVideoRect.left();
288  m_displayVideoRect.moveLeft(m_displayVideoRect.left() + xoff);
289  }
290  }
291 
292 }
293 
298 {
299  if ((m_manualVertScale != 1.0F) || (m_manualHorizScale != 1.0F))
300  {
301  QSize newsz = QSize(qRound(m_displayVideoRect.width() * m_manualHorizScale),
302  qRound(m_displayVideoRect.height() * m_manualVertScale));
303  QSize tmp = (m_displayVideoRect.size() - newsz) / 2;
304  QPoint chgloc = QPoint(tmp.width(), tmp.height());
305  QPoint newloc = m_displayVideoRect.topLeft() + chgloc;
306 
307  m_displayVideoRect = QRect(newloc, newsz);
308  }
309 
310  if (m_manualMove.y())
311  {
312  int move_vert = m_manualMove.y() * m_displayVideoRect.height() / 100;
313  m_displayVideoRect.moveTop(m_displayVideoRect.top() + move_vert);
314  }
315 
316  if (m_manualMove.x())
317  {
318  int move_horiz = m_manualMove.x() * m_displayVideoRect.width() / 100;
319  m_displayVideoRect.moveLeft(m_displayVideoRect.left() + move_horiz);
320  }
321 }
322 
323 // Code should take into account the aspect ratios of both the video as
324 // well as the actual screen to allow proper letterboxing to take place.
326 {
327  float disp_aspect = fix_aspect(GetDisplayAspect());
328  float aspect_diff = disp_aspect - m_videoAspectOverride;
329  bool aspects_match = abs(aspect_diff / disp_aspect) <= 0.02F;
330  bool nomatch_with_fill = !aspects_match && ((kAdjustFill_HorizontalStretch == m_adjustFill) ||
332  bool nomatch_without_fill = (!aspects_match) && !nomatch_with_fill;
333 
334  // Adjust for video/display aspect ratio mismatch
335  if (nomatch_with_fill && (disp_aspect > m_videoAspectOverride))
336  {
337  int pixNeeded = qRound(((disp_aspect / m_videoAspectOverride) * static_cast<float>(m_displayVideoRect.height())));
338  m_displayVideoRect.moveTop(m_displayVideoRect.top() + (m_displayVideoRect.height() - pixNeeded) / 2);
339  m_displayVideoRect.setHeight(pixNeeded);
340  }
341  else if (nomatch_with_fill)
342  {
343  int pixNeeded = qRound(((m_videoAspectOverride / disp_aspect) * static_cast<float>(m_displayVideoRect.width())));
344  m_displayVideoRect.moveLeft(m_displayVideoRect.left() + (m_displayVideoRect.width() - pixNeeded) / 2);
345  m_displayVideoRect.setWidth(pixNeeded);
346  }
347  else if (nomatch_without_fill && (disp_aspect > m_videoAspectOverride))
348  {
349  int pixNeeded = qRound(((m_videoAspectOverride / disp_aspect) * static_cast<float>(m_displayVideoRect.width())));
350  m_displayVideoRect.moveLeft(m_displayVideoRect.left() + (m_displayVideoRect.width() - pixNeeded) / 2);
351  m_displayVideoRect.setWidth(pixNeeded);
352  }
353  else if (nomatch_without_fill)
354  {
355  int pixNeeded = qRound(((disp_aspect / m_videoAspectOverride) * static_cast<float>(m_displayVideoRect.height())));
356  m_displayVideoRect.moveTop(m_displayVideoRect.top() + (m_displayVideoRect.height() - pixNeeded) / 2);
357  m_displayVideoRect.setHeight(pixNeeded);
358  }
359 
360  // Process letterbox zoom modes
362  {
363  // Zoom mode -- Expand by 4/3 and overscan.
364  // 1/6 of original is 1/8 of new
365  m_displayVideoRect = QRect(
366  m_displayVideoRect.left() - (m_displayVideoRect.width() / 6),
367  m_displayVideoRect.top() - (m_displayVideoRect.height() / 6),
368  m_displayVideoRect.width() * 4 / 3,
369  m_displayVideoRect.height() * 4 / 3);
370  }
371  else if (m_adjustFill == kAdjustFill_Half)
372  {
373  // Zoom mode -- Expand by 7/6 and overscan.
374  // Intended for eliminating the top bars on 14:9 material.
375  // Also good compromise for 4:3 material on 16:9 screen.
376  // Expanding by 7/6, so remove 1/6 of original from overscan;
377  // take half from each side, so remove 1/12.
378  m_displayVideoRect = QRect(
379  m_displayVideoRect.left() - (m_displayVideoRect.width() / 12),
380  m_displayVideoRect.top() - (m_displayVideoRect.height() / 12),
381  m_displayVideoRect.width() * 7 / 6,
382  m_displayVideoRect.height() * 7 / 6);
383  }
385  {
386  // Horizontal Stretch mode -- 1/6 of original is 1/8 of new
387  // Intended to be used to eliminate side bars on 4:3 material
388  // encoded to 16:9.
389  m_displayVideoRect.moveLeft(
390  m_displayVideoRect.left() - (m_displayVideoRect.width() / 6));
391 
392  m_displayVideoRect.setWidth(m_displayVideoRect.width() * 4 / 3);
393  }
395  {
396  // Vertical Stretch mode -- 1/6 of original is 1/8 of new
397  // Intended to be used to eliminate top/bottom bars on 16:9
398  // material encoded to 4:3.
399  m_displayVideoRect.moveTop(
400  m_displayVideoRect.top() - (m_displayVideoRect.height() / 6));
401 
402  m_displayVideoRect.setHeight(m_displayVideoRect.height() * 4 / 3);
403  }
404  else if (m_adjustFill == kAdjustFill_VerticalFill && m_displayVideoRect.height() > 0)
405  {
406  // Video fills screen vertically. May be cropped left and right
407  float factor = static_cast<float>(m_displayVisibleRect.height()) / static_cast<float>(m_displayVideoRect.height());
408  QSize newsize = QSize(qRound(m_displayVideoRect.width() * factor),
409  qRound(m_displayVideoRect.height() * factor));
410  QSize temp = (m_displayVideoRect.size() - newsize) / 2;
411  QPoint newloc = m_displayVideoRect.topLeft() + QPoint(temp.width(), temp.height());
412  m_displayVideoRect = QRect(newloc, newsize);
413  }
415  {
416  // Video fills screen horizontally. May be cropped top and bottom
417  float factor = static_cast<float>(m_displayVisibleRect.width()) /
418  static_cast<float>(m_displayVideoRect.width());
419  QSize newsize = QSize(qRound(m_displayVideoRect.width() * factor),
420  qRound(m_displayVideoRect.height() * factor));
421  QSize temp = (m_displayVideoRect.size() - newsize) / 2;
422  QPoint newloc = m_displayVideoRect.topLeft() + QPoint(temp.width(), temp.height());
423  m_displayVideoRect = QRect(newloc, newsize);
424  }
425 }
426 
427 bool VideoOutWindow::Init(const QSize &VideoDim, const QSize &VideoDispDim,
428  float Aspect, const QRect &WindowRect,
430 {
431  if (!m_display && Display)
432  {
433  m_display = Display;
435 #ifdef Q_OS_MACOS
437 #endif
438  }
439 
440  if (m_display)
441  {
442  QString dummy;
443  m_displayAspect = static_cast<float>(m_display->GetAspectRatio(dummy));
444  }
445 
446  // Refresh the geometry in case the video mode has changed
448 
449  // N.B. we are always confined to the window size so use that for the initial
450  // displayVisibleRect
451  m_rawWindowRect = WindowRect;
453 
454  int pbp_width = m_displayVisibleRect.width() / 2;
456  m_displayVisibleRect.setWidth(pbp_width);
457 
458  if (m_pipState == kPBPRight)
459  m_displayVisibleRect.moveLeft(pbp_width);
460 
461  m_videoDispDim = Fix1088(VideoDispDim);
462  m_videoDim = VideoDim;
463  m_videoRect = QRect(m_displayVisibleRect.topLeft(), m_videoDispDim);
464 
465  if (m_pipState > kPIPOff)
466  {
469  }
470  else
471  {
474  }
475  m_embedding = false;
476  SetVideoAspectRatio(Aspect);
477  MoveResize();
478  return true;
479 }
480 
482 {
483  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Window Rect: %1x%2+%3+%4")
484  .arg(m_windowRect.width()).arg(m_windowRect.height())
485  .arg(m_windowRect.left()).arg(m_windowRect.top()));
486  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Display Rect: %1x%2+%3+%4 Aspect: %5")
487  .arg(m_displayVideoRect.width()).arg(m_displayVideoRect.height())
488  .arg(m_displayVideoRect.left()).arg(m_displayVideoRect.top())
489  .arg(static_cast<qreal>(fix_aspect(GetDisplayAspect()))));
490  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Video Rect: %1x%2+%3+%4 Aspect: %5")
491  .arg(m_videoRect.width()).arg(m_videoRect.height())
492  .arg(m_videoRect.left()).arg(m_videoRect.top())
493  .arg(static_cast<qreal>(m_videoAspectOverride)));
494 }
495 
504 {
505  m_videoAspect = aspect;
507 }
508 
515 {
516  if (!qFuzzyCompare(Aspect, m_videoAspect))
517  {
518  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("New video aspect ratio: '%1'")
519  .arg(static_cast<double>(Aspect)));
520  SetVideoAspectRatio(Aspect);
521  MoveResize();
522  }
523 }
524 
530 void VideoOutWindow::InputChanged(const QSize &VideoDim, const QSize &VideoDispDim, float Aspect)
531 {
532  if (Aspect < 0.0F)
533  Aspect = m_videoAspect;
534 
535  QSize newvideodispdim = Fix1088(VideoDispDim);
536 
537  if (!((VideoDim == m_videoDim) && (newvideodispdim == m_videoDispDim) &&
538  qFuzzyCompare(Aspect + 100.0F, m_videoAspect + 100.0F)))
539  {
540  m_videoDispDim = newvideodispdim;
541  m_videoDim = VideoDim;
542  SetVideoAspectRatio(Aspect);
543  LOG(VB_PLAYBACK, LOG_INFO, LOC +
544  QString("New video parameters: Size %1x%2 DisplaySize: %3x%4 Aspect: %5")
545  .arg(m_videoDim.width()).arg(m_videoDim.height())
546  .arg(m_videoDispDim.width()).arg(m_videoDispDim.height())
547  .arg(static_cast<double>(m_videoAspect)));
548  MoveResize();
549  }
550 }
551 
552 QSize VideoOutWindow::Fix1088(QSize Dimensions)
553 {
554  QSize result = Dimensions;
555  // 544 represents a 1088 field
556  if (result.width() == 1920 || result.width() == 1440)
557  {
558  if (result.height() == 1088)
559  result.setHeight(1080);
560  else if (result.height() == 544)
561  result.setHeight(540);
562  }
563  return result;
564 }
565 
571 {
572  return { QPoint(0, 0), m_videoDispDim };
573 }
574 
582 {
584  AdjustFill = static_cast<AdjustFillMode>((m_adjustFill + 1) % kAdjustFill_END);
585  if (m_adjustFill != AdjustFill)
586  {
588  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("New fill mode: '%1'").arg(toString(m_adjustFill)));
589  MoveResize();
590  }
591 }
592 
597 {
598  float oldvert = m_dbVertScale;
599  float oldhoriz = m_dbHorizScale;
600 
601  if (Change)
602  {
603  m_dbVertScale = gCoreContext->GetNumSetting("VertScanPercentage", 0) * 0.01F;
604  m_dbHorizScale = gCoreContext->GetNumSetting("HorizScanPercentage", 0) * 0.01F;
605  m_dbScalingAllowed = true;
606  }
607  else
608  {
609  m_dbVertScale = 0.0F;
610  m_dbHorizScale = 0.0F;
611  m_dbScalingAllowed = false;
612  }
613 
614  if (!(qFuzzyCompare(oldvert + 100.0F, m_dbVertScale + 100.0F) &&
615  qFuzzyCompare(oldhoriz + 100.0F, m_dbHorizScale + 100.0F)))
616  {
617  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Over/underscan. V: %1, H: %2")
618  .arg(static_cast<double>(m_dbVertScale)).arg(static_cast<double>(m_dbHorizScale)));
619  MoveResize();
620  }
621 }
622 
623 void VideoOutWindow::SetDisplayAspect(float DisplayAspect)
624 {
625  if (!qFuzzyCompare(DisplayAspect + 10.0F, m_displayAspect + 10.0F))
626  {
627  LOG(VB_GENERAL, LOG_INFO, LOC + QString("New display aspect: %1")
628  .arg(static_cast<double>(DisplayAspect)));
629  m_displayAspect = DisplayAspect;
630  MoveResize();
631  }
632 }
633 
635 {
636  if (Size != m_rawWindowRect.size())
637  {
638  QRect rect(m_rawWindowRect.topLeft(), Size);
639  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("New window rect: %1x%2+%3+%4")
640  .arg(rect.width()).arg(rect.height()).arg(rect.left()).arg(rect.top()));
641  m_rawWindowRect = rect;
643  MoveResize();
644  }
645 }
646 
648 {
649  QRect oldrect = m_itvDisplayVideoRect;
650  if (Rect.isEmpty())
651  {
652  m_itvResizing = false;
653  m_itvDisplayVideoRect = QRect();
654  }
655  else
656  {
657  m_itvResizing = true;
658  m_itvDisplayVideoRect = Rect;
659  }
660  if (m_itvDisplayVideoRect != oldrect)
661  {
662  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("New ITV display rect: %1x%2+%3+%4")
663  .arg(m_itvDisplayVideoRect.width()).arg(m_itvDisplayVideoRect.height())
664  .arg(m_itvDisplayVideoRect.left()).arg(m_itvDisplayVideoRect.right()));
665  MoveResize();
666  }
667 }
668 
673 void VideoOutWindow::SetRotation(int Rotation)
674 {
675  if (Rotation == m_rotation)
676  return;
677  if ((Rotation < -180) || (Rotation > 180))
678  return;
679 
680  m_rotation = Rotation;
681  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("New rotation: %1").arg(m_rotation));
682  MoveResize();
683 }
684 
688 void VideoOutWindow::ResizeDisplayWindow(const QRect &Rect, bool SaveVisibleRect)
689 {
690  if (SaveVisibleRect)
692  m_displayVisibleRect = Rect;
693  MoveResize();
694 }
695 
701 void VideoOutWindow::EmbedInWidget(const QRect &Rect)
702 {
703  if (m_embedding && (Rect == m_embeddingRect))
704  return;
705  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("New embedding rect: %1x%2+%3+%4")
706  .arg(Rect.width()).arg(Rect.height()).arg(Rect.left()).arg(Rect.top()));
707  m_embeddingRect = Rect;
708  bool savevisiblerect = !m_embedding;
709  m_embedding = true;
710  m_displayVideoRect = Rect;
711  ResizeDisplayWindow(m_displayVideoRect, savevisiblerect);
712 }
713 
719 {
720  if (!m_embedding)
721  return;
722  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Stopped embedding");
723  m_embeddingRect = QRect();
725  m_embedding = false;
726  MoveResize();
727 }
728 
735 QRect VideoOutWindow::GetVisibleOSDBounds(float &VisibleAspect,
736  float &FontScaling,
737  float ThemeAspect) const
738 {
739  float dv_w = ((static_cast<float>(m_videoDispDim.width())) / m_displayVideoRect.width());
740  float dv_h = ((static_cast<float>(m_videoDispDim.height())) / m_displayVideoRect.height());
741 
742  int right_overflow = max((m_displayVideoRect.width() + m_displayVideoRect.left()) - m_displayVisibleRect.width(), 0);
743  int lower_overflow = max((m_displayVideoRect.height() + m_displayVideoRect.top()) - m_displayVisibleRect.height(), 0);
744 
745  bool isPBP = (kPBPLeft == m_pipState || kPBPRight == m_pipState);
746  if (isPBP)
747  {
748  right_overflow = 0;
749  lower_overflow = 0;
750  }
751 
752  // top left and bottom right corners respecting letterboxing
753  QPoint tl = QPoint((static_cast<int>(max(-m_displayVideoRect.left(), 0) * dv_w)) & ~1,
754  (static_cast<int>(max(-m_displayVideoRect.top(), 0) * dv_h)) & ~1);
755  QPoint br = QPoint(static_cast<int>(floor(m_videoDispDim.width() - (right_overflow * dv_w))),
756  static_cast<int>(floor(m_videoDispDim.height() - (lower_overflow * dv_h))));
757  // adjust for overscan
758  if ((m_dbVertScale > 0.0F) || (m_dbHorizScale > 0.0F))
759  {
760  QRect v(tl, br);
761  float xs = (m_dbHorizScale > 0.0F) ? m_dbHorizScale : 0.0F;
762  float ys = (m_dbVertScale > 0.0F) ? m_dbVertScale : 0.0F;
763  QPoint s(qRound((v.width() * xs)), qRound((v.height() * ys)));
764  tl += s;
765  br -= s;
766  }
767  // Work around Qt bug, QRect(QPoint(0,0), QPoint(0,0)) has area 1.
768  QRect vb(tl.x(), tl.y(), br.x() - tl.x(), br.y() - tl.y());
769 
770  // The calculation is completely bogus if the video is not centered
771  // which happens in the EPG, where we don't actually care about the OSD.
772  // So we just make sure the width and height are positive numbers
773  vb = QRect(vb.x(), vb.y(), abs(vb.width()), abs(vb.height()));
774 
775  // set the physical aspect ratio of the displayable area
776  const float dispPixelAdj = m_displayVisibleRect.width() ?
778  / m_displayVisibleRect.width() : 1.F;
779 
780  float vs = m_videoRect.height() ? static_cast<float>(m_videoRect.width()) / m_videoRect.height() : 1.0F;
781  VisibleAspect = ThemeAspect / dispPixelAdj * (m_videoAspectOverride > 0.0F ? vs / m_videoAspectOverride : 1.F);
782 
783  if (ThemeAspect > 0.0F)
784  {
785  // now adjust for scaling of the video on the size
786  float tmp = sqrtf(2.0F/(sq(VisibleAspect / ThemeAspect) + 1.0F));
787  if (tmp > 0.0F)
788  FontScaling = 1.0F / tmp;
789  // now adjust for aspect ratio effect on font size
790  // (should be in osd.cpp?)
791  FontScaling *= sqrtf(m_videoAspectOverride / ThemeAspect);
792  }
793 
794  if (isPBP)
795  FontScaling *= 0.65F;
796  return vb;
797 }
798 
806 {
807  if (m_pipState > kPIPOff)
808  return;
809 
810  if (AspectMode == kAspect_Toggle)
811  AspectMode = static_cast<AspectOverrideMode>(((m_videoAspectOverrideMode + 1) % kAspect_END));
812 
813  if (m_videoAspectOverrideMode != AspectMode)
814  {
815  m_videoAspectOverrideMode = AspectMode;
816  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("New video aspect override: '%1'")
819  MoveResize();
820  }
821 }
822 
828 {
829  if (IsEmbedding())
830  return false;
831 
832  return m_displayVideoRect.contains(m_windowRect);
833 }
834 
840 {
841  QRegion visible(m_windowRect);
842  QRegion video(m_displayVideoRect);
843  return visible.subtracted(video);
844 }
845 
846 /*
847  * \brief Determines PIP Window size and Position.
848  */
850  PIPLocation Location, MythPlayer *PiPPlayer, bool DoPixelAdjustment) const
851 {
852  QRect position;
853 
854  float pipVideoAspect = PiPPlayer ? PiPPlayer->GetVideoAspect() : (4.0F / 3.0F);
855  int tmph = (m_displayVisibleRect.height() * m_dbPipSize) / 100;
856  float pixel_adj = 1.0F;
857  if (DoPixelAdjustment)
858  {
859  pixel_adj = (static_cast<float>(m_displayVisibleRect.width()) /
860  static_cast<float>(m_displayVisibleRect.height())) / m_displayAspect;
861  }
862  position.setHeight(tmph);
863  position.setWidth(qRound((tmph * pipVideoAspect * pixel_adj)));
864 
865  int xoff = qRound(m_displayVisibleRect.width() * 0.06);
866  int yoff = qRound(m_displayVisibleRect.height() * 0.06);
867  switch (Location)
868  {
869  case kPIP_END:
870  case kPIPTopLeft:
871  break;
872  case kPIPBottomLeft:
873  yoff = m_displayVisibleRect.height() - position.height() - yoff;
874  break;
875  case kPIPTopRight:
876  xoff = m_displayVisibleRect.width() - position.width() - xoff;
877  break;
878  case kPIPBottomRight:
879  xoff = m_displayVisibleRect.width() - position.width() - xoff;
880  yoff = m_displayVisibleRect.height() - position.height() - yoff;
881  break;
882  }
883  position.translate(xoff, yoff);
884  return position;
885 }
886 
892 {
893  float oldvertscale = m_manualVertScale;
894  float oldhorizscale = m_manualHorizScale;
895  QPoint oldmove = m_manualMove;
896 
897  const float zf = 0.02F;
898  if (kZoomHome == Direction)
899  {
900  m_manualVertScale = 1.0F;
901  m_manualHorizScale = 1.0F;
902  m_manualMove = QPoint(0, 0);
903  }
904  else if (kZoomIn == Direction)
905  {
908  {
909  m_manualHorizScale += zf;
910  m_manualVertScale += zf;
911  }
912  }
913  else if (kZoomOut == Direction)
914  {
917  {
918  m_manualHorizScale -= zf;
919  m_manualVertScale -= zf;
920  }
921  }
922  else if (kZoomAspectUp == Direction)
923  {
926  {
927  m_manualHorizScale += zf;
928  m_manualVertScale -= zf;
929  }
930  }
931  else if (kZoomAspectDown == Direction)
932  {
935  {
936  m_manualHorizScale -= zf;
937  m_manualVertScale += zf;
938  }
939  }
940  else if (kZoomVerticalIn == Direction)
941  {
943  m_manualVertScale += zf;
944  }
945  else if (kZoomVerticalOut == Direction)
946  {
948  m_manualVertScale -= zf;
949  }
950  else if (kZoomHorizontalIn == Direction)
951  {
953  m_manualHorizScale += zf;
954  }
955  else if (kZoomHorizontalOut == Direction)
956  {
958  m_manualHorizScale -= zf;
959  }
960  else if (kZoomUp == Direction && (m_manualMove.y() < +kManualZoomMaxMove))
961  m_manualMove.setY(m_manualMove.y() + 1);
962  else if (kZoomDown == Direction && (m_manualMove.y() > -kManualZoomMaxMove))
963  m_manualMove.setY(m_manualMove.y() - 1);
964  else if (kZoomLeft == Direction && (m_manualMove.x() < +kManualZoomMaxMove))
965  m_manualMove.setX(m_manualMove.x() + 2);
966  else if (kZoomRight == Direction && (m_manualMove.x() > -kManualZoomMaxMove))
967  m_manualMove.setX(m_manualMove.x() - 2);
968 
969  m_manualVertScale = snap(m_manualVertScale, 1.0F, zf / 2);
970  m_manualHorizScale = snap(m_manualHorizScale, 1.0F, zf / 2);
971 
972  if (!((oldmove == m_manualMove) && qFuzzyCompare(m_manualVertScale + 100.0F, oldvertscale + 100.0F) &&
973  qFuzzyCompare(m_manualHorizScale + 100.0F, oldhorizscale + 100.0F)))
974  {
975  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("New zoom: Offset %1x%2 HScale %3 VScale %4")
976  .arg(m_manualMove.x()).arg(m_manualMove.y())
977  .arg(static_cast<double>(m_manualHorizScale))
978  .arg(static_cast<double>(m_manualVertScale)));
979  MoveResize();
980  }
981 }
982 
984 {
985  float oldvertscale = m_manualVertScale;
986  float oldhorizscale = m_manualHorizScale;
987  QPoint oldmove = m_manualMove;
988 
989  if (m_bottomLine)
990  {
991  m_manualMove.setX(0);
992  m_manualMove.setY(0);
993  m_manualHorizScale = 1.0;
994  m_manualVertScale = 1.0;
995  m_bottomLine = false;
996  }
997  else
998  {
999  const float zf = 0.02F;
1000  m_manualMove.setX(gCoreContext->GetNumSetting("OSDMoveXBottomLine", 0));
1001  m_manualMove.setY(gCoreContext->GetNumSetting("OSDMoveYBottomLine", 5));
1002  float h = static_cast<float>(gCoreContext->GetNumSetting("OSDScaleHBottomLine", 100)) / 100.0F;
1003  m_manualHorizScale = snap(h, 1.0F, zf / 2.0F);
1004  float v = static_cast<float>(gCoreContext->GetNumSetting("OSDScaleVBottomLine", 112)) / 100.0F;
1005  m_manualVertScale = snap(v, 1.0F, zf / 2.0F);
1006  m_bottomLine = true;
1007  }
1008 
1009  if (!((oldmove == m_manualMove) && qFuzzyCompare(m_manualVertScale + 100.0F, oldvertscale + 100.0F) &&
1010  qFuzzyCompare(m_manualHorizScale + 100.0F, oldhorizscale + 100.0F)))
1011  {
1012  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("New custom zoom: Offset %1x%2 HScale %3 VScale %4")
1013  .arg(m_manualMove.x()).arg(m_manualMove.y())
1014  .arg(static_cast<double>(m_manualHorizScale))
1015  .arg(static_cast<double>(m_manualVertScale)));
1016  MoveResize();
1017  }
1018 }
1019 
1021 {
1022  gCoreContext->SaveSetting("OSDMoveXBottomLine", m_manualMove.x());
1023  gCoreContext->SaveSetting("OSDMoveYBottomLine", m_manualMove.y());
1024  gCoreContext->SaveSetting("OSDScaleHBottomLine", static_cast<int>(m_manualHorizScale * 100.0F));
1025  gCoreContext->SaveSetting("OSDScaleVBottomLine", static_cast<int>(m_manualVertScale * 100.0F));
1026 }
1027 
1029 {
1030  return tr("Zoom %1x%2 @ (%3,%4)")
1031  .arg(static_cast<double>(m_manualHorizScale), 0, 'f', 2)
1032  .arg(static_cast<double>(m_manualVertScale), 0, 'f', 2)
1033  .arg(m_manualMove.x()).arg(m_manualMove.y());
1034 }
1035 
1037 static float fix_aspect(float raw)
1038 {
1039  // Check if close to 4:3
1040  if (fabs(raw - 1.333333F) < 0.05F)
1041  raw = 1.333333F;
1042 
1043  // Check if close to 16:9
1044  if (fabs(raw - 1.777777F) < 0.05F)
1045  raw = 1.777777F;
1046 
1047  return raw;
1048 }
1049 
1051 {
1052  if (m_pipState != Setting)
1053  {
1054  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("SetPIPState: %1").arg(toString(Setting)));
1055  m_pipState = Setting;
1056  }
1057 }
1058 
1059 static float snap(float value, float snapto, float diff)
1060 {
1061  if ((value + diff > snapto) && (value - diff < snapto))
1062  return snapto;
1063  return value;
1064 }
VideoOutWindow::Fix1088
static QSize Fix1088(QSize Dimensions)
Definition: videooutwindow.cpp:552
MythDisplay::GetScreenCount
static int GetScreenCount(void)
Definition: mythdisplay.cpp:252
kAspect_Toggle
@ kAspect_Toggle
Definition: videoouttypes.h:46
VideoOutWindow::VideoRectsChanged
void VideoRectsChanged(const QRect &DisplayVideoRect, const QRect &VideoRect)
VideoOutWindow::InputChanged
void InputChanged(const QSize &VideoDim, const QSize &VideoDispDim, float Aspect)
Tells video output to discard decoded frames and wait for new ones.
Definition: videooutwindow.cpp:530
VideoOutWindow::m_devicePixelRatio
qreal m_devicePixelRatio
Definition: videooutwindow.h:118
kAdjustFill_Toggle
@ kAdjustFill_Toggle
Definition: videoouttypes.h:57
VideoOutWindow::m_manualMove
QPoint m_manualMove
Manually applied percentage move.
Definition: videooutwindow.h:123
VideoOutWindow::ResizeDisplayWindow
void ResizeDisplayWindow(const QRect &Rect, bool SaveVisibleRect)
Resize Display Window.
Definition: videooutwindow.cpp:688
VideoOutWindow::MoveResize
void MoveResize(void)
performs all the calculations for video framing and any resizing.
Definition: videooutwindow.cpp:114
VideoOutWindow::SetVideoScalingAllowed
void SetVideoScalingAllowed(bool Change)
Disable or enable underscan/overscan.
Definition: videooutwindow.cpp:596
snap
static float snap(float value, float snapto, float diff)
Definition: videooutwindow.cpp:1059
VideoOutWindow::ToggleAspectOverride
void ToggleAspectOverride(AspectOverrideMode AspectMode=kAspect_Toggle)
Enforce different aspect ration than detected, then calls VideoAspectRatioChanged(float) to apply the...
Definition: videooutwindow.cpp:805
VideoOutWindow::GetBoundingRegion
QRegion GetBoundingRegion(void) const
Return the region of DisplayVisibleRect that lies outside of DisplayVideoRect.
Definition: videooutwindow.cpp:839
kZoomHorizontalIn
@ kZoomHorizontalIn
Definition: videoouttypes.h:33
VideoOutWindow::m_itvResizing
bool m_itvResizing
Definition: videooutwindow.h:160
kZoomIn
@ kZoomIn
Definition: videoouttypes.h:29
kPIP_END
@ kPIP_END
Definition: videoouttypes.h:23
kAdjustFill_HorizontalStretch
@ kAdjustFill_HorizontalStretch
Definition: videoouttypes.h:61
VideoOutWindow::m_tmpDisplayVisibleRect
QRect m_tmpDisplayVisibleRect
Used to save the display_visible_rect for restoration after video embedding ends.
Definition: videooutwindow.h:155
VideoOutWindow::kManualZoomMaxVerticalZoom
static const float kManualZoomMaxVerticalZoom
Definition: videooutwindow.h:170
kZoomAspectUp
@ kZoomAspectUp
Definition: videoouttypes.h:39
VideoOutWindow::StopEmbedding
void StopEmbedding(void)
Tells video output to stop embedding video in an existing window.
Definition: videooutwindow.cpp:718
AdjustFill
static HostComboBoxSetting * AdjustFill()
Definition: globalsettings.cpp:2144
kAdjustFill_Off
@ kAdjustFill_Off
Definition: videoouttypes.h:58
VideoOutWindow::m_dbUseGUISize
bool m_dbUseGUISize
Use the gui size for video window.
Definition: videooutwindow.h:116
VideoOutWindow::m_pipState
PIPState m_pipState
Definition: videooutwindow.h:166
kZoomUp
@ kZoomUp
Definition: videoouttypes.h:35
VideoOutWindow::Init
bool Init(const QSize &VideoDim, const QSize &VideoDispDim, float Aspect, const QRect &WindowRect, AspectOverrideMode AspectOverride, AdjustFillMode AdjustFill, MythDisplay *Display)
Definition: videooutwindow.cpp:427
arg
arg(title).arg(filename).arg(doDelete))
kZoomHome
@ kZoomHome
Definition: videoouttypes.h:28
osd.h
kAspect_Off
@ kAspect_Off
Definition: videoouttypes.h:47
kAdjustFill_VerticalStretch
@ kAdjustFill_VerticalStretch
Definition: videoouttypes.h:62
kZoomRight
@ kZoomRight
Definition: videoouttypes.h:38
MythDisplay::GetAspectRatio
double GetAspectRatio(QString &Source, bool IgnoreModeOverride=false)
Returns current screen aspect ratio.
Definition: mythdisplay.cpp:784
VideoOutWindow::m_dbScalingAllowed
bool m_dbScalingAllowed
disable this to prevent overscan/underscan
Definition: videooutwindow.h:115
kPIPOff
@ kPIPOff
Definition: videoouttypes.h:10
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
VideoOutWindow::Zoom
void Zoom(ZoomDirection Direction)
Sets up zooming into to different parts of the video.
Definition: videooutwindow.cpp:891
VideoOutWindow::m_displayAspect
float m_displayAspect
Physical aspect ratio of playback window.
Definition: videooutwindow.h:126
mythplayer.h
videooutwindow.h
VideoOutWindow::VideoAspectRatioChanged
void VideoAspectRatioChanged(float Aspect)
Calls SetVideoAspectRatio(float aspect), then calls MoveResize() to apply changes.
Definition: videooutwindow.cpp:514
MythPlayer
Definition: mythplayer.h:164
kZoomVerticalOut
@ kZoomVerticalOut
Definition: videoouttypes.h:32
VideoOutWindow::m_videoDim
QSize m_videoDim
Pixel dimensions of video buffer.
Definition: videooutwindow.h:129
VideoOutWindow::SetVideoAspectRatio
void SetVideoAspectRatio(float Aspect)
Sets VideoOutWindow::video_aspect to aspect, and sets VideoOutWindow::overriden_video_aspect if aspec...
Definition: videooutwindow.cpp:503
VideoOutWindow::m_displayVisibleRect
QRect m_displayVisibleRect
Visible portion of display window in pixels.
Definition: videooutwindow.h:148
MythDisplay::PhysicalDPIChanged
void PhysicalDPIChanged(qreal DPI)
Definition: mythdisplay.cpp:395
VideoOutWindow::m_displayVideoRect
QRect m_displayVideoRect
Pixel rectangle in display window into which video_rect maps to.
Definition: videooutwindow.h:145
VideoOutWindow::m_embeddingRect
QRect m_embeddingRect
Embedded video rectangle.
Definition: videooutwindow.h:157
get_aspect_override
float get_aspect_override(AspectOverrideMode Aspectmode, float Original)
Definition: videoouttypes.h:250
VideoOutWindow::GetDisplayAspect
float GetDisplayAspect(void) const
Definition: videooutwindow.h:90
video
QDomElement video
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:658
VideoOutWindow::PopulateGeometry
void PopulateGeometry(void)
Definition: videooutwindow.cpp:78
MythDisplay::CurrentScreenChanged
void CurrentScreenChanged(QScreen *qScreen)
VideoOutWindow::m_itvDisplayVideoRect
QRect m_itvDisplayVideoRect
Definition: videooutwindow.h:161
tmp
static guint32 * tmp
Definition: goom_core.cpp:30
VideoOutWindow::ApplyDBScaleAndMove
void ApplyDBScaleAndMove(void)
Apply scales and moves for "Overscan" and "Underscan" DB settings.
Definition: videooutwindow.cpp:194
VideoOutWindow::GetPIPRect
QRect GetPIPRect(PIPLocation Location, MythPlayer *PiPPlayer=nullptr, bool DoPixelAdjustment=true) const
Definition: videooutwindow.cpp:849
kZoomLeft
@ kZoomLeft
Definition: videoouttypes.h:37
videodisplayprofile.h
toString
QString toString(MarkTypes type)
Definition: programtypes.cpp:26
kPIPBottomRight
@ kPIPBottomRight
Definition: videoouttypes.h:22
VideoOutWindow::GetVisibleOSDBounds
QRect GetVisibleOSDBounds(float &VisibleAspect, float &FontScaling, float ThemeAspect) const
Returns visible portions of total OSD bounds.
Definition: videooutwindow.cpp:735
kPIPTopLeft
@ kPIPTopLeft
Definition: videoouttypes.h:19
VideoOutWindow::VisibleRectChanged
void VisibleRectChanged(const QRect &DisplayVisibleRect)
VideoOutWindow::m_windowRect
QRect m_windowRect
Rectangle describing QWidget bounds.
Definition: videooutwindow.h:150
kAspect_END
@ kAspect_END
Definition: videoouttypes.h:52
VideoOutWindow::SetWindowSize
void SetWindowSize(QSize Size)
Definition: videooutwindow.cpp:634
kAdjustFill_END
@ kAdjustFill_END
Definition: videoouttypes.h:65
VideoOutWindow::m_rawWindowRect
QRect m_rawWindowRect
Rectangle describing QWidget bounds - not adjusted for high DPI scaling (macos)
Definition: videooutwindow.h:152
VideoOutWindow::PhysicalDPIChanged
void PhysicalDPIChanged(qreal)
Definition: videooutwindow.cpp:70
AspectOverrideMode
AspectOverrideMode
Definition: videoouttypes.h:44
VideoOutWindow::GetTotalOSDBounds
QRect GetTotalOSDBounds(void) const
Returns total OSD bounds.
Definition: videooutwindow.cpp:570
VideoOutWindow::SetDisplayAspect
void SetDisplayAspect(float DisplayAspect)
Definition: videooutwindow.cpp:623
VideoOutWindow::m_videoAspect
float m_videoAspect
Physical aspect ratio of video.
Definition: videooutwindow.h:131
MythDisplay::GetCurrentScreen
QScreen * GetCurrentScreen(void)
Return a pointer to the screen to use.
Definition: mythdisplay.cpp:288
kZoomAspectDown
@ kZoomAspectDown
Definition: videoouttypes.h:40
kZoomOut
@ kZoomOut
Definition: videoouttypes.h:30
VideoOutWindow::m_videoDispDim
QSize m_videoDispDim
Pixel dimensions of video display area.
Definition: videooutwindow.h:130
VideoOutWindow::m_videoRect
QRect m_videoRect
Pixel rectangle in video frame to display.
Definition: videooutwindow.h:143
VideoOutWindow::SetPIPState
void SetPIPState(PIPState Setting)
Definition: videooutwindow.cpp:1050
VideoOutWindow::m_dbHorizScale
float m_dbHorizScale
Horizontal Overscan/Underscan percentage.
Definition: videooutwindow.h:112
VideoOutWindow::m_videoAspectOverride
float m_videoAspectOverride
Normally this is the same as videoAspect, but may not be if the user has toggled the aspect override ...
Definition: videooutwindow.h:135
VideoOutWindow::m_manualVertScale
float m_manualVertScale
Manually applied vertical scaling.
Definition: videooutwindow.h:121
kZoomDown
@ kZoomDown
Definition: videoouttypes.h:36
VideoOutWindow::PrintMoveResizeDebug
void PrintMoveResizeDebug(void)
Definition: videooutwindow.cpp:481
VideoOutWindow::Rotate
void Rotate(void)
Adjust various settings to facilitate portrait mode calculations.
Definition: videooutwindow.cpp:159
VideoOutWindow::SetRotation
void SetRotation(int Rotation)
Set the rotation in degrees.
Definition: videooutwindow.cpp:673
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:57
VideoOutWindow::SaveBottomLine
void SaveBottomLine(void)
Definition: videooutwindow.cpp:1020
MythDisplay
Definition: mythdisplay.h:18
MythCoreContext::GetNumSetting
int GetNumSetting(const QString &key, int defaultval=0)
Definition: mythcorecontext.cpp:930
kAdjustFill_VerticalFill
@ kAdjustFill_VerticalFill
Definition: videoouttypes.h:64
VideoOutWindow::m_screenGeometry
QRect m_screenGeometry
Full screen geometry.
Definition: videooutwindow.h:117
VideoOutWindow::VideoOutWindow
VideoOutWindow()
Definition: videooutwindow.cpp:55
VideoOutWindow::ScreenChanged
void ScreenChanged(QScreen *screen)
Definition: videooutwindow.cpp:64
VideoOutWindow::m_dbMove
QPoint m_dbMove
Percentage move from database.
Definition: videooutwindow.h:111
kAdjustFill_HorizontalFill
@ kAdjustFill_HorizontalFill
Definition: videoouttypes.h:63
VideoOutWindow::m_adjustFill
AdjustFillMode m_adjustFill
Zoom mode.
Definition: videooutwindow.h:139
MythCoreContext::GetBoolSetting
bool GetBoolSetting(const QString &key, bool defaultval=false)
Definition: mythcorecontext.cpp:924
kPBPLeft
@ kPBPLeft
Definition: videoouttypes.h:13
VideoOutWindow::IsEmbedding
bool IsEmbedding(void) const
Definition: videooutwindow.h:70
SCALED_RECT
#define SCALED_RECT(SRC, SCALE)
Definition: videooutwindow.cpp:41
Setting
QMap< QString, bool > Setting
Definition: mythsystemlegacy.h:59
VideoOutWindow::m_dbVertScale
float m_dbVertScale
Vertical Overscan/Underscan percentage.
Definition: videooutwindow.h:113
VideoOutWindow::m_embedding
bool m_embedding
State variables.
Definition: videooutwindow.h:164
MythDisplay::SpanAllScreens
static bool SpanAllScreens(void)
Return true if the MythTV windows should span all screens.
Definition: mythdisplay.cpp:453
VideoOutWindow::kManualZoomMaxMove
static const int kManualZoomMaxMove
Definition: videooutwindow.h:173
mythmiscutil.h
VideoOutWindow::WindowRectChanged
void WindowRectChanged(const QRect &WindowRect)
PIPLocation
PIPLocation
Definition: videoouttypes.h:17
VideoOutWindow::VideoSizeChanged
void VideoSizeChanged(const QSize &VideoDim, const QSize &VideoDispDim)
mythcorecontext.h
VideoOutWindow::EmbedInWidget
void EmbedInWidget(const QRect &Rect)
Tells video output to embed video in an existing window.
Definition: videooutwindow.cpp:701
VideoOutWindow::ApplyLetterboxing
void ApplyLetterboxing(void)
Definition: videooutwindow.cpp:325
VideoOutWindow::m_rotation
int m_rotation
Definition: videooutwindow.h:140
AspectOverride
static HostComboBoxSetting * AspectOverride()
Definition: globalsettings.cpp:2129
AdjustFillMode
AdjustFillMode
Definition: videoouttypes.h:55
LOC
#define LOC
Definition: videooutwindow.cpp:39
MythPlayer::GetVideoAspect
float GetVideoAspect(void) const
Definition: mythplayer.h:218
VideoOutWindow::m_videoAspectOverrideMode
AspectOverrideMode m_videoAspectOverrideMode
AspectOverrideMode to use to modify overriden_video_aspect.
Definition: videooutwindow.h:137
PIPState
PIPState
Definition: videoouttypes.h:8
decoderbase.h
VideoOutWindow::kManualZoomMinHorizontalZoom
static const float kManualZoomMinHorizontalZoom
Definition: videooutwindow.h:171
VideoOutWindow::VideoIsFullScreen
bool VideoIsFullScreen(void) const
Check whether the video display rect covers the entire window/framebuffer.
Definition: videooutwindow.cpp:827
kZoomVerticalIn
@ kZoomVerticalIn
Definition: videoouttypes.h:31
kAdjustFill_Half
@ kAdjustFill_Half
Definition: videoouttypes.h:59
VideoOutWindow::SetITVResize
void SetITVResize(QRect Rect)
Definition: videooutwindow.cpp:647
VideoOutWindow::ToggleMoveBottomLine
void ToggleMoveBottomLine(void)
Definition: videooutwindow.cpp:983
fix_aspect
static float fix_aspect(float raw)
Correct for rounding errors.
Definition: videooutwindow.cpp:1037
VideoOutWindow::m_manualHorizScale
float m_manualHorizScale
Manually applied horizontal scaling.
Definition: videooutwindow.h:122
VideoOutWindow::m_display
MythDisplay * m_display
Definition: videooutwindow.h:110
MythCoreContext::SaveSetting
void SaveSetting(const QString &key, int newValue)
Definition: mythcorecontext.cpp:899
VideoOutWindow::ApplyManualScaleAndMove
void ApplyManualScaleAndMove(void)
Apply scales and moves from "Zoom Mode" settings.
Definition: videooutwindow.cpp:297
VideoOutWindow::kManualZoomMaxHorizontalZoom
static const float kManualZoomMaxHorizontalZoom
Definition: videooutwindow.h:169
kPBPRight
@ kPBPRight
Definition: videoouttypes.h:14
sq
float sq(float a)
Definition: mythmiscutil.h:60
kPIPBottomLeft
@ kPIPBottomLeft
Definition: videoouttypes.h:20
VideoOutWindow::m_dbPipSize
int m_dbPipSize
percentage of full window to use for PiP
Definition: videooutwindow.h:114
kZoomHorizontalOut
@ kZoomHorizontalOut
Definition: videoouttypes.h:34
VideoOutWindow::kManualZoomMinVerticalZoom
static const float kManualZoomMinVerticalZoom
Definition: videooutwindow.h:172
VideoOutWindow::ToggleAdjustFill
void ToggleAdjustFill(AdjustFillMode AdjustFillMode=kAdjustFill_Toggle)
Sets up letterboxing for various standard video frame and monitor dimensions, then calls MoveResize()...
Definition: videooutwindow.cpp:581
kPIPTopRight
@ kPIPTopRight
Definition: videoouttypes.h:21
VideoOutWindow::GetZoomString
QString GetZoomString(void) const
Definition: videooutwindow.cpp:1028
ZoomDirection
ZoomDirection
Definition: videoouttypes.h:26
kAdjustFill_Full
@ kAdjustFill_Full
Definition: videoouttypes.h:60
VideoOutWindow::m_bottomLine
bool m_bottomLine
Definition: videooutwindow.h:165