[mythtv-commits] mythtv commit: r9856 by danielk

mythtv at cvs.mythtv.org mythtv at cvs.mythtv.org
Tue May 2 19:09:49 EDT 2006


      Author: danielk
        Date: 2006-05-02 23:09:48 +0000 (Tue, 02 May 2006)
New Revision: 9856
   Changeset: http://cvs.mythtv.org/trac/changeset/9856

Modified:

   branches/mythtv-vid/libs/libmythtv/videoout_directfb.cpp
   branches/mythtv-vid/libs/libmythtv/videoout_ivtv.cpp
   branches/mythtv-vid/libs/libmythtv/videoout_null.cpp
   branches/mythtv-vid/libs/libmythtv/videoout_xv.cpp
   branches/mythtv-vid/libs/libmythtv/videooutbase.cpp
   branches/mythtv-vid/libs/libmythtv/videooutbase.h

Log:

VideoOutput refactor for mythtv_vid branch.

For variables that are loaded from the database db_ is prepended, further these are loaded in the VideoOutput ctor, instead of in Init().

For a sequence of variables that represent a size or a rectangle, QSize or a QRect are used.

Some variables have been renamed for clarity:
  img_[x|y|w|h]     is now video_rect               (rectangle within video frame which is displayed)
  disp[x|y|w|h]off  is now display_video_rect       (what video_rect is scaled to on the display)
  disp[x|y|w|h]     is now display_visible_rect     (rectangle representing usable portion of display window)
  olddisp[x|y|w|h]  is now tmp_display_visible_rect (used to temporarly save display_visible_rect during embedding)
  myth_ds[w|h]      is now db_display_dim           (screen dimensions in mm according to DB, usually 0,0)
  [w|h]_mm          is now display_dim              (to match display_aspect)
  XJ_[width|height] is now video_dim                (to match video_aspect)
  XJ_aspect         is now letterboxed_video_aspect

The old names confused the heck out of me the last time I was working in VideoOutputXv so I figured I'd start by renaming these this time around.

It might make more sense to append _bounds rather than _rect since these rectangles are in fact bounds, I chose rect only because it is shorter and these names are already on the long side..

I didn't port the OS X VideoOutput classes. I can't compile those clases and wanted some feedback on the names I chose before trying to port those classes.

Finally, MoveResize() has been split up and now just calls five functions:
    ApplyDBScaleAndMove();     // applies "overscan" and "underscan"
    ApplyLetterboxing();
    ApplyManualScaleAndMove(); // applies "Zoom Mode"
    ApplySnapToVideoRect();
    PrintMoveResizeDebug();

I didn't plan to fix any bugs in this commit, but I found and fixed two when splitting up MoveResize().
 * The first was with "Zoom Mode" it used the X & Y offset to scale the movement, this of course doesn't work when the offset is zero. So I made the movement a percentage of the width and height instead, which will always work.
 * The second was with SnapToVideoRect(), as implemented this broke "overscan" and "underscan"  when < 5% because it was applied indiscriminately. I added a test so that the snap is only applied when the user hasn't requested over/under scan explicitly, i.e. only when the Letterboxing forces the scale.






More information about the mythtv-commits mailing list