author | simon <simon> | 2002-12-11 12:56:46 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-11 12:56:46 (UTC) |
commit | aa9623e53bd86c2645103ebacc81262f372b73d7 (patch) (unidiff) | |
tree | d24f0b4b3a5e5fe2f13bb011fbeff0cd53f1955a | |
parent | 9b8e5d7c225ac2dd399e392d57e3d19348412e1a (diff) | |
download | opie-aa9623e53bd86c2645103ebacc81262f372b73d7.zip opie-aa9623e53bd86c2645103ebacc81262f372b73d7.tar.gz opie-aa9623e53bd86c2645103ebacc81262f372b73d7.tar.bz2 |
- oops, do the right cast in the gamma set method
-rw-r--r-- | noncore/multimedia/opieplayer2/nullvideo.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/nullvideo.c b/noncore/multimedia/opieplayer2/nullvideo.c index 1ebb854..c988854 100644 --- a/noncore/multimedia/opieplayer2/nullvideo.c +++ b/noncore/multimedia/opieplayer2/nullvideo.c | |||
@@ -346,269 +346,269 @@ static void null_display_frame( vo_driver_t* self, vo_frame_t *frame_gen ){ | |||
346 | if (!this->m_show_video) | 346 | if (!this->m_show_video) |
347 | return; | 347 | return; |
348 | 348 | ||
349 | if( display != NULL ) { | 349 | if( display != NULL ) { |
350 | (*display)(this->caller, frame->data, | 350 | (*display)(this->caller, frame->data, |
351 | frame->sc.output_width, frame->sc.output_height, | 351 | frame->sc.output_width, frame->sc.output_height, |
352 | frame->bytes_per_line ); | 352 | frame->bytes_per_line ); |
353 | } | 353 | } |
354 | 354 | ||
355 | frame->frame.displayed (&frame->frame); | 355 | frame->frame.displayed (&frame->frame); |
356 | } | 356 | } |
357 | 357 | ||
358 | 358 | ||
359 | /* blending related */ | 359 | /* blending related */ |
360 | static void null_overlay_clut_yuv2rgb (null_driver_t *this, | 360 | static void null_overlay_clut_yuv2rgb (null_driver_t *this, |
361 | vo_overlay_t *overlay, | 361 | vo_overlay_t *overlay, |
362 | opie_frame_t *frame) { | 362 | opie_frame_t *frame) { |
363 | int i; | 363 | int i; |
364 | clut_t* clut = (clut_t*) overlay->color; | 364 | clut_t* clut = (clut_t*) overlay->color; |
365 | if (!overlay->rgb_clut) { | 365 | if (!overlay->rgb_clut) { |
366 | for (i = 0; i < sizeof(overlay->color)/sizeof(overlay->color[0]); i++) { | 366 | for (i = 0; i < sizeof(overlay->color)/sizeof(overlay->color[0]); i++) { |
367 | *((uint32_t *)&clut[i]) = | 367 | *((uint32_t *)&clut[i]) = |
368 | frame->yuv2rgb->yuv2rgb_single_pixel_fun (frame->yuv2rgb, | 368 | frame->yuv2rgb->yuv2rgb_single_pixel_fun (frame->yuv2rgb, |
369 | clut[i].y, clut[i].cb, clut[i].cr); | 369 | clut[i].y, clut[i].cb, clut[i].cr); |
370 | } | 370 | } |
371 | overlay->rgb_clut++; | 371 | overlay->rgb_clut++; |
372 | } | 372 | } |
373 | if (!overlay->clip_rgb_clut) { | 373 | if (!overlay->clip_rgb_clut) { |
374 | clut = (clut_t*) overlay->clip_color; | 374 | clut = (clut_t*) overlay->clip_color; |
375 | for (i = 0; i < sizeof(overlay->color)/sizeof(overlay->color[0]); i++) { | 375 | for (i = 0; i < sizeof(overlay->color)/sizeof(overlay->color[0]); i++) { |
376 | *((uint32_t *)&clut[i]) = | 376 | *((uint32_t *)&clut[i]) = |
377 | frame->yuv2rgb->yuv2rgb_single_pixel_fun(frame->yuv2rgb, | 377 | frame->yuv2rgb->yuv2rgb_single_pixel_fun(frame->yuv2rgb, |
378 | clut[i].y, clut[i].cb, clut[i].cr); | 378 | clut[i].y, clut[i].cb, clut[i].cr); |
379 | } | 379 | } |
380 | overlay->clip_rgb_clut++; | 380 | overlay->clip_rgb_clut++; |
381 | } | 381 | } |
382 | } | 382 | } |
383 | 383 | ||
384 | static void null_overlay_blend ( vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay) { | 384 | static void null_overlay_blend ( vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay) { |
385 | null_driver_t *this = (null_driver_t *) this_gen; | 385 | null_driver_t *this = (null_driver_t *) this_gen; |
386 | opie_frame_t *frame = (opie_frame_t *) frame_gen; | 386 | opie_frame_t *frame = (opie_frame_t *) frame_gen; |
387 | 387 | ||
388 | if(!this->m_show_video || frame->sc.output_width == 0 | 388 | if(!this->m_show_video || frame->sc.output_width == 0 |
389 | || frame->sc.output_height== 0) | 389 | || frame->sc.output_height== 0) |
390 | return; | 390 | return; |
391 | 391 | ||
392 | /* Alpha Blend here */ | 392 | /* Alpha Blend here */ |
393 | if (overlay->rle) { | 393 | if (overlay->rle) { |
394 | if( !overlay->rgb_clut || !overlay->clip_rgb_clut) | 394 | if( !overlay->rgb_clut || !overlay->clip_rgb_clut) |
395 | null_overlay_clut_yuv2rgb(this,overlay,frame); | 395 | null_overlay_clut_yuv2rgb(this,overlay,frame); |
396 | 396 | ||
397 | switch(this->bpp) { | 397 | switch(this->bpp) { |
398 | case 16: | 398 | case 16: |
399 | blend_rgb16( (uint8_t *)frame->data, overlay, | 399 | blend_rgb16( (uint8_t *)frame->data, overlay, |
400 | frame->sc.output_width, frame->sc.output_height, | 400 | frame->sc.output_width, frame->sc.output_height, |
401 | frame->sc.delivered_width, frame->sc.delivered_height); | 401 | frame->sc.delivered_width, frame->sc.delivered_height); |
402 | break; | 402 | break; |
403 | case 24: | 403 | case 24: |
404 | blend_rgb24( (uint8_t *)frame->data, overlay, | 404 | blend_rgb24( (uint8_t *)frame->data, overlay, |
405 | frame->sc.output_width, frame->sc.output_height, | 405 | frame->sc.output_width, frame->sc.output_height, |
406 | frame->sc.delivered_width, frame->sc.delivered_height); | 406 | frame->sc.delivered_width, frame->sc.delivered_height); |
407 | break; | 407 | break; |
408 | case 32: | 408 | case 32: |
409 | blend_rgb32( (uint8_t *)frame->data, overlay, | 409 | blend_rgb32( (uint8_t *)frame->data, overlay, |
410 | frame->sc.output_width, frame->sc.output_height, | 410 | frame->sc.output_width, frame->sc.output_height, |
411 | frame->sc.delivered_width, frame->sc.delivered_height); | 411 | frame->sc.delivered_width, frame->sc.delivered_height); |
412 | break; | 412 | break; |
413 | default: | 413 | default: |
414 | /* It should never get here */ | 414 | /* It should never get here */ |
415 | break; | 415 | break; |
416 | } | 416 | } |
417 | } | 417 | } |
418 | } | 418 | } |
419 | 419 | ||
420 | 420 | ||
421 | static int null_get_property( vo_driver_t* self, | 421 | static int null_get_property( vo_driver_t* self, |
422 | int property ){ | 422 | int property ){ |
423 | return 0; | 423 | return 0; |
424 | } | 424 | } |
425 | static int null_set_property( vo_driver_t* self, | 425 | static int null_set_property( vo_driver_t* self, |
426 | int property, | 426 | int property, |
427 | int value ){ | 427 | int value ){ |
428 | return value; | 428 | return value; |
429 | } | 429 | } |
430 | static void null_get_property_min_max( vo_driver_t* self, | 430 | static void null_get_property_min_max( vo_driver_t* self, |
431 | int property, int *min, | 431 | int property, int *min, |
432 | int *max ){ | 432 | int *max ){ |
433 | *max = 0; | 433 | *max = 0; |
434 | *min = 0; | 434 | *min = 0; |
435 | } | 435 | } |
436 | static int null_gui_data_exchange( vo_driver_t* self, | 436 | static int null_gui_data_exchange( vo_driver_t* self, |
437 | int data_type, | 437 | int data_type, |
438 | void *data ){ | 438 | void *data ){ |
439 | return 0; | 439 | return 0; |
440 | } | 440 | } |
441 | 441 | ||
442 | static void null_dispose ( vo_driver_t* self ){ | 442 | static void null_dispose ( vo_driver_t* self ){ |
443 | null_driver_t* this = (null_driver_t*)self; | 443 | null_driver_t* this = (null_driver_t*)self; |
444 | free ( this ); | 444 | free ( this ); |
445 | } | 445 | } |
446 | static int null_redraw_needed( vo_driver_t* self ){ | 446 | static int null_redraw_needed( vo_driver_t* self ){ |
447 | return 0; | 447 | return 0; |
448 | } | 448 | } |
449 | 449 | ||
450 | 450 | ||
451 | xine_vo_driver_t* init_video_out_plugin( xine_t *xine, | 451 | xine_vo_driver_t* init_video_out_plugin( xine_t *xine, |
452 | void* video, display_xine_frame_t frameDisplayFunc, void *userData ){ | 452 | void* video, display_xine_frame_t frameDisplayFunc, void *userData ){ |
453 | null_driver_t *vo; | 453 | null_driver_t *vo; |
454 | vo = (null_driver_t*)malloc( sizeof(null_driver_t ) ); | 454 | vo = (null_driver_t*)malloc( sizeof(null_driver_t ) ); |
455 | 455 | ||
456 | /* memset? */ | 456 | /* memset? */ |
457 | memset(vo,0, sizeof(null_driver_t ) ); | 457 | memset(vo,0, sizeof(null_driver_t ) ); |
458 | 458 | ||
459 | vo_scale_init (&vo->sc, 0, 0, xine->config); | 459 | vo_scale_init (&vo->sc, 0, 0, xine->config); |
460 | 460 | ||
461 | vo->sc.gui_pixel_aspect = 1.0; | 461 | vo->sc.gui_pixel_aspect = 1.0; |
462 | 462 | ||
463 | vo->m_show_video = 0; // false | 463 | vo->m_show_video = 0; // false |
464 | vo->m_video_fullscreen = 0; | 464 | vo->m_video_fullscreen = 0; |
465 | vo->m_is_scaling = 0; | 465 | vo->m_is_scaling = 0; |
466 | vo->display_ratio = 1.0; | 466 | vo->display_ratio = 1.0; |
467 | vo->gui_width = 16; | 467 | vo->gui_width = 16; |
468 | vo->gui_height = 8; | 468 | vo->gui_height = 8; |
469 | vo->frameDis = NULL; | 469 | vo->frameDis = NULL; |
470 | 470 | ||
471 | /* install callback handlers*/ | 471 | /* install callback handlers*/ |
472 | vo->vo_driver.get_capabilities = null_get_capabilities; | 472 | vo->vo_driver.get_capabilities = null_get_capabilities; |
473 | vo->vo_driver.alloc_frame = null_alloc_frame; | 473 | vo->vo_driver.alloc_frame = null_alloc_frame; |
474 | vo->vo_driver.update_frame_format = null_update_frame_format; | 474 | vo->vo_driver.update_frame_format = null_update_frame_format; |
475 | vo->vo_driver.display_frame = null_display_frame; | 475 | vo->vo_driver.display_frame = null_display_frame; |
476 | vo->vo_driver.overlay_blend = null_overlay_blend; | 476 | vo->vo_driver.overlay_blend = null_overlay_blend; |
477 | vo->vo_driver.get_property = null_get_property; | 477 | vo->vo_driver.get_property = null_get_property; |
478 | vo->vo_driver.set_property = null_set_property; | 478 | vo->vo_driver.set_property = null_set_property; |
479 | vo->vo_driver.get_property_min_max = null_get_property_min_max; | 479 | vo->vo_driver.get_property_min_max = null_get_property_min_max; |
480 | vo->vo_driver.gui_data_exchange = null_gui_data_exchange; | 480 | vo->vo_driver.gui_data_exchange = null_gui_data_exchange; |
481 | vo->vo_driver.dispose = null_dispose; | 481 | vo->vo_driver.dispose = null_dispose; |
482 | vo->vo_driver.redraw_needed = null_redraw_needed; | 482 | vo->vo_driver.redraw_needed = null_redraw_needed; |
483 | 483 | ||
484 | 484 | ||
485 | /* capabilities */ | 485 | /* capabilities */ |
486 | vo->m_capabilities = VO_CAP_COPIES_IMAGE | VO_CAP_YUY2 | VO_CAP_YV12; | 486 | vo->m_capabilities = VO_CAP_COPIES_IMAGE | VO_CAP_YUY2 | VO_CAP_YV12; |
487 | vo->yuv2rgb_factory = yuv2rgb_factory_init (MODE_16_RGB, vo->yuv2rgb_swap, | 487 | vo->yuv2rgb_factory = yuv2rgb_factory_init (MODE_16_RGB, vo->yuv2rgb_swap, |
488 | vo->yuv2rgb_cmap); | 488 | vo->yuv2rgb_cmap); |
489 | 489 | ||
490 | vo->caller = userData; | 490 | vo->caller = userData; |
491 | vo->frameDis = frameDisplayFunc; | 491 | vo->frameDis = frameDisplayFunc; |
492 | 492 | ||
493 | /* return ( vo_driver_t*) vo; */ | 493 | /* return ( vo_driver_t*) vo; */ |
494 | return vo_new_port( xine, ( vo_driver_t* )vo ); | 494 | return vo_new_port( xine, ( vo_driver_t* )vo ); |
495 | } | 495 | } |
496 | 496 | ||
497 | #if 0 | 497 | #if 0 |
498 | static vo_info_t vo_info_null = { | 498 | static vo_info_t vo_info_null = { |
499 | 5, | 499 | 5, |
500 | XINE_VISUAL_TYPE_FB | 500 | XINE_VISUAL_TYPE_FB |
501 | }; | 501 | }; |
502 | 502 | ||
503 | vo_info_t *get_video_out_plugin_info(){ | 503 | vo_info_t *get_video_out_plugin_info(){ |
504 | vo_info_null.description = ("xine video output plugin using null device"); | 504 | vo_info_null.description = ("xine video output plugin using null device"); |
505 | return &vo_info_null; | 505 | return &vo_info_null; |
506 | } | 506 | } |
507 | 507 | ||
508 | #endif | 508 | #endif |
509 | 509 | ||
510 | /* this is special for this device */ | 510 | /* this is special for this device */ |
511 | /** | 511 | /** |
512 | * We know that we will be controled by the XINE LIB++ | 512 | * We know that we will be controled by the XINE LIB++ |
513 | */ | 513 | */ |
514 | 514 | ||
515 | /** | 515 | /** |
516 | * | 516 | * |
517 | */ | 517 | */ |
518 | int null_is_showing_video( xine_vo_driver_t* self ){ | 518 | int null_is_showing_video( xine_vo_driver_t* self ){ |
519 | null_driver_t* this = (null_driver_t*)self->driver; | 519 | null_driver_t* this = (null_driver_t*)self->driver; |
520 | return this->m_show_video; | 520 | return this->m_show_video; |
521 | } | 521 | } |
522 | void null_set_show_video( xine_vo_driver_t* self, int show ) { | 522 | void null_set_show_video( xine_vo_driver_t* self, int show ) { |
523 | ((null_driver_t*)self->driver)->m_show_video = show; | 523 | ((null_driver_t*)self->driver)->m_show_video = show; |
524 | } | 524 | } |
525 | 525 | ||
526 | int null_is_fullscreen( xine_vo_driver_t* self ){ | 526 | int null_is_fullscreen( xine_vo_driver_t* self ){ |
527 | return ((null_driver_t*)self->driver)->m_video_fullscreen; | 527 | return ((null_driver_t*)self->driver)->m_video_fullscreen; |
528 | } | 528 | } |
529 | void null_set_fullscreen( xine_vo_driver_t* self, int screen ){ | 529 | void null_set_fullscreen( xine_vo_driver_t* self, int screen ){ |
530 | ((null_driver_t*)self->driver)->m_video_fullscreen = screen; | 530 | ((null_driver_t*)self->driver)->m_video_fullscreen = screen; |
531 | } | 531 | } |
532 | int null_is_scaling( xine_vo_driver_t* self ){ | 532 | int null_is_scaling( xine_vo_driver_t* self ){ |
533 | return ((null_driver_t*)self->driver)->m_is_scaling; | 533 | return ((null_driver_t*)self->driver)->m_is_scaling; |
534 | } | 534 | } |
535 | 535 | ||
536 | void null_set_videoGamma( xine_vo_driver_t* self , int value ) { | 536 | void null_set_videoGamma( xine_vo_driver_t* self , int value ) { |
537 | ((null_driver_t*) self->driver) ->yuv2rgb_gamma = value; | 537 | ((null_driver_t*) self->driver) ->yuv2rgb_gamma = value; |
538 | ((null_driver_t*) self->driver) ->yuv2rgb_factory->set_gamma( ((null_driver_t*) self) ->yuv2rgb_factory, value ); | 538 | ((null_driver_t*) self->driver) ->yuv2rgb_factory->set_gamma( ((null_driver_t*) self->driver) ->yuv2rgb_factory, value ); |
539 | } | 539 | } |
540 | 540 | ||
541 | void null_set_scaling( xine_vo_driver_t* self, int scale ) { | 541 | void null_set_scaling( xine_vo_driver_t* self, int scale ) { |
542 | ((null_driver_t*)self->driver)->m_is_scaling = scale; | 542 | ((null_driver_t*)self->driver)->m_is_scaling = scale; |
543 | } | 543 | } |
544 | 544 | ||
545 | void null_set_gui_width( xine_vo_driver_t* self, int width ) { | 545 | void null_set_gui_width( xine_vo_driver_t* self, int width ) { |
546 | ((null_driver_t*)self->driver)->gui_width = width; | 546 | ((null_driver_t*)self->driver)->gui_width = width; |
547 | } | 547 | } |
548 | void null_set_gui_height( xine_vo_driver_t* self, int height ) { | 548 | void null_set_gui_height( xine_vo_driver_t* self, int height ) { |
549 | ((null_driver_t*)self->driver)->gui_height = height; | 549 | ((null_driver_t*)self->driver)->gui_height = height; |
550 | } | 550 | } |
551 | 551 | ||
552 | 552 | ||
553 | void null_set_mode( xine_vo_driver_t* self, int depth, int rgb ) { | 553 | void null_set_mode( xine_vo_driver_t* self, int depth, int rgb ) { |
554 | null_driver_t* this = (null_driver_t*)self->driver; | 554 | null_driver_t* this = (null_driver_t*)self->driver; |
555 | 555 | ||
556 | this->bytes_per_pixel = (depth + 7 ) / 8; | 556 | this->bytes_per_pixel = (depth + 7 ) / 8; |
557 | this->bpp = this->bytes_per_pixel * 8; | 557 | this->bpp = this->bytes_per_pixel * 8; |
558 | this->depth = depth; | 558 | this->depth = depth; |
559 | printf("depth %d %d\n", depth, this->bpp); | 559 | printf("depth %d %d\n", depth, this->bpp); |
560 | printf("pixeltype %d\n", rgb ); | 560 | printf("pixeltype %d\n", rgb ); |
561 | switch ( this->depth ) { | 561 | switch ( this->depth ) { |
562 | case 32: | 562 | case 32: |
563 | if( rgb == 0 ) | 563 | if( rgb == 0 ) |
564 | this->yuv2rgb_mode = MODE_32_RGB; | 564 | this->yuv2rgb_mode = MODE_32_RGB; |
565 | else | 565 | else |
566 | this->yuv2rgb_mode = MODE_32_BGR; | 566 | this->yuv2rgb_mode = MODE_32_BGR; |
567 | case 24: | 567 | case 24: |
568 | if( this->bpp == 32 ) { | 568 | if( this->bpp == 32 ) { |
569 | if( rgb == 0 ) { | 569 | if( rgb == 0 ) { |
570 | this->yuv2rgb_mode = MODE_32_RGB; | 570 | this->yuv2rgb_mode = MODE_32_RGB; |
571 | } else { | 571 | } else { |
572 | this->yuv2rgb_mode = MODE_32_BGR; | 572 | this->yuv2rgb_mode = MODE_32_BGR; |
573 | } | 573 | } |
574 | }else{ | 574 | }else{ |
575 | if( rgb == 0 ) | 575 | if( rgb == 0 ) |
576 | this->yuv2rgb_mode = MODE_24_RGB; | 576 | this->yuv2rgb_mode = MODE_24_RGB; |
577 | else | 577 | else |
578 | this->yuv2rgb_mode = MODE_24_BGR; | 578 | this->yuv2rgb_mode = MODE_24_BGR; |
579 | }; | 579 | }; |
580 | break; | 580 | break; |
581 | case 16: | 581 | case 16: |
582 | if( rgb == 0 ) { | 582 | if( rgb == 0 ) { |
583 | this->yuv2rgb_mode = MODE_16_RGB; | 583 | this->yuv2rgb_mode = MODE_16_RGB; |
584 | } else { | 584 | } else { |
585 | this->yuv2rgb_mode = MODE_16_BGR; | 585 | this->yuv2rgb_mode = MODE_16_BGR; |
586 | } | 586 | } |
587 | break; | 587 | break; |
588 | case 15: | 588 | case 15: |
589 | if( rgb == 0 ) { | 589 | if( rgb == 0 ) { |
590 | this->yuv2rgb_mode = MODE_15_RGB; | 590 | this->yuv2rgb_mode = MODE_15_RGB; |
591 | } else { | 591 | } else { |
592 | this->yuv2rgb_mode = MODE_15_BGR; | 592 | this->yuv2rgb_mode = MODE_15_BGR; |
593 | } | 593 | } |
594 | break; | 594 | break; |
595 | case 8: | 595 | case 8: |
596 | if( rgb == 0 ) { | 596 | if( rgb == 0 ) { |
597 | this->yuv2rgb_mode = MODE_8_RGB; | 597 | this->yuv2rgb_mode = MODE_8_RGB; |
598 | } else { | 598 | } else { |
599 | this->yuv2rgb_mode = MODE_8_BGR; | 599 | this->yuv2rgb_mode = MODE_8_BGR; |
600 | } | 600 | } |
601 | break; | 601 | break; |
602 | }; | 602 | }; |
603 | //free(this->yuv2rgb_factory ); | 603 | //free(this->yuv2rgb_factory ); |
604 | // this->yuv2rgb_factory = yuv2rgb_factory_init (this->yuv2rgb_mode, this->yuv2rgb_swap, | 604 | // this->yuv2rgb_factory = yuv2rgb_factory_init (this->yuv2rgb_mode, this->yuv2rgb_swap, |
605 | // this->yuv2rgb_cmap); | 605 | // this->yuv2rgb_cmap); |
606 | }; | 606 | }; |
607 | 607 | ||
608 | void null_display_handler( xine_vo_driver_t* self, display_xine_frame_t t, | 608 | void null_display_handler( xine_vo_driver_t* self, display_xine_frame_t t, |
609 | void* user_data ) { | 609 | void* user_data ) { |
610 | null_driver_t* this = (null_driver_t*) self->driver; | 610 | null_driver_t* this = (null_driver_t*) self->driver; |
611 | this->caller = user_data; | 611 | this->caller = user_data; |
612 | this->frameDis = t; | 612 | this->frameDis = t; |
613 | } | 613 | } |
614 | 614 | ||