So ungefähr könnte das ganze aussehen:
Code: Alles auswählen
--- movieplayer.cpp.orig 2010-03-06 20:54:00.000000000 +0100
+++ movieplayer.cpp 2010-04-01 10:34:41.000000000 +0200
@@ -108,6 +108,13 @@
#define VDEC ADAP "/video0"
#define DMX ADAP "/demux0"
+#if defined HAVE_DBOX_HARDWARE || defined HAVE_DREAMBOX_HARDWARE || defined HAVE_IPBOX_HARDWARE
+#include <dbox/avs_core.h>
+#include <dbox/saa7126_core.h>
+#define AVS_DEVICE "/dev/dbox/avs0"
+#define SAA7126_DEVICE "/dev/dbox/saa0"
+#endif
+
#define AVIA_AV_STREAM_TYPE_0 0x00
#define AVIA_AV_STREAM_TYPE_SPTS 0x01
#define AVIA_AV_STREAM_TYPE_PES 0x02
@@ -4455,10 +4462,66 @@ void checkAspectRatio (int vdec, bool in
{
printf("[movieplayer.cpp] AR change detected in auto mode, adjusting display format\n");
video_displayformat_t vdt;
+#if defined HAVE_DREAMBOX_HARDWARE || defined HAVE_DBOX_HARDWARE || defined HAVE_IPBOX_HARDWARE
+ int format;
+ int avsiosfncFormat;
+ int wss;
+ int _fd;
+#endif
+
if(new_size.aspect_ratio == VIDEO_FORMAT_4_3)
+ {
vdt = VIDEO_LETTER_BOX;
+#if defined HAVE_DREAMBOX_HARDWARE || defined HAVE_DBOX_HARDWARE || defined HAVE_IPBOX_HARDWARE
+ format = 2;
+ wss = SAA_WSS_43F;
+#endif
+ }
else
+ {
vdt = VIDEO_CENTER_CUT_OUT;
+#if defined HAVE_DREAMBOX_HARDWARE || defined HAVE_DBOX_HARDWARE || defined HAVE_IPBOX_HARDWARE
+ format = 1;
+ wss = SAA_WSS_169F;
+#endif
+ }
+
+#if defined HAVE_DREAMBOX_HARDWARE || defined HAVE_DBOX_HARDWARE || defined HAVE_IPBOX_HARDWARE
+ if ((_fd = open(AVS_DEVICE, O_RDWR)) < 0)
+ perror("[movieplayer.cpp] " AVS_DEVICE);
+ else
+ {
+ avsiosfncFormat = format;
+
+ if (g_info.box_Type == CControld::TUXBOX_MAKER_PHILIPS)
+ {
+ switch (format)
+ {
+ case 1:
+ avsiosfncFormat = 2;
+ break;
+ case 2:
+ avsiosfncFormat = 3;
+ break;
+ }
+ }
+
+ if (ioctl(_fd, AVSIOSFNC, &avsiosfncFormat) < 0)
+ perror("[movieplayer.cpp] AVSIOSFNC");
+
+ close(_fd);
+ }
+
+ if ((_fd = open(SAA7126_DEVICE, O_RDWR)) < 0)
+ perror("[movieplayer.cpp] " SAA7126_DEVICE);
+ else {
+ if (ioctl(_fd, SAAIOSWSS, &wss) < 0)
+ perror("[movieplayer.cpp] SAAIOSWSS");
+
+ close(_fd);
+ }
+#endif
+
if(ioctl(vdec, VIDEO_SET_DISPLAY_FORMAT, vdt))
perror("[movieplayer.cpp] VIDEO_SET_DISPLAY_FORMAT");
memcpy(&g_size, &new_size, sizeof(g_size));
Habs selbst nicht kompiliert, nur mal in Trockenübung gehackt. Also keine Garantie.
[Der auskommentierte Block sollte auch noch mit rein, da es sonst bei PHILIPS Boxen nicht richtig funktioniert.
Ich hab nur leider auf die Schnelle nicht rausgefunden, wie ich im Movieplayer den Box-Type abfragen kann.]
Edit: Code überarbeitet.