From 722779f9a0b4e9805ad0378af2ecd135b7ab4a62 Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 17 Oct 2003 09:18:47 +0000 Subject: support for disabling the colorkey git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11160 b3059339-0415-0410-9bf9-f77b7e298cf2 --- vidix/drivers/nvidia_vid.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'vidix/drivers') diff --git a/vidix/drivers/nvidia_vid.c b/vidix/drivers/nvidia_vid.c index 260ecaa005..1aab6093b8 100644 --- a/vidix/drivers/nvidia_vid.c +++ b/vidix/drivers/nvidia_vid.c @@ -3,7 +3,7 @@ Copyrights 2003 Sascha Sommer. This file is based on sources from RIVATV (rivatv.sf.net) Licence: GPL - WARNING: THIS DRIVER IS IN BETTA STAGE + WARNING: THIS DRIVER IS IN BETA STAGE multi buffer support and TNT2 fixes by Dmitry Baryshkov */ @@ -410,6 +410,7 @@ static uint32_t rivatv_overlay_pan (struct rivatv_info *info){ /* Compute and set colorkey depending on the colour depth. */ static void rivatv_overlay_colorkey (rivatv_info* info, unsigned int chromakey){ uint32_t r, g, b, key = 0; + r = (chromakey & 0x00FF0000) >> 16; g = (chromakey & 0x0000FF00) >> 8; b = chromakey & 0x000000FF; @@ -428,7 +429,6 @@ static void rivatv_overlay_colorkey (rivatv_info* info, unsigned int chromakey){ break; } //printf("[nvidia_vid] depth=%d %08X \n", info->depth, chromakey); - if(!info->use_colorkey)return; switch (info->chip.arch) { case NV_ARCH_10: case NV_ARCH_20: @@ -727,7 +727,7 @@ int vixInit(void){ rivatv_enable_PMEDIA(info); info->next_frame = 0; - info->use_colorkey = 1; + info->use_colorkey = 0; return 0; } @@ -834,6 +834,14 @@ int vixPlaybackOff(void){ } int vixSetGrKeys( const vidix_grkey_t * grkey){ + if (grkey->ckey.op == CKEY_FALSE) + { + info->use_colorkey = 0; + printf("[nvidia_vid] colorkeying disabled\n"); + return 0; + } + + info->use_colorkey = 1; info->vidixcolorkey = ((grkey->ckey.red<<16)|(grkey->ckey.green<<8)|grkey->ckey.blue); printf("[nvidia_vid] set colorkey 0x%x\n",info->vidixcolorkey); rivatv_overlay_colorkey(info,info->vidixcolorkey); -- cgit v1.2.3