-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 095f206..3cf3664 100644 --- a/noncore/multimedia/opieplayer2/nullvideo.c +++ b/noncore/multimedia/opieplayer2/nullvideo.c | |||
@@ -1,90 +1,90 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> | 4 | Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> |
5 | Copyright (c) 2002 LJP <> | 5 | Copyright (c) 2002 LJP <> |
6 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> | 6 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> |
7 | =. | 7 | =. |
8 | .=l. | 8 | .=l. |
9 | .>+-= | 9 | .>+-= |
10 | _;:, .> :=|. This program is free software; you can | 10 | _;:, .> :=|. This program is free software; you can |
11 | .> <`_, > . <= redistribute it and/or modify it under | 11 | .> <`_, > . <= redistribute it and/or modify it under |
12 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 12 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
13 | .="- .-=="i, .._ License as published by the Free Software | 13 | .="- .-=="i, .._ License as published by the Free Software |
14 | - . .-<_> .<> Foundation; either version 2 of the License, | 14 | - . .-<_> .<> Foundation; either version 2 of the License, |
15 | ._= =} : or (at your option) any later version. | 15 | ._= =} : or (at your option) any later version. |
16 | .%`+i> _;_. | 16 | .%`+i> _;_. |
17 | .i_,=:_. -<s. This program is distributed in the hope that | 17 | .i_,=:_. -<s. This program is distributed in the hope that |
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
19 | : .. .:, . . . without even the implied warranty of | 19 | : .. .:, . . . without even the implied warranty of |
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
22 | ..}^=.= = ; Library General Public License for more | 22 | ..}^=.= = ; Library General Public License for more |
23 | ++= -. .` .: details. | 23 | ++= -. .` .: details. |
24 | : = ...= . :.=- | 24 | : = ...= . :.=- |
25 | -. .:....=;==+<; You should have received a copy of the GNU | 25 | -. .:....=;==+<; You should have received a copy of the GNU |
26 | -_. . . )=. = Library 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. |
28 | If not, write to the Free Software Foundation, | 28 | If not, write to the Free Software Foundation, |
29 | Inc., 59 Temple Place - Suite 330, | 29 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 30 | Boston, MA 02111-1307, USA. |
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #include <stdlib.h> | 34 | #include <stdlib.h> |
35 | #include <stdio.h> | 35 | #include <stdio.h> |
36 | 36 | ||
37 | #include <math.h> | 37 | #include <math.h> |
38 | 38 | ||
39 | #include <xine.h> | 39 | #include <xine.h> |
40 | #include <xine/video_out.h> | 40 | #include <xine/video_out.h> |
41 | #include <xine/xine_internal.h> | 41 | #include <xine/xine_internal.h> |
42 | #include <xine/xineutils.h> | 42 | //#include <xine/xineutils.h> |
43 | #include <xine/vo_scale.h> | 43 | #include <xine/vo_scale.h> |
44 | #include <xine/buffer.h> | 44 | #include <xine/buffer.h> |
45 | 45 | ||
46 | #include <pthread.h> | 46 | #include <pthread.h> |
47 | #include "alphablend.h" | 47 | #include "alphablend.h" |
48 | #include "yuv2rgb.h" | 48 | #include "yuv2rgb.h" |
49 | 49 | ||
50 | #define printf(x,...) | 50 | #define printf(x,...) |
51 | 51 | ||
52 | /* | 52 | /* |
53 | #define LOG | 53 | #define LOG |
54 | */ | 54 | */ |
55 | 55 | ||
56 | /* the caller for our event draw handler */ | 56 | /* the caller for our event draw handler */ |
57 | typedef void (*display_xine_frame_t) (void *user_data, uint8_t* frame, | 57 | typedef void (*display_xine_frame_t) (void *user_data, uint8_t* frame, |
58 | int width, int height,int bytes ); | 58 | int width, int height,int bytes ); |
59 | 59 | ||
60 | typedef struct null_driver_s null_driver_t; | 60 | typedef struct null_driver_s null_driver_t; |
61 | 61 | ||
62 | struct null_driver_s { | 62 | struct null_driver_s { |
63 | vo_driver_t vo_driver; | 63 | vo_driver_t vo_driver; |
64 | 64 | ||
65 | uint32_t m_capabilities; | 65 | uint32_t m_capabilities; |
66 | int m_show_video; | 66 | int m_show_video; |
67 | int m_video_fullscreen; | 67 | int m_video_fullscreen; |
68 | int m_is_scaling; | 68 | int m_is_scaling; |
69 | 69 | ||
70 | int depth, bpp, bytes_per_pixel; | 70 | int depth, bpp, bytes_per_pixel; |
71 | int yuv2rgb_mode; | 71 | int yuv2rgb_mode; |
72 | int yuv2rgb_swap; | 72 | int yuv2rgb_swap; |
73 | int yuv2rgb_gamma; | 73 | int yuv2rgb_gamma; |
74 | uint8_t *yuv2rgb_cmap; | 74 | uint8_t *yuv2rgb_cmap; |
75 | yuv2rgb_factory_t *yuv2rgb_factory; | 75 | yuv2rgb_factory_t *yuv2rgb_factory; |
76 | 76 | ||
77 | vo_overlay_t *overlay; | 77 | vo_overlay_t *overlay; |
78 | vo_scale_t sc; | 78 | vo_scale_t sc; |
79 | 79 | ||
80 | int gui_width; | 80 | int gui_width; |
81 | int gui_height; | 81 | int gui_height; |
82 | int gui_changed; | 82 | int gui_changed; |
83 | 83 | ||
84 | double display_ratio; | 84 | double display_ratio; |
85 | void* caller; | 85 | void* caller; |
86 | display_xine_frame_t frameDis; | 86 | display_xine_frame_t frameDis; |
87 | }; | 87 | }; |
88 | 88 | ||
89 | typedef struct opie_frame_s opie_frame_t; | 89 | typedef struct opie_frame_s opie_frame_t; |
90 | struct opie_frame_s { | 90 | struct opie_frame_s { |
@@ -449,97 +449,97 @@ static void null_dispose ( vo_driver_t* self ){ | |||
449 | static int null_redraw_needed( vo_driver_t* self ){ | 449 | static int null_redraw_needed( vo_driver_t* self ){ |
450 | return 0; | 450 | return 0; |
451 | } | 451 | } |
452 | 452 | ||
453 | 453 | ||
454 | xine_vo_driver_t* init_video_out_plugin( xine_t *xine, | 454 | xine_vo_driver_t* init_video_out_plugin( xine_t *xine, |
455 | void* video, display_xine_frame_t frameDisplayFunc, void *userData ){ | 455 | void* video, display_xine_frame_t frameDisplayFunc, void *userData ){ |
456 | null_driver_t *vo; | 456 | null_driver_t *vo; |
457 | vo = (null_driver_t*)malloc( sizeof(null_driver_t ) ); | 457 | vo = (null_driver_t*)malloc( sizeof(null_driver_t ) ); |
458 | 458 | ||
459 | /* memset? */ | 459 | /* memset? */ |
460 | memset(vo,0, sizeof(null_driver_t ) ); | 460 | memset(vo,0, sizeof(null_driver_t ) ); |
461 | 461 | ||
462 | vo_scale_init (&vo->sc, 0, 0, xine->config); | 462 | vo_scale_init (&vo->sc, 0, 0, xine->config); |
463 | 463 | ||
464 | vo->sc.gui_pixel_aspect = 1.0; | 464 | vo->sc.gui_pixel_aspect = 1.0; |
465 | 465 | ||
466 | vo->m_show_video = 0; // false | 466 | vo->m_show_video = 0; // false |
467 | vo->m_video_fullscreen = 0; | 467 | vo->m_video_fullscreen = 0; |
468 | vo->m_is_scaling = 0; | 468 | vo->m_is_scaling = 0; |
469 | vo->display_ratio = 1.0; | 469 | vo->display_ratio = 1.0; |
470 | vo->gui_width = 16; | 470 | vo->gui_width = 16; |
471 | vo->gui_height = 8; | 471 | vo->gui_height = 8; |
472 | vo->frameDis = NULL; | 472 | vo->frameDis = NULL; |
473 | 473 | ||
474 | /* install callback handlers*/ | 474 | /* install callback handlers*/ |
475 | vo->vo_driver.get_capabilities = null_get_capabilities; | 475 | vo->vo_driver.get_capabilities = null_get_capabilities; |
476 | vo->vo_driver.alloc_frame = null_alloc_frame; | 476 | vo->vo_driver.alloc_frame = null_alloc_frame; |
477 | vo->vo_driver.update_frame_format = null_update_frame_format; | 477 | vo->vo_driver.update_frame_format = null_update_frame_format; |
478 | vo->vo_driver.display_frame = null_display_frame; | 478 | vo->vo_driver.display_frame = null_display_frame; |
479 | vo->vo_driver.overlay_blend = null_overlay_blend; | 479 | vo->vo_driver.overlay_blend = null_overlay_blend; |
480 | vo->vo_driver.get_property = null_get_property; | 480 | vo->vo_driver.get_property = null_get_property; |
481 | vo->vo_driver.set_property = null_set_property; | 481 | vo->vo_driver.set_property = null_set_property; |
482 | vo->vo_driver.get_property_min_max = null_get_property_min_max; | 482 | vo->vo_driver.get_property_min_max = null_get_property_min_max; |
483 | vo->vo_driver.gui_data_exchange = null_gui_data_exchange; | 483 | vo->vo_driver.gui_data_exchange = null_gui_data_exchange; |
484 | vo->vo_driver.dispose = null_dispose; | 484 | vo->vo_driver.dispose = null_dispose; |
485 | vo->vo_driver.redraw_needed = null_redraw_needed; | 485 | vo->vo_driver.redraw_needed = null_redraw_needed; |
486 | 486 | ||
487 | 487 | ||
488 | /* capabilities */ | 488 | /* capabilities */ |
489 | vo->m_capabilities = VO_CAP_COPIES_IMAGE | VO_CAP_YUY2 | VO_CAP_YV12; | 489 | vo->m_capabilities = VO_CAP_COPIES_IMAGE | VO_CAP_YUY2 | VO_CAP_YV12; |
490 | vo->yuv2rgb_factory = yuv2rgb_factory_init (MODE_16_RGB, vo->yuv2rgb_swap, | 490 | vo->yuv2rgb_factory = yuv2rgb_factory_init (MODE_16_RGB, vo->yuv2rgb_swap, |
491 | vo->yuv2rgb_cmap); | 491 | vo->yuv2rgb_cmap); |
492 | 492 | ||
493 | vo->caller = userData; | 493 | vo->caller = userData; |
494 | vo->frameDis = frameDisplayFunc; | 494 | vo->frameDis = frameDisplayFunc; |
495 | 495 | ||
496 | /* return ( vo_driver_t*) vo; */ | 496 | /* return ( vo_driver_t*) vo; */ |
497 | return vo_new_port( xine, ( vo_driver_t* )vo ); | 497 | return vo_new_port( xine, ( vo_driver_t* )vo, 1 ); |
498 | } | 498 | } |
499 | 499 | ||
500 | #if 0 | 500 | #if 0 |
501 | static vo_info_t vo_info_null = { | 501 | static vo_info_t vo_info_null = { |
502 | 5, | 502 | 5, |
503 | XINE_VISUAL_TYPE_FB | 503 | XINE_VISUAL_TYPE_FB |
504 | }; | 504 | }; |
505 | 505 | ||
506 | vo_info_t *get_video_out_plugin_info(){ | 506 | vo_info_t *get_video_out_plugin_info(){ |
507 | vo_info_null.description = ("xine video output plugin using null device"); | 507 | vo_info_null.description = ("xine video output plugin using null device"); |
508 | return &vo_info_null; | 508 | return &vo_info_null; |
509 | } | 509 | } |
510 | 510 | ||
511 | #endif | 511 | #endif |
512 | 512 | ||
513 | /* this is special for this device */ | 513 | /* this is special for this device */ |
514 | /** | 514 | /** |
515 | * We know that we will be controled by the XINE LIB++ | 515 | * We know that we will be controled by the XINE LIB++ |
516 | */ | 516 | */ |
517 | 517 | ||
518 | /** | 518 | /** |
519 | * | 519 | * |
520 | */ | 520 | */ |
521 | int null_is_showing_video( xine_vo_driver_t* self ){ | 521 | int null_is_showing_video( xine_vo_driver_t* self ){ |
522 | null_driver_t* this = (null_driver_t*)self->driver; | 522 | null_driver_t* this = (null_driver_t*)self->driver; |
523 | return this->m_show_video; | 523 | return this->m_show_video; |
524 | } | 524 | } |
525 | void null_set_show_video( xine_vo_driver_t* self, int show ) { | 525 | void null_set_show_video( xine_vo_driver_t* self, int show ) { |
526 | ((null_driver_t*)self->driver)->m_show_video = show; | 526 | ((null_driver_t*)self->driver)->m_show_video = show; |
527 | } | 527 | } |
528 | 528 | ||
529 | int null_is_fullscreen( xine_vo_driver_t* self ){ | 529 | int null_is_fullscreen( xine_vo_driver_t* self ){ |
530 | return ((null_driver_t*)self->driver)->m_video_fullscreen; | 530 | return ((null_driver_t*)self->driver)->m_video_fullscreen; |
531 | } | 531 | } |
532 | void null_set_fullscreen( xine_vo_driver_t* self, int screen ){ | 532 | void null_set_fullscreen( xine_vo_driver_t* self, int screen ){ |
533 | ((null_driver_t*)self->driver)->m_video_fullscreen = screen; | 533 | ((null_driver_t*)self->driver)->m_video_fullscreen = screen; |
534 | } | 534 | } |
535 | int null_is_scaling( xine_vo_driver_t* self ){ | 535 | int null_is_scaling( xine_vo_driver_t* self ){ |
536 | return ((null_driver_t*)self->driver)->m_is_scaling; | 536 | return ((null_driver_t*)self->driver)->m_is_scaling; |
537 | } | 537 | } |
538 | 538 | ||
539 | void null_set_videoGamma( xine_vo_driver_t* self , int value ) { | 539 | void null_set_videoGamma( xine_vo_driver_t* self , int value ) { |
540 | ((null_driver_t*) self->driver) ->yuv2rgb_gamma = value; | 540 | ((null_driver_t*) self->driver) ->yuv2rgb_gamma = value; |
541 | ((null_driver_t*) self->driver) ->yuv2rgb_factory->set_gamma( ((null_driver_t*) self->driver) ->yuv2rgb_factory, value ); | 541 | ((null_driver_t*) self->driver) ->yuv2rgb_factory->set_gamma( ((null_driver_t*) self->driver) ->yuv2rgb_factory, value ); |
542 | } | 542 | } |
543 | 543 | ||
544 | void null_set_scaling( xine_vo_driver_t* self, int scale ) { | 544 | void null_set_scaling( xine_vo_driver_t* self, int scale ) { |
545 | ((null_driver_t*)self->driver)->m_is_scaling = scale; | 545 | ((null_driver_t*)self->driver)->m_is_scaling = scale; |