summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/nullvideo.c
authorharlekin <harlekin>2002-09-24 20:26:17 (UTC)
committer harlekin <harlekin>2002-09-24 20:26:17 (UTC)
commit7a04855af4e042152a47e90192dc4c2c20858e8c (patch) (unidiff)
treecca4567d71b8210dc8905804cebc203b71fc4958 /noncore/multimedia/opieplayer2/nullvideo.c
parent02074fb65c5e879ef1d28e52cf4e1ec4a6727599 (diff)
downloadopie-7a04855af4e042152a47e90192dc4c2c20858e8c.zip
opie-7a04855af4e042152a47e90192dc4c2c20858e8c.tar.gz
opie-7a04855af4e042152a47e90192dc4c2c20858e8c.tar.bz2
adapted to the new api
Diffstat (limited to 'noncore/multimedia/opieplayer2/nullvideo.c') (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/nullvideo.c391
1 files changed, 143 insertions, 248 deletions
diff --git a/noncore/multimedia/opieplayer2/nullvideo.c b/noncore/multimedia/opieplayer2/nullvideo.c
index ceda333..dcdfae6 100644
--- a/noncore/multimedia/opieplayer2/nullvideo.c
+++ b/noncore/multimedia/opieplayer2/nullvideo.c
@@ -4,3 +4,3 @@
4              Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> 4              Copyright (c) 2002 Max Reiss <harlekin@handhelds.org>
5 Copyright (c) 2002 L. Potter <ljp@llornkcor.com> 5 Copyright (c) 2002 LJP <>
6 Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> 6 Copyright (c) 2002 Holger Freyther <zecke@handhelds.org>
@@ -21,3 +21,3 @@
21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
22..}^=.=       =       ; General Public License for more 22..}^=.=       =       ; Library General Public License for more
23++=   -.     .`     .: details. 23++=   -.     .`     .: details.
@@ -25,3 +25,3 @@
25 -.   .:....=;==+<; You should have received a copy of the GNU 25 -.   .:....=;==+<; You should have received a copy of the GNU
26  -_. . .   )=.  = General Public License along with 26  -_. . .   )=.  = Library General Public License along with
27    --        :-=` this library; see the file COPYING.LIB. 27    --        :-=` this library; see the file COPYING.LIB.
@@ -33,3 +33,2 @@
33 33
34/*#include <xine.h>*/
35#include <stdlib.h> 34#include <stdlib.h>
@@ -39,2 +38,3 @@
39 38
39#include <xine.h>
40#include <xine/video_out.h> 40#include <xine/video_out.h>
@@ -42,3 +42,3 @@
42#include <xine/xineutils.h> 42#include <xine/xineutils.h>
43#include <xine/configfile.h> 43#include <xine/vo_scale.h>
44 44
@@ -50,2 +50,6 @@
50 50
51/*
52#define LOG
53*/
54
51/* the caller for our event draw handler */ 55/* the caller for our event draw handler */
@@ -57,3 +61,4 @@ typedef struct null_driver_s null_driver_t;
57struct null_driver_s { 61struct null_driver_s {
58 vo_driver_t vo_driver; 62 xine_vo_driver_t vo_driver;
63
59 uint32_t m_capabilities; 64 uint32_t m_capabilities;
@@ -62,2 +67,3 @@ struct null_driver_s {
62 int m_is_scaling; 67 int m_is_scaling;
68
63 int depth, bpp, bytes_per_pixel; 69 int depth, bpp, bytes_per_pixel;
@@ -68,7 +74,6 @@ struct null_driver_s {
68 yuv2rgb_factory_t *yuv2rgb_factory; 74 yuv2rgb_factory_t *yuv2rgb_factory;
75
69 vo_overlay_t *overlay; 76 vo_overlay_t *overlay;
70 int user_ratio; 77 vo_scale_t sc;
71 double output_scale_factor; 78
72 int last_frame_output_width;
73 int last_frame_output_height;
74 int gui_width; 79 int gui_width;
@@ -76,2 +81,3 @@ struct null_driver_s {
76 int gui_changed; 81 int gui_changed;
82
77 double display_ratio; 83 double display_ratio;
@@ -79,5 +85,4 @@ struct null_driver_s {
79 display_xine_frame_t frameDis; 85 display_xine_frame_t frameDis;
80
81
82}; 86};
87
83typedef struct opie_frame_s opie_frame_t; 88typedef struct opie_frame_s opie_frame_t;
@@ -85,18 +90,13 @@ struct opie_frame_s {
85 vo_frame_t frame; 90 vo_frame_t frame;
86 char* name; 91
87 int version;
88 int width;
89 int height;
90 int ratio_code;
91 int format; 92 int format;
92 int flags; 93 int flags;
93 int user_ratio;
94 94
95 double ratio_factor; 95 vo_scale_t sc;
96 int ideal_width; 96
97 int ideal_height;
98 int output_width, output_height;
99 int gui_width, gui_height;
100 uint8_t *chunk[3]; 97 uint8_t *chunk[3];
101 98
99 uint8_t *data; /* rgb */
100 int bytes_per_line;
101
102 yuv2rgb_t *yuv2rgb; 102 yuv2rgb_t *yuv2rgb;
@@ -106,6 +106,2 @@ struct opie_frame_s {
106 106
107 int bytes_per_line;
108 uint8_t *data;
109
110// int show_video;
111 null_driver_t *output; 107 null_driver_t *output;
@@ -113,5 +109,4 @@ struct opie_frame_s {
113 109
114static uint32_t null_get_capabilities(vo_driver_t *self ){ 110static uint32_t null_get_capabilities( xine_vo_driver_t *self ){
115 null_driver_t* this = (null_driver_t*)self; 111 null_driver_t* this = (null_driver_t*)self;
116 printf("capabilities\n");
117 return this->m_capabilities; 112 return this->m_capabilities;
@@ -121,6 +116,9 @@ static void null_frame_copy (vo_frame_t *vo_img, uint8_t **src) {
121 opie_frame_t *frame = (opie_frame_t *) vo_img ; 116 opie_frame_t *frame = (opie_frame_t *) vo_img ;
122 printf("frame copy\n");
123 if(!frame->output->m_show_video ){ printf("no video\n"); return; } // no video
124 117
125 if (frame->format == IMGFMT_YV12) { 118 if (!frame->output->m_show_video) {
119 /* printf("nullvideo: no video\n"); */
120 return;
121 }
122
123 if (frame->format == XINE_IMGFMT_YV12) {
126 frame->yuv2rgb->yuv2rgb_fun (frame->yuv2rgb, frame->rgb_dst, 124 frame->yuv2rgb->yuv2rgb_fun (frame->yuv2rgb, frame->rgb_dst,
@@ -134,3 +132,2 @@ static void null_frame_copy (vo_frame_t *vo_img, uint8_t **src) {
134 frame->rgb_dst += frame->stripe_inc; 132 frame->rgb_dst += frame->stripe_inc;
135 printf("returning\n");
136} 133}
@@ -140,3 +137,2 @@ static void null_frame_field (vo_frame_t *vo_img, int which_field) {
140 opie_frame_t *frame = (opie_frame_t *) vo_img ; 137 opie_frame_t *frame = (opie_frame_t *) vo_img ;
141 printf("field\n\n");
142 138
@@ -161,3 +157,3 @@ static void null_frame_dispose( vo_frame_t* vo_img){
161 opie_frame_t* frame = (opie_frame_t*)vo_img; 157 opie_frame_t* frame = (opie_frame_t*)vo_img;
162 printf("frame_dispose\n"); 158
163 if( frame->data ) 159 if( frame->data )
@@ -169,5 +165,11 @@ static void null_frame_dispose( vo_frame_t* vo_img){
169 165
170static vo_frame_t* null_alloc_frame( vo_driver_t* self ){ 166static vo_frame_t* null_alloc_frame( xine_vo_driver_t* self ){
167
171 null_driver_t* this = (null_driver_t*)self; 168 null_driver_t* this = (null_driver_t*)self;
172 opie_frame_t* frame; 169 opie_frame_t* frame;
170
171#ifdef LOG
172 fprintf (stderr, "nullvideo: alloc_frame\n");
173#endif
174
173 frame = (opie_frame_t*)malloc ( sizeof(opie_frame_t) ); 175 frame = (opie_frame_t*)malloc ( sizeof(opie_frame_t) );
@@ -175,12 +177,10 @@ static vo_frame_t* null_alloc_frame( vo_driver_t* self ){
175 memset( frame, 0, sizeof( opie_frame_t) ); 177 memset( frame, 0, sizeof( opie_frame_t) );
178 memcpy (&frame->sc, &this->sc, sizeof(vo_scale_t));
179
176 pthread_mutex_init (&frame->frame.mutex, NULL); 180 pthread_mutex_init (&frame->frame.mutex, NULL);
177 181
178 printf("alloc_frame\n");
179 frame->name = "opie\0";
180 frame->version = 1;
181 frame->output = this; 182 frame->output = this;
182// frame->show_video = this->m_show_video; 183
183 /* initialize the frame*/ 184 /* initialize the frame*/
184 frame->frame.driver = self; 185 frame->frame.driver = self;
185 /*frame.frame.free = null_frame_free;*/
186 frame->frame.copy = null_frame_copy; 186 frame->frame.copy = null_frame_copy;
@@ -188,3 +188,3 @@ static vo_frame_t* null_alloc_frame( vo_driver_t* self ){
188 frame->frame.dispose = null_frame_dispose; 188 frame->frame.dispose = null_frame_dispose;
189 frame->yuv2rgb = 0; 189
190 /* 190 /*
@@ -194,3 +194,2 @@ static vo_frame_t* null_alloc_frame( vo_driver_t* self ){
194 194
195
196 return (vo_frame_t*) frame; 195 return (vo_frame_t*) frame;
@@ -198,115 +197,3 @@ static vo_frame_t* null_alloc_frame( vo_driver_t* self ){
198 197
199// size specific 198static void null_update_frame_format( xine_vo_driver_t* self, vo_frame_t* img,
200static void null_compute_ideal_size (null_driver_t *this, opie_frame_t *frame) {
201
202 if (!this->m_is_scaling /*|| !this->m_show_video*/) {
203 printf("Not scaling\n");
204 frame->ideal_width = frame->width;
205 frame->ideal_height = frame->height;
206 frame->ratio_factor = 1.0;
207
208 } else {
209
210 double image_ratio, desired_ratio, corr_factor;
211
212 image_ratio = (double) frame->width / (double) frame->height;
213
214 switch (frame->user_ratio) {
215 case ASPECT_AUTO:
216 switch (frame->ratio_code) {
217 case XINE_ASPECT_RATIO_ANAMORPHIC: /* anamorphic */
218 case XINE_ASPECT_RATIO_PAN_SCAN:
219 desired_ratio = 16.0 /9.0;
220 break;
221 case XINE_ASPECT_RATIO_211_1: /* 2.11:1 */
222 desired_ratio = 2.11/1.0;
223 break;
224 case XINE_ASPECT_RATIO_SQUARE: /* square pels */
225 case XINE_ASPECT_RATIO_DONT_TOUCH: /* probably non-mpeg stream => don't touch aspect ratio */
226 desired_ratio = image_ratio;
227 break;
228 case 0: /* forbidden -> 4:3 */
229 printf ("video_out_fb: invalid ratio, using 4:3\n");
230 default:
231 printf ("video_out_fb: unknown aspect ratio (%d) in stream => using 4:3\n",
232 frame->ratio_code);
233 case XINE_ASPECT_RATIO_4_3: /* 4:3 */
234 desired_ratio = 4.0 / 3.0;
235 break;
236 }
237 break;
238 case ASPECT_ANAMORPHIC:
239 desired_ratio = 16.0 / 9.0;
240 break;
241 case ASPECT_DVB:
242 desired_ratio = 2.0 / 1.0;
243 break;
244 case ASPECT_SQUARE:
245 desired_ratio = image_ratio;
246 break;
247 case ASPECT_FULL:
248 default:
249 desired_ratio = 4.0 / 3.0;
250 }
251
252 frame->ratio_factor = this->display_ratio * desired_ratio;
253
254 corr_factor = frame->ratio_factor / image_ratio ;
255
256 if (fabs(corr_factor - 1.0) < 0.005) {
257 frame->ideal_width = frame->width;
258 frame->ideal_height = frame->height;
259
260 } else {
261
262 if (corr_factor >= 1.0) {
263 frame->ideal_width = frame->width * corr_factor + 0.5;
264 frame->ideal_height = frame->height;
265 } else {
266 frame->ideal_width = frame->width;
267 frame->ideal_height = frame->height / corr_factor + 0.5;
268 }
269
270 }
271 }
272 printf("return from helper\n");
273}
274
275static void null_compute_rgb_size (null_driver_t *this, opie_frame_t *frame) {
276
277 double x_factor, y_factor;
278
279 /*
280 * make the frame fit into the given destination area
281 */
282
283 x_factor = (double) this->gui_width / (double) frame->ideal_width;
284 y_factor = (double) this->gui_height / (double) frame->ideal_height;
285
286 if ( x_factor < y_factor ) {
287 frame->output_width = (double) frame->ideal_width * x_factor ;
288 frame->output_height = (double) frame->ideal_height * x_factor ;
289 } else {
290 frame->output_width = (double) frame->ideal_width * y_factor ;
291 frame->output_height = (double) frame->ideal_height * y_factor ;
292 }
293
294#define LOG 1
295#ifdef LOG
296 printf("video_out_fb: frame source %d x %d => screen output %d x %d%s\n",
297 frame->width, frame->height,
298 frame->output_width, frame->output_height,
299 ( frame->width != frame->output_width
300 || frame->height != frame->output_height
301 ? ", software scaling"
302 : "" )
303 );
304#endif
305}
306
307
308// size specific
309
310
311static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img,
312 uint32_t width, uint32_t height, 199 uint32_t width, uint32_t height,
@@ -316,4 +203,6 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img,
316 /* not needed now */ 203 /* not needed now */
317 printf("update_frame_format\n"); 204
318 printf("al crash aye?\n"); 205#ifdef LOG
206 fprintf (stderr, "nullvideo: update_frame_format\n");
207#endif
319 208
@@ -323,24 +212,30 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img,
323 212
324 if ((width != frame->width) 213 if ((width != frame->sc.delivered_width)
325 || (height != frame->height) 214 || (height != frame->sc.delivered_height)
326 || (ratio_code != frame->ratio_code) 215 || (ratio_code != frame->sc.delivered_ratio_code)
327 || (flags != frame->flags) 216 || (flags != frame->flags)
328 || (format != frame->format) 217 || (format != frame->format)
329 || (this->user_ratio != frame->user_ratio) 218 || (this->sc.user_ratio != frame->sc.user_ratio)
330 || (this->gui_width != frame-> gui_width ) 219 || (this->gui_width != frame->sc.gui_width)
331 || (this-> gui_height != frame-> gui_height)) { 220 || (this->gui_height != frame->sc.gui_height)) {
332 221
333 frame->width = width; 222 frame->sc.delivered_width = width;
334 frame->height = height; 223 frame->sc.delivered_height = height;
335 frame->ratio_code = ratio_code; 224 frame->sc.delivered_ratio_code = ratio_code;
336 frame->flags = flags; 225 frame->flags = flags;
337 frame->format = format; 226 frame->format = format;
338 frame->user_ratio = this->user_ratio; 227 frame->sc.user_ratio = this->sc.user_ratio;
339 this->gui_changed = 0; 228 frame->sc.gui_width = this->gui_width;
340 //frame->show_video = this->m_show_video; 229 frame->sc.gui_height = this->gui_height;
341 frame->gui_width = this->gui_width; 230 frame->sc.gui_pixel_aspect = 1.0;
342 frame->gui_height = this->gui_height; 231
232 vo_scale_compute_ideal_size ( &frame->sc );
233 vo_scale_compute_output_size( &frame->sc );
343 234
344 null_compute_ideal_size (this, frame); 235 #ifdef LOG
345 null_compute_rgb_size (this, frame); 236 fprintf (stderr, "nullvideo: gui %dx%d delivered %dx%d output %dx%d\n",
237 frame->sc.gui_width, frame->sc.gui_height,
238 frame->sc.delivered_width, frame->sc.delivered_height,
239 frame->sc.output_width, frame->sc.output_height);
240#endif
346 241
@@ -364,7 +259,8 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img,
364 } 259 }
365 printf("after freeing\n");
366 frame->data = xine_xmalloc (frame->output_width * frame->output_height *
367 this->bytes_per_pixel );
368 260
369 if( format == IMGFMT_YV12 ) { 261 frame->data = xine_xmalloc (frame->sc.output_width
262 * frame->sc.output_height
263 * this->bytes_per_pixel );
264
265 if( format == XINE_IMGFMT_YV12 ) {
370 frame->frame.pitches[0] = 8*((width + 7) / 8); 266 frame->frame.pitches[0] = 8*((width + 7) / 8);
@@ -385,8 +281,4 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img,
385 281
386 frame->format = format; 282 frame->stripe_height = 16 * frame->sc.output_height / frame->sc.delivered_height;
387 frame->width = width; 283 frame->bytes_per_line = frame->sc.output_width * this->bytes_per_pixel;
388 frame->height = height;
389
390 frame->stripe_height = 16 * frame->output_height / frame->height;
391 frame->bytes_per_line = frame->output_width * this->bytes_per_pixel;
392 284
@@ -395,4 +287,2 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img,
395 */ 287 */
396 if(1 /*this->m_show_video*/ ){
397 printf("showing video\n");
398 288
@@ -402,3 +292,3 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img,
402 frame->yuv2rgb->configure (frame->yuv2rgb, 292 frame->yuv2rgb->configure (frame->yuv2rgb,
403 frame->width, 293 frame->sc.delivered_width,
404 16, 294 16,
@@ -406,3 +296,3 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img,
406 2*frame->frame.pitches[1], 296 2*frame->frame.pitches[1],
407 frame->output_width, 297 frame->sc.output_width,
408 frame->stripe_height, 298 frame->stripe_height,
@@ -413,3 +303,3 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img,
413 frame->yuv2rgb->configure (frame->yuv2rgb, 303 frame->yuv2rgb->configure (frame->yuv2rgb,
414 frame->width, 304 frame->sc.delivered_width,
415 16, 305 16,
@@ -417,3 +307,3 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img,
417 frame->frame.pitches[1], 307 frame->frame.pitches[1],
418 frame->output_width, 308 frame->sc.output_width,
419 frame->stripe_height, 309 frame->stripe_height,
@@ -423,5 +313,7 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img,
423 } 313 }
314#ifdef LOG
315 fprintf (stderr, "nullvideo: colorspace converter configured.\n");
316#endif
424 } 317 }
425 } 318
426 printf("after gui changed\n");
427 /* 319 /*
@@ -446,5 +338,5 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img,
446 } 338 }
447 printf("done\n");
448} 339}
449static void null_display_frame( vo_driver_t* self, vo_frame_t *frame_gen ){ 340
341static void null_display_frame( xine_vo_driver_t* self, vo_frame_t *frame_gen ){
450 null_driver_t* this = (null_driver_t*) self; 342 null_driver_t* this = (null_driver_t*) self;
@@ -453,12 +345,10 @@ static void null_display_frame( vo_driver_t* self, vo_frame_t *frame_gen ){
453 345
454 printf("display frame\n"); 346 if (!this->m_show_video)
455 // if( this->m_show_video ) { // return if not displaying 347 return;
456 printf("calling home aye\n" ); 348
457 if( display != NULL ) { 349 if( display != NULL ) {
458 (*display)(this->caller, frame->data, 350 (*display)(this->caller, frame->data,
459 frame->output_width, frame->output_height, 351 frame->sc.output_width, frame->sc.output_height,
460 frame->bytes_per_line ); 352 frame->bytes_per_line );
461 printf("display done hope you enyoyed the frame");
462 } 353 }
463// }
464 354
@@ -468,6 +358,5 @@ static void null_display_frame( vo_driver_t* self, vo_frame_t *frame_gen ){
468 358
469// blending related 359/* blending related */
470 360static void null_overlay_clut_yuv2rgb (null_driver_t *this,
471 361 vo_overlay_t *overlay,
472static void null_overlay_clut_yuv2rgb(null_driver_t *this, vo_overlay_t *overlay,
473 opie_frame_t *frame) { 362 opie_frame_t *frame) {
@@ -494,3 +383,3 @@ static void null_overlay_clut_yuv2rgb(null_driver_t *this, vo_overlay_t *overla
494 383
495static void null_overlay_blend (vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay) { 384static void null_overlay_blend ( xine_vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay) {
496 null_driver_t *this = (null_driver_t *) this_gen; 385 null_driver_t *this = (null_driver_t *) this_gen;
@@ -498,4 +387,4 @@ static void null_overlay_blend (vo_driver_t *this_gen, vo_frame_t *frame_gen, vo
498 387
499 printf("overlay blend\n"); 388 if(!this->m_show_video || frame->sc.output_width == 0
500 if(!this->m_show_video || frame->output_width == 0 || frame->output_height== 0) 389 || frame->sc.output_height== 0)
501 return; 390 return;
@@ -510,4 +399,4 @@ static void null_overlay_blend (vo_driver_t *this_gen, vo_frame_t *frame_gen, vo
510 blend_rgb16( (uint8_t *)frame->data, overlay, 399 blend_rgb16( (uint8_t *)frame->data, overlay,
511 frame->output_width, frame->output_height, 400 frame->sc.output_width, frame->sc.output_height,
512 frame->width, frame->height); 401 frame->sc.delivered_width, frame->sc.delivered_height);
513 break; 402 break;
@@ -515,4 +404,4 @@ static void null_overlay_blend (vo_driver_t *this_gen, vo_frame_t *frame_gen, vo
515 blend_rgb24( (uint8_t *)frame->data, overlay, 404 blend_rgb24( (uint8_t *)frame->data, overlay,
516 frame->output_width, frame->output_height, 405 frame->sc.output_width, frame->sc.output_height,
517 frame->width, frame->height); 406 frame->sc.delivered_width, frame->sc.delivered_height);
518 break; 407 break;
@@ -520,4 +409,4 @@ static void null_overlay_blend (vo_driver_t *this_gen, vo_frame_t *frame_gen, vo
520 blend_rgb32( (uint8_t *)frame->data, overlay, 409 blend_rgb32( (uint8_t *)frame->data, overlay,
521 frame->output_width, frame->output_height, 410 frame->sc.output_width, frame->sc.output_height,
522 frame->width, frame->height); 411 frame->sc.delivered_width, frame->sc.delivered_height);
523 break; 412 break;
@@ -531,17 +420,14 @@ static void null_overlay_blend (vo_driver_t *this_gen, vo_frame_t *frame_gen, vo
531 420
532static int null_get_property( vo_driver_t* self, 421static int null_get_property( xine_vo_driver_t* self,
533 int property ){ 422 int property ){
534 printf("property get\n");
535 return 0; 423 return 0;
536} 424}
537static int null_set_property( vo_driver_t* self, 425static int null_set_property( xine_vo_driver_t* self,
538 int property, 426 int property,
539 int value ){ 427 int value ){
540 printf("set property\n");
541 return value; 428 return value;
542} 429}
543static void null_get_property_min_max( vo_driver_t* self, 430static void null_get_property_min_max( xine_vo_driver_t* self,
544 int property, int *min, 431 int property, int *min,
545 int *max ){ 432 int *max ){
546 printf("min max\n");
547 *max = 0; 433 *max = 0;
@@ -549,3 +435,3 @@ static void null_get_property_min_max( vo_driver_t* self,
549} 435}
550static int null_gui_data_exchange( vo_driver_t* self, 436static int null_gui_data_exchange( xine_vo_driver_t* self,
551 int data_type, 437 int data_type,
@@ -554,3 +440,4 @@ static int null_gui_data_exchange( vo_driver_t* self,
554} 440}
555static void null_exit( vo_driver_t* self ){ 441
442static void null_exit( xine_vo_driver_t* self ){
556 null_driver_t* this = (null_driver_t*)self; 443 null_driver_t* this = (null_driver_t*)self;
@@ -558,3 +445,3 @@ static void null_exit( vo_driver_t* self ){
558} 445}
559static int null_redraw_needed( vo_driver_t* self ){ 446static int null_redraw_needed( xine_vo_driver_t* self ){
560 return 0; 447 return 0;
@@ -563,3 +450,3 @@ static int null_redraw_needed( vo_driver_t* self ){
563 450
564vo_driver_t* init_video_out_plugin( config_values_t* conf, 451xine_vo_driver_t* init_video_out_plugin( config_values_t* conf,
565 void* video ){ 452 void* video ){
@@ -570,2 +457,7 @@ vo_driver_t* init_video_out_plugin( config_values_t* conf,
570 memset(vo,0, sizeof(null_driver_t ) ); 457 memset(vo,0, sizeof(null_driver_t ) );
458
459 vo_scale_init (&vo->sc, 0, 0);
460
461 vo->sc.gui_pixel_aspect = 1.0;
462
571 vo->m_show_video = 0; // false 463 vo->m_show_video = 0; // false
@@ -573,3 +465,2 @@ vo_driver_t* init_video_out_plugin( config_values_t* conf,
573 vo->m_is_scaling = 0; 465 vo->m_is_scaling = 0;
574 vo->user_ratio = ASPECT_AUTO;
575 vo->display_ratio = 1.0; 466 vo->display_ratio = 1.0;
@@ -597,4 +488,4 @@ vo_driver_t* init_video_out_plugin( config_values_t* conf,
597 vo->yuv2rgb_cmap); 488 vo->yuv2rgb_cmap);
598 printf("done initialisation\n"); 489
599 return (vo_driver_t*) vo; 490 return ( xine_vo_driver_t*) vo;
600} 491}
@@ -604,5 +495,3 @@ static vo_info_t vo_info_null = {
604 "null plugin", 495 "null plugin",
605 NULL, 496 XINE_VISUAL_TYPE_FB
606 VISUAL_TYPE_FB,
607 5
608}; 497};
@@ -622,3 +511,3 @@ vo_info_t *get_video_out_plugin_info(){
622 */ 511 */
623int null_is_showing_video( vo_driver_t* self ){ 512int null_is_showing_video( xine_vo_driver_t* self ){
624 null_driver_t* this = (null_driver_t*)self; 513 null_driver_t* this = (null_driver_t*)self;
@@ -626,3 +515,3 @@ int null_is_showing_video( vo_driver_t* self ){
626} 515}
627void null_set_show_video( vo_driver_t* self, int show ) { 516void null_set_show_video( xine_vo_driver_t* self, int show ) {
628 ((null_driver_t*)self)->m_show_video = show; 517 ((null_driver_t*)self)->m_show_video = show;
@@ -630,9 +519,9 @@ void null_set_show_video( vo_driver_t* self, int show ) {
630 519
631int null_is_fullscreen( vo_driver_t* self ){ 520int null_is_fullscreen( xine_vo_driver_t* self ){
632 return ((null_driver_t*)self)->m_video_fullscreen; 521 return ((null_driver_t*)self)->m_video_fullscreen;
633} 522}
634void null_set_fullscreen( vo_driver_t* self, int screen ){ 523void null_set_fullscreen( xine_vo_driver_t* self, int screen ){
635 ((null_driver_t*)self)->m_video_fullscreen = screen; 524 ((null_driver_t*)self)->m_video_fullscreen = screen;
636} 525}
637int null_is_scaling( vo_driver_t* self ){ 526int null_is_scaling( xine_vo_driver_t* self ){
638 return ((null_driver_t*)self)->m_is_scaling; 527 return ((null_driver_t*)self)->m_is_scaling;
@@ -640,3 +529,3 @@ int null_is_scaling( vo_driver_t* self ){
640 529
641void null_set_videoGamma( vo_driver_t* self , int value ) { 530void null_set_videoGamma( xine_vo_driver_t* self , int value ) {
642 ((null_driver_t*) self) ->yuv2rgb_gamma = value; 531 ((null_driver_t*) self) ->yuv2rgb_gamma = value;
@@ -645,3 +534,3 @@ void null_set_videoGamma( vo_driver_t* self , int value ) {
645 534
646void null_set_scaling( vo_driver_t* self, int scale ){ 535void null_set_scaling( xine_vo_driver_t* self, int scale ) {
647 ((null_driver_t*)self)->m_is_scaling = scale; 536 ((null_driver_t*)self)->m_is_scaling = scale;
@@ -649,6 +538,6 @@ void null_set_scaling( vo_driver_t* self, int scale ){
649 538
650void null_set_gui_width( vo_driver_t* self, int width ){ 539void null_set_gui_width( xine_vo_driver_t* self, int width ) {
651 ((null_driver_t*)self)->gui_width = width; 540 ((null_driver_t*)self)->gui_width = width;
652} 541}
653void null_set_gui_height( vo_driver_t* self, int height ){ 542void null_set_gui_height( xine_vo_driver_t* self, int height ) {
654 ((null_driver_t*)self)->gui_height = height; 543 ((null_driver_t*)self)->gui_height = height;
@@ -657,3 +546,3 @@ void null_set_gui_height( vo_driver_t* self, int height ){
657 546
658void null_set_mode( vo_driver_t* self, int depth, int rgb ){ 547void null_set_mode( xine_vo_driver_t* self, int depth, int rgb ) {
659 null_driver_t* this = (null_driver_t*)self; 548 null_driver_t* this = (null_driver_t*)self;
@@ -673,6 +562,7 @@ void null_set_mode( vo_driver_t* self, int depth, int rgb ){
673 if( this->bpp == 32 ) { 562 if( this->bpp == 32 ) {
674 if(rgb == 0 ) 563 if( rgb == 0 ) {
675 this->yuv2rgb_mode = MODE_32_RGB; 564 this->yuv2rgb_mode = MODE_32_RGB;
676 else 565 } else {
677 this->yuv2rgb_mode = MODE_32_BGR; 566 this->yuv2rgb_mode = MODE_32_BGR;
567 }
678 }else{ 568 }else{
@@ -685,18 +575,21 @@ void null_set_mode( vo_driver_t* self, int depth, int rgb ){
685 case 16: 575 case 16:
686 if( rgb == 0 ) 576 if( rgb == 0 ) {
687 this->yuv2rgb_mode = MODE_16_RGB; 577 this->yuv2rgb_mode = MODE_16_RGB;
688 else 578 } else {
689 this->yuv2rgb_mode = MODE_16_BGR; 579 this->yuv2rgb_mode = MODE_16_BGR;
580 }
690 break; 581 break;
691 case 15: 582 case 15:
692 if( rgb == 0 ) 583 if( rgb == 0 ) {
693 this->yuv2rgb_mode = MODE_15_RGB; 584 this->yuv2rgb_mode = MODE_15_RGB;
694 else 585 } else {
695 this->yuv2rgb_mode = MODE_15_BGR; 586 this->yuv2rgb_mode = MODE_15_BGR;
587 }
696 break; 588 break;
697 case 8: 589 case 8:
698 if( rgb == 0 ) 590 if( rgb == 0 ) {
699 this->yuv2rgb_mode = MODE_8_RGB; 591 this->yuv2rgb_mode = MODE_8_RGB;
700 else 592 } else {
701 this->yuv2rgb_mode = MODE_8_BGR; 593 this->yuv2rgb_mode = MODE_8_BGR;
594 }
702 break; 595 break;
@@ -707,3 +600,5 @@ void null_set_mode( vo_driver_t* self, int depth, int rgb ){
707}; 600};
708void null_display_handler(vo_driver_t* self, display_xine_frame_t t, void* user_data) { 601
602void null_display_handler( xine_vo_driver_t* self, display_xine_frame_t t,
603 void* user_data ) {
709 null_driver_t* this = (null_driver_t*) self; 604 null_driver_t* this = (null_driver_t*) self;