author | simon <simon> | 2002-12-14 17:00:16 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-14 17:00:16 (UTC) |
commit | bbdeff25bd0cc5ff59d52fd8bf25cdfbeac8f251 (patch) (unidiff) | |
tree | 6357471675db58fbf6d1d9d168618635c2e5cbf6 | |
parent | 354b07f236773c0dbb642972a7dffb598ea1af2f (diff) | |
download | opie-bbdeff25bd0cc5ff59d52fd8bf25cdfbeac8f251.zip opie-bbdeff25bd0cc5ff59d52fd8bf25cdfbeac8f251.tar.gz opie-bbdeff25bd0cc5ff59d52fd8bf25cdfbeac8f251.tar.bz2 |
- skip the free_(audio|video)_decoder calls. today's libvorbis doesn't
like it
-rw-r--r-- | noncore/multimedia/opieplayer2/nullvideo.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/multimedia/opieplayer2/nullvideo.c b/noncore/multimedia/opieplayer2/nullvideo.c index e2eb663..a49f9d3 100644 --- a/noncore/multimedia/opieplayer2/nullvideo.c +++ b/noncore/multimedia/opieplayer2/nullvideo.c | |||
@@ -243,393 +243,393 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, | |||
243 | /* | 243 | /* |
244 | * (re-) allocate | 244 | * (re-) allocate |
245 | */ | 245 | */ |
246 | if( frame->data ) { | 246 | if( frame->data ) { |
247 | if( frame->chunk[0] ){ | 247 | if( frame->chunk[0] ){ |
248 | free( frame->chunk[0] ); | 248 | free( frame->chunk[0] ); |
249 | frame->chunk[0] = NULL; | 249 | frame->chunk[0] = NULL; |
250 | } | 250 | } |
251 | if( frame->chunk[1] ){ | 251 | if( frame->chunk[1] ){ |
252 | free ( frame->chunk[1] ); | 252 | free ( frame->chunk[1] ); |
253 | frame->chunk[1] = NULL; | 253 | frame->chunk[1] = NULL; |
254 | } | 254 | } |
255 | if( frame->chunk[2] ){ | 255 | if( frame->chunk[2] ){ |
256 | free ( frame->chunk[2] ); | 256 | free ( frame->chunk[2] ); |
257 | frame->chunk[2] = NULL; | 257 | frame->chunk[2] = NULL; |
258 | } | 258 | } |
259 | free ( frame->data ); | 259 | free ( frame->data ); |
260 | } | 260 | } |
261 | 261 | ||
262 | frame->data = xine_xmalloc (frame->sc.output_width | 262 | frame->data = xine_xmalloc (frame->sc.output_width |
263 | * frame->sc.output_height | 263 | * frame->sc.output_height |
264 | * this->bytes_per_pixel ); | 264 | * this->bytes_per_pixel ); |
265 | 265 | ||
266 | if( format == XINE_IMGFMT_YV12 ) { | 266 | if( format == XINE_IMGFMT_YV12 ) { |
267 | frame->frame.pitches[0] = 8*((width + 7) / 8); | 267 | frame->frame.pitches[0] = 8*((width + 7) / 8); |
268 | frame->frame.pitches[1] = 8*((width + 15) / 16); | 268 | frame->frame.pitches[1] = 8*((width + 15) / 16); |
269 | frame->frame.pitches[2] = 8*((width + 15) / 16); | 269 | frame->frame.pitches[2] = 8*((width + 15) / 16); |
270 | frame->frame.base[0] = xine_xmalloc_aligned (16, frame->frame.pitches[0] * height,(void **)&frame->chunk[0]); | 270 | frame->frame.base[0] = xine_xmalloc_aligned (16, frame->frame.pitches[0] * height,(void **)&frame->chunk[0]); |
271 | frame->frame.base[1] = xine_xmalloc_aligned (16, frame->frame.pitches[1] * ((height+ 1)/2), (void **)&frame->chunk[1]); | 271 | frame->frame.base[1] = xine_xmalloc_aligned (16, frame->frame.pitches[1] * ((height+ 1)/2), (void **)&frame->chunk[1]); |
272 | frame->frame.base[2] = xine_xmalloc_aligned (16, frame->frame.pitches[2] * ((height+ 1)/2), (void **)&frame->chunk[2]); | 272 | frame->frame.base[2] = xine_xmalloc_aligned (16, frame->frame.pitches[2] * ((height+ 1)/2), (void **)&frame->chunk[2]); |
273 | 273 | ||
274 | }else{ | 274 | }else{ |
275 | frame->frame.pitches[0] = 8*((width + 3) / 4); | 275 | frame->frame.pitches[0] = 8*((width + 3) / 4); |
276 | 276 | ||
277 | frame->frame.base[0] = xine_xmalloc_aligned (16, frame->frame.pitches[0] * height, | 277 | frame->frame.base[0] = xine_xmalloc_aligned (16, frame->frame.pitches[0] * height, |
278 | (void **)&frame->chunk[0]); | 278 | (void **)&frame->chunk[0]); |
279 | frame->chunk[1] = NULL; | 279 | frame->chunk[1] = NULL; |
280 | frame->chunk[2] = NULL; | 280 | frame->chunk[2] = NULL; |
281 | } | 281 | } |
282 | 282 | ||
283 | frame->stripe_height = 16 * frame->sc.output_height / frame->sc.delivered_height; | 283 | frame->stripe_height = 16 * frame->sc.output_height / frame->sc.delivered_height; |
284 | frame->bytes_per_line = frame->sc.output_width * this->bytes_per_pixel; | 284 | frame->bytes_per_line = frame->sc.output_width * this->bytes_per_pixel; |
285 | 285 | ||
286 | /* | 286 | /* |
287 | * set up colorspace converter | 287 | * set up colorspace converter |
288 | */ | 288 | */ |
289 | 289 | ||
290 | switch (flags) { | 290 | switch (flags) { |
291 | case VO_TOP_FIELD: | 291 | case VO_TOP_FIELD: |
292 | case VO_BOTTOM_FIELD: | 292 | case VO_BOTTOM_FIELD: |
293 | frame->yuv2rgb->configure (frame->yuv2rgb, | 293 | frame->yuv2rgb->configure (frame->yuv2rgb, |
294 | frame->sc.delivered_width, | 294 | frame->sc.delivered_width, |
295 | 16, | 295 | 16, |
296 | 2*frame->frame.pitches[0], | 296 | 2*frame->frame.pitches[0], |
297 | 2*frame->frame.pitches[1], | 297 | 2*frame->frame.pitches[1], |
298 | frame->sc.output_width, | 298 | frame->sc.output_width, |
299 | frame->stripe_height, | 299 | frame->stripe_height, |
300 | frame->bytes_per_line*2); | 300 | frame->bytes_per_line*2); |
301 | frame->yuv_stride = frame->bytes_per_line*2; | 301 | frame->yuv_stride = frame->bytes_per_line*2; |
302 | break; | 302 | break; |
303 | case VO_BOTH_FIELDS: | 303 | case VO_BOTH_FIELDS: |
304 | frame->yuv2rgb->configure (frame->yuv2rgb, | 304 | frame->yuv2rgb->configure (frame->yuv2rgb, |
305 | frame->sc.delivered_width, | 305 | frame->sc.delivered_width, |
306 | 16, | 306 | 16, |
307 | frame->frame.pitches[0], | 307 | frame->frame.pitches[0], |
308 | frame->frame.pitches[1], | 308 | frame->frame.pitches[1], |
309 | frame->sc.output_width, | 309 | frame->sc.output_width, |
310 | frame->stripe_height, | 310 | frame->stripe_height, |
311 | frame->bytes_per_line); | 311 | frame->bytes_per_line); |
312 | frame->yuv_stride = frame->bytes_per_line; | 312 | frame->yuv_stride = frame->bytes_per_line; |
313 | break; | 313 | break; |
314 | } | 314 | } |
315 | #ifdef LOG | 315 | #ifdef LOG |
316 | fprintf (stderr, "nullvideo: colorspace converter configured.\n"); | 316 | fprintf (stderr, "nullvideo: colorspace converter configured.\n"); |
317 | #endif | 317 | #endif |
318 | } | 318 | } |
319 | 319 | ||
320 | /* | 320 | /* |
321 | * reset dest pointers | 321 | * reset dest pointers |
322 | */ | 322 | */ |
323 | 323 | ||
324 | if (frame->data) { | 324 | if (frame->data) { |
325 | switch (flags) { | 325 | switch (flags) { |
326 | case VO_TOP_FIELD: | 326 | case VO_TOP_FIELD: |
327 | frame->rgb_dst = (uint8_t *)frame->data; | 327 | frame->rgb_dst = (uint8_t *)frame->data; |
328 | frame->stripe_inc = 2 * frame->stripe_height * frame->bytes_per_line; | 328 | frame->stripe_inc = 2 * frame->stripe_height * frame->bytes_per_line; |
329 | break; | 329 | break; |
330 | case VO_BOTTOM_FIELD: | 330 | case VO_BOTTOM_FIELD: |
331 | frame->rgb_dst = (uint8_t *)frame->data + frame->bytes_per_line ; | 331 | frame->rgb_dst = (uint8_t *)frame->data + frame->bytes_per_line ; |
332 | frame->stripe_inc = 2 * frame->stripe_height * frame->bytes_per_line; | 332 | frame->stripe_inc = 2 * frame->stripe_height * frame->bytes_per_line; |
333 | break; | 333 | break; |
334 | case VO_BOTH_FIELDS: | 334 | case VO_BOTH_FIELDS: |
335 | frame->rgb_dst = (uint8_t *)frame->data; | 335 | frame->rgb_dst = (uint8_t *)frame->data; |
336 | frame->stripe_inc = frame->stripe_height * frame->bytes_per_line; | 336 | frame->stripe_inc = frame->stripe_height * frame->bytes_per_line; |
337 | break; | 337 | break; |
338 | } | 338 | } |
339 | } | 339 | } |
340 | } | 340 | } |
341 | 341 | ||
342 | static void null_display_frame( vo_driver_t* self, vo_frame_t *frame_gen ){ | 342 | static void null_display_frame( vo_driver_t* self, vo_frame_t *frame_gen ){ |
343 | null_driver_t* this = (null_driver_t*) self; | 343 | null_driver_t* this = (null_driver_t*) self; |
344 | opie_frame_t* frame = (opie_frame_t*)frame_gen; | 344 | opie_frame_t* frame = (opie_frame_t*)frame_gen; |
345 | display_xine_frame_t display = this->frameDis; | 345 | display_xine_frame_t display = this->frameDis; |
346 | 346 | ||
347 | if (!this->m_show_video) | 347 | if (!this->m_show_video) |
348 | return; | 348 | return; |
349 | 349 | ||
350 | if( display != NULL ) { | 350 | if( display != NULL ) { |
351 | (*display)(this->caller, frame->data, | 351 | (*display)(this->caller, frame->data, |
352 | frame->sc.output_width, frame->sc.output_height, | 352 | frame->sc.output_width, frame->sc.output_height, |
353 | frame->bytes_per_line ); | 353 | frame->bytes_per_line ); |
354 | } | 354 | } |
355 | 355 | ||
356 | frame->frame.displayed (&frame->frame); | 356 | frame->frame.displayed (&frame->frame); |
357 | } | 357 | } |
358 | 358 | ||
359 | 359 | ||
360 | /* blending related */ | 360 | /* blending related */ |
361 | static void null_overlay_clut_yuv2rgb (null_driver_t *this, | 361 | static void null_overlay_clut_yuv2rgb (null_driver_t *this, |
362 | vo_overlay_t *overlay, | 362 | vo_overlay_t *overlay, |
363 | opie_frame_t *frame) { | 363 | opie_frame_t *frame) { |
364 | int i; | 364 | int i; |
365 | clut_t* clut = (clut_t*) overlay->color; | 365 | clut_t* clut = (clut_t*) overlay->color; |
366 | if (!overlay->rgb_clut) { | 366 | if (!overlay->rgb_clut) { |
367 | for (i = 0; i < sizeof(overlay->color)/sizeof(overlay->color[0]); i++) { | 367 | for (i = 0; i < sizeof(overlay->color)/sizeof(overlay->color[0]); i++) { |
368 | *((uint32_t *)&clut[i]) = | 368 | *((uint32_t *)&clut[i]) = |
369 | frame->yuv2rgb->yuv2rgb_single_pixel_fun (frame->yuv2rgb, | 369 | frame->yuv2rgb->yuv2rgb_single_pixel_fun (frame->yuv2rgb, |
370 | clut[i].y, clut[i].cb, clut[i].cr); | 370 | clut[i].y, clut[i].cb, clut[i].cr); |
371 | } | 371 | } |
372 | overlay->rgb_clut++; | 372 | overlay->rgb_clut++; |
373 | } | 373 | } |
374 | if (!overlay->clip_rgb_clut) { | 374 | if (!overlay->clip_rgb_clut) { |
375 | clut = (clut_t*) overlay->clip_color; | 375 | clut = (clut_t*) overlay->clip_color; |
376 | for (i = 0; i < sizeof(overlay->color)/sizeof(overlay->color[0]); i++) { | 376 | for (i = 0; i < sizeof(overlay->color)/sizeof(overlay->color[0]); i++) { |
377 | *((uint32_t *)&clut[i]) = | 377 | *((uint32_t *)&clut[i]) = |
378 | frame->yuv2rgb->yuv2rgb_single_pixel_fun(frame->yuv2rgb, | 378 | frame->yuv2rgb->yuv2rgb_single_pixel_fun(frame->yuv2rgb, |
379 | clut[i].y, clut[i].cb, clut[i].cr); | 379 | clut[i].y, clut[i].cb, clut[i].cr); |
380 | } | 380 | } |
381 | overlay->clip_rgb_clut++; | 381 | overlay->clip_rgb_clut++; |
382 | } | 382 | } |
383 | } | 383 | } |
384 | 384 | ||
385 | static void null_overlay_blend ( vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay) { | 385 | static void null_overlay_blend ( vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay) { |
386 | null_driver_t *this = (null_driver_t *) this_gen; | 386 | null_driver_t *this = (null_driver_t *) this_gen; |
387 | opie_frame_t *frame = (opie_frame_t *) frame_gen; | 387 | opie_frame_t *frame = (opie_frame_t *) frame_gen; |
388 | 388 | ||
389 | if(!this->m_show_video || frame->sc.output_width == 0 | 389 | if(!this->m_show_video || frame->sc.output_width == 0 |
390 | || frame->sc.output_height== 0) | 390 | || frame->sc.output_height== 0) |
391 | return; | 391 | return; |
392 | 392 | ||
393 | /* Alpha Blend here */ | 393 | /* Alpha Blend here */ |
394 | if (overlay->rle) { | 394 | if (overlay->rle) { |
395 | if( !overlay->rgb_clut || !overlay->clip_rgb_clut) | 395 | if( !overlay->rgb_clut || !overlay->clip_rgb_clut) |
396 | null_overlay_clut_yuv2rgb(this,overlay,frame); | 396 | null_overlay_clut_yuv2rgb(this,overlay,frame); |
397 | 397 | ||
398 | switch(this->bpp) { | 398 | switch(this->bpp) { |
399 | case 16: | 399 | case 16: |
400 | blend_rgb16( (uint8_t *)frame->data, overlay, | 400 | blend_rgb16( (uint8_t *)frame->data, overlay, |
401 | frame->sc.output_width, frame->sc.output_height, | 401 | frame->sc.output_width, frame->sc.output_height, |
402 | frame->sc.delivered_width, frame->sc.delivered_height); | 402 | frame->sc.delivered_width, frame->sc.delivered_height); |
403 | break; | 403 | break; |
404 | case 24: | 404 | case 24: |
405 | blend_rgb24( (uint8_t *)frame->data, overlay, | 405 | blend_rgb24( (uint8_t *)frame->data, overlay, |
406 | frame->sc.output_width, frame->sc.output_height, | 406 | frame->sc.output_width, frame->sc.output_height, |
407 | frame->sc.delivered_width, frame->sc.delivered_height); | 407 | frame->sc.delivered_width, frame->sc.delivered_height); |
408 | break; | 408 | break; |
409 | case 32: | 409 | case 32: |
410 | blend_rgb32( (uint8_t *)frame->data, overlay, | 410 | blend_rgb32( (uint8_t *)frame->data, overlay, |
411 | frame->sc.output_width, frame->sc.output_height, | 411 | frame->sc.output_width, frame->sc.output_height, |
412 | frame->sc.delivered_width, frame->sc.delivered_height); | 412 | frame->sc.delivered_width, frame->sc.delivered_height); |
413 | break; | 413 | break; |
414 | default: | 414 | default: |
415 | /* It should never get here */ | 415 | /* It should never get here */ |
416 | break; | 416 | break; |
417 | } | 417 | } |
418 | } | 418 | } |
419 | } | 419 | } |
420 | 420 | ||
421 | 421 | ||
422 | static int null_get_property( vo_driver_t* self, | 422 | static int null_get_property( vo_driver_t* self, |
423 | int property ){ | 423 | int property ){ |
424 | return 0; | 424 | return 0; |
425 | } | 425 | } |
426 | static int null_set_property( vo_driver_t* self, | 426 | static int null_set_property( vo_driver_t* self, |
427 | int property, | 427 | int property, |
428 | int value ){ | 428 | int value ){ |
429 | return value; | 429 | return value; |
430 | } | 430 | } |
431 | static void null_get_property_min_max( vo_driver_t* self, | 431 | static void null_get_property_min_max( vo_driver_t* self, |
432 | int property, int *min, | 432 | int property, int *min, |
433 | int *max ){ | 433 | int *max ){ |
434 | *max = 0; | 434 | *max = 0; |
435 | *min = 0; | 435 | *min = 0; |
436 | } | 436 | } |
437 | static int null_gui_data_exchange( vo_driver_t* self, | 437 | static int null_gui_data_exchange( vo_driver_t* self, |
438 | int data_type, | 438 | int data_type, |
439 | void *data ){ | 439 | void *data ){ |
440 | return 0; | 440 | return 0; |
441 | } | 441 | } |
442 | 442 | ||
443 | static void null_dispose ( vo_driver_t* self ){ | 443 | static void null_dispose ( vo_driver_t* self ){ |
444 | null_driver_t* this = (null_driver_t*)self; | 444 | null_driver_t* this = (null_driver_t*)self; |
445 | free ( this ); | 445 | free ( this ); |
446 | } | 446 | } |
447 | static int null_redraw_needed( vo_driver_t* self ){ | 447 | static int null_redraw_needed( vo_driver_t* self ){ |
448 | return 0; | 448 | return 0; |
449 | } | 449 | } |
450 | 450 | ||
451 | 451 | ||
452 | xine_vo_driver_t* init_video_out_plugin( xine_t *xine, | 452 | xine_vo_driver_t* init_video_out_plugin( xine_t *xine, |
453 | void* video, display_xine_frame_t frameDisplayFunc, void *userData ){ | 453 | void* video, display_xine_frame_t frameDisplayFunc, void *userData ){ |
454 | null_driver_t *vo; | 454 | null_driver_t *vo; |
455 | vo = (null_driver_t*)malloc( sizeof(null_driver_t ) ); | 455 | vo = (null_driver_t*)malloc( sizeof(null_driver_t ) ); |
456 | 456 | ||
457 | /* memset? */ | 457 | /* memset? */ |
458 | memset(vo,0, sizeof(null_driver_t ) ); | 458 | memset(vo,0, sizeof(null_driver_t ) ); |
459 | 459 | ||
460 | vo_scale_init (&vo->sc, 0, 0, xine->config); | 460 | vo_scale_init (&vo->sc, 0, 0, xine->config); |
461 | 461 | ||
462 | vo->sc.gui_pixel_aspect = 1.0; | 462 | vo->sc.gui_pixel_aspect = 1.0; |
463 | 463 | ||
464 | vo->m_show_video = 0; // false | 464 | vo->m_show_video = 0; // false |
465 | vo->m_video_fullscreen = 0; | 465 | vo->m_video_fullscreen = 0; |
466 | vo->m_is_scaling = 0; | 466 | vo->m_is_scaling = 0; |
467 | vo->display_ratio = 1.0; | 467 | vo->display_ratio = 1.0; |
468 | vo->gui_width = 16; | 468 | vo->gui_width = 16; |
469 | vo->gui_height = 8; | 469 | vo->gui_height = 8; |
470 | vo->frameDis = NULL; | 470 | vo->frameDis = NULL; |
471 | 471 | ||
472 | /* install callback handlers*/ | 472 | /* install callback handlers*/ |
473 | vo->vo_driver.get_capabilities = null_get_capabilities; | 473 | vo->vo_driver.get_capabilities = null_get_capabilities; |
474 | vo->vo_driver.alloc_frame = null_alloc_frame; | 474 | vo->vo_driver.alloc_frame = null_alloc_frame; |
475 | vo->vo_driver.update_frame_format = null_update_frame_format; | 475 | vo->vo_driver.update_frame_format = null_update_frame_format; |
476 | vo->vo_driver.display_frame = null_display_frame; | 476 | vo->vo_driver.display_frame = null_display_frame; |
477 | vo->vo_driver.overlay_blend = null_overlay_blend; | 477 | vo->vo_driver.overlay_blend = null_overlay_blend; |
478 | vo->vo_driver.get_property = null_get_property; | 478 | vo->vo_driver.get_property = null_get_property; |
479 | vo->vo_driver.set_property = null_set_property; | 479 | vo->vo_driver.set_property = null_set_property; |
480 | vo->vo_driver.get_property_min_max = null_get_property_min_max; | 480 | vo->vo_driver.get_property_min_max = null_get_property_min_max; |
481 | vo->vo_driver.gui_data_exchange = null_gui_data_exchange; | 481 | vo->vo_driver.gui_data_exchange = null_gui_data_exchange; |
482 | vo->vo_driver.dispose = null_dispose; | 482 | vo->vo_driver.dispose = null_dispose; |
483 | vo->vo_driver.redraw_needed = null_redraw_needed; | 483 | vo->vo_driver.redraw_needed = null_redraw_needed; |
484 | 484 | ||
485 | 485 | ||
486 | /* capabilities */ | 486 | /* capabilities */ |
487 | vo->m_capabilities = VO_CAP_COPIES_IMAGE | VO_CAP_YUY2 | VO_CAP_YV12; | 487 | vo->m_capabilities = VO_CAP_COPIES_IMAGE | VO_CAP_YUY2 | VO_CAP_YV12; |
488 | vo->yuv2rgb_factory = yuv2rgb_factory_init (MODE_16_RGB, vo->yuv2rgb_swap, | 488 | vo->yuv2rgb_factory = yuv2rgb_factory_init (MODE_16_RGB, vo->yuv2rgb_swap, |
489 | vo->yuv2rgb_cmap); | 489 | vo->yuv2rgb_cmap); |
490 | 490 | ||
491 | vo->caller = userData; | 491 | vo->caller = userData; |
492 | vo->frameDis = frameDisplayFunc; | 492 | vo->frameDis = frameDisplayFunc; |
493 | 493 | ||
494 | /* return ( vo_driver_t*) vo; */ | 494 | /* return ( vo_driver_t*) vo; */ |
495 | return vo_new_port( xine, ( vo_driver_t* )vo ); | 495 | return vo_new_port( xine, ( vo_driver_t* )vo ); |
496 | } | 496 | } |
497 | 497 | ||
498 | #if 0 | 498 | #if 0 |
499 | static vo_info_t vo_info_null = { | 499 | static vo_info_t vo_info_null = { |
500 | 5, | 500 | 5, |
501 | XINE_VISUAL_TYPE_FB | 501 | XINE_VISUAL_TYPE_FB |
502 | }; | 502 | }; |
503 | 503 | ||
504 | vo_info_t *get_video_out_plugin_info(){ | 504 | vo_info_t *get_video_out_plugin_info(){ |
505 | vo_info_null.description = ("xine video output plugin using null device"); | 505 | vo_info_null.description = ("xine video output plugin using null device"); |
506 | return &vo_info_null; | 506 | return &vo_info_null; |
507 | } | 507 | } |
508 | 508 | ||
509 | #endif | 509 | #endif |
510 | 510 | ||
511 | /* this is special for this device */ | 511 | /* this is special for this device */ |
512 | /** | 512 | /** |
513 | * We know that we will be controled by the XINE LIB++ | 513 | * We know that we will be controled by the XINE LIB++ |
514 | */ | 514 | */ |
515 | 515 | ||
516 | /** | 516 | /** |
517 | * | 517 | * |
518 | */ | 518 | */ |
519 | int null_is_showing_video( xine_vo_driver_t* self ){ | 519 | int null_is_showing_video( xine_vo_driver_t* self ){ |
520 | null_driver_t* this = (null_driver_t*)self->driver; | 520 | null_driver_t* this = (null_driver_t*)self->driver; |
521 | return this->m_show_video; | 521 | return this->m_show_video; |
522 | } | 522 | } |
523 | void null_set_show_video( xine_vo_driver_t* self, int show ) { | 523 | void null_set_show_video( xine_vo_driver_t* self, int show ) { |
524 | ((null_driver_t*)self->driver)->m_show_video = show; | 524 | ((null_driver_t*)self->driver)->m_show_video = show; |
525 | } | 525 | } |
526 | 526 | ||
527 | int null_is_fullscreen( xine_vo_driver_t* self ){ | 527 | int null_is_fullscreen( xine_vo_driver_t* self ){ |
528 | return ((null_driver_t*)self->driver)->m_video_fullscreen; | 528 | return ((null_driver_t*)self->driver)->m_video_fullscreen; |
529 | } | 529 | } |
530 | void null_set_fullscreen( xine_vo_driver_t* self, int screen ){ | 530 | void null_set_fullscreen( xine_vo_driver_t* self, int screen ){ |
531 | ((null_driver_t*)self->driver)->m_video_fullscreen = screen; | 531 | ((null_driver_t*)self->driver)->m_video_fullscreen = screen; |
532 | } | 532 | } |
533 | int null_is_scaling( xine_vo_driver_t* self ){ | 533 | int null_is_scaling( xine_vo_driver_t* self ){ |
534 | return ((null_driver_t*)self->driver)->m_is_scaling; | 534 | return ((null_driver_t*)self->driver)->m_is_scaling; |
535 | } | 535 | } |
536 | 536 | ||
537 | void null_set_videoGamma( xine_vo_driver_t* self , int value ) { | 537 | void null_set_videoGamma( xine_vo_driver_t* self , int value ) { |
538 | ((null_driver_t*) self->driver) ->yuv2rgb_gamma = value; | 538 | ((null_driver_t*) self->driver) ->yuv2rgb_gamma = value; |
539 | ((null_driver_t*) self->driver) ->yuv2rgb_factory->set_gamma( ((null_driver_t*) self->driver) ->yuv2rgb_factory, value ); | 539 | ((null_driver_t*) self->driver) ->yuv2rgb_factory->set_gamma( ((null_driver_t*) self->driver) ->yuv2rgb_factory, value ); |
540 | } | 540 | } |
541 | 541 | ||
542 | void null_set_scaling( xine_vo_driver_t* self, int scale ) { | 542 | void null_set_scaling( xine_vo_driver_t* self, int scale ) { |
543 | ((null_driver_t*)self->driver)->m_is_scaling = scale; | 543 | ((null_driver_t*)self->driver)->m_is_scaling = scale; |
544 | } | 544 | } |
545 | 545 | ||
546 | void null_set_gui_width( xine_vo_driver_t* self, int width ) { | 546 | void null_set_gui_width( xine_vo_driver_t* self, int width ) { |
547 | ((null_driver_t*)self->driver)->gui_width = width; | 547 | ((null_driver_t*)self->driver)->gui_width = width; |
548 | } | 548 | } |
549 | void null_set_gui_height( xine_vo_driver_t* self, int height ) { | 549 | void null_set_gui_height( xine_vo_driver_t* self, int height ) { |
550 | ((null_driver_t*)self->driver)->gui_height = height; | 550 | ((null_driver_t*)self->driver)->gui_height = height; |
551 | } | 551 | } |
552 | 552 | ||
553 | 553 | ||
554 | void null_set_mode( xine_vo_driver_t* self, int depth, int rgb ) { | 554 | void null_set_mode( xine_vo_driver_t* self, int depth, int rgb ) { |
555 | null_driver_t* this = (null_driver_t*)self->driver; | 555 | null_driver_t* this = (null_driver_t*)self->driver; |
556 | 556 | ||
557 | this->bytes_per_pixel = (depth + 7 ) / 8; | 557 | this->bytes_per_pixel = (depth + 7 ) / 8; |
558 | this->bpp = this->bytes_per_pixel * 8; | 558 | this->bpp = this->bytes_per_pixel * 8; |
559 | this->depth = depth; | 559 | this->depth = depth; |
560 | printf("depth %d %d\n", depth, this->bpp); | 560 | printf("depth %d %d\n", depth, this->bpp); |
561 | printf("pixeltype %d\n", rgb ); | 561 | printf("pixeltype %d\n", rgb ); |
562 | switch ( this->depth ) { | 562 | switch ( this->depth ) { |
563 | case 32: | 563 | case 32: |
564 | if( rgb == 0 ) | 564 | if( rgb == 0 ) |
565 | this->yuv2rgb_mode = MODE_32_RGB; | 565 | this->yuv2rgb_mode = MODE_32_RGB; |
566 | else | 566 | else |
567 | this->yuv2rgb_mode = MODE_32_BGR; | 567 | this->yuv2rgb_mode = MODE_32_BGR; |
568 | case 24: | 568 | case 24: |
569 | if( this->bpp == 32 ) { | 569 | if( this->bpp == 32 ) { |
570 | if( rgb == 0 ) { | 570 | if( rgb == 0 ) { |
571 | this->yuv2rgb_mode = MODE_32_RGB; | 571 | this->yuv2rgb_mode = MODE_32_RGB; |
572 | } else { | 572 | } else { |
573 | this->yuv2rgb_mode = MODE_32_BGR; | 573 | this->yuv2rgb_mode = MODE_32_BGR; |
574 | } | 574 | } |
575 | }else{ | 575 | }else{ |
576 | if( rgb == 0 ) | 576 | if( rgb == 0 ) |
577 | this->yuv2rgb_mode = MODE_24_RGB; | 577 | this->yuv2rgb_mode = MODE_24_RGB; |
578 | else | 578 | else |
579 | this->yuv2rgb_mode = MODE_24_BGR; | 579 | this->yuv2rgb_mode = MODE_24_BGR; |
580 | }; | 580 | }; |
581 | break; | 581 | break; |
582 | case 16: | 582 | case 16: |
583 | if( rgb == 0 ) { | 583 | if( rgb == 0 ) { |
584 | this->yuv2rgb_mode = MODE_16_RGB; | 584 | this->yuv2rgb_mode = MODE_16_RGB; |
585 | } else { | 585 | } else { |
586 | this->yuv2rgb_mode = MODE_16_BGR; | 586 | this->yuv2rgb_mode = MODE_16_BGR; |
587 | } | 587 | } |
588 | break; | 588 | break; |
589 | case 15: | 589 | case 15: |
590 | if( rgb == 0 ) { | 590 | if( rgb == 0 ) { |
591 | this->yuv2rgb_mode = MODE_15_RGB; | 591 | this->yuv2rgb_mode = MODE_15_RGB; |
592 | } else { | 592 | } else { |
593 | this->yuv2rgb_mode = MODE_15_BGR; | 593 | this->yuv2rgb_mode = MODE_15_BGR; |
594 | } | 594 | } |
595 | break; | 595 | break; |
596 | case 8: | 596 | case 8: |
597 | if( rgb == 0 ) { | 597 | if( rgb == 0 ) { |
598 | this->yuv2rgb_mode = MODE_8_RGB; | 598 | this->yuv2rgb_mode = MODE_8_RGB; |
599 | } else { | 599 | } else { |
600 | this->yuv2rgb_mode = MODE_8_BGR; | 600 | this->yuv2rgb_mode = MODE_8_BGR; |
601 | } | 601 | } |
602 | break; | 602 | break; |
603 | }; | 603 | }; |
604 | //free(this->yuv2rgb_factory ); | 604 | //free(this->yuv2rgb_factory ); |
605 | // this->yuv2rgb_factory = yuv2rgb_factory_init (this->yuv2rgb_mode, this->yuv2rgb_swap, | 605 | // this->yuv2rgb_factory = yuv2rgb_factory_init (this->yuv2rgb_mode, this->yuv2rgb_swap, |
606 | // this->yuv2rgb_cmap); | 606 | // this->yuv2rgb_cmap); |
607 | }; | 607 | }; |
608 | 608 | ||
609 | void null_display_handler( xine_vo_driver_t* self, display_xine_frame_t t, | 609 | void null_display_handler( xine_vo_driver_t* self, display_xine_frame_t t, |
610 | void* user_data ) { | 610 | void* user_data ) { |
611 | null_driver_t* this = (null_driver_t*) self->driver; | 611 | null_driver_t* this = (null_driver_t*) self->driver; |
612 | this->caller = user_data; | 612 | this->caller = user_data; |
613 | this->frameDis = t; | 613 | this->frameDis = t; |
614 | } | 614 | } |
615 | 615 | ||
616 | void null_preload_decoders( xine_stream_t *stream ) | 616 | void null_preload_decoders( xine_stream_t *stream ) |
617 | { | 617 | { |
618 | static const uint32_t preloadedAudioDecoders[] = { BUF_AUDIO_MPEG, BUF_AUDIO_VORBIS }; | 618 | static const uint32_t preloadedAudioDecoders[] = { BUF_AUDIO_MPEG, BUF_AUDIO_VORBIS }; |
619 | static const uint8_t preloadedAudioDecoderCount = sizeof( preloadedAudioDecoders ) / sizeof( preloadedAudioDecoders[ 0 ] ); | 619 | static const uint8_t preloadedAudioDecoderCount = sizeof( preloadedAudioDecoders ) / sizeof( preloadedAudioDecoders[ 0 ] ); |
620 | static const uint32_t preloadedVideoDecoders[] = { BUF_VIDEO_MPEG, BUF_VIDEO_MPEG4, BUF_VIDEO_DIVX5 }; | 620 | static const uint32_t preloadedVideoDecoders[] = { BUF_VIDEO_MPEG, BUF_VIDEO_MPEG4, BUF_VIDEO_DIVX5 }; |
621 | static const uint8_t preloadedVideoDecoderCount = sizeof( preloadedVideoDecoders ) / sizeof( preloadedVideoDecoders[ 0 ] ); | 621 | static const uint8_t preloadedVideoDecoderCount = sizeof( preloadedVideoDecoders ) / sizeof( preloadedVideoDecoders[ 0 ] ); |
622 | 622 | ||
623 | uint8_t i; | 623 | uint8_t i; |
624 | 624 | ||
625 | for ( i = 0; i < preloadedAudioDecoderCount; ++i ) { | 625 | for ( i = 0; i < preloadedAudioDecoderCount; ++i ) { |
626 | audio_decoder_t *decoder = get_audio_decoder( stream, ( preloadedAudioDecoders[ i ] >> 16 ) & 0xff ); | 626 | audio_decoder_t *decoder = get_audio_decoder( stream, ( preloadedAudioDecoders[ i ] >> 16 ) & 0xff ); |
627 | free_audio_decoder( stream, decoder ); | 627 | /* free_audio_decoder( stream, decoder ); */ |
628 | } | 628 | } |
629 | 629 | ||
630 | for ( i = 0; i < preloadedVideoDecoderCount; ++i ) { | 630 | for ( i = 0; i < preloadedVideoDecoderCount; ++i ) { |
631 | video_decoder_t *decoder = get_video_decoder( stream, ( preloadedVideoDecoders[ i ] >> 16 ) & 0xff ); | 631 | video_decoder_t *decoder = get_video_decoder( stream, ( preloadedVideoDecoders[ i ] >> 16 ) & 0xff ); |
632 | free_video_decoder( stream, decoder ); | 632 | /* free_video_decoder( stream, decoder ); */ |
633 | } | 633 | } |
634 | } | 634 | } |
635 | 635 | ||