[mythtv-commits] Ticket #8656: Display video format in INFO OSD

MythTV mythtv at cvs.mythtv.org
Thu Jul 15 14:53:57 UTC 2010


#8656: Display video format in INFO OSD
-------------------------------------+--------------------------------------
 Reporter:  nigel                    |       Owner:  janne     
     Type:  patch                    |      Status:  new       
 Priority:  minor                    |   Milestone:            
Component:  MythTV - Video Playback  |     Version:  Trunk Head
 Severity:  low                      |     Mlocked:  0         
-------------------------------------+--------------------------------------
 Several times I have wanted to check the format of Live TV channels. I
 thought about adding another OSD "page" to cycle through, and add signal
 monitoring in there, but the latter was too hard to hook into the timing
 events.
 [[BR]]
 Building on the mythui OSD theming (thanks Mark), the following adds a
 small OSD string after the show time/length, and also works for recordings
 (should be safe for videos, and optical media too):
 {{{
 % svn diff libs/libmythtv/playercontext.cpp themes/default/osd.xml
 Index: libs/libmythtv/playercontext.cpp
 ===================================================================
 --- libs/libmythtv/playercontext.cpp    (revision 25340)
 +++ libs/libmythtv/playercontext.cpp    (working copy)
 @@ -751,6 +751,18 @@
              infoMap["screenshotpath"] = VideoMetaDataUtil::GetArtPath(
                  playingInfo->GetPathname(), "Screenshots");
          }
 +        // Store video format, except when tuning Live TV.
 +        if (playingState != kState_WatchingLiveTV   // Recorded TV,
 videos/DVDs
 +            || tvchain->GetCardType() != "DUMMY")   // Live TV after
 tuning
 +        {
 +            float rate = nvp->GetFrameRate();
 +            QSize size = nvp->GetVideoSize();
 +            infoMap["format"] = QString("%1x%2%3%4, %5")
 +                .arg(size.width()).arg(size.height())
 +                .arg(rate > 31 ? 'p' : 'i')   // TODO: should lookup, not
 guess
 +                .arg(rate)
 +                .arg(nvp->GetEncodingType());
 +        }
          infoMap.detach();
          loaded = true;
      }
 Index: themes/default/osd.xml
 ===================================================================
 --- themes/default/osd.xml      (revision 25328)
 +++ themes/default/osd.xml      (working copy)
 @@ -118,10 +118,15 @@
          </textarea>
          <textarea name="starttime">
              <font>smaller</font>
 -            <area>6,42,437,25</area>
 +            <area>6,42,290,25</area>
              <align>left,top</align>
              <template>%STARTTIME%-%ENDTIME% : %LENMINS%</template>
          </textarea>
 +        <textarea name="format">
 +            <font>smaller</font>
 +            <area>300,42,200,25</area>
 +            <align>left,top</align>
 +        </textarea>
          <clock name="clock">
              <area>481,8,187,25</area>
              <font>small</font>
 }}}

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/8656>
MythTV <http://www.mythtv.org/>
MythTV


More information about the mythtv-commits mailing list