author | simon <simon> | 2002-12-14 01:03:42 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-14 01:03:42 (UTC) |
commit | 8940bc946446352bea498b66c6a6d81002f0c405 (patch) (unidiff) | |
tree | 93aa9e32da1414e95ecd7b80f7cce955298626d9 | |
parent | e9ff9ed56c1f198fb4d56cf2d57421e2183f9c3d (diff) | |
download | opie-8940bc946446352bea498b66c6a6d81002f0c405.zip opie-8940bc946446352bea498b66c6a6d81002f0c405.tar.gz opie-8940bc946446352bea498b66c6a6d81002f0c405.tar.bz2 |
- preload a couple of decoders
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 5 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/nullvideo.c | 21 |
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 | |||
@@ -61,16 +61,18 @@ extern "C" { | |||
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 | ||
71 | using namespace XINE; | 73 | using namespace XINE; |
72 | 74 | ||
73 | Lib::Lib( InitializationMode initMode, XineVideoWidget* widget ) | 75 | Lib::Lib( InitializationMode initMode, XineVideoWidget* widget ) |
74 | { | 76 | { |
75 | m_initialized = false; | 77 | m_initialized = false; |
76 | m_duringInitialization = false; | 78 | m_duringInitialization = false; |
@@ -131,16 +133,19 @@ void Lib::initialize() | |||
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 | ||
142 | Lib::~Lib() { | 147 | Lib::~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 ); |
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 | |||
@@ -36,16 +36,17 @@ | |||
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 | /* |
@@ -607,8 +608,28 @@ void null_set_mode( xine_vo_driver_t* self, int depth, int rgb ) { | |||
607 | 608 | ||
608 | 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, |
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 | ||
616 | void 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 | |||