Hi,
latest version of vidix-radeon-alpha patch is now in vidix cvs :-)) .
To make use of it you need attached patch for softdevice.
This patch includes also an extension of Roland Praml to make
use of available equalizers: brightness, saturation, hue, contrast
and HW-Deinterlace.
HW-Deinterlace is limited to available vidix constants and some
values present in current xorg radeon sources.
To be honest, I don't see a difference :-( .
--
Stefan Lucke
Index: video-vidix.c
===================================================================
RCS file: /cvsroot/softdevice/softdevice/video-vidix.c,v
retrieving revision 1.21
diff -U3 -r1.21 video-vidix.c
--- video-vidix.c 17 Jun 2006 20:42:58 -0000 1.21
+++ video-vidix.c 9 Aug 2006 07:06:12 -0000
@@ -113,7 +113,7 @@
*/
fwidth = lwidth = dwidth = Xres;
fheight = lheight = dheight = Yres;
-
+ useVidixAlpha = false;
swidth = 720;
sheight = 576;
@@ -195,6 +195,40 @@
printf("cVidixVideoOut: fourcc.flags: 0x%0x\n",vidix_fourcc.flags);
AllocLayer();
+
+ vidix_video_eq_t tmpeq;
+ if( (err = vdlPlaybackGetEq(vidix_handler, &tmpeq)) != 0)
+ {
+ esyslog("[cVidixVideoOut] Couldn't get EQ capability: %s exiting\n",
+ strerror(err) );
+ exit(1);
+ }
+ vidix_curr_eq=tmpeq;
+ printf("cVidixVideoOut: EQ capabilities: %x: ", vidix_curr_eq.cap);
+ if (vidix_curr_eq.cap & VEQ_CAP_BRIGHTNESS) {
+ printf("brightness (%d) ", vidix_curr_eq.brightness);
+ setupStore->vidCaps |= CAP_BRIGHTNESS;
+ }
+ if (vidix_curr_eq.cap & VEQ_CAP_CONTRAST) {
+ printf("contrast (%d) ", vidix_curr_eq.contrast);
+ setupStore->vidCaps |= CAP_CONTRAST;
+ }
+ if (vidix_curr_eq.cap & VEQ_CAP_SATURATION) {
+ printf("saturation (%d) ", vidix_curr_eq.saturation);
+ setupStore->vidCaps |= CAP_SATURATION;
+ }
+ if (vidix_curr_eq.cap & VEQ_CAP_HUE) {
+ printf("hue (%d) ", vidix_curr_eq.hue);
+ setupStore->vidCaps |= CAP_HUE;
+ }
+
+ setupStore->vidCaps |= CAP_HWDEINTERLACE;
+
+ if (vidix_curr_eq.cap & VEQ_CAP_RGB_INTENSITY) printf("RGB-intensity (%d, %d, %d) ",
+ vidix_curr_eq.red_intensity,
+ vidix_curr_eq.green_intensity,
+ vidix_curr_eq.blue_intensity );
+ printf("\n");
}
/* ----------------------------------------------------------------------------
@@ -222,6 +256,9 @@
*/
void cVidixVideoOut::SetParams(int Ystride, int UVstride)
{
+ vidix_video_eq_t vidix_video_eq;
+ int err;
+
if (aspect_changed || currentPixelFormat != setupStore->pixelFormat ||
cutTop != setupStore->cropTopLines ||
cutBottom != setupStore->cropBottomLines )
@@ -301,6 +338,75 @@
printf("cVidixVideoOut : dstrides.v=%d\n", dstrides.v);
#endif
}
+
+ vidix_video_eq=vidix_curr_eq;
+
+ vidix_video_eq.brightness = (setupStore->vidBrightness - 50)*20;
+ vidix_video_eq.contrast = (setupStore->vidContrast - 50)*20;
+ vidix_video_eq.saturation = (setupStore->vidSaturation - 50)*20;
+ vidix_video_eq.hue = (setupStore->vidHue - 50)*20;
+
+ if (vidix_curr_eq.brightness != vidix_video_eq.brightness ||
+ vidix_curr_eq.contrast != vidix_video_eq.contrast ||
+ vidix_curr_eq.saturation != vidix_video_eq.saturation ||
+ vidix_curr_eq.hue != vidix_video_eq.hue ) {
+ printf("cVidixVideoOut : set eq values\n");
+ vidix_curr_eq = vidix_video_eq;
+ if( (err = vdlPlaybackSetEq(vidix_handler, &vidix_curr_eq)) != 0)
+ {
+ esyslog("[cVidixVideoOut] Couldn't set EQ capability: %s exiting\n",
+ strerror(err) );
+ printf("FAILED!!!\n");
+ //exit(1);
+ }
+ }
+
+ if (setupStore->vidDeinterlace > 10)
+ setupStore->vidDeinterlace = 10;
+
+ if (setupStore->vidDeinterlace != vidix_curr_deinterlace) {
+ vidix_deinterlace_t vidix_deint;
+
+ vidix_curr_deinterlace = setupStore->vidDeinterlace;
+ switch (vidix_curr_deinterlace)
+ {
+ case 0: // CFG_NON_INTERLACED
+ vidix_deint.flags = CFG_NON_INTERLACED;
+ break;
+ case 1: // CFG_INTERLACED
+ case 2: // CFG_EVEN_ODD_INTERLACING
+ case 3:
+ vidix_deint. flags = CFG_EVEN_ODD_INTERLACING;
+ break;
+ case 4: // CFG_ODD_EVEN_INTERLACING
+ case 5:
+ case 6:
+ case 7:
+ vidix_deint. flags = CFG_ODD_EVEN_INTERLACING;
+ break;
+ case 8: // CFG_UNIQUE_INTERLACING
+ // xorg METHOD_BOB
+ vidix_deint. flags = CFG_UNIQUE_INTERLACING;
+ vidix_deint. deinterlace_pattern = 0xAAAAA;
+ break;
+ case 9: // CFG_UNIQUE_INTERLACING
+ // xorg METHOD_SINGLE
+ vidix_deint. flags = CFG_UNIQUE_INTERLACING;
+ vidix_deint. deinterlace_pattern = 0xEEEEE | (9<<28);
+ break;
+ case 10:
+ // xorg METHOD_WEAVE
+ vidix_deint. flags = CFG_UNIQUE_INTERLACING;
+ vidix_deint. deinterlace_pattern = 0;
+ break;
+ default:
+ vidix_deint.flags = CFG_NON_INTERLACED;
+ break;
+ }
+ vdlPlaybackSetDeint(vidix_handler, &vidix_deint);
+ vdlPlaybackGetDeint(vidix_handler, &vidix_deint);
+ printf("Deinterlacer: %x %x\n", vidix_deint.flags, vidix_deint.deinterlace_pattern);
+ }
}
/* ----------------------------------------------------------------------------
@@ -337,15 +443,36 @@
if (vidix_fourcc.flags & VID_CAP_COLORKEY)
{
- printf("cVidixVideoOut: set colorkey\n");
+ int res = 0;
+
+ printf("cVidixVideoOut: set colorkey ");
vdlGetGrKeys(vidix_handler, &gr_key);
gr_key.key_op = KEYS_PUT;
-
+#ifdef CKEY_ALPHA
+ if (vidix_fourcc.flags & VID_CAP_BLEND) {
+ useVidixAlpha = true;
+ gr_key.ckey.op = CKEY_ALPHA;
+ printf("[patched vidix version (for radeon)] ");
+ } else {
+ gr_key.ckey.op = CKEY_TRUE;
+ printf("[patched vidix version] ");
+ }
+#else
gr_key.ckey.op = CKEY_TRUE;
+ printf("[base vidix version] ");
+#endif
gr_key.ckey.red = gr_key.ckey.green = gr_key.ckey.blue = 0;
+ res = vdlSetGrKeys(vidix_handler, &gr_key);
+ printf ("vdlSetGrKeys() = %d, ", res);
- vdlSetGrKeys(vidix_handler, &gr_key);
+ if (res) {
+ gr_key.ckey.op = CKEY_TRUE;
+ res = vdlSetGrKeys(vidix_handler, &gr_key);
+ printf (" - %d", res);
+ useVidixAlpha = false;
+ }
+ printf ("\n");
}
next_frame = 0;
@@ -595,6 +722,18 @@
void cVidixVideoOut::AdjustOSDMode()
{
current_osdMode = setupStore->osdMode;
+}
+
+/* ---------------------------------------------------------------------------
+ */
+void cVidixVideoOut::GetOSDMode(int &Depth, bool &HasAlpha, bool &AlphaInversed,
+ bool &IsYUV, uint8_t *&PixelMask)
+{
+ Depth = Bpp;
+ HasAlpha = useVidixAlpha;
+ AlphaInversed = false;
+ IsYUV = (current_osdMode == OSDMODE_SOFTWARE);
+ PixelMask = NULL;
}
/* ---------------------------------------------------------------------------
Index: video-vidix.h
===================================================================
RCS file: /cvsroot/softdevice/softdevice/video-vidix.h,v
retrieving revision 1.10
diff -U3 -r1.10 video-vidix.h
--- video-vidix.h 27 May 2006 19:12:41 -0000 1.10
+++ video-vidix.h 9 Aug 2006 07:06:13 -0000
@@ -14,7 +14,6 @@
#include "vidixlib.h"
#include "fourcc.h"
-
class cVidixVideoOut : public cVideoOut {
private:
uint8_t * fb;
@@ -37,7 +36,9 @@
vidix_yuv_t dstrides;
vidix_grkey_t gr_key;
uint8_t next_frame;
-
+ bool useVidixAlpha;
+ vidix_video_eq_t vidix_curr_eq;
+ int vidix_curr_deinterlace;
void SetParams(int Ystride, int UVstride);
public:
@@ -46,22 +47,23 @@
#if VDRVERSNUM >= 10307
virtual void ClearOSD();
- virtual void AdjustOSDMode();
+ virtual void AdjustOSDMode();
virtual void GetOSDDimension(int &OsdWidth,int &OsdHeight,
int &xPan, int &yPan);
- virtual void GetOSDMode(int &Depth,bool &HasAlpha, bool &AlphaInversed,
- bool &IsYUV,uint8_t *&PixelMask)
- { Depth=Bpp; HasAlpha=false;AlphaInversed=false;
- IsYUV=(current_osdMode == OSDMODE_SOFTWARE);
- PixelMask=NULL;};
- virtual void GetLockOsdSurface(uint8_t *&osd, int &stride,
- bool *&dirtyLines);
+ virtual void GetOSDMode(int &Depth,
+ bool &HasAlpha,
+ bool &AlphaInversed,
+ bool &IsYUV,
+ uint8_t *&PixelMask);
+ virtual void GetLockOsdSurface(uint8_t *&osd,
+ int &stride,
+ bool *&dirtyLines);
#else
virtual void Refresh();
#endif
virtual void CloseOSD();
-// virtual void OpenOSD();
+// virtual void OpenOSD();
virtual void YUV(sPicBuffer *buf);
virtual void Pause(void);
Index: setup-softdevice.h
===================================================================
RCS file: /cvsroot/softdevice/softdevice/setup-softdevice.h,v
retrieving revision 1.33
diff -U3 -r1.33 setup-softdevice.h
--- setup-softdevice.h 25 Jul 2006 19:58:12 -0000 1.33
+++ setup-softdevice.h 9 Aug 2006 07:06:13 -0000
@@ -31,10 +31,11 @@
#define ALSA_DEVICE_NAME_LENGTH 64
-#define CAP_BRIGHTNESS 1
-#define CAP_CONTRAST 2
-#define CAP_HUE 4
-#define CAP_SATURATION 8
+#define CAP_BRIGHTNESS 1
+#define CAP_CONTRAST 2
+#define CAP_HUE 4
+#define CAP_SATURATION 8
+#define CAP_HWDEINTERLACE 16
#define VID_MAX_PARM_VALUE 100
@@ -164,6 +165,7 @@
vidContrast,
vidHue,
vidSaturation,
+ vidDeinterlace,
vidCaps;
char alsaDevice [ALSA_DEVICE_NAME_LENGTH];
char alsaAC3Device [ALSA_DEVICE_NAME_LENGTH];
Index: setup-softdevice-menu.c
===================================================================
RCS file: /cvsroot/softdevice/softdevice/setup-softdevice-menu.c,v
retrieving revision 1.6
diff -U3 -r1.6 setup-softdevice-menu.c
--- setup-softdevice-menu.c 25 Jun 2006 13:46:12 -0000 1.6
+++ setup-softdevice-menu.c 9 Aug 2006 07:06:13 -0000
@@ -44,6 +44,13 @@
0,
VID_MAX_PARM_VALUE));
}
+ if (data->vidCaps & CAP_HWDEINTERLACE)
+ {
+ Add(new cMenuEditIntItem(tr("HW-Deinterlace"),
+ &data->vidDeinterlace,
+ 0,
+ 10));
+ }
}
/* ---------------------------------------------------------------------------
_______________________________________________
Softdevice-devel mailing list
[email protected]
http://bat.berlios.de/mailman/listinfo/softdevice-devel