Mercurial > mplayer.hg
annotate libvo/vo_cvidix.c @ 11221:5c6e899ee6f3
handle sis_vid the same way as the other drivers
author | faust3 |
---|---|
date | Wed, 22 Oct 2003 16:45:33 +0000 |
parents | 30eccb0d1a64 |
children | 147a4c50214d |
rev | line source |
---|---|
10979 | 1 /* |
2 VIDIX accelerated overlay on black background | |
3 should work on any OS | |
4 TODO: implement blanking, aspect, geometry,fs etc. | |
5 | |
6 (C) Sascha Sommer | |
7 | |
8 | |
9 */ | |
10 | |
11 #include <stdio.h> | |
12 #include <stdlib.h> | |
13 #include <string.h> | |
14 #include <math.h> | |
15 #include <errno.h> | |
16 | |
17 #include "config.h" | |
18 #include "video_out.h" | |
19 #include "video_out_internal.h" | |
20 | |
21 #include "mp_msg.h" | |
22 | |
23 #include "vosub_vidix.h" | |
24 #include "../vidix/vidixlib.h" | |
25 | |
26 | |
27 static vo_info_t info = { | |
28 "VIDIX", | |
11017 | 29 "cvidix", |
10979 | 30 "Sascha Sommer", |
31 "" | |
32 }; | |
33 | |
11017 | 34 LIBVO_EXTERN(cvidix) |
10979 | 35 |
36 #define UNUSED(x) ((void)(x)) /* Removes warning about unused arguments */ | |
37 | |
38 /* VIDIX related */ | |
39 static char *vidix_name; | |
40 | |
41 | |
42 static vidix_grkey_t gr_key; | |
43 | |
44 static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width,uint32_t d_height, uint32_t flags, char *title, uint32_t format){ | |
45 if(vidix_init(width, height, 0, 0, d_width, d_height, format, 32, 640, 480))mp_msg(MSGT_VO, MSGL_FATAL, "Can't initialize VIDIX driver: %s\n", strerror(errno)); | |
46 /*set colorkey*/ | |
47 vidix_start(); | |
48 if(vidix_grkey_support()){ | |
49 vidix_grkey_get(&gr_key); | |
50 gr_key.key_op = KEYS_PUT; | |
11216 | 51 if (!(vo_colorkey & 0xff000000)) |
11158
85f4534d1edb
Colorkeying can be disabled. Fbdev, svga and vesa vidix colorkeying support
alex
parents:
11019
diff
changeset
|
52 { |
85f4534d1edb
Colorkeying can be disabled. Fbdev, svga and vesa vidix colorkeying support
alex
parents:
11019
diff
changeset
|
53 gr_key.ckey.op = CKEY_TRUE; |
85f4534d1edb
Colorkeying can be disabled. Fbdev, svga and vesa vidix colorkeying support
alex
parents:
11019
diff
changeset
|
54 gr_key.ckey.red = (vo_colorkey & 0x00FF0000) >> 16; |
85f4534d1edb
Colorkeying can be disabled. Fbdev, svga and vesa vidix colorkeying support
alex
parents:
11019
diff
changeset
|
55 gr_key.ckey.green = (vo_colorkey & 0x0000FF00) >> 8; |
85f4534d1edb
Colorkeying can be disabled. Fbdev, svga and vesa vidix colorkeying support
alex
parents:
11019
diff
changeset
|
56 gr_key.ckey.blue = vo_colorkey & 0x000000FF; |
85f4534d1edb
Colorkeying can be disabled. Fbdev, svga and vesa vidix colorkeying support
alex
parents:
11019
diff
changeset
|
57 } |
85f4534d1edb
Colorkeying can be disabled. Fbdev, svga and vesa vidix colorkeying support
alex
parents:
11019
diff
changeset
|
58 else |
85f4534d1edb
Colorkeying can be disabled. Fbdev, svga and vesa vidix colorkeying support
alex
parents:
11019
diff
changeset
|
59 gr_key.ckey.op = CKEY_FALSE; |
10979 | 60 vidix_grkey_set(&gr_key); |
61 } | |
62 return 0; | |
63 } | |
64 | |
65 static void check_events(void){ | |
66 } | |
67 | |
68 /* draw_osd, flip_page, draw_slice, draw_frame should be | |
69 overwritten with vidix functions (vosub_vidix.c) */ | |
70 static void draw_osd(void){ | |
11019 | 71 mp_msg(MSGT_VO, MSGL_FATAL, "vo_cvidix: error: didn't use vidix draw_osd!\n"); |
10979 | 72 return; |
73 } | |
74 | |
75 static void flip_page(void){ | |
11019 | 76 mp_msg(MSGT_VO, MSGL_FATAL, "vo_cvidix: error: didn't use vidix flip_page!\n"); |
10979 | 77 return; |
78 } | |
79 | |
80 static uint32_t draw_slice(uint8_t *src[], int stride[],int w, int h, int x, int y){ | |
81 UNUSED(src); | |
82 UNUSED(stride); | |
83 UNUSED(w); | |
84 UNUSED(h); | |
85 UNUSED(x); | |
86 UNUSED(y); | |
11019 | 87 mp_msg(MSGT_VO, MSGL_FATAL, "vo_cvidix: error: didn't use vidix draw_slice!\n"); |
10979 | 88 return -1; |
89 } | |
90 | |
91 static uint32_t draw_frame(uint8_t *src[]){ | |
92 UNUSED(src); | |
11019 | 93 mp_msg(MSGT_VO, MSGL_FATAL, "vo_cvidix: error: didn't use vidix draw_frame!\n"); |
10979 | 94 return -1; |
95 } | |
96 | |
97 static uint32_t query_format(uint32_t format){ | |
98 return(vidix_query_fourcc(format)); | |
99 } | |
100 | |
101 static void uninit(void){ | |
102 if(!vo_config_count) return; | |
103 vidix_term(); | |
104 if(vidix_name){ | |
105 free(vidix_name); | |
106 vidix_name = NULL; | |
107 } | |
108 } | |
109 | |
110 static uint32_t preinit(const char *arg){ | |
111 if(arg)vidix_name = strdup(arg); | |
112 else { | |
11019 | 113 mp_msg(MSGT_VO, MSGL_INFO, "vo_cvidix: No vidix driver name provided, probing available ones!\n"); |
10979 | 114 vidix_name = NULL; |
115 } | |
11019 | 116 if(vidix_preinit(vidix_name, &video_out_cvidix))return 1; |
10979 | 117 return 0; |
118 } | |
119 | |
120 static uint32_t control(uint32_t request, void *data, ...){ | |
121 switch (request) { | |
122 case VOCTRL_QUERY_FORMAT: | |
123 return query_format(*((uint32_t*)data)); | |
124 } | |
125 return vidix_control(request, data); | |
126 } |