summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp5
-rw-r--r--noncore/multimedia/opieplayer2/nullvideo.c21
2 files changed, 26 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp
index 8896cfe..d04af08 100644
--- a/noncore/multimedia/opieplayer2/lib.cpp
+++ b/noncore/multimedia/opieplayer2/lib.cpp
@@ -57,24 +57,26 @@ extern "C" {
57 xine_vo_driver_t* init_video_out_plugin( xine_t *xine, void* video, display_xine_frame_t, void * ); 57 xine_vo_driver_t* init_video_out_plugin( xine_t *xine, void* video, display_xine_frame_t, void * );
58 int null_is_showing_video( const xine_vo_driver_t* self ); 58 int null_is_showing_video( const xine_vo_driver_t* self );
59 void null_set_show_video( const xine_vo_driver_t* self, int show ); 59 void null_set_show_video( const xine_vo_driver_t* self, int show );
60 int null_is_fullscreen( const xine_vo_driver_t* self ); 60 int null_is_fullscreen( const xine_vo_driver_t* self );
61 void null_set_fullscreen( const xine_vo_driver_t* self, int screen ); 61 void null_set_fullscreen( const xine_vo_driver_t* self, int screen );
62 int null_is_scaling( const xine_vo_driver_t* self ); 62 int null_is_scaling( const xine_vo_driver_t* self );
63 void null_set_scaling( const xine_vo_driver_t* self, int scale ); 63 void null_set_scaling( const xine_vo_driver_t* self, int scale );
64 void null_set_gui_width( const xine_vo_driver_t* self, int width ); 64 void null_set_gui_width( const xine_vo_driver_t* self, int width );
65 void null_set_gui_height( const xine_vo_driver_t* self, int height ); 65 void null_set_gui_height( const xine_vo_driver_t* self, int height );
66 void null_set_mode( const xine_vo_driver_t* self, int depth, int rgb ); 66 void null_set_mode( const xine_vo_driver_t* self, int depth, int rgb );
67 void null_set_videoGamma( const xine_vo_driver_t* self , int value ); 67 void null_set_videoGamma( const xine_vo_driver_t* self , int value );
68 void null_display_handler( const xine_vo_driver_t* self, display_xine_frame_t t, void* user_data ); 68 void null_display_handler( const xine_vo_driver_t* self, display_xine_frame_t t, void* user_data );
69
70 void null_preload_decoders( xine_stream_t *stream );
69} 71}
70 72
71using namespace XINE; 73using namespace XINE;
72 74
73Lib::Lib( InitializationMode initMode, XineVideoWidget* widget ) 75Lib::Lib( InitializationMode initMode, XineVideoWidget* widget )
74{ 76{
75 m_initialized = false; 77 m_initialized = false;
76 m_duringInitialization = false; 78 m_duringInitialization = false;
77 m_video = false; 79 m_video = false;
78 m_wid = widget; 80 m_wid = widget;
79 printf("Lib"); 81 printf("Lib");
80 QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf"; 82 QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf";
@@ -127,24 +129,27 @@ void Lib::initialize()
127// null_display_handler( m_videoOutput, xine_display_frame, this ); 129// null_display_handler( m_videoOutput, xine_display_frame, this );
128 130
129 m_stream = xine_stream_new (m_xine, m_audioOutput, m_videoOutput ); 131 m_stream = xine_stream_new (m_xine, m_audioOutput, m_videoOutput );
130 132
131 if (m_wid != 0 ) { 133 if (m_wid != 0 ) {
132 printf( "!0\n" ); 134 printf( "!0\n" );
133 setWidget( m_wid ); 135 setWidget( m_wid );
134 } 136 }
135 137
136 m_queue = xine_event_new_queue (m_stream); 138 m_queue = xine_event_new_queue (m_stream);
137 139
138 xine_event_create_listener_thread (m_queue, xine_event_handler, this); 140 xine_event_create_listener_thread (m_queue, xine_event_handler, this);
141
142 ::null_preload_decoders( m_stream );
143
139 m_duringInitialization = false; 144 m_duringInitialization = false;
140} 145}
141 146
142Lib::~Lib() { 147Lib::~Lib() {
143 assert( isRunning() == false ); 148 assert( isRunning() == false );
144 assert( m_initialized ); 149 assert( m_initialized );
145 150
146// free( m_config ); 151// free( m_config );
147 152
148 xine_close( m_stream ); 153 xine_close( m_stream );
149 154
150 xine_event_dispose_queue( m_queue ); 155 xine_event_dispose_queue( m_queue );
diff --git a/noncore/multimedia/opieplayer2/nullvideo.c b/noncore/multimedia/opieplayer2/nullvideo.c
index c988854..e2eb663 100644
--- a/noncore/multimedia/opieplayer2/nullvideo.c
+++ b/noncore/multimedia/opieplayer2/nullvideo.c
@@ -32,24 +32,25 @@
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 45
45#include <pthread.h> 46#include <pthread.h>
46#include "alphablend.h" 47#include "alphablend.h"
47#include "yuv2rgb.h" 48#include "yuv2rgb.h"
48 49
49#define printf(x,...) 50#define printf(x,...)
50 51
51/* 52/*
52#define LOG 53#define LOG
53*/ 54*/
54 55
55/* the caller for our event draw handler */ 56/* the caller for our event draw handler */
@@ -603,12 +604,32 @@ void null_set_mode( xine_vo_driver_t* self, int depth, int rgb ) {
603 //free(this->yuv2rgb_factory ); 604 //free(this->yuv2rgb_factory );
604 // 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,
605 // this->yuv2rgb_cmap); 606 // this->yuv2rgb_cmap);
606}; 607};
607 608
608void null_display_handler( xine_vo_driver_t* self, display_xine_frame_t t, 609void null_display_handler( xine_vo_driver_t* self, display_xine_frame_t t,
609 void* user_data ) { 610 void* user_data ) {
610 null_driver_t* this = (null_driver_t*) self->driver; 611 null_driver_t* this = (null_driver_t*) self->driver;
611 this->caller = user_data; 612 this->caller = user_data;
612 this->frameDis = t; 613 this->frameDis = t;
613} 614}
614 615
616void null_preload_decoders( xine_stream_t *stream )
617{
618 static const uint32_t preloadedAudioDecoders[] = { BUF_AUDIO_MPEG, BUF_AUDIO_VORBIS };
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 };
621 static const uint8_t preloadedVideoDecoderCount = sizeof( preloadedVideoDecoders ) / sizeof( preloadedVideoDecoders[ 0 ] );
622
623 uint8_t i;
624
625 for ( i = 0; i < preloadedAudioDecoderCount; ++i ) {
626 audio_decoder_t *decoder = get_audio_decoder( stream, ( preloadedAudioDecoders[ i ] >> 16 ) & 0xff );
627 free_audio_decoder( stream, decoder );
628 }
629
630 for ( i = 0; i < preloadedVideoDecoderCount; ++i ) {
631 video_decoder_t *decoder = get_video_decoder( stream, ( preloadedVideoDecoders[ i ] >> 16 ) & 0xff );
632 free_video_decoder( stream, decoder );
633 }
634}
635