summaryrefslogtreecommitdiff
path: root/noncore
authorsimon <simon>2002-12-14 01:03:42 (UTC)
committer simon <simon>2002-12-14 01:03:42 (UTC)
commit8940bc946446352bea498b66c6a6d81002f0c405 (patch) (side-by-side diff)
tree93aa9e32da1414e95ecd7b80f7cce955298626d9 /noncore
parente9ff9ed56c1f198fb4d56cf2d57421e2183f9c3d (diff)
downloadopie-8940bc946446352bea498b66c6a6d81002f0c405.zip
opie-8940bc946446352bea498b66c6a6d81002f0c405.tar.gz
opie-8940bc946446352bea498b66c6a6d81002f0c405.tar.bz2
- preload a couple of decoders
Diffstat (limited to 'noncore') (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
@@ -61,16 +61,18 @@ extern "C" {
void null_set_fullscreen( const xine_vo_driver_t* self, int screen );
int null_is_scaling( const xine_vo_driver_t* self );
void null_set_scaling( const xine_vo_driver_t* self, int scale );
void null_set_gui_width( const xine_vo_driver_t* self, int width );
void null_set_gui_height( const xine_vo_driver_t* self, int height );
void null_set_mode( const xine_vo_driver_t* self, int depth, int rgb );
void null_set_videoGamma( const xine_vo_driver_t* self , int value );
void null_display_handler( const xine_vo_driver_t* self, display_xine_frame_t t, void* user_data );
+
+ void null_preload_decoders( xine_stream_t *stream );
}
using namespace XINE;
Lib::Lib( InitializationMode initMode, XineVideoWidget* widget )
{
m_initialized = false;
m_duringInitialization = false;
@@ -131,16 +133,19 @@ void Lib::initialize()
if (m_wid != 0 ) {
printf( "!0\n" );
setWidget( m_wid );
}
m_queue = xine_event_new_queue (m_stream);
xine_event_create_listener_thread (m_queue, xine_event_handler, this);
+
+ ::null_preload_decoders( m_stream );
+
m_duringInitialization = false;
}
Lib::~Lib() {
assert( isRunning() == false );
assert( m_initialized );
// 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 @@
#include <math.h>
#include <xine.h>
#include <xine/video_out.h>
#include <xine/xine_internal.h>
#include <xine/xineutils.h>
#include <xine/vo_scale.h>
+#include <xine/buffer.h>
#include <pthread.h>
#include "alphablend.h"
#include "yuv2rgb.h"
#define printf(x,...)
/*
@@ -607,8 +608,28 @@ void null_set_mode( xine_vo_driver_t* self, int depth, int rgb ) {
void null_display_handler( xine_vo_driver_t* self, display_xine_frame_t t,
void* user_data ) {
null_driver_t* this = (null_driver_t*) self->driver;
this->caller = user_data;
this->frameDis = t;
}
+void null_preload_decoders( xine_stream_t *stream )
+{
+ static const uint32_t preloadedAudioDecoders[] = { BUF_AUDIO_MPEG, BUF_AUDIO_VORBIS };
+ static const uint8_t preloadedAudioDecoderCount = sizeof( preloadedAudioDecoders ) / sizeof( preloadedAudioDecoders[ 0 ] );
+ static const uint32_t preloadedVideoDecoders[] = { BUF_VIDEO_MPEG, BUF_VIDEO_MPEG4, BUF_VIDEO_DIVX5 };
+ static const uint8_t preloadedVideoDecoderCount = sizeof( preloadedVideoDecoders ) / sizeof( preloadedVideoDecoders[ 0 ] );
+
+ uint8_t i;
+
+ for ( i = 0; i < preloadedAudioDecoderCount; ++i ) {
+ audio_decoder_t *decoder = get_audio_decoder( stream, ( preloadedAudioDecoders[ i ] >> 16 ) & 0xff );
+ free_audio_decoder( stream, decoder );
+ }
+
+ for ( i = 0; i < preloadedVideoDecoderCount; ++i ) {
+ video_decoder_t *decoder = get_video_decoder( stream, ( preloadedVideoDecoders[ i ] >> 16 ) & 0xff );
+ free_video_decoder( stream, decoder );
+ }
+}
+