summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/lib.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/opieplayer2/lib.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp
index 1e0dc21..6431de7 100644
--- a/noncore/multimedia/opieplayer2/lib.cpp
+++ b/noncore/multimedia/opieplayer2/lib.cpp
@@ -49,67 +49,81 @@
49#include "frame.h" 49#include "frame.h"
50#include "lib.h" 50#include "lib.h"
51 51
52 52
53typedef void (*display_xine_frame_t) (void *user_data, uint8_t* frame, 53typedef void (*display_xine_frame_t) (void *user_data, uint8_t* frame,
54 int width, int height,int bytes ); 54 int width, int height,int bytes );
55 55
56extern "C" { 56extern "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} 69}
70 70
71using namespace XINE; 71using namespace XINE;
72 72
73Lib::Lib( XineVideoWidget* widget ) 73Lib::Lib( InitializationMode initMode, XineVideoWidget* widget )
74{ 74{
75 m_video = false; 75 m_video = false;
76 m_wid = widget; 76 m_wid = widget;
77 printf("Lib"); 77 printf("Lib");
78 QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf"; 78 QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf";
79 // get the configuration 79 // get the configuration
80 80
81 // not really OO, should be an extra class, later 81 // not really OO, should be an extra class, later
82 if ( !QFile::exists(configPath) ) { 82 if ( !QFile::exists(configPath) ) {
83 QFile f(configPath); 83 QFile f(configPath);
84 f.open(IO_WriteOnly); 84 f.open(IO_WriteOnly);
85 QTextStream ts( &f ); 85 QTextStream ts( &f );
86 ts << "misc.memcpy_method:glibc\n"; 86 ts << "misc.memcpy_method:glibc\n";
87 f.close(); 87 f.close();
88 } 88 }
89 89
90 if ( initMode == InitializeImmediately )
91 initialize();
92 else
93 assert( false );
94}
95
96void Lib::run()
97{
98 assert( false );
99}
100
101void Lib::initialize()
102{
90 m_xine = xine_new( ); 103 m_xine = xine_new( );
91 104
105 QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf";
92 xine_config_load( m_xine, QFile::encodeName( configPath ) ); 106 xine_config_load( m_xine, QFile::encodeName( configPath ) );
93 107
94 xine_init( m_xine ); 108 xine_init( m_xine );
95 109
96 // allocate oss for sound 110 // allocate oss for sound
97 // and fb for framebuffer 111 // and fb for framebuffer
98 m_audioOutput = xine_open_audio_driver( m_xine, "oss", NULL ); 112 m_audioOutput = xine_open_audio_driver( m_xine, "oss", NULL );
99 m_videoOutput = ::init_video_out_plugin( m_xine, NULL, xine_display_frame, this ); 113 m_videoOutput = ::init_video_out_plugin( m_xine, NULL, xine_display_frame, this );
100 114
101 115
102//xine_open_video_driver( m_xine, NULL, XINE_VISUAL_TYPE_FB, NULL); 116//xine_open_video_driver( m_xine, NULL, XINE_VISUAL_TYPE_FB, NULL);
103 117
104 118
105// null_display_handler( m_videoOutput, xine_display_frame, this ); 119// null_display_handler( m_videoOutput, xine_display_frame, this );
106 120
107 m_stream = xine_stream_new (m_xine, m_audioOutput, m_videoOutput ); 121 m_stream = xine_stream_new (m_xine, m_audioOutput, m_videoOutput );
108 122
109 if (m_wid != 0 ) { 123 if (m_wid != 0 ) {
110 printf( "!0\n" ); 124 printf( "!0\n" );
111 resize ( m_wid-> size ( ) ); 125 resize ( m_wid-> size ( ) );
112 ::null_set_mode( m_videoOutput, qt_screen->depth(), qt_screen->pixelType() ); 126 ::null_set_mode( m_videoOutput, qt_screen->depth(), qt_screen->pixelType() );
113 127
114// m_wid->repaint(); 128// m_wid->repaint();
115 } 129 }