Mercurial > mplayer.hg
comparison vidix/drivers/nvidia_vid.c @ 11159:8ac4d769a1fb
support for disabling the colorkey
author | alex |
---|---|
date | Fri, 17 Oct 2003 09:18:47 +0000 |
parents | 344052fdfc4a |
children | b5a3ef555164 |
comparison
equal
deleted
inserted
replaced
11158:85f4534d1edb | 11159:8ac4d769a1fb |
---|---|
1 /* | 1 /* |
2 nvidia_vid - VIDIX based video driver for NVIDIA chips | 2 nvidia_vid - VIDIX based video driver for NVIDIA chips |
3 Copyrights 2003 Sascha Sommer. This file is based on sources from | 3 Copyrights 2003 Sascha Sommer. This file is based on sources from |
4 RIVATV (rivatv.sf.net) | 4 RIVATV (rivatv.sf.net) |
5 Licence: GPL | 5 Licence: GPL |
6 WARNING: THIS DRIVER IS IN BETTA STAGE | 6 WARNING: THIS DRIVER IS IN BETA STAGE |
7 | 7 |
8 multi buffer support and TNT2 fixes by Dmitry Baryshkov | 8 multi buffer support and TNT2 fixes by Dmitry Baryshkov |
9 */ | 9 */ |
10 | 10 |
11 | 11 |
408 } | 408 } |
409 | 409 |
410 /* Compute and set colorkey depending on the colour depth. */ | 410 /* Compute and set colorkey depending on the colour depth. */ |
411 static void rivatv_overlay_colorkey (rivatv_info* info, unsigned int chromakey){ | 411 static void rivatv_overlay_colorkey (rivatv_info* info, unsigned int chromakey){ |
412 uint32_t r, g, b, key = 0; | 412 uint32_t r, g, b, key = 0; |
413 | |
413 r = (chromakey & 0x00FF0000) >> 16; | 414 r = (chromakey & 0x00FF0000) >> 16; |
414 g = (chromakey & 0x0000FF00) >> 8; | 415 g = (chromakey & 0x0000FF00) >> 8; |
415 b = chromakey & 0x000000FF; | 416 b = chromakey & 0x000000FF; |
416 switch (info->depth) { | 417 switch (info->depth) { |
417 case 15: | 418 case 15: |
426 case 32: | 427 case 32: |
427 key = chromakey | 0x80000000; | 428 key = chromakey | 0x80000000; |
428 break; | 429 break; |
429 } | 430 } |
430 //printf("[nvidia_vid] depth=%d %08X \n", info->depth, chromakey); | 431 //printf("[nvidia_vid] depth=%d %08X \n", info->depth, chromakey); |
431 if(!info->use_colorkey)return; | |
432 switch (info->chip.arch) { | 432 switch (info->chip.arch) { |
433 case NV_ARCH_10: | 433 case NV_ARCH_10: |
434 case NV_ARCH_20: | 434 case NV_ARCH_20: |
435 case NV_ARCH_30: | 435 case NV_ARCH_30: |
436 VID_WR32 (info->chip.PVIDEO, 0xB00, key); | 436 VID_WR32 (info->chip.PVIDEO, 0xB00, key); |
725 else printf("[nvidia_vid] video mode: %ux%u@%u\n",info->screen_x,info->screen_y, info->depth); | 725 else printf("[nvidia_vid] video mode: %ux%u@%u\n",info->screen_x,info->screen_y, info->depth); |
726 | 726 |
727 | 727 |
728 rivatv_enable_PMEDIA(info); | 728 rivatv_enable_PMEDIA(info); |
729 info->next_frame = 0; | 729 info->next_frame = 0; |
730 info->use_colorkey = 1; | 730 info->use_colorkey = 0; |
731 return 0; | 731 return 0; |
732 } | 732 } |
733 | 733 |
734 void vixDestroy(void){ | 734 void vixDestroy(void){ |
735 unmap_phys_mem(info->control_base ,0x00C00000 + 0x00008000); | 735 unmap_phys_mem(info->control_base ,0x00C00000 + 0x00008000); |
832 rivatv_overlay_stop(info); | 832 rivatv_overlay_stop(info); |
833 return 0; | 833 return 0; |
834 } | 834 } |
835 | 835 |
836 int vixSetGrKeys( const vidix_grkey_t * grkey){ | 836 int vixSetGrKeys( const vidix_grkey_t * grkey){ |
837 if (grkey->ckey.op == CKEY_FALSE) | |
838 { | |
839 info->use_colorkey = 0; | |
840 printf("[nvidia_vid] colorkeying disabled\n"); | |
841 return 0; | |
842 } | |
843 | |
844 info->use_colorkey = 1; | |
837 info->vidixcolorkey = ((grkey->ckey.red<<16)|(grkey->ckey.green<<8)|grkey->ckey.blue); | 845 info->vidixcolorkey = ((grkey->ckey.red<<16)|(grkey->ckey.green<<8)|grkey->ckey.blue); |
838 printf("[nvidia_vid] set colorkey 0x%x\n",info->vidixcolorkey); | 846 printf("[nvidia_vid] set colorkey 0x%x\n",info->vidixcolorkey); |
839 rivatv_overlay_colorkey(info,info->vidixcolorkey); | 847 rivatv_overlay_colorkey(info,info->vidixcolorkey); |
840 return 0; | 848 return 0; |
841 } | 849 } |