summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp
index 5ae6c21..eb57b67 100644
--- a/noncore/multimedia/opieplayer2/lib.cpp
+++ b/noncore/multimedia/opieplayer2/lib.cpp
@@ -14,129 +14,129 @@
14#include "frame.h" 14#include "frame.h"
15#include "lib.h" 15#include "lib.h"
16 16
17typedef void (*display_xine_frame_t) (void *user_data, uint8_t* frame, 17typedef void (*display_xine_frame_t) (void *user_data, uint8_t* frame,
18 int width, int height,int bytes ); 18 int width, int height,int bytes );
19 19
20extern "C" { 20extern "C" {
21 vo_driver_t* init_video_out_plugin( config_values_t* conf, void* video); 21 vo_driver_t* init_video_out_plugin( config_values_t* conf, void* video);
22 int null_is_showing_video( vo_driver_t* self ); 22 int null_is_showing_video( vo_driver_t* self );
23 void null_set_show_video( vo_driver_t* self, int show ); 23 void null_set_show_video( vo_driver_t* self, int show );
24 int null_is_fullscreen( vo_driver_t* self ); 24 int null_is_fullscreen( vo_driver_t* self );
25 void null_set_fullscreen( vo_driver_t* self, int screen ); 25 void null_set_fullscreen( vo_driver_t* self, int screen );
26 int null_is_scaling( vo_driver_t* self ); 26 int null_is_scaling( vo_driver_t* self );
27 void null_set_scaling( vo_driver_t* self, int scale ); 27 void null_set_scaling( vo_driver_t* self, int scale );
28 void null_set_gui_width( vo_driver_t* self, int width ); 28 void null_set_gui_width( vo_driver_t* self, int width );
29 void null_set_gui_height( vo_driver_t* self, int height ); 29 void null_set_gui_height( vo_driver_t* self, int height );
30 void null_set_mode( vo_driver_t* self, int depth, int rgb ); 30 void null_set_mode( vo_driver_t* self, int depth, int rgb );
31 void null_display_handler(vo_driver_t* self, display_xine_frame_t t, void* user_data); 31 void null_display_handler(vo_driver_t* self, display_xine_frame_t t, void* user_data);
32} 32}
33 33
34using namespace XINE; 34using namespace XINE;
35 35
36Lib::Lib(XineVideoWidget* widget) { 36Lib::Lib(XineVideoWidget* widget) {
37 m_video = false; 37 m_video = false;
38 m_wid = widget; 38 m_wid = widget;
39 printf("Lib"); 39 printf("Lib");
40 QCString str( getenv("HOME") ); 40 QCString str( getenv("HOME") );
41 str += "/Settings/opiexine.cf"; 41 str += "/Settings/opiexine.cf";
42 // get the configuration 42 // get the configuration
43 m_config = xine_config_file_init( str.data() ); 43 m_config = xine_config_file_init( str.data() );
44 44
45 // allocate oss for sound 45 // allocate oss for sound
46 // and fb for framebuffer 46 // and fb for framebuffer
47 m_audioOutput= xine_load_audio_output_plugin( m_config, "oss") ; 47 m_audioOutput= xine_load_audio_output_plugin( m_config, "oss") ;
48 if (m_audioOutput == NULL ) 48 if (m_audioOutput == NULL )
49 printf("Failure\n"); 49 printf("Failure\n");
50 else 50 else
51 printf("Success\n"); 51 printf("Success\n");
52 52
53 53
54 // test code 54 // test code
55/* m_videoOutput = xine_load_video_output_plugin(m_config, "fb", 55/* m_videoOutput = xine_load_video_output_plugin(m_config, "fb",
56 VISUAL_TYPE_FB, 56 VISUAL_TYPE_FB,
57 0 ); 57 0 );
58*/ 58*/
59 59
60 char** files = xine_list_video_output_plugins(3); 60 char** files = xine_list_video_output_plugins(3);
61 char* out; 61 char* out;
62 int i = 0; 62 int i = 0;
63 while ( ( out = files[i] ) != 0 ) { 63 while ( ( out = files[i] ) != 0 ) {
64 printf("Video %s\n", out ); 64 printf("Video %s\n", out );
65 i++; 65 i++;
66 } 66 }
67// m_xine = xine_init( m_videoOutput, 67// m_xine = xine_init( m_videoOutput,
68// m_audioOutput, 68// m_audioOutput,
69// m_config ); 69// m_config );
70 // test loading 70 // test loading
71 m_videoOutput = ::init_video_out_plugin( m_config, NULL ); 71 m_videoOutput = ::init_video_out_plugin( m_config, NULL );
72 if (m_wid != 0 ) { 72 if (m_wid != 0 ) {
73 printf("!0\n" ); 73 printf("!0\n" );
74 ::null_set_gui_width( m_videoOutput, m_wid->image()->width() ); 74 ::null_set_gui_width( m_videoOutput, m_wid->image()->width() );
75 ::null_set_gui_height(m_videoOutput, m_wid->image()->height() ); 75 ::null_set_gui_height(m_videoOutput, m_wid->image()->height() );
76 ::null_set_mode( m_videoOutput, qt_screen->depth(), qt_screen->pixelType() ); 76 ::null_set_mode( m_videoOutput, qt_screen->depth(), qt_screen->pixelType() );
77 m_bytes_per_pixel = ( qt_screen->depth() + 7 ) / 8; 77 m_bytes_per_pixel = ( qt_screen->depth() + 7 ) / 8;
78 QImage image = Resource::loadImage("SoundPlayer"); 78 QImage image = Resource::loadImage("");
79 image = image.smoothScale( m_wid->width(), m_wid->height() ); 79 image = image.smoothScale( m_wid->width(), m_wid->height() );
80 QImage* img = new QImage( image ); 80 QImage* img = new QImage( image );
81 m_wid->setImage( img ); 81 m_wid->setImage( img );
82 m_wid->repaint(); 82 m_wid->repaint();
83 } 83 }
84 null_display_handler( m_videoOutput, 84 null_display_handler( m_videoOutput,
85 xine_display_frame, 85 xine_display_frame,
86 this ); 86 this );
87 87
88 m_xine = xine_init( m_videoOutput, 88 m_xine = xine_init( m_videoOutput,
89 m_audioOutput, m_config ); 89 m_audioOutput, m_config );
90 // install the event handler 90 // install the event handler
91 xine_register_event_listener( m_xine, xine_event_handler, this ); 91 xine_register_event_listener( m_xine, xine_event_handler, this );
92} 92}
93 93
94Lib::~Lib() { 94Lib::~Lib() {
95 delete m_config; 95 delete m_config;
96 xine_remove_event_listener( m_xine, xine_event_handler ); 96 xine_remove_event_listener( m_xine, xine_event_handler );
97 xine_exit( m_xine ); 97 xine_exit( m_xine );
98 delete m_videoOutput; 98 delete m_videoOutput;
99 //delete m_audioOutput; 99 //delete m_audioOutput;
100 100
101} 101}
102 102
103QCString Lib::version() { 103QCString Lib::version() {
104 QCString str( xine_get_str_version() ); 104 QCString str( xine_get_str_version() );
105 return str; 105 return str;
106}; 106};
107 107
108int Lib::majorVersion() { 108int Lib::majorVersion() {
109 return xine_get_major_version(); 109 return xine_get_major_version();
110} 110}
111int Lib::minorVersion() { 111int Lib::minorVersion() {
112 return xine_get_minor_version(); 112 return xine_get_minor_version();
113}; 113};
114 114
115int Lib::subVersion() { 115int Lib::subVersion() {
116 return xine_get_sub_version(); 116 return xine_get_sub_version();
117} 117}
118int Lib::play( const QString& fileName, 118int Lib::play( const QString& fileName,
119 int startPos, 119 int startPos,
120 int start_time ) { 120 int start_time ) {
121 QString str = fileName.stripWhiteSpace(); 121 QString str = fileName.stripWhiteSpace();
122 //workaround OpiePlayer bug 122 //workaround OpiePlayer bug
123 if (str.right(1) == QString::fromLatin1("/") ) 123 if (str.right(1) == QString::fromLatin1("/") )
124 str = str.mid( str.length() -1 ); 124 str = str.mid( str.length() -1 );
125 return xine_play( m_xine, QFile::encodeName(str.utf8() ).data(), 125 return xine_play( m_xine, QFile::encodeName(str.utf8() ).data(),
126 startPos, start_time); 126 startPos, start_time);
127} 127}
128void Lib::stop() { 128void Lib::stop() {
129 xine_stop(m_xine ); 129 xine_stop(m_xine );
130} 130}
131void Lib::pause(){ 131void Lib::pause(){
132 xine_set_speed( m_xine, SPEED_PAUSE ); 132 xine_set_speed( m_xine, SPEED_PAUSE );
133} 133}
134int Lib::speed() { 134int Lib::speed() {
135 return xine_get_speed( m_xine ); 135 return xine_get_speed( m_xine );
136} 136}
137void Lib::setSpeed( int speed ) { 137void Lib::setSpeed( int speed ) {
138 xine_set_speed( m_xine, speed ); 138 xine_set_speed( m_xine, speed );
139} 139}
140int Lib::status(){ 140int Lib::status(){
141 return xine_get_status( m_xine ); 141 return xine_get_status( m_xine );
142} 142}