author | zecke <zecke> | 2002-07-09 13:49:34 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-07-09 13:49:34 (UTC) |
commit | 87bb55055c826b6c75d4a66a7ff6e21058cf6361 (patch) (unidiff) | |
tree | 000f68448ce3b903da00a3e5a2ad24140a18f85b | |
parent | e99adc2029808f6276474c95e8587607a4bd8091 (diff) | |
download | opie-87bb55055c826b6c75d4a66a7ff6e21058cf6361.zip opie-87bb55055c826b6c75d4a66a7ff6e21058cf6361.tar.gz opie-87bb55055c826b6c75d4a66a7ff6e21058cf6361.tar.bz2 |
Update the lib
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 40 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.h | 47 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/nullvideo.c | 37 |
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 @@ | |||
12 | extern "C" { | 12 | extern "C" { |
13 | vo_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 | 129 | void Lib::handleXineEvent( xine_event_t* t ) { | |
130 | if ( t->type == XINE_EVENT_PLAYBACK_FINISHED ) | ||
131 | emit stopped(); | ||
132 | } | ||
133 | void Lib::setShowVideo( bool video ) { | ||
134 | ::null_set_show_video( m_videoOutput, video ); | ||
135 | } | ||
136 | bool Lib::isShowingVideo() { | ||
137 | return ::null_is_showing_video( m_videoOutput ); | ||
138 | } | ||
139 | void Lib::showVideoFullScreen( bool fullScreen ) { | ||
140 | ::null_set_fullscreen( m_videoOutput, fullScreen ); | ||
141 | } | ||
142 | bool Lib::isVideoFullScreen() { | ||
143 | return ::null_is_fullscreen( m_videoOutput ); | ||
144 | } | ||
145 | void Lib::setScaling( bool scale ) { | ||
146 | ::null_set_scaling( m_videoOutput, scale ); | ||
147 | } | ||
148 | bool Lib::isScaling() { | ||
149 | return ::null_is_scaling( m_videoOutput ); | ||
150 | } | ||
151 | void 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 | */ | ||
198 | int null_is_showing_video( vo_driver_t* self ){ | ||
199 | null_driver_t* this = (null_driver_t*)self; | ||
200 | return this->m_show_video; | ||
201 | } | ||
202 | void null_set_show_video( vo_driver_t* self, int show ) { | ||
203 | ((null_driver_t*)self)->m_show_video = show; | ||
204 | } | ||
205 | |||
206 | int null_is_fullscreen( vo_driver_t* self ){ | ||
207 | return ((null_driver_t*)self)->m_video_fullscreen; | ||
208 | } | ||
209 | void null_set_fullscreen( vo_driver_t* self, int screen ){ | ||
210 | ((null_driver_t*)self)->m_video_fullscreen = screen; | ||
211 | } | ||
212 | int null_is_scaling( vo_driver_t* self ){ | ||
213 | return ((null_driver_t*)self)->m_is_scaling; | ||
214 | } | ||
215 | void null_set_scaling( vo_driver_t* self, int scale ){ | ||
216 | ((null_driver_t*)self)->m_is_scaling = scale; | ||
217 | } | ||
218 | |||