Showing aspect ratio or providing automatic widescreen switching signals
Commit Message
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.
===================================================================
RCS file: /cvsroot/softdevice/softdevice/mpeg2decoder.h,v
retrieving revision 1.29
@@ -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)
===================================================================
RCS file: /cvsroot/softdevice/softdevice/softdevice.c,v
retrieving revision 1.34
@@ -594,6 +594,13 @@
else return 0;
}
+/* ----------------------------------------------------------------------------
+ */
+char * cSoftDevice::GetVideoFormat(void)
+{
+ return (decoder) ? decoder->GetVideoFormat() : (char *) " ";
+}
+
#endif
/* ----------------------------------------------------------------------------
===================================================================
RCS file: /cvsroot/softdevice/softdevice/softdevice.h,v
retrieving revision 1.4
@@ -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;
===================================================================
RCS file: /cvsroot/softdevice/softdevice/video.c,v
retrieving revision 1.25
@@ -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;
}
===================================================================
RCS file: /cvsroot/softdevice/softdevice/video.h,v
retrieving revision 1.16
@@ -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