annotate libvo/vo_tga.c @ 26759:8eff880f638c

cosmetics: Remove useless parentheses from return statements.
author diego
date Fri, 16 May 2008 09:42:28 +0000
parents 46f0b4d34fa1
children 7681eab10aea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10689
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
1 /*
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
2 * vo_tga.c: targa output
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
3 *
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
4 * this video output module write targa uncompressed file in 15, 24 and 32 bit bgr format.
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
5 *
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
6 * to select the output format use the format filter:
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
7 * mplayer -vo tga -vf format=bgr15 ...
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
8 * mplayer -vo tga -vf format=bgr24 ...
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
9 * mplayer -vo tga -vf format=bgr32 ...
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
10 *
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
11 * The 16 bit file are loaded without problem from Gimp and ImageMagick but give an error
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
12 * with entice (a visualizer from the enlightenment package that use the imlib2 package).
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
13 *
12573
e14b7c6e9d54 Fix for big endian systems
rtognimp
parents: 10689
diff changeset
14 * In 32 bit mode the alpha channel is set to 255 (0xff). For big endian
e14b7c6e9d54 Fix for big endian systems
rtognimp
parents: 10689
diff changeset
15 * machines, TGA_ALPHA32 changes from 0xff000000 to 0x000000ff, and TGA_SHIFT32 from 0 to 8.
10689
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
16 *
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
17 * I need to fill the alpha channel because entice consider that alpha channel (and displays
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
18 * nothing, only the background!), but ImageMacick (the program display) or gimp doesn't
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
19 * care.
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
20 *
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
21 * maybe is possible (with a compilation switch) to avoid the fill of the alpha channel
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
22 * and work outside mplayer (if needed)
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
23 *
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
24 * Daniele Forghieri ( guru@digitalfantasy.it )
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
25 *
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
26 */
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
27
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
28 #include <stdio.h>
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
29 #include <stdlib.h>
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
30 #include <string.h>
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
31 #include <errno.h>
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
32 #include <math.h>
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
33
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
34 #include "config.h"
18234
a107276371a8 Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents: 16171
diff changeset
35 #include "mp_msg.h"
a107276371a8 Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents: 16171
diff changeset
36 #include "help_mp.h"
10689
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
37 #include "video_out.h"
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
38 #include "video_out_internal.h"
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
39
25216
3aee342be929 Make vo info structs const
reimar
parents: 22026
diff changeset
40 static const vo_info_t info =
10689
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
41 {
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
42 "Targa output",
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
43 "tga",
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
44 "Daniele Forghieri - guru@digitalfantasy.it",
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
45 ""
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
46 };
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
47
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
48
25220
c9e9ac2008c2 Mark the vo_functions_t definitions as const where possible.
reimar
parents: 25216
diff changeset
49 const LIBVO_EXTERN (tga)
10689
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
50
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
51 /* locals vars */
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
52 static int frame_num = 0;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
53 static void *line_buff;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
54
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
55 static void tga_make_header(uint8_t *h, int dx, int dy, int bpp)
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
56 {
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
57
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
58 int i;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
59
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
60 for(i = 0; i < 18; i++) {
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
61 switch (i) {
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
62 case 2:
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
63 *h = 0x02;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
64 break;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
65
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
66 case 12:
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
67 *h = dx & 0xff;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
68 break;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
69
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
70 case 13:
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
71 *h = (dx >> 8) & 0xff;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
72 break;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
73
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
74 case 14:
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
75 *h = dy & 0xff;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
76 break;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
77
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
78 case 15:
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
79 *h = (dy >> 8) & 0xff;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
80 break;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
81
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
82 case 16:
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
83 *h = bpp;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
84 break;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
85
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
86 case 17:
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
87 *h = 0x20;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
88 break;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
89
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
90 default:
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
91 *h = 0;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
92 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
93 ++h;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
94 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
95
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
96 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
97
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
98 static int write_tga( char *file, int bpp, int dx, int dy, uint8_t *buf, int stride)
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
99 {
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
100 int er;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
101 FILE *fo;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
102
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
103 fo = fopen(file, "wb");
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
104 if (fo != NULL) {
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
105 uint8_t hdr[18];
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
106
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
107 er = 0;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
108 tga_make_header(hdr, dx, dy, bpp);
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
109 if (fwrite(hdr, sizeof(hdr), 1, fo) == 1) {
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
110 int wb;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
111
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
112 wb = ((bpp + 7) / 8) * dx;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
113 if (bpp == 32) {
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
114 /* Setup the alpha channel for every pixel */
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
115 while (dy-- > 0) {
22026
cac6e3b0d2e5 fix endianess, see bug #727
lu_zero
parents: 18234
diff changeset
116 uint8_t *d;
cac6e3b0d2e5 fix endianess, see bug #727
lu_zero
parents: 18234
diff changeset
117 uint8_t *s;
10689
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
118 int x;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
119
22026
cac6e3b0d2e5 fix endianess, see bug #727
lu_zero
parents: 18234
diff changeset
120 s = buf;
10689
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
121 d = line_buff;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
122 for(x = 0; x < dx; x++) {
22026
cac6e3b0d2e5 fix endianess, see bug #727
lu_zero
parents: 18234
diff changeset
123 #ifdef WORDS_BIGENDIAN
cac6e3b0d2e5 fix endianess, see bug #727
lu_zero
parents: 18234
diff changeset
124 d[0] = s[3];
cac6e3b0d2e5 fix endianess, see bug #727
lu_zero
parents: 18234
diff changeset
125 d[1] = s[2];
cac6e3b0d2e5 fix endianess, see bug #727
lu_zero
parents: 18234
diff changeset
126 d[2] = s[1];
cac6e3b0d2e5 fix endianess, see bug #727
lu_zero
parents: 18234
diff changeset
127 d[3] = 0xff;
cac6e3b0d2e5 fix endianess, see bug #727
lu_zero
parents: 18234
diff changeset
128 #else
cac6e3b0d2e5 fix endianess, see bug #727
lu_zero
parents: 18234
diff changeset
129 d[0] = 0xff;
cac6e3b0d2e5 fix endianess, see bug #727
lu_zero
parents: 18234
diff changeset
130 d[1] = s[1];
cac6e3b0d2e5 fix endianess, see bug #727
lu_zero
parents: 18234
diff changeset
131 d[2] = s[2];
cac6e3b0d2e5 fix endianess, see bug #727
lu_zero
parents: 18234
diff changeset
132 d[3] = s[3];
cac6e3b0d2e5 fix endianess, see bug #727
lu_zero
parents: 18234
diff changeset
133 #endif
cac6e3b0d2e5 fix endianess, see bug #727
lu_zero
parents: 18234
diff changeset
134 d+=4;
cac6e3b0d2e5 fix endianess, see bug #727
lu_zero
parents: 18234
diff changeset
135 s+=4;
10689
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
136 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
137 if (fwrite(line_buff, wb, 1, fo) != 1) {
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
138 er = 4;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
139 break;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
140 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
141 buf += stride;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
142 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
143
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
144 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
145 else {
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
146 while (dy-- > 0) {
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
147 if (fwrite(buf, wb, 1, fo) != 1) {
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
148 er = 4;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
149 break;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
150 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
151 buf += stride;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
152 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
153 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
154 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
155 else {
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
156 er = 2;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
157 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
158
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
159 fclose(fo);
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
160 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
161 else {
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
162 er = 1;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
163 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
164
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
165 if (er) {
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
166 fprintf(stderr, "Error writing file [%s]\n", file);
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
167 }
26755
46f0b4d34fa1 cosmetics: Remove useless parentheses from from return statements.
diego
parents: 25220
diff changeset
168 return er;
10689
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
169 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
170
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
171 static uint32_t draw_image(mp_image_t* mpi)
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
172 {
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
173 char file[20 + 1];
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
174
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
175 snprintf (file, 20, "%08d.tga", ++frame_num);
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
176
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
177 write_tga( file,
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
178 mpi->bpp,
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
179 mpi->w,
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
180 mpi->h,
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
181 mpi->planes[0],
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
182 mpi->stride[0]);
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
183
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
184 return VO_TRUE;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
185 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
186
16171
fd51fd1ff231 Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents: 15212
diff changeset
187 static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format)
10689
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
188 {
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
189 /* buffer for alpha */
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
190 if(line_buff){ free(line_buff); line_buff=NULL; }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
191 if (format == (IMGFMT_BGR | 32)) {
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
192 line_buff = malloc(width * 4);
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
193 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
194 return 0;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
195 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
196
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
197 static void draw_osd(void)
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
198 {
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
199 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
200
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
201 static void flip_page (void)
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
202 {
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
203 return;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
204 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
205
16171
fd51fd1ff231 Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents: 15212
diff changeset
206 static int draw_slice(uint8_t *srcimg[], int stride[], int w,int h,int x,int y)
10689
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
207 {
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
208 return -1;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
209 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
210
16171
fd51fd1ff231 Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents: 15212
diff changeset
211 static int draw_frame(uint8_t * src[])
10689
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
212 {
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
213 return -1;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
214 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
215
16171
fd51fd1ff231 Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents: 15212
diff changeset
216 static int query_format(uint32_t format)
10689
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
217 {
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
218 switch(format){
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
219 case IMGFMT_BGR|15:
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
220 case IMGFMT_BGR|24:
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
221 case IMGFMT_BGR|32:
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
222 return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
223 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
224 return 0;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
225 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
226
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
227 static void uninit(void)
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
228 {
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
229 if(line_buff){ free(line_buff); line_buff=NULL; }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
230 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
231
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
232 static void check_events(void)
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
233 {
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
234 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
235
16171
fd51fd1ff231 Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents: 15212
diff changeset
236 static int preinit(const char *arg)
10689
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
237 {
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
238 if(arg) {
18234
a107276371a8 Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents: 16171
diff changeset
239 mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_TGA_UnknownSubdevice,arg);
10689
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
240 return ENOSYS;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
241 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
242 return 0;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
243 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
244
16171
fd51fd1ff231 Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents: 15212
diff changeset
245 static int control(uint32_t request, void *data, ...)
10689
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
246 {
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
247 switch (request) {
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
248 case VOCTRL_DRAW_IMAGE:
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
249 return draw_image(data);
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
250
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
251 case VOCTRL_QUERY_FORMAT:
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
252 return query_format(*((uint32_t*)data));
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
253 }
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
254 return VO_NOTIMPL;
c6c54f467984 TGA image output VO module
arpi
parents:
diff changeset
255 }