summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp40
-rw-r--r--noncore/multimedia/opieplayer2/lib.h47
-rw-r--r--noncore/multimedia/opieplayer2/nullvideo.c37
3 files changed, 119 insertions, 5 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp
index 0ea85dd..69ff492 100644
--- a/noncore/multimedia/opieplayer2/lib.cpp
+++ b/noncore/multimedia/opieplayer2/lib.cpp
@@ -12,3 +12,10 @@
12extern "C" { 12extern "C" {
13vo_driver_t* init_video_out_plugin( config_values_t* conf, void* video); 13 vo_driver_t* init_video_out_plugin( config_values_t* conf, void* video);
14 int null_is_showing_video( vo_driver_t* self );
15 void null_set_show_video( vo_driver_t* self, int show );
16 int null_is_fullscreen( vo_driver_t* self );
17 void null_set_fullscreen( vo_driver_t* self, int screen );
18 int null_is_scaling( vo_driver_t* self );
19 void null_set_scaling( vo_driver_t* self, int scale );
20
14} 21}
@@ -49,5 +56,7 @@ Lib::Lib() {
49 // test loading 56 // test loading
50 m_videoOutput = ::init_video_out_plugin( m_config, NULL ); 57 m_videoOutput = ::init_video_out_plugin( m_config, NULL );
51 m_xine = xine_init( m_videoOutput, 58 m_xine = xine_init( m_videoOutput,
52 m_audioOutput, m_config ); 59 m_audioOutput, m_config );
60 // install the event handler
61 xine_register_event_listener( m_xine, xine_event_handler, this );
53} 62}
@@ -56,2 +65,3 @@ Lib::~Lib() {
56 delete m_config; 65 delete m_config;
66 xine_remove_event_listener( m_xine, xine_event_handler );
57 xine_exit( m_xine ); 67 xine_exit( m_xine );
@@ -118,2 +128,26 @@ int Lib::error() {
118}; 128};
119 129void Lib::handleXineEvent( xine_event_t* t ) {
130 if ( t->type == XINE_EVENT_PLAYBACK_FINISHED )
131 emit stopped();
132}
133void Lib::setShowVideo( bool video ) {
134 ::null_set_show_video( m_videoOutput, video );
135}
136bool Lib::isShowingVideo() {
137 return ::null_is_showing_video( m_videoOutput );
138}
139void Lib::showVideoFullScreen( bool fullScreen ) {
140 ::null_set_fullscreen( m_videoOutput, fullScreen );
141}
142bool Lib::isVideoFullScreen() {
143 return ::null_is_fullscreen( m_videoOutput );
144}
145void Lib::setScaling( bool scale ) {
146 ::null_set_scaling( m_videoOutput, scale );
147}
148bool Lib::isScaling() {
149 return ::null_is_scaling( m_videoOutput );
150}
151void Lib::xine_event_handler( void* user_data, xine_event_t* t ) {
152 ((Lib*)user_data)->handleXineEvent( t );
153}
diff --git a/noncore/multimedia/opieplayer2/lib.h b/noncore/multimedia/opieplayer2/lib.h
index d9dc931..00a1248 100644
--- a/noncore/multimedia/opieplayer2/lib.h
+++ b/noncore/multimedia/opieplayer2/lib.h
@@ -7,2 +7,4 @@
7#include <qstring.h> 7#include <qstring.h>
8#include <qobject.h>
9
8#include <xine.h> 10#include <xine.h>
@@ -19,3 +21,4 @@ namespace XINE {
19 class Frame; 21 class Frame;
20 class Lib { 22 class Lib : public QObject {
23 Q_OBJECT
21 public: 24 public:
@@ -47,4 +50,43 @@ namespace XINE {
47 50
51 /**
52 * Whether or not to show video output
53 */
54 void setShowVideo(bool video);
55
56 /**
57 * is we show video
58 */
59 bool isShowingVideo() /*const*/;
60
61 /**
62 *
63 */
64 void showVideoFullScreen( bool fullScreen );
65
66 /**
67 *
68 */
69 bool isVideoFullScreen()/*const*/ ;
70
71 /**
72 *
73 */
74 bool isScaling();
75
76 /**
77 *
78 */
79 void setScaling( bool );
80 /**
81 * test
82 */
48 Frame currentFrame()/*const*/; 83 Frame currentFrame()/*const*/;
84
85 /**
86 * Returns the error code
87 */
49 int error() /*const*/; 88 int error() /*const*/;
89
90 signals:
91 void stopped();
50 private: 92 private:
@@ -55,2 +97,5 @@ namespace XINE {
55 97
98 void handleXineEvent( xine_event_t* t );
99 // C -> C++ bridge for the event system
100 static void xine_event_handler( void* user_data, xine_event_t* t);
56 }; 101 };
diff --git a/noncore/multimedia/opieplayer2/nullvideo.c b/noncore/multimedia/opieplayer2/nullvideo.c
index 5224862..b8b8eb3 100644
--- a/noncore/multimedia/opieplayer2/nullvideo.c
+++ b/noncore/multimedia/opieplayer2/nullvideo.c
@@ -15,3 +15,5 @@ struct null_driver_s {
15 uint32_t m_capabilities; 15 uint32_t m_capabilities;
16 16 int m_show_video;
17 int m_video_fullscreen;
18 int m_is_scaling;
17}; 19};
@@ -149,2 +151,5 @@ vo_driver_t* init_video_out_plugin( config_values_t* conf,
149 vo = (null_driver_t*)malloc( sizeof(null_driver_t ) ); 151 vo = (null_driver_t*)malloc( sizeof(null_driver_t ) );
152 vo->m_show_video = 0; // false
153 vo->m_video_fullscreen = 0;
154 vo->m_is_scaling = 0;
150 /* memset? */ 155 /* memset? */
@@ -183 +188,31 @@ vo_info_t *get_video_out_plugin_info(){
183} 188}
189
190/* this is special for this device */
191/**
192 * We know that we will be controled by the XINE LIB++
193 */
194
195/**
196 *
197 */
198int null_is_showing_video( vo_driver_t* self ){
199 null_driver_t* this = (null_driver_t*)self;
200 return this->m_show_video;
201}
202void null_set_show_video( vo_driver_t* self, int show ) {
203 ((null_driver_t*)self)->m_show_video = show;
204}
205
206int null_is_fullscreen( vo_driver_t* self ){
207 return ((null_driver_t*)self)->m_video_fullscreen;
208}
209void null_set_fullscreen( vo_driver_t* self, int screen ){
210 ((null_driver_t*)self)->m_video_fullscreen = screen;
211}
212int null_is_scaling( vo_driver_t* self ){
213 return ((null_driver_t*)self)->m_is_scaling;
214}
215void null_set_scaling( vo_driver_t* self, int scale ){
216 ((null_driver_t*)self)->m_is_scaling = scale;
217}
218