Showing aspect ratio or providing automatic widescreen switching signals

Message ID 200507191127.03519.stefan@lucke.in-berlin.de
State New
Headers

Commit Message

Stefan Lucke July 19, 2005, 9:27 a.m. UTC
  On Sonntag, 20. März 2005 23:56, Stefan Lucke wrote:
> On Sonntag, 20. März 2005 17:31, Mark Watson wrote:
> > I just got a widescreen TV and put VDR in 16:9 mode. However there is still a 
> > lot of content still in 4:3 mode and it sometimes takes me a while to spot 
> > the short/fat people and switch the TV! It would help to see the aspect on 
> > the overlay when switching channels.
> 
> Are you thinking of something like this (left to the teletext icon) ?
> 
> http://www.lucke.in-berlin.de/vdr-aspect-info.png
> 

I modified this a bit, so that stream width and hight is shown too.
This additional info is presented in channel and recording display.

http://www.lucke.in-berlin.de/vdr-stream-info.png

vdr patch is made for vdr-1.3.22, but applies to vdr-1.3.27 too
(with some offsets).

softdevice patch is for cvs version.
  

Patch

Index: mpeg2decoder.h
===================================================================
RCS file: /cvsroot/softdevice/softdevice/mpeg2decoder.h,v
retrieving revision 1.29
diff -b -B -U3 -r1.29 mpeg2decoder.h
--- mpeg2decoder.h	17 Jul 2005 11:26:08 -0000	1.29
+++ mpeg2decoder.h	19 Jul 2005 08:48:50 -0000
@@ -313,6 +313,10 @@ 
     void Suspend(void);
     void Resume(void);
     void TrickSpeed(int Speed);
+    char *GetVideoFormat(void) { return (videoOut) ?
+                                          videoOut->GetVideoFormat():
+                                          (char *) "              ";
+                               }
    
     void SetPlayMode(softPlayMode playMode);
     void PlayAudioVideo(bool playAudio,bool playVideo)
Index: softdevice.c
===================================================================
RCS file: /cvsroot/softdevice/softdevice/softdevice.c,v
retrieving revision 1.34
diff -b -B -U3 -r1.34 softdevice.c
--- softdevice.c	29 May 2005 10:13:59 -0000	1.34
+++ softdevice.c	19 Jul 2005 08:48:51 -0000
@@ -594,6 +594,13 @@ 
   else return 0;
 }
 
+/* ----------------------------------------------------------------------------
+ */
+char * cSoftDevice::GetVideoFormat(void)
+{
+  return (decoder) ? decoder->GetVideoFormat() : (char *) "              ";
+}
+
 #endif
 
 /* ----------------------------------------------------------------------------
Index: softdevice.h
===================================================================
RCS file: /cvsroot/softdevice/softdevice/softdevice.h,v
retrieving revision 1.4
diff -b -B -U3 -r1.4 softdevice.h
--- softdevice.h	2 Apr 2005 12:19:06 -0000	1.4
+++ softdevice.h	19 Jul 2005 08:48:52 -0000
@@ -89,6 +89,7 @@ 
   virtual void SetDigitalAudioDevice(bool On);
   virtual void SetAudioTrackDevice(eTrackType Type);  
   virtual int  PlayAudio(const uchar *Data, int Length);
+  virtual char *GetVideoFormat(void);
 #endif
 #if VDRVERSNUM >= 10307
   virtual int ProvidesCa(const cChannel *Channel) const;
Index: video.c
===================================================================
RCS file: /cvsroot/softdevice/softdevice/video.c,v
retrieving revision 1.25
diff -b -B -U3 -r1.25 video.c
--- video.c	15 Jul 2005 20:42:16 -0000	1.25
+++ video.c	19 Jul 2005 08:48:53 -0000
@@ -28,6 +28,7 @@ 
   OsdRefreshCounter=0;
   displayTimeUS = 0;
   this->setupStore=setupStore;
+  strcpy (videoFormat, "              ");
   freezeMode=false;
 
   for (int i = 0; i < MAX_PAR; ++i)
@@ -158,13 +159,25 @@ 
     int           new_aspect;
     double        d_asp, afd_asp, p_asp;
 
+  sprintf (videoFormat, "%4dx%-4d ", fwidth, fheight);
   /* -------------------------------------------------------------------------
    * check if there are some aspect ratio constraints
    * flags & XV_FORMAT_.. check if our ouput aspect is
    *                        NORMAL 4:3 or WIDE 16:9
    *
    */
-  new_aspect = (new_asp > 1.4) ? DV_FORMAT_WIDE : DV_FORMAT_NORMAL;
+  if (new_asp > 1.4)
+  {
+    new_aspect = DV_FORMAT_WIDE;
+    strcat (videoFormat, (new_asp > 2.0) ? "19:8 " : "16:9 ");
+  }
+  else
+  {
+    new_aspect = DV_FORMAT_NORMAL;
+    strcat (videoFormat, " 4:3 ");
+  }
+  //new_aspect = (new_asp > 1.4) ? DV_FORMAT_WIDE : DV_FORMAT_NORMAL;
+  //videoFormat =
   new_afd &= 0x07;
   /* -------------------------------------------------------------------------
    * override afd value with crop value from setup
@@ -199,13 +212,13 @@ 
    * is a mismatch (4:3 frame encoded as 16:9, and 16:9 enc as 4:3
    */
     case 0: afd_asp = new_asp; break;
-    case 1: afd_asp = 4.0 / 3.0; break;
-    case 2: afd_asp = 16.0 / 9.0; break;
-    case 3: afd_asp = 14.0 / 9.0; break;
+    case 1: afd_asp = 4.0 / 3.0;  strcat (videoFormat, " 4:3 "); break;
+    case 2: afd_asp = 16.0 / 9.0; strcat (videoFormat, "16:9 "); break;
+    case 3: afd_asp = 14.0 / 9.0; strcat (videoFormat, "14:9 "); break;
     case 4: afd_asp = new_asp; break;
-    case 5: afd_asp = 4.0 / 3.0; break;
-    case 6: afd_asp = 16.0 / 9.0; break;
-    case 7: afd_asp = 16.0 / 9.0; break;
+    case 5: afd_asp = 4.0 / 3.0;  strcat (videoFormat, " 4:3 "); break;
+    case 6: afd_asp = 16.0 / 9.0; strcat (videoFormat, "16:9 "); break;
+    case 7: afd_asp = 16.0 / 9.0; strcat (videoFormat, "16:9 "); break;
     default: afd_asp = new_asp; break;
   }
 
Index: video.h
===================================================================
RCS file: /cvsroot/softdevice/softdevice/video.h,v
retrieving revision 1.16
diff -b -B -U3 -r1.16 video.h
--- video.h	15 Jul 2005 20:42:16 -0000	1.16
+++ video.h	19 Jul 2005 08:48:54 -0000
@@ -95,6 +95,7 @@ 
             aspect_changed,
             current_afd,
             displayTimeUS;
+    char    videoFormat [20];
     double  parValues[MAX_PAR];
 
     cSetupStore *setupStore;
@@ -126,6 +127,8 @@ 
     inline void FreezeMode(bool freeze)
     {freezeMode=freeze;};
     bool freezeMode;
+
+    char   *GetVideoFormat(void) { return videoFormat; };
 
     virtual void Action(void);
     // osd control thread. Refreshes the osd on dimension changes and