changeset 4255:5a4a4b272d10

vidix_grkey_support checking for colorkeying
author alex
date Sat, 19 Jan 2002 16:58:33 +0000
parents f04c49aa2408
children bbaa26821fdf
files libvo/vo_xvidix.c libvo/vosub_vidix.c libvo/vosub_vidix.h
diffstat 3 files changed, 17 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_xvidix.c	Sat Jan 19 16:58:04 2002 +0000
+++ b/libvo/vo_xvidix.c	Sat Jan 19 16:58:33 2002 +0000
@@ -187,7 +187,6 @@
 static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width,
     uint32_t d_height, uint32_t flags, char *title, uint32_t format)
 {
-    unsigned int fg, bg;
     XVisualInfo vinfo;
     XEvent xev;
     XSizeHints hint;
@@ -359,13 +358,16 @@
 }
 #endif
 
-    vidix_grkey_get(&gr_key);
-    gr_key.key_op = KEYS_PUT;
-    gr_key.ckey.op = CKEY_TRUE;
-    gr_key.ckey.red = 255;
-    gr_key.ckey.green = 0;
-    gr_key.ckey.blue = 255;
-    vidix_grkey_set(&gr_key);
+    if (vidix_grkey_support())
+    {
+	vidix_grkey_get(&gr_key);
+	gr_key.key_op = KEYS_PUT;
+	gr_key.ckey.op = CKEY_TRUE;
+	gr_key.ckey.red = 255;
+	gr_key.ckey.green = 0;
+	gr_key.ckey.blue = 255;
+	vidix_grkey_set(&gr_key);
+    }
 
     set_window(1);
 
--- a/libvo/vosub_vidix.c	Sat Jan 19 16:58:04 2002 +0000
+++ b/libvo/vosub_vidix.c	Sat Jan 19 16:58:33 2002 +0000
@@ -190,6 +190,7 @@
 	printf("vosub_vidix: Can't start playback: %s\n",strerror(err));
 	return -1;
     }
+    
     vid_eq.brightness = vo_gamma_brightness;
     vid_eq.saturation = vo_gamma_saturation;
     vid_eq.contrast = vo_gamma_contrast;
@@ -373,6 +374,11 @@
   return vidix_fourcc.depth != VID_DEPTH_NONE;
 }
 
+int vidix_grkey_support(void)
+{
+    return (vidix_fourcc.flags & VID_CAP_COLORKEY);
+}
+
 int vidix_grkey_get(vidix_grkey_t *gr_key)
 {
     return(vdlGetGrKeys(vidix_handler, gr_key));
--- a/libvo/vosub_vidix.h	Sat Jan 19 16:58:04 2002 +0000
+++ b/libvo/vosub_vidix.h	Sat Jan 19 16:58:33 2002 +0000
@@ -31,6 +31,7 @@
 
 #include "../vidix/vidix.h"
 /* graphic keys */
+int vidix_grkey_support(void);
 int vidix_grkey_get(vidix_grkey_t *gr_key);
 int vidix_grkey_set(const vidix_grkey_t *gr_key);