annotate libvo/vo_svga.c @ 989:1be1647ebd7d

flip_page gl_fillbox fix.
author se7encode
date Mon, 04 Jun 2001 11:27:42 +0000
parents 90408bd383a5
children bf2c01c5e9dc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
1 /*
292
2c0bb83b77b3 Some bugfix.
se7encode
parents: 290
diff changeset
2 Video driver for SVGAlib - alpha, slow
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
3 by Zoltan Mark Vician <se7en@sch.bme.hu>
381
bbd079aa1614 Date bugfix :)
se7encode
parents: 377
diff changeset
4 Code started: Mon Apr 1 23:25:47 2001
407
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
5
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
6 Uses HW acceleration if your card is supported by SVGAlib.
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
7 */
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
8
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
9 #include <stdio.h>
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
10 #include <stdlib.h>
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
11
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
12 #include <vga.h>
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
13 #include <vgagl.h>
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
14
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
15 #include <limits.h>
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
16
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
17 #include "config.h"
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
18 #include "video_out.h"
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
19 #include "video_out_internal.h"
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
20
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
21 #include "yuv2rgb.h"
377
8ad594a8c94c Bugfixes in draw_slice.
se7encode
parents: 343
diff changeset
22 #include "mmx.h"
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
23
616
41d6eec69b60 clean up
pontscho
parents: 612
diff changeset
24 #include "sub.h"
41d6eec69b60 clean up
pontscho
parents: 612
diff changeset
25
407
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
26 extern void rgb15to16_mmx(char* s0,char* d0,int count);
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
27 extern int vo_dbpp;
504
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
28 extern int verbose;
407
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
29
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
30 LIBVO_EXTERN(svga)
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
31
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
32 static vo_info_t vo_info = {
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
33 "SVGAlib",
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
34 "svga",
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
35 "Zoltan Mark Vician <se7en@sch.bme.hu>",
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
36 ""
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
37 };
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
38
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
39 // SVGAlib definitions
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
40
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
41 GraphicsContext *screen;
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
42 GraphicsContext *virt;
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
43
407
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
44 static uint8_t *scalebuf = NULL, *yuvbuf = NULL, *bppbuf = NULL;
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
45
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
46 static uint32_t orig_w, orig_h, maxw, maxh; // Width, height
377
8ad594a8c94c Bugfixes in draw_slice.
se7encode
parents: 343
diff changeset
47 static float scaling = 1.0;
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
48 static uint32_t x_pos, y_pos; // Position
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
49
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
50 // SVGAlib - list of detected modes
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
51 typedef struct vga_modelist_s {
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
52 uint16_t modenum;
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
53 vga_modeinfo modeinfo;
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
54 struct vga_modelist_s *next;
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
55 } vga_modelist_t;
447
b3b28a0d9404 All available videomodes support added.
se7encode
parents: 411
diff changeset
56
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
57 vga_modelist_t *modelist = NULL;
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
58
327
e7731f5c76cc OSD renderers for all modes added.
se7encode
parents: 293
diff changeset
59 static uint8_t bpp;
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
60 static uint8_t bpp_conv = 0;
448
198b46b739d8 qrva eletbe nem kene cvs-t elbaszni inkabb ne nyuljatok hozza baz+
arpi_esp
parents: 447
diff changeset
61 static uint32_t pformat;
447
b3b28a0d9404 All available videomodes support added.
se7encode
parents: 411
diff changeset
62
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
63 #define BPP_15 1
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
64 #define BPP_16 2
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
65 #define BPP_24 4
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
66 #define BPP_32 8
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
67 static uint8_t bpp_avail = 0;
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
68
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
69 static uint8_t checked = 0;
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
70
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
71 static uint32_t add_mode(uint16_t mode, vga_modeinfo minfo) {
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
72 vga_modelist_t *list;
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
73
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
74 if (modelist == NULL) {
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
75 modelist = (vga_modelist_t *) malloc(sizeof(vga_modelist_t));
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
76 if (modelist == NULL) {
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
77 printf("vo_svga: add_mode() failed. Not enough memory for modelist.");
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
78 return(1); // error
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
79 }
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
80 modelist->modenum = mode;
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
81 modelist->modeinfo = minfo;
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
82 modelist->next = NULL;
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
83 } else {
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
84 list = modelist;
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
85 while (list->next != NULL)
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
86 list = list->next;
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
87 list->next = (vga_modelist_t *) malloc(sizeof(vga_modelist_t));
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
88 if (list->next == NULL) {
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
89 printf("vo_svga: add_mode() failed. Not enough memory for modelist.");
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
90 return(1); // error
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
91 }
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
92 list = list->next;
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
93 list->modenum = mode;
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
94 list->modeinfo = minfo;
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
95 list->next = NULL;
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
96 }
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
97 return (0);
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
98 }
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
99
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
100 static int checksupportedmodes() {
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
101 uint16_t i, max;
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
102 vga_modeinfo *minfo;
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
103
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
104 checked = 1;
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
105 vga_init();
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
106 vga_disabledriverreport();
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
107 max = vga_lastmodenumber();
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
108 for (i = 1; i < max; i++)
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
109 if (vga_hasmode(i) > 0) {
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
110 minfo = vga_getmodeinfo(i);
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
111 switch (minfo->colors) {
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
112 case 32768: bpp_avail |= BPP_15; break;
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
113 case 65536: bpp_avail |= BPP_16; break;
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
114 }
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
115 switch (minfo->bytesperpixel) {
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
116 case 3: bpp_avail |= BPP_24; break;
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
117 case 4: bpp_avail |= BPP_32; break;
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
118 }
504
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
119 if (verbose >= 2)
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
120 printf("vo_svga: Mode found: %s\n",vga_getmodename(i));
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
121 if (add_mode(i, *minfo))
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
122 return(1);
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
123 }
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
124 return(0);
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
125 }
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
126
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
127 static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width,
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
128 uint32_t d_height, uint32_t fullscreen, char *title,
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
129 uint32_t format) {
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
130 uint32_t req_w = (d_width > 0 ? d_width : width);
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
131 uint32_t req_h = (d_height > 0 ? d_height : height);
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
132 uint16_t vid_mode = 0;
976
90408bd383a5 Scaling bug fixed.
se7encode
parents: 875
diff changeset
133 uint8_t res_widescr, vid_widescr = (((req_w*1.0)/req_h) > (4.0/3)) ? 1 : 0;
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
134 uint16_t buf_w = USHRT_MAX, buf_h = USHRT_MAX;
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
135 vga_modelist_t *list = modelist;
387
43acef8f7c74 Requested resolution (d_width) added.
se7encode
parents: 381
diff changeset
136
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
137 if (!checked) {
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
138 if (checksupportedmodes()) // Looking for available video modes
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
139 return(1);
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
140 }
407
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
141
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
142 bpp_avail = 0;
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
143 while (list != NULL) {
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
144 if ((list->modeinfo.width >= req_w) && (list->modeinfo.height >= req_h)) {
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
145 switch (list->modeinfo.colors) {
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
146 case 32768: bpp_avail |= BPP_15; break;
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
147 case 65536: bpp_avail |= BPP_16; break;
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
148 }
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
149 switch (list->modeinfo.bytesperpixel) {
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
150 case 3: bpp_avail |= BPP_24; break;
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
151 case 4: bpp_avail |= BPP_32; break;
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
152 }
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
153 }
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
154 list = list->next;
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
155 }
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
156
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
157 pformat = format;
411
53203545daa7 -bpp added.
se7encode
parents: 407
diff changeset
158
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
159 // bpp check
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
160 bpp_conv = 0;
411
53203545daa7 -bpp added.
se7encode
parents: 407
diff changeset
161 if (!vo_dbpp) {
53203545daa7 -bpp added.
se7encode
parents: 407
diff changeset
162 if (format == IMGFMT_YV12) bpp = 32;
53203545daa7 -bpp added.
se7encode
parents: 407
diff changeset
163 else bpp = format & 255;
504
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
164 if (verbose)
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
165 printf("vo_svga: vo_dbpp == 0, bpp: %d\n",bpp);
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
166 switch (bpp) {
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
167 case 32: if (!(bpp_avail & BPP_32)) {
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
168 printf("vo_svga: Haven't found video mode which fit to: %dx%d %dbpp\n",req_w,req_h,bpp);
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
169 printf("vo_svga: Maybe you should try -bpp\n");
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
170 return(1);
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
171 }
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
172 break;
619
99a716d8cac8 -Wall warnings fixed.
se7encode
parents: 617
diff changeset
173 case 24: if (!(bpp_avail & BPP_24)) {
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
174 if (!(bpp_avail & BPP_32)) {
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
175 printf("vo_svga: Haven't found video mode which fit to: %dx%d %dbpp\n",req_w,req_h,bpp);
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
176 printf("vo_svga: Maybe you should try -bpp\n");
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
177 return(1);
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
178 } else {
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
179 bpp = 32;
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
180 bpp_conv = 1;
617
33b559940fb4 *** empty log message ***
se7encode
parents: 616
diff changeset
181 printf("vo_svga: BPP conversion 24->32\n");
619
99a716d8cac8 -Wall warnings fixed.
se7encode
parents: 617
diff changeset
182 }
99a716d8cac8 -Wall warnings fixed.
se7encode
parents: 617
diff changeset
183 }
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
184 break;
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
185 case 16: if (!(bpp_avail & BPP_16)) {
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
186 printf("vo_svga: Haven't found video mode which fit to: %dx%d %dbpp\n",req_w,req_h,bpp);
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
187 printf("vo_svga: Maybe you should try -bpp\n");
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
188 return(1);
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
189 }
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
190 break;
619
99a716d8cac8 -Wall warnings fixed.
se7encode
parents: 617
diff changeset
191 case 15: if (!(bpp_avail & BPP_15)) {
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
192 if (!(bpp_avail & BPP_16)) {
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
193 printf("vo_svga: Haven't found video mode which fit to: %dx%d %dbpp\n",req_w,req_h,bpp);
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
194 printf("vo_svga: Maybe you should try -bpp\n");
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
195 return(1);
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
196 } else {
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
197 bpp = 16;
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
198 bpp_conv = 1;
617
33b559940fb4 *** empty log message ***
se7encode
parents: 616
diff changeset
199 printf("vo_svga: BPP conversion 15->16\n");
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
200 }
619
99a716d8cac8 -Wall warnings fixed.
se7encode
parents: 617
diff changeset
201 }
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
202 break;
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
203 }
411
53203545daa7 -bpp added.
se7encode
parents: 407
diff changeset
204 } else {
53203545daa7 -bpp added.
se7encode
parents: 407
diff changeset
205 bpp = vo_dbpp;
504
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
206 if (verbose)
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
207 printf("vo_svga: vo_dbpp == %d\n",bpp);
411
53203545daa7 -bpp added.
se7encode
parents: 407
diff changeset
208 switch (bpp) {
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
209 case 32: if (!(bpp_avail & BPP_32)) {
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
210 printf("vo_svga: %dbpp not supported in %dx%d (or larger resoltuion) by HW or SVGAlib\n",bpp,req_w,req_h);
411
53203545daa7 -bpp added.
se7encode
parents: 407
diff changeset
211 return(1);
53203545daa7 -bpp added.
se7encode
parents: 407
diff changeset
212 }
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
213 break;
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
214 case 24: if (!(bpp_avail & BPP_24)) {
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
215 printf("vo_svga: %dbpp not supported in %dx%d (or larger resoltuion) by HW or SVGAlib\n",bpp,req_w,req_h);
411
53203545daa7 -bpp added.
se7encode
parents: 407
diff changeset
216 return(1);
53203545daa7 -bpp added.
se7encode
parents: 407
diff changeset
217 }
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
218 break;
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
219 case 16: if (!(bpp_avail & BPP_16)) {
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
220 printf("vo_svga: %dbpp not supported in %dx%d (or larger resoltuion) by HW or SVGAlib\n",bpp,req_w,req_h);
411
53203545daa7 -bpp added.
se7encode
parents: 407
diff changeset
221 return(1);
53203545daa7 -bpp added.
se7encode
parents: 407
diff changeset
222 }
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
223 break;
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
224 case 15: if (!(bpp_avail & BPP_15)) {
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
225 printf("vo_svga: %dbpp not supported in %dx%d (or larger resoltuion) by HW or SVGAlib\n",bpp,req_w,req_h);
411
53203545daa7 -bpp added.
se7encode
parents: 407
diff changeset
226 return(1);
53203545daa7 -bpp added.
se7encode
parents: 407
diff changeset
227 }
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
228 break;
411
53203545daa7 -bpp added.
se7encode
parents: 407
diff changeset
229 }
53203545daa7 -bpp added.
se7encode
parents: 407
diff changeset
230 }
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
231
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
232 list = modelist;
504
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
233 if (verbose) {
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
234 printf("vo_svga: Looking for the best resolution...\n");
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
235 printf("vo_svga: req_w: %d, req_h: %d, bpp: %d\n",req_w,req_h,bpp);
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
236 }
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
237 while (list != NULL) {
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
238 if ((list->modeinfo.width >= req_w) && (list->modeinfo.height >= req_h)) {
504
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
239 if (verbose) {
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
240 switch (list->modeinfo.colors) {
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
241 case 32768: printf("vo_svga: vid_mode: %d, %dx%d 15bpp\n",list->modenum,list->modeinfo.width,list->modeinfo.height);
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
242 break;
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
243 case 65536: printf("vo_svga: vid_mode: %d, %dx%d 16bpp\n",list->modenum,list->modeinfo.width,list->modeinfo.height);
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
244 break;
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
245 }
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
246 switch (list->modeinfo.bytesperpixel) {
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
247 case 3: printf("vo_svga: vid_mode: %d, %dx%d 24bpp\n",list->modenum,list->modeinfo.width,list->modeinfo.height);
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
248 break;
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
249 case 4: printf("vo_svga: vid_mode: %d, %dx%d 32bpp\n",list->modenum,list->modeinfo.width,list->modeinfo.height);
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
250 break;
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
251 }
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
252 }
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
253 switch (bpp) {
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
254 case 32: if (list->modeinfo.bytesperpixel == 4)
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
255 if ((list->modeinfo.width < buf_w) || (list->modeinfo.height < buf_h)) {
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
256 vid_mode = list->modenum;
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
257 buf_w = list->modeinfo.width;
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
258 buf_h = list->modeinfo.height;
976
90408bd383a5 Scaling bug fixed.
se7encode
parents: 875
diff changeset
259 res_widescr = (((buf_w*1.0)/buf_h) > (4.0/3)) ? 1 : 0;
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
260 }
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
261 break;
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
262 case 24: if (list->modeinfo.bytesperpixel == 3)
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
263 if ((list->modeinfo.width < buf_w) || (list->modeinfo.height < buf_h)) {
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
264 vid_mode = list->modenum;
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
265 buf_w = list->modeinfo.width;
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
266 buf_h = list->modeinfo.height;
976
90408bd383a5 Scaling bug fixed.
se7encode
parents: 875
diff changeset
267 res_widescr = (((buf_w*1.0)/buf_h) > (4.0/3)) ? 1 : 0;
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
268 }
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
269 break;
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
270 case 16: if (list->modeinfo.colors == 65536)
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
271 if ((list->modeinfo.width < buf_w) || (list->modeinfo.height < buf_h)) {
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
272 vid_mode = list->modenum;
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
273 buf_w = list->modeinfo.width;
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
274 buf_h = list->modeinfo.height;
976
90408bd383a5 Scaling bug fixed.
se7encode
parents: 875
diff changeset
275 res_widescr = (((buf_w*1.0)/buf_h) > (4.0/3)) ? 1 : 0;
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
276 }
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
277 break;
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
278 case 15: if (list->modeinfo.colors == 32768)
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
279 if ((list->modeinfo.width < buf_w) || (list->modeinfo.height < buf_h)) {
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
280 vid_mode = list->modenum;
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
281 buf_w = list->modeinfo.width;
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
282 buf_h = list->modeinfo.height;
976
90408bd383a5 Scaling bug fixed.
se7encode
parents: 875
diff changeset
283 res_widescr = (((buf_w*1.0)/buf_h) > (4.0/3)) ? 1 : 0;
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
284 }
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
285 break;
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
286 }
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
287 }
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
288 list = list->next;
407
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
289 }
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
290
504
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
291 if (verbose)
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
292 printf("vo_svga: vid_mode: %d\n",vid_mode);
407
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
293 vga_setlinearaddressing();
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
294 if (vga_setmode(vid_mode) == -1) {
286
b2f3f2ab3787 integrated vo_svga by se7en
arpi_esp
parents: 285
diff changeset
295 printf("vo_svga: vga_setmode(%d) failed.\n",vid_mode);
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
296 uninit();
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
297 return(1); // error
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
298 }
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
299 if (gl_setcontextvga(vid_mode)) {
286
b2f3f2ab3787 integrated vo_svga by se7en
arpi_esp
parents: 285
diff changeset
300 printf("vo_svga: gl_setcontextvga(%d) failed.\n",vid_mode);
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
301 uninit();
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
302 return(1); // error
286
b2f3f2ab3787 integrated vo_svga by se7en
arpi_esp
parents: 285
diff changeset
303 }
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
304 screen = gl_allocatecontext();
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
305 gl_getcontext(screen);
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
306 if (gl_setcontextvgavirtual(vid_mode)) {
286
b2f3f2ab3787 integrated vo_svga by se7en
arpi_esp
parents: 285
diff changeset
307 printf("vo_svga: gl_setcontextvgavirtual(%d) failed.\n",vid_mode);
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
308 uninit();
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
309 return(1); // error
286
b2f3f2ab3787 integrated vo_svga by se7en
arpi_esp
parents: 285
diff changeset
310 }
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
311 virt = gl_allocatecontext();
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
312 gl_getcontext(virt);
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
313 gl_setcontext(virt);
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
314 gl_clearscreen(0);
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
315
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
316 if (bpp_conv) {
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
317 bppbuf = malloc(maxw * maxh * BYTESPERPIXEL);
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
318 if (bppbuf == NULL) {
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
319 printf("vo_svga: bppbuf -> Not enough memory for buffering!\n");
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
320 uninit();
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
321 return (1);
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
322 }
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
323 }
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
324
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
325 orig_w = width;
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
326 orig_h = height;
976
90408bd383a5 Scaling bug fixed.
se7encode
parents: 875
diff changeset
327 if ((fullscreen & 0x04) && (WIDTH != orig_w) && (HEIGHT != orig_h)) {
90408bd383a5 Scaling bug fixed.
se7encode
parents: 875
diff changeset
328 if (!vid_widescr || !res_widescr) {
292
2c0bb83b77b3 Some bugfix.
se7encode
parents: 290
diff changeset
329 maxh = HEIGHT;
2c0bb83b77b3 Some bugfix.
se7encode
parents: 290
diff changeset
330 scaling = maxh / (orig_h * 1.0);
2c0bb83b77b3 Some bugfix.
se7encode
parents: 290
diff changeset
331 maxw = (uint32_t) (orig_w * scaling);
2c0bb83b77b3 Some bugfix.
se7encode
parents: 290
diff changeset
332 scalebuf = malloc(maxw * maxh * BYTESPERPIXEL);
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
333 if (scalebuf == NULL) {
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
334 printf("vo_svga: scalebuf -> Not enough memory for buffering!\n");
407
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
335 uninit();
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
336 return (1);
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
337 }
292
2c0bb83b77b3 Some bugfix.
se7encode
parents: 290
diff changeset
338 } else {
2c0bb83b77b3 Some bugfix.
se7encode
parents: 290
diff changeset
339 maxw = WIDTH;
2c0bb83b77b3 Some bugfix.
se7encode
parents: 290
diff changeset
340 scaling = maxw / (orig_w * 1.0);
2c0bb83b77b3 Some bugfix.
se7encode
parents: 290
diff changeset
341 maxh = (uint32_t) (orig_h * scaling);
2c0bb83b77b3 Some bugfix.
se7encode
parents: 290
diff changeset
342 scalebuf = malloc(maxw * maxh * BYTESPERPIXEL);
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
343 if (scalebuf == NULL) {
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
344 printf("vo_svga: scalebuf -> Not enough memory for buffering!\n");
407
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
345 uninit();
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
346 return (1);
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
347 }
292
2c0bb83b77b3 Some bugfix.
se7encode
parents: 290
diff changeset
348 }
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
349 } else {
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
350 maxw = orig_w;
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
351 maxh = orig_h;
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
352 }
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
353 x_pos = (WIDTH - maxw) / 2;
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
354 y_pos = (HEIGHT - maxh) / 2;
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
355
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
356 if (pformat == IMGFMT_YV12) {
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
357 yuv2rgb_init(bpp, MODE_RGB);
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
358 yuvbuf = malloc(maxw * maxh * BYTESPERPIXEL);
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
359 if (yuvbuf == NULL) {
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
360 printf("vo_svga: yuvbuf -> Not enough memory for buffering!\n");
407
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
361 uninit();
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
362 return (1);
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
363 }
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
364 }
377
8ad594a8c94c Bugfixes in draw_slice.
se7encode
parents: 343
diff changeset
365
504
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
366 printf("vo_svga: SVGAlib resolution: %dx%d %dbpp - ", WIDTH, HEIGHT, bpp);
293
f7e65132e296 Some bugfix.
se7encode
parents: 292
diff changeset
367 if (maxw != orig_w || maxh != orig_h) printf("Video scaled to: %dx%d\n",maxw,maxh);
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
368 else printf("No video scaling\n");
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
369
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
370 return (0);
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
371 }
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
372
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
373 static uint32_t query_format(uint32_t format) {
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
374 uint32_t res = 0;
407
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
375
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
376 if (!checked) {
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
377 if (checksupportedmodes()) // Looking for available video modes
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
378 return(0);
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
379 }
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
380
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
381 // if (vo_dbpp) => There is NO conversion!!!
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
382 if (vo_dbpp) {
712
ea093aa3ecae -bpp bug fixed.
se7encode
parents: 620
diff changeset
383 if (format == IMGFMT_YV12) return (1);
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
384 switch (vo_dbpp) {
488
108be5ee3b1a Thanx to Arpi, There is no more YUY2 bug.
se7encode
parents: 486
diff changeset
385 case 32: if ((format == IMGFMT_RGB32) || (format == IMGFMT_BGR32))
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
386 return ((bpp_avail & BPP_32) ? 1 : 0);
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
387 break;
488
108be5ee3b1a Thanx to Arpi, There is no more YUY2 bug.
se7encode
parents: 486
diff changeset
388 case 24: if ((format == IMGFMT_RGB24) || (format == IMGFMT_BGR24))
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
389 return ((bpp_avail & BPP_24) ? 1 : 0);
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
390 break;
488
108be5ee3b1a Thanx to Arpi, There is no more YUY2 bug.
se7encode
parents: 486
diff changeset
391 case 16: if ((format == IMGFMT_RGB16) || (format == IMGFMT_BGR16))
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
392 return ((bpp_avail & BPP_16) ? 1 : 0);
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
393 break;
488
108be5ee3b1a Thanx to Arpi, There is no more YUY2 bug.
se7encode
parents: 486
diff changeset
394 case 15: if ((format == IMGFMT_RGB15) || (format == IMGFMT_BGR15))
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
395 return ((bpp_avail & BPP_15) ? 1 : 0);
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
396 break;
407
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
397 }
488
108be5ee3b1a Thanx to Arpi, There is no more YUY2 bug.
se7encode
parents: 486
diff changeset
398 } else {
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
399 switch (format) {
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
400 case IMGFMT_RGB32:
488
108be5ee3b1a Thanx to Arpi, There is no more YUY2 bug.
se7encode
parents: 486
diff changeset
401 case IMGFMT_BGR32: return ((bpp_avail & BPP_32) ? 1 : 0); break;
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
402 case IMGFMT_RGB24:
488
108be5ee3b1a Thanx to Arpi, There is no more YUY2 bug.
se7encode
parents: 486
diff changeset
403 case IMGFMT_BGR24: {
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
404 res = (bpp_avail & BPP_24) ? 1 : 0;
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
405 if (!res)
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
406 res = (bpp_avail & BPP_32) ? 1 : 0;
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
407 return (res);
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
408 } break;
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
409 case IMGFMT_RGB16:
488
108be5ee3b1a Thanx to Arpi, There is no more YUY2 bug.
se7encode
parents: 486
diff changeset
410 case IMGFMT_BGR16: return ((bpp_avail & BPP_16) ? 1 : 0); break;
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
411 case IMGFMT_RGB15:
488
108be5ee3b1a Thanx to Arpi, There is no more YUY2 bug.
se7encode
parents: 486
diff changeset
412 case IMGFMT_BGR15: {
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
413 res = (bpp_avail & BPP_15) ? 1 : 0;
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
414 if (!res)
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
415 res = (bpp_avail & BPP_16) ? 1 : 0;
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
416 return (res);
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
417 } break;
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
418 case IMGFMT_YV12: return (1); break;
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
419 }
488
108be5ee3b1a Thanx to Arpi, There is no more YUY2 bug.
se7encode
parents: 486
diff changeset
420 }
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
421 return (0);
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
422 }
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
423
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
424 static const vo_info_t* get_info(void) {
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
425 return (&vo_info);
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
426 }
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
427
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
428 static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src,
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
429 unsigned char *srca, int stride) {
327
e7731f5c76cc OSD renderers for all modes added.
se7encode
parents: 293
diff changeset
430 switch (bpp) {
e7731f5c76cc OSD renderers for all modes added.
se7encode
parents: 293
diff changeset
431 case 32:
e7731f5c76cc OSD renderers for all modes added.
se7encode
parents: 293
diff changeset
432 vo_draw_alpha_rgb32(w, h, src, srca, stride, virt->vbuf+4*(y0*WIDTH+x0), 4*WIDTH);
e7731f5c76cc OSD renderers for all modes added.
se7encode
parents: 293
diff changeset
433 break;
e7731f5c76cc OSD renderers for all modes added.
se7encode
parents: 293
diff changeset
434 case 24:
e7731f5c76cc OSD renderers for all modes added.
se7encode
parents: 293
diff changeset
435 vo_draw_alpha_rgb24(w, h, src, srca, stride, virt->vbuf+3*(y0*WIDTH+x0), 3*WIDTH);
e7731f5c76cc OSD renderers for all modes added.
se7encode
parents: 293
diff changeset
436 break;
e7731f5c76cc OSD renderers for all modes added.
se7encode
parents: 293
diff changeset
437 case 16:
e7731f5c76cc OSD renderers for all modes added.
se7encode
parents: 293
diff changeset
438 vo_draw_alpha_rgb16(w, h, src, srca, stride, virt->vbuf+2*(y0*WIDTH+x0), 2*WIDTH);
e7731f5c76cc OSD renderers for all modes added.
se7encode
parents: 293
diff changeset
439 break;
e7731f5c76cc OSD renderers for all modes added.
se7encode
parents: 293
diff changeset
440 case 15:
e7731f5c76cc OSD renderers for all modes added.
se7encode
parents: 293
diff changeset
441 vo_draw_alpha_rgb15(w, h, src, srca, stride, virt->vbuf+2*(y0*WIDTH+x0), 2*WIDTH);
e7731f5c76cc OSD renderers for all modes added.
se7encode
parents: 293
diff changeset
442 break;
e7731f5c76cc OSD renderers for all modes added.
se7encode
parents: 293
diff changeset
443 }
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
444 }
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
445
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
446 static uint32_t draw_frame(uint8_t *src[]) {
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
447 if (pformat == IMGFMT_YV12) {
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
448 yuv2rgb(yuvbuf, src[0], src[1], src[2], orig_w, orig_h, orig_w * BYTESPERPIXEL, orig_w, orig_w / 2);
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
449 src[0] = yuvbuf;
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
450 }
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
451 if (scalebuf != NULL) {
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
452 gl_scalebox(orig_w, orig_h, src[0], maxw, maxh, scalebuf);
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
453 src[0] = scalebuf;
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
454 }
407
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
455 if (bpp_conv) {
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
456 switch(bpp) {
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
457 case 32: {
620
b623949ddedb Some names, types changed.
se7encode
parents: 619
diff changeset
458 uint8_t *source = src[0];
b623949ddedb Some names, types changed.
se7encode
parents: 619
diff changeset
459 uint8_t *dest = bppbuf;
b623949ddedb Some names, types changed.
se7encode
parents: 619
diff changeset
460 register uint32_t i = 0;
502
75c689abb763 Maybe a little speedup.
se7encode
parents: 488
diff changeset
461
620
b623949ddedb Some names, types changed.
se7encode
parents: 619
diff changeset
462 while (i < (maxw * maxh * 4)) {
b623949ddedb Some names, types changed.
se7encode
parents: 619
diff changeset
463 dest[i] = source[i];
b623949ddedb Some names, types changed.
se7encode
parents: 619
diff changeset
464 dest[i+1] = source[i+1];
b623949ddedb Some names, types changed.
se7encode
parents: 619
diff changeset
465 dest[i+2] = source[i+2];
b623949ddedb Some names, types changed.
se7encode
parents: 619
diff changeset
466 dest[i+3] = 0;
b623949ddedb Some names, types changed.
se7encode
parents: 619
diff changeset
467 i += 4;
407
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
468 }
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
469 } break;
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
470 case 16: {
407
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
471 #ifdef HAVE_MMX
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
472 rgb15to16_mmx(src[0],bppbuf,maxw * maxh * 2);
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
473 #else
502
75c689abb763 Maybe a little speedup.
se7encode
parents: 488
diff changeset
474 uint16_t *source = (uint16_t *) src[0];
75c689abb763 Maybe a little speedup.
se7encode
parents: 488
diff changeset
475 uint16_t *dest = (uint16_t *) bppbuf;
620
b623949ddedb Some names, types changed.
se7encode
parents: 619
diff changeset
476 register uint32_t i = 0;
407
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
477 register uint16_t srcdata;
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
478
620
b623949ddedb Some names, types changed.
se7encode
parents: 619
diff changeset
479 while (i < (maxw * maxh)) {
b623949ddedb Some names, types changed.
se7encode
parents: 619
diff changeset
480 srcdata = source[i];
b623949ddedb Some names, types changed.
se7encode
parents: 619
diff changeset
481 dest[i++] = (srcdata & 0x1f) | ((srcdata & 0x7fe0) << 1);
407
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
482 }
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
483 #endif
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
484 } break;
407
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
485 }
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
486 src[0] = bppbuf;
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
487 }
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
488 gl_putbox(x_pos, y_pos, maxw, maxh, src[0]);
617
33b559940fb4 *** empty log message ***
se7encode
parents: 616
diff changeset
489
33b559940fb4 *** empty log message ***
se7encode
parents: 616
diff changeset
490 return (0);
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
491 }
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
492
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
493 static uint32_t draw_slice(uint8_t *image[], int stride[],
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
494 int w, int h, int x, int y) {
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
495 uint8_t *src = yuvbuf;
377
8ad594a8c94c Bugfixes in draw_slice.
se7encode
parents: 343
diff changeset
496 uint32_t sw, sh;
8ad594a8c94c Bugfixes in draw_slice.
se7encode
parents: 343
diff changeset
497
875
c1cd62f01b2f removed emms() and reordered stuff
arpi_esp
parents: 874
diff changeset
498 yuv2rgb(yuvbuf, image[0], image[1], image[2], w, h, orig_w * BYTESPERPIXEL, stride[0], stride[1]);
377
8ad594a8c94c Bugfixes in draw_slice.
se7encode
parents: 343
diff changeset
499 sw = (uint32_t) (w * scaling);
8ad594a8c94c Bugfixes in draw_slice.
se7encode
parents: 343
diff changeset
500 sh = (uint32_t) (h * scaling);
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
501 if (scalebuf != NULL) {
377
8ad594a8c94c Bugfixes in draw_slice.
se7encode
parents: 343
diff changeset
502 gl_scalebox(w, h, yuvbuf, sw, sh, scalebuf);
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
503 src = scalebuf;
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
504 }
377
8ad594a8c94c Bugfixes in draw_slice.
se7encode
parents: 343
diff changeset
505 gl_putbox((int)(x * scaling) + x_pos, (int)(y * scaling) + y_pos, sw, sh, src);
617
33b559940fb4 *** empty log message ***
se7encode
parents: 616
diff changeset
506
33b559940fb4 *** empty log message ***
se7encode
parents: 616
diff changeset
507 return (0);
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
508 }
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
509
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
510 static void flip_page(void) {
292
2c0bb83b77b3 Some bugfix.
se7encode
parents: 290
diff changeset
511 if (y_pos) {
2c0bb83b77b3 Some bugfix.
se7encode
parents: 290
diff changeset
512 gl_fillbox(0, 0, WIDTH, y_pos, 0);
2c0bb83b77b3 Some bugfix.
se7encode
parents: 290
diff changeset
513 gl_fillbox(0, HEIGHT - y_pos, WIDTH, y_pos, 0);
989
1be1647ebd7d flip_page gl_fillbox fix.
se7encode
parents: 976
diff changeset
514 }
1be1647ebd7d flip_page gl_fillbox fix.
se7encode
parents: 976
diff changeset
515 if (x_pos) {
1be1647ebd7d flip_page gl_fillbox fix.
se7encode
parents: 976
diff changeset
516 gl_fillbox(0, 0, x_pos, HEIGHT, 0);
1be1647ebd7d flip_page gl_fillbox fix.
se7encode
parents: 976
diff changeset
517 gl_fillbox(WIDTH - x_pos, 0, x_pos, HEIGHT, 0);
1be1647ebd7d flip_page gl_fillbox fix.
se7encode
parents: 976
diff changeset
518 }
1be1647ebd7d flip_page gl_fillbox fix.
se7encode
parents: 976
diff changeset
519
486
4f52aa06f0fc A couple of bugfixes.
se7encode
parents: 485
diff changeset
520 vo_draw_text(WIDTH, HEIGHT, draw_alpha);
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
521 gl_copyscreen(screen);
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
522 }
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
523
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
524 static void check_events(void) {
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
525 }
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
526
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
527 static void uninit(void) {
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
528 vga_modelist_t *list = modelist;
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
529
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
530 gl_freecontext(screen);
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
531 gl_freecontext(virt);
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
532 vga_setmode(TEXT);
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
533 if (bppbuf != NULL)
407
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
534 free(bppbuf);
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
535 if (scalebuf != NULL)
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
536 free(scalebuf);
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
537 if (yuvbuf != NULL)
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
538 free(yuvbuf);
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
539 if (modelist != NULL) {
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
540 while (modelist->next != NULL) {
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
541 list = modelist;
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
542 while (list->next != NULL)
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
543 list = list->next;
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
544 free(list);
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
545 }
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
546 free(modelist);
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
547 }
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
548 }
617
33b559940fb4 *** empty log message ***
se7encode
parents: 616
diff changeset
549