summaryrefslogtreecommitdiff
authorsimon <simon>2002-12-05 23:28:06 (UTC)
committer simon <simon>2002-12-05 23:28:06 (UTC)
commit8a1c4b4b84d8a8de87bb6adb4df3f09961854633 (patch) (unidiff)
tree2399c784b4d5e87c8bb834389837870353b4a43f
parent15d4d1f2fc8b37d30694acc5765a822718af6c13 (diff)
downloadopie-8a1c4b4b84d8a8de87bb6adb4df3f09961854633.zip
opie-8a1c4b4b84d8a8de87bb6adb4df3f09961854633.tar.gz
opie-8a1c4b4b84d8a8de87bb6adb4df3f09961854633.tar.bz2
- adapted to xine CVS HEAD
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp7
-rw-r--r--noncore/multimedia/opieplayer2/nullvideo.c62
2 files changed, 37 insertions, 32 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp
index 96bdb21..4a96408 100644
--- a/noncore/multimedia/opieplayer2/lib.cpp
+++ b/noncore/multimedia/opieplayer2/lib.cpp
@@ -45,17 +45,18 @@
45#include <assert.h> 45#include <assert.h>
46 46
47#include "xinevideowidget.h" 47#include "xinevideowidget.h"
48#include "frame.h" 48#include "frame.h"
49#include "lib.h" 49#include "lib.h"
50 50
51
51typedef void (*display_xine_frame_t) (void *user_data, uint8_t* frame, 52typedef void (*display_xine_frame_t) (void *user_data, uint8_t* frame,
52 int width, int height,int bytes ); 53 int width, int height,int bytes );
53 54
54extern "C" { 55extern "C" {
55 xine_vo_driver_t* init_video_out_plugin( xine_cfg_entry_t* conf, void* video); 56 xine_vo_driver_t* init_video_out_plugin( xine_t *xine, void* video, display_xine_frame_t, void * );
56 int null_is_showing_video( const xine_vo_driver_t* self ); 57 int null_is_showing_video( const xine_vo_driver_t* self );
57 void null_set_show_video( const xine_vo_driver_t* self, int show ); 58 void null_set_show_video( const xine_vo_driver_t* self, int show );
58 int null_is_fullscreen( const xine_vo_driver_t* self ); 59 int null_is_fullscreen( const xine_vo_driver_t* self );
59 void null_set_fullscreen( const xine_vo_driver_t* self, int screen ); 60 void null_set_fullscreen( const xine_vo_driver_t* self, int screen );
60 int null_is_scaling( const xine_vo_driver_t* self ); 61 int null_is_scaling( const xine_vo_driver_t* self );
61 void null_set_scaling( const xine_vo_driver_t* self, int scale ); 62 void null_set_scaling( const xine_vo_driver_t* self, int scale );
@@ -91,19 +92,19 @@ Lib::Lib( XineVideoWidget* widget ) {
91 92
92 xine_init( m_xine ); 93 xine_init( m_xine );
93 94
94 // allocate oss for sound 95 // allocate oss for sound
95 // and fb for framebuffer 96 // and fb for framebuffer
96 m_audioOutput = xine_open_audio_driver( m_xine, "oss", NULL ); 97 m_audioOutput = xine_open_audio_driver( m_xine, "oss", NULL );
97 m_videoOutput = ::init_video_out_plugin( m_config, NULL ); 98 m_videoOutput = ::init_video_out_plugin( m_xine, NULL, xine_display_frame, this );
98 99
99 100
100//xine_open_video_driver( m_xine, NULL, XINE_VISUAL_TYPE_FB, NULL); 101//xine_open_video_driver( m_xine, NULL, XINE_VISUAL_TYPE_FB, NULL);
101 102
102 103
103 null_display_handler( m_videoOutput, xine_display_frame, this ); 104// null_display_handler( m_videoOutput, xine_display_frame, this );
104 105
105 m_stream = xine_stream_new (m_xine, m_audioOutput, m_videoOutput ); 106 m_stream = xine_stream_new (m_xine, m_audioOutput, m_videoOutput );
106 107
107 if (m_wid != 0 ) { 108 if (m_wid != 0 ) {
108 printf( "!0\n" ); 109 printf( "!0\n" );
109 resize ( m_wid-> size ( ) ); 110 resize ( m_wid-> size ( ) );
diff --git a/noncore/multimedia/opieplayer2/nullvideo.c b/noncore/multimedia/opieplayer2/nullvideo.c
index 9c285a0..1ebb854 100644
--- a/noncore/multimedia/opieplayer2/nullvideo.c
+++ b/noncore/multimedia/opieplayer2/nullvideo.c
@@ -56,13 +56,13 @@
56typedef void (*display_xine_frame_t) (void *user_data, uint8_t* frame, 56typedef void (*display_xine_frame_t) (void *user_data, uint8_t* frame,
57 int width, int height,int bytes ); 57 int width, int height,int bytes );
58 58
59typedef struct null_driver_s null_driver_t; 59typedef struct null_driver_s null_driver_t;
60 60
61struct null_driver_s { 61struct null_driver_s {
62 xine_vo_driver_t vo_driver; 62 vo_driver_t vo_driver;
63 63
64 uint32_t m_capabilities; 64 uint32_t m_capabilities;
65 int m_show_video; 65 int m_show_video;
66 int m_video_fullscreen; 66 int m_video_fullscreen;
67 int m_is_scaling; 67 int m_is_scaling;
68 68
@@ -104,13 +104,13 @@ struct opie_frame_s {
104 int yuv_stride; 104 int yuv_stride;
105 int stripe_height, stripe_inc; 105 int stripe_height, stripe_inc;
106 106
107 null_driver_t *output; 107 null_driver_t *output;
108}; 108};
109 109
110static uint32_t null_get_capabilities( xine_vo_driver_t *self ){ 110static uint32_t null_get_capabilities( vo_driver_t *self ){
111 null_driver_t* this = (null_driver_t*)self; 111 null_driver_t* this = (null_driver_t*)self;
112 return this->m_capabilities; 112 return this->m_capabilities;
113} 113}
114 114
115static void null_frame_copy (vo_frame_t *vo_img, uint8_t **src) { 115static void null_frame_copy (vo_frame_t *vo_img, uint8_t **src) {
116 opie_frame_t *frame = (opie_frame_t *) vo_img ; 116 opie_frame_t *frame = (opie_frame_t *) vo_img ;
@@ -160,13 +160,13 @@ static void null_frame_dispose( vo_frame_t* vo_img){
160 free( frame->data ); 160 free( frame->data );
161 free (frame); 161 free (frame);
162} 162}
163 163
164/* end take care of frames*/ 164/* end take care of frames*/
165 165
166static vo_frame_t* null_alloc_frame( xine_vo_driver_t* self ){ 166static vo_frame_t* null_alloc_frame( vo_driver_t* self ){
167 167
168 null_driver_t* this = (null_driver_t*)self; 168 null_driver_t* this = (null_driver_t*)self;
169 opie_frame_t* frame; 169 opie_frame_t* frame;
170 170
171#ifdef LOG 171#ifdef LOG
172 fprintf (stderr, "nullvideo: alloc_frame\n"); 172 fprintf (stderr, "nullvideo: alloc_frame\n");
@@ -192,13 +192,13 @@ static vo_frame_t* null_alloc_frame( xine_vo_driver_t* self ){
192 */ 192 */
193 frame->yuv2rgb = this->yuv2rgb_factory->create_converter (this->yuv2rgb_factory); 193 frame->yuv2rgb = this->yuv2rgb_factory->create_converter (this->yuv2rgb_factory);
194 194
195 return (vo_frame_t*) frame; 195 return (vo_frame_t*) frame;
196} 196}
197 197
198static void null_update_frame_format( xine_vo_driver_t* self, vo_frame_t* img, 198static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img,
199 uint32_t width, uint32_t height, 199 uint32_t width, uint32_t height,
200 int ratio_code, int format, int flags ){ 200 int ratio_code, int format, int flags ){
201 null_driver_t* this = (null_driver_t*) self; 201 null_driver_t* this = (null_driver_t*) self;
202 opie_frame_t* frame = (opie_frame_t*)img; 202 opie_frame_t* frame = (opie_frame_t*)img;
203 /* not needed now */ 203 /* not needed now */
204 204
@@ -335,13 +335,13 @@ static void null_update_frame_format( xine_vo_driver_t* self, vo_frame_t* img,
335 frame->stripe_inc = frame->stripe_height * frame->bytes_per_line; 335 frame->stripe_inc = frame->stripe_height * frame->bytes_per_line;
336 break; 336 break;
337 } 337 }
338 } 338 }
339} 339}
340 340
341static void null_display_frame( xine_vo_driver_t* self, vo_frame_t *frame_gen ){ 341static void null_display_frame( vo_driver_t* self, vo_frame_t *frame_gen ){
342 null_driver_t* this = (null_driver_t*) self; 342 null_driver_t* this = (null_driver_t*) self;
343 opie_frame_t* frame = (opie_frame_t*)frame_gen; 343 opie_frame_t* frame = (opie_frame_t*)frame_gen;
344 display_xine_frame_t display = this->frameDis; 344 display_xine_frame_t display = this->frameDis;
345 345
346 if (!this->m_show_video) 346 if (!this->m_show_video)
347 return; 347 return;
@@ -378,13 +378,13 @@ static void null_overlay_clut_yuv2rgb (null_driver_t *this,
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
384static void null_overlay_blend ( xine_vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay) { 384static 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;
@@ -415,51 +415,51 @@ static void null_overlay_blend ( xine_vo_driver_t *this_gen, vo_frame_t *frame_g
415 break; 415 break;
416 } 416 }
417 } 417 }
418} 418}
419 419
420 420
421static int null_get_property( xine_vo_driver_t* self, 421static int null_get_property( vo_driver_t* self,
422 int property ){ 422 int property ){
423 return 0; 423 return 0;
424} 424}
425static int null_set_property( xine_vo_driver_t* self, 425static 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}
430static void null_get_property_min_max( xine_vo_driver_t* self, 430static 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}
436static int null_gui_data_exchange( xine_vo_driver_t* self, 436static 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
442static void null_dispose ( xine_vo_driver_t* self ){ 442static 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}
446static int null_redraw_needed( xine_vo_driver_t* self ){ 446static int null_redraw_needed( vo_driver_t* self ){
447 return 0; 447 return 0;
448} 448}
449 449
450 450
451xine_vo_driver_t* init_video_out_plugin( config_values_t* conf, 451xine_vo_driver_t* init_video_out_plugin( xine_t *xine,
452 void* video ){ 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); 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;
@@ -484,13 +484,17 @@ xine_vo_driver_t* init_video_out_plugin( config_values_t* conf,
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 return ( xine_vo_driver_t*) vo; 490 vo->caller = userData;
491 vo->frameDis = frameDisplayFunc;
492
493 /* return ( vo_driver_t*) vo; */
494 return vo_new_port( xine, ( vo_driver_t* )vo );
491} 495}
492 496
493#if 0 497#if 0
494static vo_info_t vo_info_null = { 498static vo_info_t vo_info_null = {
495 5, 499 5,
496 XINE_VISUAL_TYPE_FB 500 XINE_VISUAL_TYPE_FB
@@ -509,48 +513,48 @@ vo_info_t *get_video_out_plugin_info(){
509 */ 513 */
510 514
511/** 515/**
512 * 516 *
513 */ 517 */
514int null_is_showing_video( xine_vo_driver_t* self ){ 518int null_is_showing_video( xine_vo_driver_t* self ){
515 null_driver_t* this = (null_driver_t*)self; 519 null_driver_t* this = (null_driver_t*)self->driver;
516 return this->m_show_video; 520 return this->m_show_video;
517} 521}
518void null_set_show_video( xine_vo_driver_t* self, int show ) { 522void null_set_show_video( xine_vo_driver_t* self, int show ) {
519 ((null_driver_t*)self)->m_show_video = show; 523 ((null_driver_t*)self->driver)->m_show_video = show;
520} 524}
521 525
522int null_is_fullscreen( xine_vo_driver_t* self ){ 526int null_is_fullscreen( xine_vo_driver_t* self ){
523 return ((null_driver_t*)self)->m_video_fullscreen; 527 return ((null_driver_t*)self->driver)->m_video_fullscreen;
524} 528}
525void null_set_fullscreen( xine_vo_driver_t* self, int screen ){ 529void null_set_fullscreen( xine_vo_driver_t* self, int screen ){
526 ((null_driver_t*)self)->m_video_fullscreen = screen; 530 ((null_driver_t*)self->driver)->m_video_fullscreen = screen;
527} 531}
528int null_is_scaling( xine_vo_driver_t* self ){ 532int null_is_scaling( xine_vo_driver_t* self ){
529 return ((null_driver_t*)self)->m_is_scaling; 533 return ((null_driver_t*)self->driver)->m_is_scaling;
530} 534}
531 535
532void null_set_videoGamma( xine_vo_driver_t* self , int value ) { 536void null_set_videoGamma( xine_vo_driver_t* self , int value ) {
533 ((null_driver_t*) self) ->yuv2rgb_gamma = value; 537 ((null_driver_t*) self->driver) ->yuv2rgb_gamma = value;
534 ((null_driver_t*) self) ->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) ->yuv2rgb_factory, value );
535} 539}
536 540
537void null_set_scaling( xine_vo_driver_t* self, int scale ) { 541void null_set_scaling( xine_vo_driver_t* self, int scale ) {
538 ((null_driver_t*)self)->m_is_scaling = scale; 542 ((null_driver_t*)self->driver)->m_is_scaling = scale;
539} 543}
540 544
541void null_set_gui_width( xine_vo_driver_t* self, int width ) { 545void null_set_gui_width( xine_vo_driver_t* self, int width ) {
542 ((null_driver_t*)self)->gui_width = width; 546 ((null_driver_t*)self->driver)->gui_width = width;
543} 547}
544void null_set_gui_height( xine_vo_driver_t* self, int height ) { 548void null_set_gui_height( xine_vo_driver_t* self, int height ) {
545 ((null_driver_t*)self)->gui_height = height; 549 ((null_driver_t*)self->driver)->gui_height = height;
546} 550}
547 551
548 552
549void null_set_mode( xine_vo_driver_t* self, int depth, int rgb ) { 553void null_set_mode( xine_vo_driver_t* self, int depth, int rgb ) {
550 null_driver_t* this = (null_driver_t*)self; 554 null_driver_t* this = (null_driver_t*)self->driver;
551 555
552 this->bytes_per_pixel = (depth + 7 ) / 8; 556 this->bytes_per_pixel = (depth + 7 ) / 8;
553 this->bpp = this->bytes_per_pixel * 8; 557 this->bpp = this->bytes_per_pixel * 8;
554 this->depth = depth; 558 this->depth = depth;
555 printf("depth %d %d\n", depth, this->bpp); 559 printf("depth %d %d\n", depth, this->bpp);
556 printf("pixeltype %d\n", rgb ); 560 printf("pixeltype %d\n", rgb );
@@ -600,11 +604,11 @@ void null_set_mode( xine_vo_driver_t* self, int depth, int rgb ) {
600 // 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,
601 // this->yuv2rgb_cmap); 605 // this->yuv2rgb_cmap);
602}; 606};
603 607
604void null_display_handler( xine_vo_driver_t* self, display_xine_frame_t t, 608void null_display_handler( xine_vo_driver_t* self, display_xine_frame_t t,
605 void* user_data ) { 609 void* user_data ) {
606 null_driver_t* this = (null_driver_t*) self; 610 null_driver_t* this = (null_driver_t*) self->driver;
607 this->caller = user_data; 611 this->caller = user_data;
608 this->frameDis = t; 612 this->frameDis = t;
609} 613}
610 614