annotate libvo/vo_png.c @ 7953:60624e692b95

GCC warning fixes
author bertrand
date Tue, 29 Oct 2002 09:18:53 +0000
parents 7d2542838d24
children 5b39e79af5fe
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
527
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
1 /*
530
670d47b4ce10 changed copyroght message to correct stuff :)
atmosfear
parents: 527
diff changeset
2 * vo_png.c, Portable Network Graphics Renderer for Mplayer
527
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
3 *
530
670d47b4ce10 changed copyroght message to correct stuff :)
atmosfear
parents: 527
diff changeset
4 * Copyright 2001 by Felix Buenemann <atmosfear@users.sourceforge.net>
527
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
5 *
530
670d47b4ce10 changed copyroght message to correct stuff :)
atmosfear
parents: 527
diff changeset
6 * Uses libpng (which uses zlib), so see according licenses.
527
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
7 *
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
8 */
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
9
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
10 #include <stdio.h>
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
11 #include <stdlib.h>
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
12 #include <string.h>
612
77e0094f0cce some warnings killed
szabii
parents: 530
diff changeset
13 #include <errno.h>
527
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
14
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
15 #include <png.h>
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
16
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
17 #include "config.h"
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
18 #include "video_out.h"
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
19 #include "video_out_internal.h"
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
20
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
21 LIBVO_EXTERN (png)
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
22
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
23 static vo_info_t vo_info =
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
24 {
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
25 "PNG file",
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
26 "png",
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
27 "Felix Buenemann <atmosfear@users.sourceforge.net>",
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
28 ""
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
29 };
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
30
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
31 extern int verbose;
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
32 int z_compression = Z_NO_COMPRESSION;
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
33 static int framenum = 0;
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
34
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
35 struct pngdata {
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
36 FILE * fp;
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
37 png_structp png_ptr;
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
38 png_infop info_ptr;
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
39 enum {OK,ERROR} status;
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
40 };
3950
e92653caf5d7 osd support, zlib range fix. by Kim Minh Kaplan <kmkaplan@selfoffice.com>
arpi
parents: 2732
diff changeset
41
527
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
42 static uint32_t
7124
eca7dbad0166 finally removed query_vaa, bes_da and vo_tune_info - the obsoleted libvo api
alex
parents: 6132
diff changeset
43 config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format)
527
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
44 {
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
45
3950
e92653caf5d7 osd support, zlib range fix. by Kim Minh Kaplan <kmkaplan@selfoffice.com>
arpi
parents: 2732
diff changeset
46 if((z_compression >= 0) && (z_compression <= 9)) {
527
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
47 if(z_compression == 0) {
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
48 printf("PNG Warning: compression level set to 0, compression disabled!\n");
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
49 printf("PNG Info: Use the -z <n> switch to set compression level from 0 to 9.\n");
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
50 printf("PNG Info: (0 = no compression, 1 = fastest, lowest - 9 best, slowest compression)\n");
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
51 }
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
52 }
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
53 else {
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
54 printf("PNG Warning: compression level out of range setting to 1!\n");
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
55 printf("PNG Info: Use the -z <n> switch to set compression level from 0 to 9.\n");
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
56 printf("PNG Info: (0 = no compression, 1 = fastest, lowest - 9 best, slowest compression)\n");
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
57 z_compression = Z_BEST_SPEED;
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
58 }
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
59
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
60 if(verbose) printf("PNG Compression level %i\n", z_compression);
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
61
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
62 return 0;
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
63 }
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
64
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
65 static const vo_info_t*
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
66 get_info(void)
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
67 {
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
68 return &vo_info;
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
69 }
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
70
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
71
7926
7d2542838d24 - removed YV12 support (builtin yv12->rgb conversion)
arpi
parents: 7694
diff changeset
72 struct pngdata create_png (char * fname, int image_width, int image_height, int swapped)
527
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
73 {
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
74 struct pngdata png;
7926
7d2542838d24 - removed YV12 support (builtin yv12->rgb conversion)
arpi
parents: 7694
diff changeset
75
527
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
76 /*png_structp png_ptr = png_create_write_struct
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
77 (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr,
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
78 user_error_fn, user_warning_fn);*/
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
79 //png_byte *row_pointers[image_height];
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
80 png.png_ptr = png_create_write_struct
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
81 (PNG_LIBPNG_VER_STRING, NULL,
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
82 NULL, NULL);
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
83 png.info_ptr = png_create_info_struct(png.png_ptr);
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
84
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
85 if (!png.png_ptr) {
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
86 if(verbose > 1) printf("PNG Failed to init png pointer\n");
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
87 png.status = ERROR;
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
88 return png;
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
89 }
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
90
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
91 if (!png.info_ptr) {
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
92 if(verbose > 1) printf("PNG Failed to init png infopointer\n");
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
93 png_destroy_write_struct(&png.png_ptr,
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
94 (png_infopp)NULL);
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
95 png.status = ERROR;
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
96 return png;
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
97 }
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
98
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
99 if (setjmp(png.png_ptr->jmpbuf)) {
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
100 if(verbose > 1) printf("PNG Internal error!\n");
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
101 png_destroy_write_struct(&png.png_ptr, &png.info_ptr);
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
102 fclose(png.fp);
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
103 png.status = ERROR;
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
104 return png;
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
105 }
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
106
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
107 png.fp = fopen (fname, "wb");
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
108 if (png.fp == NULL) {
612
77e0094f0cce some warnings killed
szabii
parents: 530
diff changeset
109 printf("\nPNG Error opening %s for writing!\n", strerror(errno));
527
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
110 png.status = ERROR;
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
111 return png;
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
112 }
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
113
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
114 if(verbose > 1) printf("PNG Init IO\n");
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
115 png_init_io(png.png_ptr, png.fp);
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
116
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
117 /* set the zlib compression level */
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
118 png_set_compression_level(png.png_ptr, z_compression);
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
119
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
120
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
121 /*png_set_IHDR(png_ptr, info_ptr, width, height,
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
122 bit_depth, color_type, interlace_type,
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
123 compression_type, filter_type)*/
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
124 png_set_IHDR(png.png_ptr, png.info_ptr, image_width, image_height,
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
125 8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE,
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
126 PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
127
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
128 if(verbose > 1) printf("PNG Write Info\n");
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
129 png_write_info(png.png_ptr, png.info_ptr);
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
130
7926
7d2542838d24 - removed YV12 support (builtin yv12->rgb conversion)
arpi
parents: 7694
diff changeset
131 if(swapped) {
527
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
132 if(verbose > 1) printf("PNG Set BGR Conversion\n");
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
133 png_set_bgr(png.png_ptr);
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
134 }
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
135
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
136 png.status = OK;
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
137 return png;
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
138 }
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
139
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
140 static uint8_t destroy_png(struct pngdata png) {
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
141
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
142 if(verbose > 1) printf("PNG Write End\n");
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
143 png_write_end(png.png_ptr, png.info_ptr);
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
144
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
145 if(verbose > 1) printf("PNG Destroy Write Struct\n");
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
146 png_destroy_write_struct(&png.png_ptr, &png.info_ptr);
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
147
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
148 fclose (png.fp);
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
149
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
150 return 0;
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
151 }
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
152
7693
3f218f3172f3 draw_image()
arpi
parents: 7472
diff changeset
153 static uint32_t draw_image(mp_image_t* mpi){
527
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
154 char buf[100];
7926
7d2542838d24 - removed YV12 support (builtin yv12->rgb conversion)
arpi
parents: 7694
diff changeset
155 int k;
527
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
156 struct pngdata png;
7926
7d2542838d24 - removed YV12 support (builtin yv12->rgb conversion)
arpi
parents: 7694
diff changeset
157 png_byte *row_pointers[mpi->h];
7693
3f218f3172f3 draw_image()
arpi
parents: 7472
diff changeset
158
3f218f3172f3 draw_image()
arpi
parents: 7472
diff changeset
159 // if -dr or -slices then do nothing:
3f218f3172f3 draw_image()
arpi
parents: 7472
diff changeset
160 if(mpi->flags&(MP_IMGFLAG_DIRECT|MP_IMGFLAG_DRAW_CALLBACK)) return VO_TRUE;
527
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
161
1078
874ba7049c1a sprintf possible buffer overflow fixes
al3x
parents: 612
diff changeset
162 snprintf (buf, 100, "%08d.png", ++framenum);
527
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
163
7926
7d2542838d24 - removed YV12 support (builtin yv12->rgb conversion)
arpi
parents: 7694
diff changeset
164 png = create_png(buf, mpi->w, mpi->h, mpi->flags&MP_IMGFLAG_SWAPPED);
527
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
165
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
166 if(png.status){
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
167 printf("PNG Error in create_png\n");
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
168 return 1;
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
169 }
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
170
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
171 if(verbose > 1) printf("PNG Creating Row Pointers\n");
7926
7d2542838d24 - removed YV12 support (builtin yv12->rgb conversion)
arpi
parents: 7694
diff changeset
172 for ( k = 0; k < mpi->h; k++ )
7693
3f218f3172f3 draw_image()
arpi
parents: 7472
diff changeset
173 row_pointers[k] = mpi->planes[0]+mpi->stride[0]*k;
3f218f3172f3 draw_image()
arpi
parents: 7472
diff changeset
174
527
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
175 //png_write_flush(png.png_ptr);
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
176 //png_set_flush(png.png_ptr, nrows);
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
177
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
178 if(verbose > 1) printf("PNG Writing Image Data\n");
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
179 png_write_image(png.png_ptr, row_pointers);
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
180
7693
3f218f3172f3 draw_image()
arpi
parents: 7472
diff changeset
181 destroy_png(png);
527
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
182
7693
3f218f3172f3 draw_image()
arpi
parents: 7472
diff changeset
183 return VO_TRUE;
527
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
184 }
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
185
7926
7d2542838d24 - removed YV12 support (builtin yv12->rgb conversion)
arpi
parents: 7694
diff changeset
186 static void draw_osd(void){}
1501
d40f2b686846 changes according to -utf8 option, draw_osd() function added
atlka
parents: 1078
diff changeset
187
7926
7d2542838d24 - removed YV12 support (builtin yv12->rgb conversion)
arpi
parents: 7694
diff changeset
188 static void flip_page (void){}
527
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
189
7926
7d2542838d24 - removed YV12 support (builtin yv12->rgb conversion)
arpi
parents: 7694
diff changeset
190 static uint32_t draw_frame(uint8_t * src[])
7d2542838d24 - removed YV12 support (builtin yv12->rgb conversion)
arpi
parents: 7694
diff changeset
191 {
7d2542838d24 - removed YV12 support (builtin yv12->rgb conversion)
arpi
parents: 7694
diff changeset
192 return -1;
527
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
193 }
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
194
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
195 static uint32_t draw_slice( uint8_t *src[],int stride[],int w,int h,int x,int y )
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
196 {
7926
7d2542838d24 - removed YV12 support (builtin yv12->rgb conversion)
arpi
parents: 7694
diff changeset
197 return -1;
527
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
198 }
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
199
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
200 static uint32_t
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
201 query_format(uint32_t format)
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
202 {
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
203 switch(format){
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
204 case IMGFMT_RGB|24:
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
205 case IMGFMT_BGR|24:
7694
b64f14fdadfb also set VFCAP_ACCEPT_STRIDE when draw_image() is implemented
arpi
parents: 7693
diff changeset
206 return VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW|VFCAP_ACCEPT_STRIDE;
527
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
207 }
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
208 return 0;
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
209 }
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
210
7926
7d2542838d24 - removed YV12 support (builtin yv12->rgb conversion)
arpi
parents: 7694
diff changeset
211 static void uninit(void){}
527
a38decaa04ec png video out renderer initial release
atmosfear
parents:
diff changeset
212
7926
7d2542838d24 - removed YV12 support (builtin yv12->rgb conversion)
arpi
parents: 7694
diff changeset
213 static void check_events(void){}
4352
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4060
diff changeset
214
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4060
diff changeset
215 static uint32_t preinit(const char *arg)
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4060
diff changeset
216 {
4737
32e1f5042f65 I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents: 4596
diff changeset
217 if(arg)
32e1f5042f65 I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents: 4596
diff changeset
218 {
32e1f5042f65 I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents: 4596
diff changeset
219 printf("PNG Unknown subdevice: %s\n",arg);
32e1f5042f65 I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents: 4596
diff changeset
220 return ENOSYS;
32e1f5042f65 I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents: 4596
diff changeset
221 }
32e1f5042f65 I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents: 4596
diff changeset
222 return 0;
4352
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4060
diff changeset
223 }
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4060
diff changeset
224
4596
c35d7ce151b3 10000hl to Holm... control MUST BE static...
arpi
parents: 4592
diff changeset
225 static uint32_t control(uint32_t request, void *data, ...)
4352
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4060
diff changeset
226 {
4592
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4433
diff changeset
227 switch (request) {
7693
3f218f3172f3 draw_image()
arpi
parents: 7472
diff changeset
228 case VOCTRL_DRAW_IMAGE:
3f218f3172f3 draw_image()
arpi
parents: 7472
diff changeset
229 return draw_image(data);
4592
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4433
diff changeset
230 case VOCTRL_QUERY_FORMAT:
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4433
diff changeset
231 return query_format(*((uint32_t*)data));
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4433
diff changeset
232 }
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4433
diff changeset
233 return VO_NOTIMPL;
4352
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4060
diff changeset
234 }