From patchwork Mon May 15 08:22:18 2006 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schwarzott X-Patchwork-Id: 12308 Received: from mail-out.m-online.net ([212.18.0.9]) by www.linuxtv.org with esmtp (Exim 4.50) id 1FfYLM-0005vK-Kr for vdr@linuxtv.org; Mon, 15 May 2006 10:22:20 +0200 Received: from mail01.m-online.net (svr21.m-online.net [192.168.3.149]) by mail-out.m-online.net (Postfix) with ESMTP id 18B06708F3 for ; Mon, 15 May 2006 10:22:20 +0200 (CEST) Received: from gauss.x.fun (DSL01.83.171.162.245.NEFkom.net [83.171.162.245]) by mail.nefkom.net (Postfix) with ESMTP id DB2199242B for ; Mon, 15 May 2006 10:22:19 +0200 (CEST) Received: from gateway (gateway [192.168.42.1]) by gauss.x.fun (Postfix) with ESMTP id 50502D39E97 for ; Mon, 15 May 2006 10:22:19 +0200 (CEST) From: Matthias Schwarzott To: vdr@linuxtv.org Date: Mon, 15 May 2006 10:22:18 +0200 User-Agent: KMail/1.9.1 MIME-Version: 1.0 Message-Id: <200605151022.18430.zzam@gentoo.org> Subject: [vdr] patch against softdevice-CVS to not change picture settings (contrast, ...) X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 May 2006 08:22:20 -0000 Status: O X-Status: X-Keywords: X-UID: 9470 Hi! I have written this patch for the softdevice xv-output method to stop it from changing all my xv output settings (contrast brightness hue saturation). I mainly use the new shm-output communication with xv. I know that it is in some parts a hack, but I hope that a similar patch will be incorporated into the official version. The other problem I could not solve myself is that the colorkey setting of xv gets modified to colorkey=black, which makes every window containing black areas transparent, this is just annoying. Matthias diff -ru --exclude=CVS --ignore-matching-lines=Id: softdevice-0.2.3.20060511/video-xv.c softdevice-0.2.3.20060511-zzam/video-xv.c --- softdevice-0.2.3.20060511/video-xv.c 2006-04-25 00:56:47.000000000 +0200 +++ softdevice-0.2.3.20060511-zzam/video-xv.c 2006-05-13 20:31:19.000000000 +0200 @@ -126,6 +126,21 @@ /* --------------------------------------------------------------------------- */ +int cXvPortAttributeStore::GetValuePercent(int index) +{ + int value = portAttributeCurrentValues[index]; + + value = (int) (((double) value - (double) portAttributes[index].min_value) * 100.0 + / ((double) portAttributes[index].max_value - (double) portAttributes[index].min_value)); + + if (value <= 100 && + value >= 0) + return value; + return 0; +} + +/* --------------------------------------------------------------------------- + */ void cXvPortAttributeStore::SetValuePercent(char *name, int value) { for (int i = 0; i < portAttributeCount; ++i) @@ -149,15 +164,16 @@ /* --------------------------------------------------------------------------- */ -void cXvPortAttributeStore::SetColorkey(int value) +int cXvPortAttributeStore::SetColorkey(int value) { for (int i = 0; i < portAttributeCount; ++i) { if (!strcmp("XV_COLORKEY",portAttributes[i].name)) { + int oldColorkey = portAttributeCurrentValues[i]; portAttributeCurrentValues[i] = value; XvSetPortAttribute(dpy,port,portAttributeAtoms[i],portAttributeCurrentValues[i]); - return; + return oldColorkey; } } } @@ -217,13 +233,25 @@ portAttributeCurrentValues[i] = portAttributeSaveValues[i]; } if (!strcmp(portAttributes[i].name, "XV_BRIGHTNESS")) + { setupStore->vidCaps |= CAP_BRIGHTNESS; + setupStore->vidBrightness = currBrightness = GetValuePercent(i); + } if (!strcmp(portAttributes[i].name, "XV_CONTRAST")) + { setupStore->vidCaps |= CAP_CONTRAST; + setupStore->vidContrast = currContrast = GetValuePercent(i); + } if (!strcmp(portAttributes[i].name, "XV_HUE")) + { setupStore->vidCaps |= CAP_HUE; + setupStore->vidHue = currHue = GetValuePercent(i); + } if (!strcmp(portAttributes[i].name, "XV_SATURATION")) + { setupStore->vidCaps |= CAP_SATURATION; + setupStore->vidSaturation = currSaturation = GetValuePercent(i); + } dsyslog("[XvVideoOut]:" " %-25s %-4sXvGettable %-4sXvSettable " diff -ru --exclude=CVS --ignore-matching-lines=Id: softdevice-0.2.3.20060511/video-xv.h softdevice-0.2.3.20060511-zzam/video-xv.h --- softdevice-0.2.3.20060511/video-xv.h 2006-04-23 21:38:29.000000000 +0200 +++ softdevice-0.2.3.20060511-zzam/video-xv.h 2006-05-13 20:29:38.000000000 +0200 @@ -91,7 +91,8 @@ void SetXInfo(Display *dpy, XvPortID port, cSetupStore *setupStore); void SetValue(char *name, int value); void SetValuePercent(char *name, int value); - void SetColorkey(int value); + int GetValuePercent(int index); + int SetColorkey(int value); void Increment(char *name); void Decrement(char *name); void Save();