-rw-r--r-- | noncore/multimedia/opieplayer2/alphablend.c | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 165 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.h | 28 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/nullvideo.c | 925 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/opieplayer2.pro | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | 3 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 7 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinevideowidget.cpp | 151 |
10 files changed, 622 insertions, 664 deletions
diff --git a/noncore/multimedia/opieplayer2/alphablend.c b/noncore/multimedia/opieplayer2/alphablend.c index 57f6013..cdd7b28 100644 --- a/noncore/multimedia/opieplayer2/alphablend.c +++ b/noncore/multimedia/opieplayer2/alphablend.c | |||
@@ -38,4 +38,6 @@ | |||
38 | #include <inttypes.h> | 38 | #include <inttypes.h> |
39 | 39 | ||
40 | #include <xine.h> | ||
41 | #include <xine/xine_internal.h> | ||
40 | #include <xine/video_out.h> | 42 | #include <xine/video_out.h> |
41 | #include "alphablend.h" | 43 | #include "alphablend.h" |
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 45f301e..620c71f 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -333,5 +333,5 @@ void AudioWidget::setView( char view ) { | |||
333 | hide(); | 333 | hide(); |
334 | } | 334 | } |
335 | qApp->processEvents(); | 335 | // qApp->processEvents(); |
336 | } | 336 | } |
337 | 337 | ||
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index d8a0694..4021d4a 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
@@ -51,21 +51,21 @@ typedef void (*display_xine_frame_t) (void *user_data, uint8_t* frame, | |||
51 | 51 | ||
52 | extern "C" { | 52 | extern "C" { |
53 | vo_driver_t* init_video_out_plugin( config_values_t* conf, void* video); | 53 | xine_vo_driver_t* init_video_out_plugin( xine_cfg_entry_t* conf, void* video); |
54 | int null_is_showing_video( vo_driver_t* self ); | 54 | int null_is_showing_video( const xine_vo_driver_t* self ); |
55 | void null_set_show_video( vo_driver_t* self, int show ); | 55 | void null_set_show_video( const xine_vo_driver_t* self, int show ); |
56 | int null_is_fullscreen( vo_driver_t* self ); | 56 | int null_is_fullscreen( const xine_vo_driver_t* self ); |
57 | void null_set_fullscreen( vo_driver_t* self, int screen ); | 57 | void null_set_fullscreen( const xine_vo_driver_t* self, int screen ); |
58 | int null_is_scaling( vo_driver_t* self ); | 58 | int null_is_scaling( const xine_vo_driver_t* self ); |
59 | void null_set_scaling( vo_driver_t* self, int scale ); | 59 | void null_set_scaling( const xine_vo_driver_t* self, int scale ); |
60 | void null_set_gui_width( vo_driver_t* self, int width ); | 60 | void null_set_gui_width( const xine_vo_driver_t* self, int width ); |
61 | void null_set_gui_height( vo_driver_t* self, int height ); | 61 | void null_set_gui_height( const xine_vo_driver_t* self, int height ); |
62 | void null_set_mode( vo_driver_t* self, int depth, int rgb ); | 62 | void null_set_mode( const xine_vo_driver_t* self, int depth, int rgb ); |
63 | void null_set_videoGamma( vo_driver_t* self , int value ); | 63 | void null_set_videoGamma( const xine_vo_driver_t* self , int value ); |
64 | void null_display_handler(vo_driver_t* self, display_xine_frame_t t, void* user_data); | 64 | void null_display_handler( const xine_vo_driver_t* self, display_xine_frame_t t, void* user_data ); |
65 | } | 65 | } |
66 | 66 | ||
67 | using namespace XINE; | 67 | using namespace XINE; |
68 | 68 | ||
69 | Lib::Lib(XineVideoWidget* widget) { | 69 | Lib::Lib( XineVideoWidget* widget ) { |
70 | m_video = false; | 70 | m_video = false; |
71 | m_wid = widget; | 71 | m_wid = widget; |
@@ -84,29 +84,34 @@ Lib::Lib(XineVideoWidget* widget) { | |||
84 | } | 84 | } |
85 | 85 | ||
86 | m_config = xine_config_file_init( str.data() ); | 86 | m_xine = xine_new( ); |
87 | |||
88 | xine_config_load( m_xine, str.data() ); | ||
89 | |||
87 | 90 | ||
88 | // allocate oss for sound | 91 | // allocate oss for sound |
89 | // and fb for framebuffer | 92 | // and fb for framebuffer |
90 | m_audioOutput= xine_load_audio_output_plugin( m_config, "oss") ; | 93 | m_audioOutput = xine_open_audio_driver( m_xine, "oss", NULL ); |
91 | m_videoOutput = ::init_video_out_plugin( m_config, NULL ); | 94 | m_videoOutput = ::init_video_out_plugin( m_config, NULL ); |
95 | |||
96 | |||
97 | //xine_open_video_driver( m_xine, NULL, XINE_VISUAL_TYPE_FB, NULL); | ||
98 | |||
99 | |||
100 | null_display_handler( m_videoOutput, xine_display_frame, this ); | ||
101 | xine_init( m_xine, m_audioOutput, m_videoOutput ); | ||
102 | |||
92 | if (m_wid != 0 ) { | 103 | if (m_wid != 0 ) { |
93 | printf("!0\n" ); | 104 | printf( "!0\n" ); |
94 | resize ( m_wid-> size ( )); | 105 | resize ( m_wid-> size ( ) ); |
95 | ::null_set_mode( m_videoOutput, qt_screen->depth(), qt_screen->pixelType() ); | 106 | ::null_set_mode( m_videoOutput, qt_screen->depth(), qt_screen->pixelType() ); |
96 | m_wid-> setLogo ( new QImage ( Resource::loadImage(""))); | 107 | |
97 | m_wid->repaint(); | 108 | m_wid->repaint(); |
98 | } | 109 | } |
99 | null_display_handler( m_videoOutput, | ||
100 | xine_display_frame, | ||
101 | this ); | ||
102 | 110 | ||
103 | m_xine = xine_init( m_videoOutput, | ||
104 | m_audioOutput, m_config ); | ||
105 | // install the event handler | ||
106 | xine_register_event_listener( m_xine, xine_event_handler, this ); | 111 | xine_register_event_listener( m_xine, xine_event_handler, this ); |
107 | } | 112 | } |
108 | 113 | ||
109 | Lib::~Lib() { | 114 | Lib::~Lib() { |
110 | free( m_config ); | 115 | // free( m_config ); |
111 | xine_remove_event_listener( m_xine, xine_event_handler ); | 116 | xine_remove_event_listener( m_xine, xine_event_handler ); |
112 | xine_exit( m_xine ); | 117 | xine_exit( m_xine ); |
@@ -114,92 +119,117 @@ Lib::~Lib() { | |||
114 | //free( m_videoOutput ); | 119 | //free( m_videoOutput ); |
115 | //delete m_audioOutput; | 120 | //delete m_audioOutput; |
116 | |||
117 | } | 121 | } |
118 | 122 | ||
119 | void Lib::resize ( const QSize &s ) | 123 | void Lib::resize ( const QSize &s ) { |
120 | { | 124 | if ( s. width ( ) && s. height ( ) ) { |
121 | if ( s. width ( ) && s. height ( )) { | 125 | ::null_set_gui_width( m_videoOutput, s. width() ); |
122 | ::null_set_gui_width( m_videoOutput, s. width() ); | 126 | ::null_set_gui_height( m_videoOutput, s. height() ); |
123 | ::null_set_gui_height(m_videoOutput, s. height() ); | 127 | } |
124 | } | ||
125 | } | 128 | } |
126 | 129 | ||
127 | QCString Lib::version() { | 130 | QCString Lib::version() { |
128 | QCString str( xine_get_str_version() ); | 131 | // QCString str( xine_get_str_version() ); |
129 | return str; | 132 | // return str; |
130 | }; | 133 | return "test"; |
134 | } | ||
131 | 135 | ||
132 | int Lib::majorVersion() { | 136 | int Lib::majorVersion() { |
133 | return xine_get_major_version(); | 137 | xine_get_version ( &m_major_version, &m_minor_version, &m_sub_version ); |
138 | return m_major_version; | ||
134 | } | 139 | } |
140 | |||
135 | int Lib::minorVersion() { | 141 | int Lib::minorVersion() { |
136 | return xine_get_minor_version(); | 142 | xine_get_version ( &m_major_version, &m_minor_version, &m_sub_version ); |
137 | }; | 143 | return m_minor_version; |
144 | } | ||
138 | 145 | ||
139 | int Lib::subVersion() { | 146 | int Lib::subVersion() { |
140 | return xine_get_sub_version(); | 147 | xine_get_version ( &m_major_version, &m_minor_version, &m_sub_version ); |
148 | return m_sub_version; | ||
141 | } | 149 | } |
142 | int Lib::play( const QString& fileName, | 150 | |
143 | int startPos, | 151 | int Lib::play( const QString& fileName, int startPos, int start_time ) { |
144 | int start_time ) { | ||
145 | QString str = fileName.stripWhiteSpace(); | 152 | QString str = fileName.stripWhiteSpace(); |
146 | //workaround OpiePlayer bug | 153 | xine_open( m_xine, QFile::encodeName(str.utf8() ).data() ); |
147 | //f (str.right(1) == QString::fromLatin1("/") ) | 154 | return xine_play( m_xine, startPos, start_time); |
148 | // str = str.mid( str.length() -1 ); | ||
149 | return xine_play( m_xine, QFile::encodeName(str.utf8() ).data(), | ||
150 | startPos, start_time); | ||
151 | } | 155 | } |
156 | |||
152 | void Lib::stop() { | 157 | void Lib::stop() { |
153 | qDebug("<<<<<<<< STOP IN LIB TRIGGERED >>>>>>>"); | 158 | qDebug("<<<<<<<< STOP IN LIB TRIGGERED >>>>>>>"); |
154 | xine_stop(m_xine ); | 159 | xine_stop( m_xine ); |
155 | } | 160 | } |
156 | void Lib::pause(){ | 161 | |
157 | xine_set_speed( m_xine, SPEED_PAUSE ); | 162 | void Lib::pause() { |
163 | xine_set_param( m_xine, XINE_PARAM_SPEED, XINE_SPEED_PAUSE ); | ||
158 | } | 164 | } |
165 | |||
159 | int Lib::speed() { | 166 | int Lib::speed() { |
160 | return xine_get_speed( m_xine ); | 167 | return xine_get_param ( m_xine, XINE_PARAM_SPEED ); |
161 | } | 168 | } |
169 | |||
162 | void Lib::setSpeed( int speed ) { | 170 | void Lib::setSpeed( int speed ) { |
163 | xine_set_speed( m_xine, speed ); | 171 | xine_set_param ( m_xine, XINE_PARAM_SPEED, speed ); |
164 | } | 172 | } |
165 | int Lib::status(){ | 173 | |
174 | int Lib::status() { | ||
166 | return xine_get_status( m_xine ); | 175 | return xine_get_status( m_xine ); |
167 | } | 176 | } |
168 | int Lib::currentPosition(){ | 177 | |
169 | return xine_get_current_position( m_xine ); | 178 | int Lib::currentPosition() { |
179 | xine_get_pos_length( m_xine, &m_pos, &m_time, &m_length ); | ||
180 | return m_pos; | ||
181 | } | ||
182 | |||
183 | int Lib::currentTime() { | ||
184 | xine_get_pos_length( m_xine, &m_pos, &m_time, &m_length ); | ||
185 | return m_time/1000; | ||
170 | } | 186 | } |
171 | int Lib::currentTime() { | 187 | |
172 | return xine_get_current_time( m_xine ); | ||
173 | }; | ||
174 | int Lib::length() { | 188 | int Lib::length() { |
175 | return xine_get_stream_length( m_xine ); | 189 | xine_get_pos_length( m_xine, &m_pos, &m_time, &m_length ); |
190 | return m_length/1000; | ||
176 | } | 191 | } |
192 | |||
177 | bool Lib::isSeekable() { | 193 | bool Lib::isSeekable() { |
178 | return xine_is_stream_seekable(m_xine); | 194 | return xine_get_stream_info ( m_xine, XINE_STREAM_INFO_SEEKABLE ); |
179 | } | 195 | } |
196 | |||
180 | Frame Lib::currentFrame() { | 197 | Frame Lib::currentFrame() { |
181 | Frame frame; | 198 | Frame frame; |
182 | return frame; | 199 | return frame; |
183 | }; | 200 | }; |
201 | |||
202 | QString Lib::metaInfo() { | ||
203 | xine_get_meta_info( m_xine, 0 ); | ||
204 | } | ||
205 | |||
184 | int Lib::error() { | 206 | int Lib::error() { |
185 | return xine_get_error( m_xine ); | 207 | return xine_get_error( m_xine ); |
186 | }; | 208 | }; |
209 | |||
187 | void Lib::handleXineEvent( xine_event_t* t ) { | 210 | void Lib::handleXineEvent( xine_event_t* t ) { |
188 | if ( t->type == XINE_EVENT_PLAYBACK_FINISHED ) | 211 | if ( t->type == XINE_EVENT_PLAYBACK_FINISHED ) { |
189 | emit stopped(); | 212 | emit stopped(); |
213 | } | ||
190 | } | 214 | } |
215 | |||
216 | |||
191 | void Lib::setShowVideo( bool video ) { | 217 | void Lib::setShowVideo( bool video ) { |
192 | m_video = video; | 218 | m_video = video; |
193 | ::null_set_show_video( m_videoOutput, video ); | 219 | ::null_set_show_video( m_videoOutput, video ); |
194 | } | 220 | } |
221 | |||
195 | bool Lib::isShowingVideo() { | 222 | bool Lib::isShowingVideo() { |
196 | return ::null_is_showing_video( m_videoOutput ); | 223 | return ::null_is_showing_video( m_videoOutput ); |
197 | } | 224 | } |
225 | |||
198 | void Lib::showVideoFullScreen( bool fullScreen ) { | 226 | void Lib::showVideoFullScreen( bool fullScreen ) { |
199 | ::null_set_fullscreen( m_videoOutput, fullScreen ); | 227 | ::null_set_fullscreen( m_videoOutput, fullScreen ); |
200 | } | 228 | } |
229 | |||
201 | bool Lib::isVideoFullScreen() { | 230 | bool Lib::isVideoFullScreen() { |
202 | return ::null_is_fullscreen( m_videoOutput ); | 231 | return ::null_is_fullscreen( m_videoOutput ); |
203 | } | 232 | } |
233 | |||
204 | void Lib::setScaling( bool scale ) { | 234 | void Lib::setScaling( bool scale ) { |
205 | ::null_set_scaling( m_videoOutput, scale ); | 235 | ::null_set_scaling( m_videoOutput, scale ); |
@@ -214,17 +244,20 @@ bool Lib::isScaling() { | |||
214 | return ::null_is_scaling( m_videoOutput ); | 244 | return ::null_is_scaling( m_videoOutput ); |
215 | } | 245 | } |
246 | |||
216 | void Lib::xine_event_handler( void* user_data, xine_event_t* t ) { | 247 | void Lib::xine_event_handler( void* user_data, xine_event_t* t ) { |
217 | ((Lib*)user_data)->handleXineEvent( t ); | 248 | ( (Lib*)user_data)->handleXineEvent( t ); |
218 | } | 249 | } |
250 | |||
219 | void Lib::xine_display_frame( void* user_data, uint8_t *frame, | 251 | void Lib::xine_display_frame( void* user_data, uint8_t *frame, |
220 | int width, int height, int bytes ) { | 252 | int width, int height, int bytes ) { |
221 | 253 | ( (Lib*)user_data)->drawFrame( frame, width, height, bytes ); | |
222 | ((Lib*)user_data)->drawFrame( frame, width, height, bytes ); | ||
223 | } | 254 | } |
255 | |||
224 | void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) { | 256 | void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) { |
225 | if (!m_video ) { | 257 | if ( !m_video ) { |
226 | qWarning("not showing video now"); | 258 | qWarning("not showing video now"); |
227 | return; | 259 | return; |
228 | } | 260 | } |
261 | |||
229 | // qWarning( "called draw frame %d %d", width, height ); | 262 | // qWarning( "called draw frame %d %d", width, height ); |
230 | 263 | ||
diff --git a/noncore/multimedia/opieplayer2/lib.h b/noncore/multimedia/opieplayer2/lib.h index b9d0a8a..29adc4d 100644 --- a/noncore/multimedia/opieplayer2/lib.h +++ b/noncore/multimedia/opieplayer2/lib.h | |||
@@ -40,4 +40,5 @@ | |||
40 | 40 | ||
41 | #include <xine.h> | 41 | #include <xine.h> |
42 | //#include "xine.h" | ||
42 | 43 | ||
43 | class XineVideoWidget; | 44 | class XineVideoWidget; |
@@ -73,5 +74,15 @@ namespace XINE { | |||
73 | 74 | ||
74 | int speed() /*const*/; | 75 | int speed() /*const*/; |
75 | void setSpeed( int speed = SPEED_PAUSE ); | 76 | |
77 | /** | ||
78 | * Set the speed of the stream, if codec supports it | ||
79 | * XINE_SPEED_PAUSE 0 | ||
80 | * XINE_SPEED_SLOW_4 1 | ||
81 | * XINE_SPEED_SLOW_2 2 | ||
82 | * XINE_SPEED_NORMAL 4 | ||
83 | * XINE_SPEED_FAST_2 8 | ||
84 | *XINE_SPEED_FAST_4 16 | ||
85 | */ | ||
86 | void setSpeed( int speed = XINE_SPEED_PAUSE ); | ||
76 | 87 | ||
77 | int status() /*const*/; | 88 | int status() /*const*/; |
@@ -104,4 +115,11 @@ namespace XINE { | |||
104 | bool isVideoFullScreen()/*const*/ ; | 115 | bool isVideoFullScreen()/*const*/ ; |
105 | 116 | ||
117 | |||
118 | /** | ||
119 | * Get the meta info (like author etc) from the stream | ||
120 | * | ||
121 | */ | ||
122 | QString metaInfo() ; | ||
123 | |||
106 | /** | 124 | /** |
107 | * | 125 | * |
@@ -134,10 +152,12 @@ namespace XINE { | |||
134 | private: | 152 | private: |
135 | int m_bytes_per_pixel; | 153 | int m_bytes_per_pixel; |
154 | int m_length, m_pos, m_time; | ||
155 | int m_major_version, m_minor_version, m_sub_version; | ||
136 | bool m_video:1; | 156 | bool m_video:1; |
137 | XineVideoWidget *m_wid; | 157 | XineVideoWidget *m_wid; |
138 | xine_t *m_xine; | 158 | xine_t *m_xine; |
139 | config_values_t *m_config; | 159 | xine_cfg_entry_t *m_config; |
140 | vo_driver_t *m_videoOutput; | 160 | xine_vo_driver_t *m_videoOutput; |
141 | ao_driver_t* m_audioOutput; | 161 | xine_ao_driver_t* m_audioOutput; |
142 | 162 | ||
143 | void handleXineEvent( xine_event_t* t ); | 163 | void handleXineEvent( xine_event_t* t ); |
diff --git a/noncore/multimedia/opieplayer2/nullvideo.c b/noncore/multimedia/opieplayer2/nullvideo.c index ceda333..dcdfae6 100644 --- a/noncore/multimedia/opieplayer2/nullvideo.c +++ b/noncore/multimedia/opieplayer2/nullvideo.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> | 4 | Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> |
5 | Copyright (c) 2002 L. Potter <ljp@llornkcor.com> | 5 | Copyright (c) 2002 LJP <> |
6 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> | 6 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> |
7 | =. | 7 | =. |
@@ -20,9 +20,9 @@ | |||
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
22 | ..}^=.= = ; General Public License for more | 22 | ..}^=.= = ; Library General Public License for more |
23 | ++= -. .` .: details. | 23 | ++= -. .` .: details. |
24 | : = ...= . :.=- | 24 | : = ...= . :.=- |
25 | -. .:....=;==+<; You should have received a copy of the GNU | 25 | -. .:....=;==+<; You should have received a copy of the GNU |
26 | -_. . . )=. = General Public License along with | 26 | -_. . . )=. = Library General Public License along with |
27 | -- :-=` this library; see the file COPYING.LIB. | 27 | -- :-=` this library; see the file COPYING.LIB. |
28 | If not, write to the Free Software Foundation, | 28 | If not, write to the Free Software Foundation, |
@@ -32,5 +32,4 @@ | |||
32 | */ | 32 | */ |
33 | 33 | ||
34 | /*#include <xine.h>*/ | ||
35 | #include <stdlib.h> | 34 | #include <stdlib.h> |
36 | #include <stdio.h> | 35 | #include <stdio.h> |
@@ -38,8 +37,9 @@ | |||
38 | #include <math.h> | 37 | #include <math.h> |
39 | 38 | ||
39 | #include <xine.h> | ||
40 | #include <xine/video_out.h> | 40 | #include <xine/video_out.h> |
41 | #include <xine/xine_internal.h> | 41 | #include <xine/xine_internal.h> |
42 | #include <xine/xineutils.h> | 42 | #include <xine/xineutils.h> |
43 | #include <xine/configfile.h> | 43 | #include <xine/vo_scale.h> |
44 | 44 | ||
45 | #include <pthread.h> | 45 | #include <pthread.h> |
@@ -49,4 +49,8 @@ | |||
49 | #define printf(x,...) | 49 | #define printf(x,...) |
50 | 50 | ||
51 | /* | ||
52 | #define LOG | ||
53 | */ | ||
54 | |||
51 | /* the caller for our event draw handler */ | 55 | /* the caller for our event draw handler */ |
52 | typedef void (*display_xine_frame_t) (void *user_data, uint8_t* frame, | 56 | typedef void (*display_xine_frame_t) (void *user_data, uint8_t* frame, |
@@ -56,82 +60,75 @@ typedef struct null_driver_s null_driver_t; | |||
56 | 60 | ||
57 | struct null_driver_s { | 61 | struct null_driver_s { |
58 | vo_driver_t vo_driver; | 62 | xine_vo_driver_t vo_driver; |
59 | uint32_t m_capabilities; | 63 | |
60 | int m_show_video; | 64 | uint32_t m_capabilities; |
61 | int m_video_fullscreen; | 65 | int m_show_video; |
62 | int m_is_scaling; | 66 | int m_video_fullscreen; |
63 | int depth, bpp, bytes_per_pixel; | 67 | int m_is_scaling; |
64 | int yuv2rgb_mode; | 68 | |
65 | int yuv2rgb_swap; | 69 | int depth, bpp, bytes_per_pixel; |
66 | int yuv2rgb_gamma; | 70 | int yuv2rgb_mode; |
67 | uint8_t *yuv2rgb_cmap; | 71 | int yuv2rgb_swap; |
68 | yuv2rgb_factory_t *yuv2rgb_factory; | 72 | int yuv2rgb_gamma; |
69 | vo_overlay_t *overlay; | 73 | uint8_t *yuv2rgb_cmap; |
70 | int user_ratio; | 74 | yuv2rgb_factory_t *yuv2rgb_factory; |
71 | double output_scale_factor; | 75 | |
72 | int last_frame_output_width; | 76 | vo_overlay_t *overlay; |
73 | int last_frame_output_height; | 77 | vo_scale_t sc; |
74 | int gui_width; | 78 | |
75 | int gui_height; | 79 | int gui_width; |
76 | int gui_changed; | 80 | int gui_height; |
77 | double display_ratio; | 81 | int gui_changed; |
78 | void* caller; | 82 | |
79 | display_xine_frame_t frameDis; | 83 | double display_ratio; |
80 | 84 | void* caller; | |
81 | 85 | display_xine_frame_t frameDis; | |
82 | }; | 86 | }; |
87 | |||
83 | typedef struct opie_frame_s opie_frame_t; | 88 | typedef struct opie_frame_s opie_frame_t; |
84 | struct opie_frame_s { | 89 | struct opie_frame_s { |
85 | vo_frame_t frame; | 90 | vo_frame_t frame; |
86 | char* name; | 91 | |
87 | int version; | 92 | int format; |
88 | int width; | 93 | int flags; |
89 | int height; | 94 | |
90 | int ratio_code; | 95 | vo_scale_t sc; |
91 | int format; | 96 | |
92 | int flags; | 97 | uint8_t *chunk[3]; |
93 | int user_ratio; | ||
94 | |||
95 | double ratio_factor; | ||
96 | int ideal_width; | ||
97 | int ideal_height; | ||
98 | int output_width, output_height; | ||
99 | int gui_width, gui_height; | ||
100 | uint8_t *chunk[3]; | ||
101 | |||
102 | yuv2rgb_t *yuv2rgb; | ||
103 | uint8_t *rgb_dst; | ||
104 | int yuv_stride; | ||
105 | int stripe_height, stripe_inc; | ||
106 | |||
107 | int bytes_per_line; | ||
108 | uint8_t *data; | ||
109 | 98 | ||
110 | // int show_video; | 99 | uint8_t *data; /* rgb */ |
111 | null_driver_t *output; | 100 | int bytes_per_line; |
101 | |||
102 | yuv2rgb_t *yuv2rgb; | ||
103 | uint8_t *rgb_dst; | ||
104 | int yuv_stride; | ||
105 | int stripe_height, stripe_inc; | ||
106 | |||
107 | null_driver_t *output; | ||
112 | }; | 108 | }; |
113 | 109 | ||
114 | static uint32_t null_get_capabilities(vo_driver_t *self ){ | 110 | static uint32_t null_get_capabilities( xine_vo_driver_t *self ){ |
115 | null_driver_t* this = (null_driver_t*)self; | 111 | null_driver_t* this = (null_driver_t*)self; |
116 | printf("capabilities\n"); | 112 | return this->m_capabilities; |
117 | return this->m_capabilities; | ||
118 | } | 113 | } |
119 | 114 | ||
120 | static void null_frame_copy (vo_frame_t *vo_img, uint8_t **src) { | 115 | static void null_frame_copy (vo_frame_t *vo_img, uint8_t **src) { |
121 | opie_frame_t *frame = (opie_frame_t *) vo_img ; | 116 | opie_frame_t *frame = (opie_frame_t *) vo_img ; |
122 | printf("frame copy\n"); | ||
123 | if(!frame->output->m_show_video ){ printf("no video\n"); return; } // no video | ||
124 | 117 | ||
125 | if (frame->format == IMGFMT_YV12) { | 118 | if (!frame->output->m_show_video) { |
126 | frame->yuv2rgb->yuv2rgb_fun (frame->yuv2rgb, frame->rgb_dst, | 119 | /* printf("nullvideo: no video\n"); */ |
127 | src[0], src[1], src[2]); | 120 | return; |
121 | } | ||
122 | |||
123 | if (frame->format == XINE_IMGFMT_YV12) { | ||
124 | frame->yuv2rgb->yuv2rgb_fun (frame->yuv2rgb, frame->rgb_dst, | ||
125 | src[0], src[1], src[2]); | ||
128 | } else { | 126 | } else { |
129 | 127 | ||
130 | frame->yuv2rgb->yuy22rgb_fun (frame->yuv2rgb, frame->rgb_dst, | 128 | frame->yuv2rgb->yuy22rgb_fun (frame->yuv2rgb, frame->rgb_dst, |
131 | src[0]); | 129 | src[0]); |
132 | } | 130 | } |
133 | 131 | ||
134 | frame->rgb_dst += frame->stripe_inc; | 132 | frame->rgb_dst += frame->stripe_inc; |
135 | printf("returning\n"); | ||
136 | } | 133 | } |
137 | 134 | ||
@@ -139,5 +136,4 @@ static void null_frame_field (vo_frame_t *vo_img, int which_field) { | |||
139 | 136 | ||
140 | opie_frame_t *frame = (opie_frame_t *) vo_img ; | 137 | opie_frame_t *frame = (opie_frame_t *) vo_img ; |
141 | printf("field\n\n"); | ||
142 | 138 | ||
143 | switch (which_field) { | 139 | switch (which_field) { |
@@ -159,317 +155,210 @@ static void null_frame_field (vo_frame_t *vo_img, int which_field) { | |||
159 | /* take care of the frame*/ | 155 | /* take care of the frame*/ |
160 | static void null_frame_dispose( vo_frame_t* vo_img){ | 156 | static void null_frame_dispose( vo_frame_t* vo_img){ |
161 | opie_frame_t* frame = (opie_frame_t*)vo_img; | 157 | opie_frame_t* frame = (opie_frame_t*)vo_img; |
162 | printf("frame_dispose\n"); | ||
163 | if( frame->data ) | ||
164 | free( frame->data ); | ||
165 | free (frame); | ||
166 | } | ||
167 | |||
168 | /* end take care of frames*/ | ||
169 | |||
170 | static vo_frame_t* null_alloc_frame( vo_driver_t* self ){ | ||
171 | null_driver_t* this = (null_driver_t*)self; | ||
172 | opie_frame_t* frame; | ||
173 | frame = (opie_frame_t*)malloc ( sizeof(opie_frame_t) ); | ||
174 | |||
175 | memset( frame, 0, sizeof( opie_frame_t) ); | ||
176 | pthread_mutex_init (&frame->frame.mutex, NULL); | ||
177 | |||
178 | printf("alloc_frame\n"); | ||
179 | frame->name = "opie\0"; | ||
180 | frame->version = 1; | ||
181 | frame->output = this; | ||
182 | // frame->show_video = this->m_show_video; | ||
183 | /* initialize the frame*/ | ||
184 | frame->frame.driver = self; | ||
185 | /*frame.frame.free = null_frame_free;*/ | ||
186 | frame->frame.copy = null_frame_copy; | ||
187 | frame->frame.field = null_frame_field; | ||
188 | frame->frame.dispose = null_frame_dispose; | ||
189 | frame->yuv2rgb = 0; | ||
190 | /* | ||
191 | * colorspace converter for this frame | ||
192 | */ | ||
193 | frame->yuv2rgb = this->yuv2rgb_factory->create_converter (this->yuv2rgb_factory); | ||
194 | |||
195 | 158 | ||
196 | return (vo_frame_t*) frame; | 159 | if (frame->data) |
160 | free( frame->data ); | ||
161 | free (frame); | ||
197 | } | 162 | } |
198 | 163 | ||
199 | // size specific | 164 | /* end take care of frames*/ |
200 | static void null_compute_ideal_size (null_driver_t *this, opie_frame_t *frame) { | ||
201 | 165 | ||
202 | if (!this->m_is_scaling /*|| !this->m_show_video*/) { | 166 | static vo_frame_t* null_alloc_frame( xine_vo_driver_t* self ){ |
203 | printf("Not scaling\n"); | ||
204 | frame->ideal_width = frame->width; | ||
205 | frame->ideal_height = frame->height; | ||
206 | frame->ratio_factor = 1.0; | ||
207 | 167 | ||
208 | } else { | 168 | null_driver_t* this = (null_driver_t*)self; |
209 | 169 | opie_frame_t* frame; | |
210 | double image_ratio, desired_ratio, corr_factor; | ||
211 | |||
212 | image_ratio = (double) frame->width / (double) frame->height; | ||
213 | |||
214 | switch (frame->user_ratio) { | ||
215 | case ASPECT_AUTO: | ||
216 | switch (frame->ratio_code) { | ||
217 | case XINE_ASPECT_RATIO_ANAMORPHIC: /* anamorphic */ | ||
218 | case XINE_ASPECT_RATIO_PAN_SCAN: | ||
219 | desired_ratio = 16.0 /9.0; | ||
220 | break; | ||
221 | case XINE_ASPECT_RATIO_211_1: /* 2.11:1 */ | ||
222 | desired_ratio = 2.11/1.0; | ||
223 | break; | ||
224 | case XINE_ASPECT_RATIO_SQUARE: /* square pels */ | ||
225 | case XINE_ASPECT_RATIO_DONT_TOUCH: /* probably non-mpeg stream => don't touch aspect ratio */ | ||
226 | desired_ratio = image_ratio; | ||
227 | break; | ||
228 | case 0: /* forbidden -> 4:3 */ | ||
229 | printf ("video_out_fb: invalid ratio, using 4:3\n"); | ||
230 | default: | ||
231 | printf ("video_out_fb: unknown aspect ratio (%d) in stream => using 4:3\n", | ||
232 | frame->ratio_code); | ||
233 | case XINE_ASPECT_RATIO_4_3: /* 4:3 */ | ||
234 | desired_ratio = 4.0 / 3.0; | ||
235 | break; | ||
236 | } | ||
237 | break; | ||
238 | case ASPECT_ANAMORPHIC: | ||
239 | desired_ratio = 16.0 / 9.0; | ||
240 | break; | ||
241 | case ASPECT_DVB: | ||
242 | desired_ratio = 2.0 / 1.0; | ||
243 | break; | ||
244 | case ASPECT_SQUARE: | ||
245 | desired_ratio = image_ratio; | ||
246 | break; | ||
247 | case ASPECT_FULL: | ||
248 | default: | ||
249 | desired_ratio = 4.0 / 3.0; | ||
250 | } | ||
251 | |||
252 | frame->ratio_factor = this->display_ratio * desired_ratio; | ||
253 | |||
254 | corr_factor = frame->ratio_factor / image_ratio ; | ||
255 | |||
256 | if (fabs(corr_factor - 1.0) < 0.005) { | ||
257 | frame->ideal_width = frame->width; | ||
258 | frame->ideal_height = frame->height; | ||
259 | |||
260 | } else { | ||
261 | |||
262 | if (corr_factor >= 1.0) { | ||
263 | frame->ideal_width = frame->width * corr_factor + 0.5; | ||
264 | frame->ideal_height = frame->height; | ||
265 | } else { | ||
266 | frame->ideal_width = frame->width; | ||
267 | frame->ideal_height = frame->height / corr_factor + 0.5; | ||
268 | } | ||
269 | |||
270 | } | ||
271 | } | ||
272 | printf("return from helper\n"); | ||
273 | } | ||
274 | 170 | ||
275 | static void null_compute_rgb_size (null_driver_t *this, opie_frame_t *frame) { | 171 | #ifdef LOG |
172 | fprintf (stderr, "nullvideo: alloc_frame\n"); | ||
173 | #endif | ||
276 | 174 | ||
277 | double x_factor, y_factor; | 175 | frame = (opie_frame_t*)malloc ( sizeof(opie_frame_t) ); |
278 | |||
279 | /* | ||
280 | * make the frame fit into the given destination area | ||
281 | */ | ||
282 | 176 | ||
283 | x_factor = (double) this->gui_width / (double) frame->ideal_width; | 177 | memset( frame, 0, sizeof( opie_frame_t) ); |
284 | y_factor = (double) this->gui_height / (double) frame->ideal_height; | 178 | memcpy (&frame->sc, &this->sc, sizeof(vo_scale_t)); |
285 | 179 | ||
286 | if ( x_factor < y_factor ) { | 180 | pthread_mutex_init (&frame->frame.mutex, NULL); |
287 | frame->output_width = (double) frame->ideal_width * x_factor ; | 181 | |
288 | frame->output_height = (double) frame->ideal_height * x_factor ; | 182 | frame->output = this; |
289 | } else { | 183 | |
290 | frame->output_width = (double) frame->ideal_width * y_factor ; | 184 | /* initialize the frame*/ |
291 | frame->output_height = (double) frame->ideal_height * y_factor ; | 185 | frame->frame.driver = self; |
292 | } | 186 | frame->frame.copy = null_frame_copy; |
187 | frame->frame.field = null_frame_field; | ||
188 | frame->frame.dispose = null_frame_dispose; | ||
189 | |||
190 | /* | ||
191 | * colorspace converter for this frame | ||
192 | */ | ||
193 | frame->yuv2rgb = this->yuv2rgb_factory->create_converter (this->yuv2rgb_factory); | ||
194 | |||
195 | return (vo_frame_t*) frame; | ||
196 | } | ||
197 | |||
198 | static void null_update_frame_format( xine_vo_driver_t* self, vo_frame_t* img, | ||
199 | uint32_t width, uint32_t height, | ||
200 | int ratio_code, int format, int flags ){ | ||
201 | null_driver_t* this = (null_driver_t*) self; | ||
202 | opie_frame_t* frame = (opie_frame_t*)img; | ||
203 | /* not needed now */ | ||
293 | 204 | ||
294 | #define LOG 1 | ||
295 | #ifdef LOG | 205 | #ifdef LOG |
296 | printf("video_out_fb: frame source %d x %d => screen output %d x %d%s\n", | 206 | fprintf (stderr, "nullvideo: update_frame_format\n"); |
297 | frame->width, frame->height, | ||
298 | frame->output_width, frame->output_height, | ||
299 | ( frame->width != frame->output_width | ||
300 | || frame->height != frame->output_height | ||
301 | ? ", software scaling" | ||
302 | : "" ) | ||
303 | ); | ||
304 | #endif | 207 | #endif |
305 | } | ||
306 | 208 | ||
209 | flags &= VO_BOTH_FIELDS; | ||
210 | |||
211 | /* find out if we need to adapt this frame */ | ||
212 | |||
213 | if ((width != frame->sc.delivered_width) | ||
214 | || (height != frame->sc.delivered_height) | ||
215 | || (ratio_code != frame->sc.delivered_ratio_code) | ||
216 | || (flags != frame->flags) | ||
217 | || (format != frame->format) | ||
218 | || (this->sc.user_ratio != frame->sc.user_ratio) | ||
219 | || (this->gui_width != frame->sc.gui_width) | ||
220 | || (this->gui_height != frame->sc.gui_height)) { | ||
221 | |||
222 | frame->sc.delivered_width = width; | ||
223 | frame->sc.delivered_height = height; | ||
224 | frame->sc.delivered_ratio_code = ratio_code; | ||
225 | frame->flags = flags; | ||
226 | frame->format = format; | ||
227 | frame->sc.user_ratio = this->sc.user_ratio; | ||
228 | frame->sc.gui_width = this->gui_width; | ||
229 | frame->sc.gui_height = this->gui_height; | ||
230 | frame->sc.gui_pixel_aspect = 1.0; | ||
231 | |||
232 | vo_scale_compute_ideal_size ( &frame->sc ); | ||
233 | vo_scale_compute_output_size( &frame->sc ); | ||
234 | |||
235 | #ifdef LOG | ||
236 | fprintf (stderr, "nullvideo: gui %dx%d delivered %dx%d output %dx%d\n", | ||
237 | frame->sc.gui_width, frame->sc.gui_height, | ||
238 | frame->sc.delivered_width, frame->sc.delivered_height, | ||
239 | frame->sc.output_width, frame->sc.output_height); | ||
240 | #endif | ||
241 | |||
242 | /* | ||
243 | * (re-) allocate | ||
244 | */ | ||
245 | if( frame->data ) { | ||
246 | if( frame->chunk[0] ){ | ||
247 | free( frame->chunk[0] ); | ||
248 | frame->chunk[0] = NULL; | ||
249 | } | ||
250 | if( frame->chunk[1] ){ | ||
251 | free ( frame->chunk[1] ); | ||
252 | frame->chunk[1] = NULL; | ||
253 | } | ||
254 | if( frame->chunk[2] ){ | ||
255 | free ( frame->chunk[2] ); | ||
256 | frame->chunk[2] = NULL; | ||
257 | } | ||
258 | free ( frame->data ); | ||
259 | } | ||
307 | 260 | ||
308 | // size specific | 261 | frame->data = xine_xmalloc (frame->sc.output_width |
262 | * frame->sc.output_height | ||
263 | * this->bytes_per_pixel ); | ||
309 | 264 | ||
265 | if( format == XINE_IMGFMT_YV12 ) { | ||
266 | frame->frame.pitches[0] = 8*((width + 7) / 8); | ||
267 | frame->frame.pitches[1] = 8*((width + 15) / 16); | ||
268 | frame->frame.pitches[2] = 8*((width + 15) / 16); | ||
269 | frame->frame.base[0] = xine_xmalloc_aligned (16, frame->frame.pitches[0] * height,(void **)&frame->chunk[0]); | ||
270 | frame->frame.base[1] = xine_xmalloc_aligned (16, frame->frame.pitches[1] * ((height+ 1)/2), (void **)&frame->chunk[1]); | ||
271 | frame->frame.base[2] = xine_xmalloc_aligned (16, frame->frame.pitches[2] * ((height+ 1)/2), (void **)&frame->chunk[2]); | ||
310 | 272 | ||
311 | static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, | 273 | }else{ |
312 | uint32_t width, uint32_t height, | 274 | frame->frame.pitches[0] = 8*((width + 3) / 4); |
313 | int ratio_code, int format, int flags ){ | ||
314 | null_driver_t* this = (null_driver_t*) self; | ||
315 | opie_frame_t* frame = (opie_frame_t*)img; | ||
316 | /* not needed now */ | ||
317 | printf("update_frame_format\n"); | ||
318 | printf("al crash aye?\n"); | ||
319 | |||
320 | flags &= VO_BOTH_FIELDS; | ||
321 | |||
322 | /* find out if we need to adapt this frame */ | ||
323 | |||
324 | if ((width != frame->width) | ||
325 | || (height != frame->height) | ||
326 | || (ratio_code != frame->ratio_code) | ||
327 | || (flags != frame->flags) | ||
328 | || (format != frame->format) | ||
329 | || (this->user_ratio != frame->user_ratio) | ||
330 | || (this->gui_width != frame-> gui_width ) | ||
331 | || (this-> gui_height != frame-> gui_height)) { | ||
332 | |||
333 | frame->width = width; | ||
334 | frame->height = height; | ||
335 | frame->ratio_code = ratio_code; | ||
336 | frame->flags = flags; | ||
337 | frame->format = format; | ||
338 | frame->user_ratio = this->user_ratio; | ||
339 | this->gui_changed = 0; | ||
340 | //frame->show_video = this->m_show_video; | ||
341 | frame->gui_width = this->gui_width; | ||
342 | frame->gui_height = this->gui_height; | ||
343 | |||
344 | null_compute_ideal_size (this, frame); | ||
345 | null_compute_rgb_size (this, frame); | ||
346 | |||
347 | /* | ||
348 | * (re-) allocate | ||
349 | */ | ||
350 | if( frame->data ) { | ||
351 | if(frame->chunk[0] ){ | ||
352 | free( frame->chunk[0] ); | ||
353 | frame->chunk[0] = NULL; | ||
354 | } | ||
355 | if(frame->chunk[1] ){ | ||
356 | free ( frame->chunk[1] ); | ||
357 | frame->chunk[1] = NULL; | ||
358 | } | ||
359 | if(frame->chunk[2] ){ | ||
360 | free ( frame->chunk[2] ); | ||
361 | frame->chunk[2] = NULL; | ||
362 | } | ||
363 | free ( frame->data ); | ||
364 | } | ||
365 | printf("after freeing\n"); | ||
366 | frame->data = xine_xmalloc (frame->output_width * frame->output_height * | ||
367 | this->bytes_per_pixel ); | ||
368 | |||
369 | if( format == IMGFMT_YV12 ) { | ||
370 | frame->frame.pitches[0] = 8*((width + 7) / 8); | ||
371 | frame->frame.pitches[1] = 8*((width + 15) / 16); | ||
372 | frame->frame.pitches[2] = 8*((width + 15) / 16); | ||
373 | frame->frame.base[0] = xine_xmalloc_aligned (16, frame->frame.pitches[0] * height,(void **)&frame->chunk[0]); | ||
374 | frame->frame.base[1] = xine_xmalloc_aligned (16, frame->frame.pitches[1] * ((height+ 1)/2), (void **)&frame->chunk[1]); | ||
375 | frame->frame.base[2] = xine_xmalloc_aligned (16, frame->frame.pitches[2] * ((height+ 1)/2), (void **)&frame->chunk[2]); | ||
376 | |||
377 | }else{ | ||
378 | frame->frame.pitches[0] = 8*((width + 3) / 4); | ||
379 | 275 | ||
380 | frame->frame.base[0] = xine_xmalloc_aligned (16, frame->frame.pitches[0] * height, | 276 | frame->frame.base[0] = xine_xmalloc_aligned (16, frame->frame.pitches[0] * height, |
381 | (void **)&frame->chunk[0]); | 277 | (void **)&frame->chunk[0]); |
382 | frame->chunk[1] = NULL; | 278 | frame->chunk[1] = NULL; |
383 | frame->chunk[2] = NULL; | 279 | frame->chunk[2] = NULL; |
384 | } | ||
385 | |||
386 | frame->format = format; | ||
387 | frame->width = width; | ||
388 | frame->height = height; | ||
389 | |||
390 | frame->stripe_height = 16 * frame->output_height / frame->height; | ||
391 | frame->bytes_per_line = frame->output_width * this->bytes_per_pixel; | ||
392 | |||
393 | /* | ||
394 | * set up colorspace converter | ||
395 | */ | ||
396 | if(1 /*this->m_show_video*/ ){ | ||
397 | printf("showing video\n"); | ||
398 | |||
399 | switch (flags) { | ||
400 | case VO_TOP_FIELD: | ||
401 | case VO_BOTTOM_FIELD: | ||
402 | frame->yuv2rgb->configure (frame->yuv2rgb, | ||
403 | frame->width, | ||
404 | 16, | ||
405 | 2*frame->frame.pitches[0], | ||
406 | 2*frame->frame.pitches[1], | ||
407 | frame->output_width, | ||
408 | frame->stripe_height, | ||
409 | frame->bytes_per_line*2); | ||
410 | frame->yuv_stride = frame->bytes_per_line*2; | ||
411 | break; | ||
412 | case VO_BOTH_FIELDS: | ||
413 | frame->yuv2rgb->configure (frame->yuv2rgb, | ||
414 | frame->width, | ||
415 | 16, | ||
416 | frame->frame.pitches[0], | ||
417 | frame->frame.pitches[1], | ||
418 | frame->output_width, | ||
419 | frame->stripe_height, | ||
420 | frame->bytes_per_line); | ||
421 | frame->yuv_stride = frame->bytes_per_line; | ||
422 | break; | ||
423 | } | ||
424 | } | ||
425 | } | 280 | } |
426 | printf("after gui changed\n"); | 281 | |
427 | /* | 282 | frame->stripe_height = 16 * frame->sc.output_height / frame->sc.delivered_height; |
428 | * reset dest pointers | 283 | frame->bytes_per_line = frame->sc.output_width * this->bytes_per_pixel; |
284 | |||
285 | /* | ||
286 | * set up colorspace converter | ||
429 | */ | 287 | */ |
430 | 288 | ||
431 | if (frame->data) { | 289 | switch (flags) { |
432 | switch (flags) { | 290 | case VO_TOP_FIELD: |
433 | case VO_TOP_FIELD: | 291 | case VO_BOTTOM_FIELD: |
434 | frame->rgb_dst = (uint8_t *)frame->data; | 292 | frame->yuv2rgb->configure (frame->yuv2rgb, |
435 | frame->stripe_inc = 2 * frame->stripe_height * frame->bytes_per_line; | 293 | frame->sc.delivered_width, |
436 | break; | 294 | 16, |
437 | case VO_BOTTOM_FIELD: | 295 | 2*frame->frame.pitches[0], |
438 | frame->rgb_dst = (uint8_t *)frame->data + frame->bytes_per_line ; | 296 | 2*frame->frame.pitches[1], |
439 | frame->stripe_inc = 2 * frame->stripe_height * frame->bytes_per_line; | 297 | frame->sc.output_width, |
440 | break; | 298 | frame->stripe_height, |
441 | case VO_BOTH_FIELDS: | 299 | frame->bytes_per_line*2); |
442 | frame->rgb_dst = (uint8_t *)frame->data; | 300 | frame->yuv_stride = frame->bytes_per_line*2; |
443 | frame->stripe_inc = frame->stripe_height * frame->bytes_per_line; | 301 | break; |
444 | break; | 302 | case VO_BOTH_FIELDS: |
445 | } | 303 | frame->yuv2rgb->configure (frame->yuv2rgb, |
446 | } | 304 | frame->sc.delivered_width, |
447 | printf("done\n"); | 305 | 16, |
448 | } | 306 | frame->frame.pitches[0], |
449 | static void null_display_frame( vo_driver_t* self, vo_frame_t *frame_gen ){ | 307 | frame->frame.pitches[1], |
450 | null_driver_t* this = (null_driver_t*) self; | 308 | frame->sc.output_width, |
451 | opie_frame_t* frame = (opie_frame_t*)frame_gen; | 309 | frame->stripe_height, |
452 | display_xine_frame_t display = this->frameDis; | 310 | frame->bytes_per_line); |
453 | 311 | frame->yuv_stride = frame->bytes_per_line; | |
454 | printf("display frame\n"); | 312 | break; |
455 | // if( this->m_show_video ) { // return if not displaying | 313 | } |
456 | printf("calling home aye\n" ); | 314 | #ifdef LOG |
457 | if( display != NULL ) { | 315 | fprintf (stderr, "nullvideo: colorspace converter configured.\n"); |
458 | (*display)(this->caller, frame->data, | 316 | #endif |
459 | frame->output_width, frame->output_height, | 317 | } |
460 | frame->bytes_per_line ); | 318 | |
461 | printf("display done hope you enyoyed the frame"); | 319 | /* |
462 | } | 320 | * reset dest pointers |
463 | // } | 321 | */ |
464 | 322 | ||
465 | frame->frame.displayed (&frame->frame); | 323 | if (frame->data) { |
324 | switch (flags) { | ||
325 | case VO_TOP_FIELD: | ||
326 | frame->rgb_dst = (uint8_t *)frame->data; | ||
327 | frame->stripe_inc = 2 * frame->stripe_height * frame->bytes_per_line; | ||
328 | break; | ||
329 | case VO_BOTTOM_FIELD: | ||
330 | frame->rgb_dst = (uint8_t *)frame->data + frame->bytes_per_line ; | ||
331 | frame->stripe_inc = 2 * frame->stripe_height * frame->bytes_per_line; | ||
332 | break; | ||
333 | case VO_BOTH_FIELDS: | ||
334 | frame->rgb_dst = (uint8_t *)frame->data; | ||
335 | frame->stripe_inc = frame->stripe_height * frame->bytes_per_line; | ||
336 | break; | ||
337 | } | ||
338 | } | ||
466 | } | 339 | } |
467 | 340 | ||
341 | static void null_display_frame( xine_vo_driver_t* self, vo_frame_t *frame_gen ){ | ||
342 | null_driver_t* this = (null_driver_t*) self; | ||
343 | opie_frame_t* frame = (opie_frame_t*)frame_gen; | ||
344 | display_xine_frame_t display = this->frameDis; | ||
345 | |||
346 | if (!this->m_show_video) | ||
347 | return; | ||
468 | 348 | ||
469 | // blending related | 349 | if( display != NULL ) { |
350 | (*display)(this->caller, frame->data, | ||
351 | frame->sc.output_width, frame->sc.output_height, | ||
352 | frame->bytes_per_line ); | ||
353 | } | ||
354 | |||
355 | frame->frame.displayed (&frame->frame); | ||
356 | } | ||
470 | 357 | ||
471 | 358 | ||
472 | static void null_overlay_clut_yuv2rgb(null_driver_t *this, vo_overlay_t *overlay, | 359 | /* blending related */ |
473 | opie_frame_t *frame) { | 360 | static void null_overlay_clut_yuv2rgb (null_driver_t *this, |
361 | vo_overlay_t *overlay, | ||
362 | opie_frame_t *frame) { | ||
474 | int i; | 363 | int i; |
475 | clut_t* clut = (clut_t*) overlay->color; | 364 | clut_t* clut = (clut_t*) overlay->color; |
@@ -493,122 +382,122 @@ static void null_overlay_clut_yuv2rgb(null_driver_t *this, vo_overlay_t *overla | |||
493 | } | 382 | } |
494 | 383 | ||
495 | static void null_overlay_blend (vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay) { | 384 | static void null_overlay_blend ( xine_vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay) { |
496 | null_driver_t *this = (null_driver_t *) this_gen; | 385 | null_driver_t *this = (null_driver_t *) this_gen; |
497 | opie_frame_t *frame = (opie_frame_t *) frame_gen; | 386 | opie_frame_t *frame = (opie_frame_t *) frame_gen; |
498 | 387 | ||
499 | printf("overlay blend\n"); | 388 | if(!this->m_show_video || frame->sc.output_width == 0 |
500 | if(!this->m_show_video || frame->output_width == 0 || frame->output_height== 0) | 389 | || frame->sc.output_height== 0) |
501 | return; | 390 | return; |
502 | 391 | ||
503 | /* Alpha Blend here */ | 392 | /* Alpha Blend here */ |
504 | if (overlay->rle) { | 393 | if (overlay->rle) { |
505 | if( !overlay->rgb_clut || !overlay->clip_rgb_clut) | 394 | if( !overlay->rgb_clut || !overlay->clip_rgb_clut) |
506 | null_overlay_clut_yuv2rgb(this,overlay,frame); | 395 | null_overlay_clut_yuv2rgb(this,overlay,frame); |
507 | 396 | ||
508 | switch(this->bpp) { | 397 | switch(this->bpp) { |
509 | case 16: | 398 | case 16: |
510 | blend_rgb16( (uint8_t *)frame->data, overlay, | 399 | blend_rgb16( (uint8_t *)frame->data, overlay, |
511 | frame->output_width, frame->output_height, | 400 | frame->sc.output_width, frame->sc.output_height, |
512 | frame->width, frame->height); | 401 | frame->sc.delivered_width, frame->sc.delivered_height); |
513 | break; | 402 | break; |
514 | case 24: | 403 | case 24: |
515 | blend_rgb24( (uint8_t *)frame->data, overlay, | 404 | blend_rgb24( (uint8_t *)frame->data, overlay, |
516 | frame->output_width, frame->output_height, | 405 | frame->sc.output_width, frame->sc.output_height, |
517 | frame->width, frame->height); | 406 | frame->sc.delivered_width, frame->sc.delivered_height); |
518 | break; | 407 | break; |
519 | case 32: | 408 | case 32: |
520 | blend_rgb32( (uint8_t *)frame->data, overlay, | 409 | blend_rgb32( (uint8_t *)frame->data, overlay, |
521 | frame->output_width, frame->output_height, | 410 | frame->sc.output_width, frame->sc.output_height, |
522 | frame->width, frame->height); | 411 | frame->sc.delivered_width, frame->sc.delivered_height); |
523 | break; | 412 | break; |
524 | default: | 413 | default: |
525 | /* It should never get here */ | 414 | /* It should never get here */ |
526 | break; | 415 | break; |
527 | } | 416 | } |
528 | } | 417 | } |
529 | } | 418 | } |
530 | 419 | ||
531 | 420 | ||
532 | static int null_get_property( vo_driver_t* self, | 421 | static int null_get_property( xine_vo_driver_t* self, |
533 | int property ){ | 422 | int property ){ |
534 | printf("property get\n"); | 423 | return 0; |
535 | return 0; | ||
536 | } | 424 | } |
537 | static int null_set_property( vo_driver_t* self, | 425 | static int null_set_property( xine_vo_driver_t* self, |
538 | int property, | 426 | int property, |
539 | int value ){ | 427 | int value ){ |
540 | printf("set property\n"); | 428 | return value; |
541 | return value; | ||
542 | } | 429 | } |
543 | static void null_get_property_min_max( vo_driver_t* self, | 430 | static void null_get_property_min_max( xine_vo_driver_t* self, |
544 | int property, int *min, | 431 | int property, int *min, |
545 | int *max ){ | 432 | int *max ){ |
546 | printf("min max\n"); | 433 | *max = 0; |
547 | *max = 0; | 434 | *min = 0; |
548 | *min = 0; | ||
549 | } | 435 | } |
550 | static int null_gui_data_exchange( vo_driver_t* self, | 436 | static int null_gui_data_exchange( xine_vo_driver_t* self, |
551 | int data_type, | 437 | int data_type, |
552 | void *data ){ | 438 | void *data ){ |
553 | return 0; | 439 | return 0; |
554 | } | 440 | } |
555 | static void null_exit( vo_driver_t* self ){ | 441 | |
556 | null_driver_t* this = (null_driver_t*)self; | 442 | static void null_exit( xine_vo_driver_t* self ){ |
557 | free ( this ); | 443 | null_driver_t* this = (null_driver_t*)self; |
444 | free ( this ); | ||
558 | } | 445 | } |
559 | static int null_redraw_needed( vo_driver_t* self ){ | 446 | static int null_redraw_needed( xine_vo_driver_t* self ){ |
560 | return 0; | 447 | return 0; |
561 | } | 448 | } |
562 | 449 | ||
563 | 450 | ||
564 | vo_driver_t* init_video_out_plugin( config_values_t* conf, | 451 | xine_vo_driver_t* init_video_out_plugin( config_values_t* conf, |
565 | void* video ){ | 452 | void* video ){ |
566 | null_driver_t *vo; | 453 | null_driver_t *vo; |
567 | vo = (null_driver_t*)malloc( sizeof(null_driver_t ) ); | 454 | vo = (null_driver_t*)malloc( sizeof(null_driver_t ) ); |
568 | 455 | ||
569 | /* memset? */ | 456 | /* memset? */ |
570 | memset(vo,0, sizeof(null_driver_t ) ); | 457 | memset(vo,0, sizeof(null_driver_t ) ); |
571 | vo->m_show_video = 0; // false | 458 | |
572 | vo->m_video_fullscreen = 0; | 459 | vo_scale_init (&vo->sc, 0, 0); |
573 | vo->m_is_scaling = 0; | 460 | |
574 | vo->user_ratio = ASPECT_AUTO; | 461 | vo->sc.gui_pixel_aspect = 1.0; |
575 | vo->display_ratio = 1.0; | 462 | |
576 | vo->gui_width = 16; | 463 | vo->m_show_video = 0; // false |
577 | vo->gui_height = 8; | 464 | vo->m_video_fullscreen = 0; |
578 | vo->frameDis = NULL; | 465 | vo->m_is_scaling = 0; |
579 | 466 | vo->display_ratio = 1.0; | |
580 | /* install callback handlers*/ | 467 | vo->gui_width = 16; |
581 | vo->vo_driver.get_capabilities = null_get_capabilities; | 468 | vo->gui_height = 8; |
582 | vo->vo_driver.alloc_frame = null_alloc_frame; | 469 | vo->frameDis = NULL; |
583 | vo->vo_driver.update_frame_format = null_update_frame_format; | 470 | |
584 | vo->vo_driver.display_frame = null_display_frame; | 471 | /* install callback handlers*/ |
585 | vo->vo_driver.overlay_blend = null_overlay_blend; | 472 | vo->vo_driver.get_capabilities = null_get_capabilities; |
586 | vo->vo_driver.get_property = null_get_property; | 473 | vo->vo_driver.alloc_frame = null_alloc_frame; |
587 | vo->vo_driver.set_property = null_set_property; | 474 | vo->vo_driver.update_frame_format = null_update_frame_format; |
588 | vo->vo_driver.get_property_min_max = null_get_property_min_max; | 475 | vo->vo_driver.display_frame = null_display_frame; |
589 | vo->vo_driver.gui_data_exchange = null_gui_data_exchange; | 476 | vo->vo_driver.overlay_blend = null_overlay_blend; |
590 | vo->vo_driver.exit = null_exit; | 477 | vo->vo_driver.get_property = null_get_property; |
591 | vo->vo_driver.redraw_needed = null_redraw_needed; | 478 | vo->vo_driver.set_property = null_set_property; |
479 | vo->vo_driver.get_property_min_max = null_get_property_min_max; | ||
480 | vo->vo_driver.gui_data_exchange = null_gui_data_exchange; | ||
481 | vo->vo_driver.exit = null_exit; | ||
482 | vo->vo_driver.redraw_needed = null_redraw_needed; | ||
592 | 483 | ||
593 | 484 | ||
594 | /* capabilities */ | 485 | /* capabilities */ |
595 | vo->m_capabilities = VO_CAP_COPIES_IMAGE | VO_CAP_YUY2 | VO_CAP_YV12; | 486 | vo->m_capabilities = VO_CAP_COPIES_IMAGE | VO_CAP_YUY2 | VO_CAP_YV12; |
596 | vo->yuv2rgb_factory = yuv2rgb_factory_init (MODE_16_RGB, vo->yuv2rgb_swap, | 487 | vo->yuv2rgb_factory = yuv2rgb_factory_init (MODE_16_RGB, vo->yuv2rgb_swap, |
597 | vo->yuv2rgb_cmap); | 488 | vo->yuv2rgb_cmap); |
598 | printf("done initialisation\n"); | 489 | |
599 | return (vo_driver_t*) vo; | 490 | return ( xine_vo_driver_t*) vo; |
600 | } | 491 | } |
601 | 492 | ||
602 | static vo_info_t vo_info_null = { | 493 | static vo_info_t vo_info_null = { |
603 | 5, | 494 | 5, |
604 | "null plugin", | 495 | "null plugin", |
605 | NULL, | 496 | XINE_VISUAL_TYPE_FB |
606 | VISUAL_TYPE_FB, | ||
607 | 5 | ||
608 | }; | 497 | }; |
609 | 498 | ||
610 | vo_info_t *get_video_out_plugin_info(){ | 499 | vo_info_t *get_video_out_plugin_info(){ |
611 | vo_info_null.description = _("xine video output plugin using null device"); | 500 | vo_info_null.description = _("xine video output plugin using null device"); |
612 | return &vo_info_null; | 501 | return &vo_info_null; |
613 | } | 502 | } |
614 | 503 | ||
@@ -621,93 +510,99 @@ vo_info_t *get_video_out_plugin_info(){ | |||
621 | * | 510 | * |
622 | */ | 511 | */ |
623 | int null_is_showing_video( vo_driver_t* self ){ | 512 | int null_is_showing_video( xine_vo_driver_t* self ){ |
624 | null_driver_t* this = (null_driver_t*)self; | 513 | null_driver_t* this = (null_driver_t*)self; |
625 | return this->m_show_video; | 514 | return this->m_show_video; |
626 | } | 515 | } |
627 | void null_set_show_video( vo_driver_t* self, int show ) { | 516 | void null_set_show_video( xine_vo_driver_t* self, int show ) { |
628 | ((null_driver_t*)self)->m_show_video = show; | 517 | ((null_driver_t*)self)->m_show_video = show; |
629 | } | 518 | } |
630 | 519 | ||
631 | int null_is_fullscreen( vo_driver_t* self ){ | 520 | int null_is_fullscreen( xine_vo_driver_t* self ){ |
632 | return ((null_driver_t*)self)->m_video_fullscreen; | 521 | return ((null_driver_t*)self)->m_video_fullscreen; |
633 | } | 522 | } |
634 | void null_set_fullscreen( vo_driver_t* self, int screen ){ | 523 | void null_set_fullscreen( xine_vo_driver_t* self, int screen ){ |
635 | ((null_driver_t*)self)->m_video_fullscreen = screen; | 524 | ((null_driver_t*)self)->m_video_fullscreen = screen; |
636 | } | 525 | } |
637 | int null_is_scaling( vo_driver_t* self ){ | 526 | int null_is_scaling( xine_vo_driver_t* self ){ |
638 | return ((null_driver_t*)self)->m_is_scaling; | 527 | return ((null_driver_t*)self)->m_is_scaling; |
639 | } | 528 | } |
640 | 529 | ||
641 | void null_set_videoGamma( vo_driver_t* self , int value ) { | 530 | void null_set_videoGamma( xine_vo_driver_t* self , int value ) { |
642 | ((null_driver_t*) self) ->yuv2rgb_gamma = value; | 531 | ((null_driver_t*) self) ->yuv2rgb_gamma = value; |
643 | ((null_driver_t*) self) ->yuv2rgb_factory->set_gamma( ((null_driver_t*) self) ->yuv2rgb_factory, value ); | 532 | ((null_driver_t*) self) ->yuv2rgb_factory->set_gamma( ((null_driver_t*) self) ->yuv2rgb_factory, value ); |
644 | } | 533 | } |
645 | 534 | ||
646 | void null_set_scaling( vo_driver_t* self, int scale ){ | 535 | void null_set_scaling( xine_vo_driver_t* self, int scale ) { |
647 | ((null_driver_t*)self)->m_is_scaling = scale; | 536 | ((null_driver_t*)self)->m_is_scaling = scale; |
648 | } | 537 | } |
649 | 538 | ||
650 | void null_set_gui_width( vo_driver_t* self, int width ){ | 539 | void null_set_gui_width( xine_vo_driver_t* self, int width ) { |
651 | ((null_driver_t*)self)->gui_width = width; | 540 | ((null_driver_t*)self)->gui_width = width; |
652 | } | 541 | } |
653 | void null_set_gui_height( vo_driver_t* self, int height ){ | 542 | void null_set_gui_height( xine_vo_driver_t* self, int height ) { |
654 | ((null_driver_t*)self)->gui_height = height; | 543 | ((null_driver_t*)self)->gui_height = height; |
655 | } | 544 | } |
656 | 545 | ||
657 | 546 | ||
658 | void null_set_mode( vo_driver_t* self, int depth, int rgb ){ | 547 | void null_set_mode( xine_vo_driver_t* self, int depth, int rgb ) { |
659 | null_driver_t* this = (null_driver_t*)self; | 548 | null_driver_t* this = (null_driver_t*)self; |
660 | 549 | ||
661 | this->bytes_per_pixel = (depth + 7 ) / 8; | 550 | this->bytes_per_pixel = (depth + 7 ) / 8; |
662 | this->bpp = this->bytes_per_pixel * 8; | 551 | this->bpp = this->bytes_per_pixel * 8; |
663 | this->depth = depth; | 552 | this->depth = depth; |
664 | printf("depth %d %d\n", depth, this->bpp); | 553 | printf("depth %d %d\n", depth, this->bpp); |
665 | printf("pixeltype %d\n", rgb ); | 554 | printf("pixeltype %d\n", rgb ); |
666 | switch ( this->depth ){ | 555 | switch ( this->depth ) { |
667 | case 32: | 556 | case 32: |
668 | if( rgb == 0 ) | 557 | if( rgb == 0 ) |
669 | this->yuv2rgb_mode = MODE_32_RGB; | 558 | this->yuv2rgb_mode = MODE_32_RGB; |
670 | else | 559 | else |
671 | this->yuv2rgb_mode = MODE_32_BGR; | 560 | this->yuv2rgb_mode = MODE_32_BGR; |
672 | case 24: | 561 | case 24: |
673 | if( this->bpp == 32 ) { | 562 | if( this->bpp == 32 ) { |
674 | if(rgb == 0 ) | 563 | if( rgb == 0 ) { |
675 | this->yuv2rgb_mode = MODE_32_RGB; | 564 | this->yuv2rgb_mode = MODE_32_RGB; |
676 | else | 565 | } else { |
677 | this->yuv2rgb_mode = MODE_32_BGR; | 566 | this->yuv2rgb_mode = MODE_32_BGR; |
678 | }else{ | 567 | } |
679 | if( rgb == 0 ) | 568 | }else{ |
680 | this->yuv2rgb_mode = MODE_24_RGB; | 569 | if( rgb == 0 ) |
681 | else | 570 | this->yuv2rgb_mode = MODE_24_RGB; |
682 | this->yuv2rgb_mode = MODE_24_BGR; | 571 | else |
683 | }; | 572 | this->yuv2rgb_mode = MODE_24_BGR; |
684 | break; | ||
685 | case 16: | ||
686 | if( rgb == 0 ) | ||
687 | this->yuv2rgb_mode = MODE_16_RGB; | ||
688 | else | ||
689 | this->yuv2rgb_mode = MODE_16_BGR; | ||
690 | break; | ||
691 | case 15: | ||
692 | if( rgb == 0 ) | ||
693 | this->yuv2rgb_mode = MODE_15_RGB; | ||
694 | else | ||
695 | this->yuv2rgb_mode = MODE_15_BGR; | ||
696 | break; | ||
697 | case 8: | ||
698 | if( rgb == 0 ) | ||
699 | this->yuv2rgb_mode = MODE_8_RGB; | ||
700 | else | ||
701 | this->yuv2rgb_mode = MODE_8_BGR; | ||
702 | break; | ||
703 | }; | 573 | }; |
704 | //free(this->yuv2rgb_factory ); | 574 | break; |
705 | // this->yuv2rgb_factory = yuv2rgb_factory_init (this->yuv2rgb_mode, this->yuv2rgb_swap, | 575 | case 16: |
706 | // this->yuv2rgb_cmap); | 576 | if( rgb == 0 ) { |
577 | this->yuv2rgb_mode = MODE_16_RGB; | ||
578 | } else { | ||
579 | this->yuv2rgb_mode = MODE_16_BGR; | ||
580 | } | ||
581 | break; | ||
582 | case 15: | ||
583 | if( rgb == 0 ) { | ||
584 | this->yuv2rgb_mode = MODE_15_RGB; | ||
585 | } else { | ||
586 | this->yuv2rgb_mode = MODE_15_BGR; | ||
587 | } | ||
588 | break; | ||
589 | case 8: | ||
590 | if( rgb == 0 ) { | ||
591 | this->yuv2rgb_mode = MODE_8_RGB; | ||
592 | } else { | ||
593 | this->yuv2rgb_mode = MODE_8_BGR; | ||
594 | } | ||
595 | break; | ||
596 | }; | ||
597 | //free(this->yuv2rgb_factory ); | ||
598 | // this->yuv2rgb_factory = yuv2rgb_factory_init (this->yuv2rgb_mode, this->yuv2rgb_swap, | ||
599 | // this->yuv2rgb_cmap); | ||
707 | }; | 600 | }; |
708 | void null_display_handler(vo_driver_t* self, display_xine_frame_t t, void* user_data) { | 601 | |
709 | null_driver_t* this = (null_driver_t*) self; | 602 | void null_display_handler( xine_vo_driver_t* self, display_xine_frame_t t, |
710 | this->caller = user_data; | 603 | void* user_data ) { |
711 | this->frameDis = t; | 604 | null_driver_t* this = (null_driver_t*) self; |
605 | this->caller = user_data; | ||
606 | this->frameDis = t; | ||
712 | } | 607 | } |
713 | 608 | ||
diff --git a/noncore/multimedia/opieplayer2/opieplayer2.pro b/noncore/multimedia/opieplayer2/opieplayer2.pro index a83a624..1b687a3 100644 --- a/noncore/multimedia/opieplayer2/opieplayer2.pro +++ b/noncore/multimedia/opieplayer2/opieplayer2.pro | |||
@@ -16,5 +16,5 @@ TARGET = opieplayer2 | |||
16 | INCLUDEPATH += $(OPIEDIR)/include | 16 | INCLUDEPATH += $(OPIEDIR)/include |
17 | DEPENDPATH += $(OPIEDIR)/include | 17 | DEPENDPATH += $(OPIEDIR)/include |
18 | LIBS += -lqpe -lpthread -lopie -lxine -lxineutils | 18 | LIBS += -lqpe -lpthread -lopie -lxine |
19 | MOC_DIR = qpeobj | 19 | MOC_DIR = qpeobj |
20 | OBJECTS_DIR = qpeobj | 20 | OBJECTS_DIR = qpeobj |
diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp index ce472f1..1042a0c 100644 --- a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | |||
@@ -101,6 +101,5 @@ PlayListWidgetGui::PlayListWidgetGui( QWidget* parent, const char* name, WFlags | |||
101 | 101 | ||
102 | gammaMenu = new QPopupMenu( this ); | 102 | gammaMenu = new QPopupMenu( this ); |
103 | pmView->insertItem( tr( "Gamma" ), gammaMenu ); | 103 | pmView->insertItem( tr( "Gamma (Video)" ), gammaMenu ); |
104 | gammaMenu->setMinimumHeight( 50 ); | ||
105 | 104 | ||
106 | gammaSlider = new QSlider( QSlider::Vertical, gammaMenu ); | 105 | gammaSlider = new QSlider( QSlider::Vertical, gammaMenu ); |
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index b0ec673..f5f5c37 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp | |||
@@ -385,5 +385,5 @@ void VideoWidget::makeVisible() { | |||
385 | slider->hide(); | 385 | slider->hide(); |
386 | videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); | 386 | videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); |
387 | qApp->processEvents(); | 387 | // qApp->processEvents(); |
388 | } else { | 388 | } else { |
389 | showNormal(); | 389 | showNormal(); |
@@ -399,7 +399,6 @@ void VideoWidget::makeVisible() { | |||
399 | connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | 399 | connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); |
400 | } | 400 | } |
401 | |||
402 | QWidget *d = QApplication::desktop(); | 401 | QWidget *d = QApplication::desktop(); |
403 | int w=d->width(); | 402 | int w=d->width(); |
404 | int h=d->height(); | 403 | int h=d->height(); |
405 | 404 | ||
@@ -410,5 +409,5 @@ void VideoWidget::makeVisible() { | |||
410 | videoFrame->setGeometry( QRect( 0, 30, 240, 170 ) ); | 409 | videoFrame->setGeometry( QRect( 0, 30, 240, 170 ) ); |
411 | 410 | ||
412 | qApp->processEvents(); | 411 | // qApp->processEvents(); |
413 | } | 412 | } |
414 | } | 413 | } |
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index 0137ae5..fabc9a5 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp | |||
@@ -95,4 +95,5 @@ void XineControl::play( const QString& fileName ) { | |||
95 | mediaPlayerState->setView( whichGui ); | 95 | mediaPlayerState->setView( whichGui ); |
96 | 96 | ||
97 | |||
97 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 98 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
98 | if ( !disabledSuspendScreenSaver ) { | 99 | if ( !disabledSuspendScreenSaver ) { |
diff --git a/noncore/multimedia/opieplayer2/xinevideowidget.cpp b/noncore/multimedia/opieplayer2/xinevideowidget.cpp index 9b26d41..1d88cea 100644 --- a/noncore/multimedia/opieplayer2/xinevideowidget.cpp +++ b/noncore/multimedia/opieplayer2/xinevideowidget.cpp | |||
@@ -2,5 +2,5 @@ | |||
2 | /* | 2 | /* |
3 | This file is part of the Opie Project | 3 | This file is part of the Opie Project |
4 | 4 | ||
5 | Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 5 | Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
6 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> | 6 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> |
@@ -29,5 +29,5 @@ | |||
29 | Inc., 59 Temple Place - Suite 330, | 29 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 30 | Boston, MA 02111-1307, USA. |
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
@@ -45,4 +45,5 @@ | |||
45 | #include "xinevideowidget.h" | 45 | #include "xinevideowidget.h" |
46 | 46 | ||
47 | |||
47 | // 0 deg rot: copy a line from src to dst (use libc memcpy) | 48 | // 0 deg rot: copy a line from src to dst (use libc memcpy) |
48 | 49 | ||
@@ -51,19 +52,19 @@ | |||
51 | static inline void memcpy_rev ( void *dst, void *src, size_t len ) | 52 | static inline void memcpy_rev ( void *dst, void *src, size_t len ) |
52 | { | 53 | { |
53 | ((char *) src) += len; | 54 | ((char *) src ) += len; |
54 | 55 | ||
55 | len >>= 1; | 56 | len >>= 1; |
56 | while ( len-- ) | 57 | while ( len-- ) |
57 | *((short int *) dst) ++ = *--((short int *) src); | 58 | *((short int *) dst )++ = *--((short int *) src ); |
58 | } | 59 | } |
59 | 60 | ||
60 | // 90 deg rot: copy a column from src to dst | 61 | // 90 deg rot: copy a column from src to dst |
61 | 62 | ||
62 | static inline void memcpy_step ( void *dst, void *src, size_t len, size_t linestep ) | 63 | static inline void memcpy_step ( void *dst, void *src, size_t len, size_t step ) |
63 | { | 64 | { |
64 | len >>= 1; | 65 | len >>= 1; |
65 | while ( len-- ) { | 66 | while ( len-- ) { |
66 | *((short int *) dst) ++ = *((short int *) src); | 67 | *((short int *) dst )++ = *((short int *) src ); |
67 | ((char * ) src) += linestep; | 68 | ((char *) src ) += step; |
68 | } | 69 | } |
69 | } | 70 | } |
@@ -71,13 +72,13 @@ static inline void memcpy_step ( void *dst, void *src, size_t len, size_t linest | |||
71 | // 270 deg rot: copy a column from src to dst reversed | 72 | // 270 deg rot: copy a column from src to dst reversed |
72 | 73 | ||
73 | static inline void memcpy_step_rev ( void *dst, void *src, size_t len, size_t linestep ) | 74 | static inline void memcpy_step_rev ( void *dst, void *src, size_t len, size_t step ) |
74 | { | 75 | { |
75 | len >>= 1; | 76 | len >>= 1; |
76 | 77 | ||
77 | ((char *) src) += ( len * linestep ); | 78 | ((char *) src ) += ( len * step ); |
78 | 79 | ||
79 | while ( len-- ) { | 80 | while ( len-- ) { |
80 | ((char *) src) -= linestep; | 81 | ((char *) src ) -= step; |
81 | *((short int *) dst) ++ = *((short int *) src); | 82 | *((short int *) dst )++ = *((short int *) src ); |
82 | } | 83 | } |
83 | } | 84 | } |
@@ -85,13 +86,13 @@ static inline void memcpy_step_rev ( void *dst, void *src, size_t len, size_t li | |||
85 | 86 | ||
86 | XineVideoWidget::XineVideoWidget ( QWidget* parent, const char* name ) | 87 | XineVideoWidget::XineVideoWidget ( QWidget* parent, const char* name ) |
87 | : QWidget ( parent, name, WRepaintNoErase | WResizeNoErase ) | 88 | : QWidget ( parent, name, WRepaintNoErase | WResizeNoErase ) |
88 | { | 89 | { |
89 | setBackgroundMode ( NoBackground ); | 90 | setBackgroundMode ( NoBackground ); |
90 | 91 | ||
91 | m_logo = 0; | 92 | m_logo = 0; |
92 | m_buff = 0; | 93 | m_buff = 0; |
93 | m_bytes_per_line_fb = qt_screen-> linestep ( ); | 94 | m_bytes_per_line_fb = qt_screen-> linestep ( ); |
94 | m_bytes_per_pixel = ( qt_screen-> depth ( ) + 7 ) / 8; | 95 | m_bytes_per_pixel = ( qt_screen->depth() + 7 ) / 8; |
95 | m_rotation = 0; | 96 | m_rotation = 0; |
96 | } | 97 | } |
97 | 98 | ||
@@ -158,7 +159,7 @@ void XineVideoWidget::paintEvent ( QPaintEvent * ) | |||
158 | 159 | ||
159 | if ( clip. left ( ) < framerect. left ( )) | 160 | if ( clip. left ( ) < framerect. left ( )) |
160 | leftfill = (( framerect. left ( ) - clip. left ( )) * m_bytes_per_pixel ) < ? clipwidth; | 161 | leftfill = (( framerect. left ( ) - clip. left ( )) * m_bytes_per_pixel ) <? clipwidth; |
161 | if ( clip. right ( ) > framerect. right ( )) | 162 | if ( clip. right ( ) > framerect. right ( )) |
162 | rightfill = (( clip. right ( ) - framerect. right ( )) * m_bytes_per_pixel ) < ? clipwidth; | 163 | rightfill = (( clip. right ( ) - framerect. right ( )) * m_bytes_per_pixel ) <? clipwidth; |
163 | 164 | ||
164 | framefill = clipwidth - ( leftfill + rightfill ); | 165 | framefill = clipwidth - ( leftfill + rightfill ); |
@@ -183,81 +184,89 @@ void XineVideoWidget::paintEvent ( QPaintEvent * ) | |||
183 | default: break; | 184 | default: break; |
184 | } | 185 | } |
185 | if ( rightfill ) | ||
186 | memset ( dst + leftfill + framefill, 0, rightfill ); // "right" border -> black | ||
187 | } | 186 | } |
187 | if ( rightfill ) | ||
188 | memset ( dst + leftfill + framefill, 0, rightfill ); // "right" border -> black | ||
189 | } | ||
188 | 190 | ||
189 | dst += m_bytes_per_line_fb; // advance one line in the framebuffer | 191 | dst += m_bytes_per_line_fb; // advance one line in the framebuffer |
190 | 192 | ||
191 | // advance one "line" in the xine frame data | 193 | // advance one "line" in the xine frame data |
192 | switch ( rot ) { | 194 | switch ( rot ) { |
193 | case 0: src += m_bytes_per_line_frame;break; | 195 | case 0: src += m_bytes_per_line_frame;break; |
194 | case 1: src -= m_bytes_per_pixel; break; | 196 | case 1: src -= m_bytes_per_pixel; break; |
195 | case 2: src -= m_bytes_per_line_frame; break; | 197 | case 2: src -= m_bytes_per_line_frame; break; |
196 | case 3: src += m_bytes_per_pixel; break; | 198 | case 3: src += m_bytes_per_pixel; break; |
197 | default: break; | 199 | default: break; |
198 | } | ||
199 | } | 200 | } |
200 | } | 201 | } |
202 | } | ||
203 | } | ||
201 | 204 | ||
202 | { | 205 | { |
203 | // QVFB hack by Martin Jones | 206 | // QVFB hack by Martin Jones |
204 | // We need to "touch" all affected clip rects with a normal QPainter in addition to the QDirectPainter | 207 | // We need to "touch" all affected clip rects with a normal QPainter in addition to the QDirectPainter |
205 | 208 | ||
206 | QPainter p ( this ); | 209 | QPainter p ( this ); |
207 | 210 | ||
208 | for ( int i = qt_bug_workaround_clip_rects. size ( ) - 1; i >= 0; i-- ) { | 211 | for ( int i = qt_bug_workaround_clip_rects. size ( ) - 1; i >= 0; i-- ) { |
209 | p. fillRect ( QRect ( mapFromGlobal ( qt_bug_workaround_clip_rects [ i ]. topLeft ( )), qt_bug_workaround_clip_rects [ i ]. size ( )), QBrush ( NoBrush )); | 212 | p. fillRect ( QRect ( mapFromGlobal ( qt_bug_workaround_clip_rects [ i ]. topLeft ( )), qt_bug_workaround_clip_rects [ i ]. size ( )), QBrush ( NoBrush )); |
210 | } | ||
211 | } | ||
212 | } | 213 | } |
213 | } | 214 | } |
215 | } | ||
216 | } | ||
214 | 217 | ||
215 | QImage *XineVideoWidget::logo ( ) const { | ||
216 | return m_logo; | ||
217 | } | ||
218 | 218 | ||
219 | void XineVideoWidget::setLogo ( QImage * image ) { | 219 | QImage *XineVideoWidget::logo ( ) const |
220 | delete m_logo; | 220 | { |
221 | m_logo = image; | 221 | return m_logo; |
222 | } | 222 | } |
223 | 223 | ||
224 | void XineVideoWidget::setVideoFrame ( uchar * img, int w, int h, int bpl ) { | ||
225 | bool rot90 = (( -m_rotation ) & 1 ); | ||
226 | 224 | ||
227 | if ( rot90 ) { // if the rotation is 90 or 270 we have to swap width / height | 225 | void XineVideoWidget::setLogo ( QImage* logo ) |
228 | int d = w; | 226 | { |
229 | w = h; | 227 | delete m_logo; |
230 | h = d; | 228 | m_logo = logo; |
231 | } | 229 | } |
232 | 230 | ||
233 | m_lastframe = m_thisframe; | 231 | void XineVideoWidget::setVideoFrame ( uchar* img, int w, int h, int bpl ) |
234 | m_thisframe. setRect (( width ( ) - w ) / 2, ( height ( ) - h ) / 2, w , h ); | 232 | { |
233 | bool rot90 = (( -m_rotation ) & 1 ); | ||
235 | 234 | ||
236 | m_buff = img; | 235 | if ( rot90 ) { // if the rotation is 90 or 270 we have to swap width / height |
237 | m_bytes_per_line_frame = bpl; | 236 | int d = w; |
237 | w = h; | ||
238 | h = d; | ||
239 | } | ||
238 | 240 | ||
239 | // only repaint the area that *really* needs to be repainted | 241 | m_lastframe = m_thisframe; |
242 | m_thisframe. setRect (( width ( ) - w ) / 2, ( height ( ) - h ) / 2, w , h ); | ||
240 | 243 | ||
241 | repaint (( | 244 | m_buff = img; |
242 | } | 245 | m_bytes_per_line_frame = bpl; |
243 | 246 | ||
244 | void XineVideoWidget::resizeEvent ( QResizeEvent * ) { | 247 | // only repaint the area that *really* needs to be repainted |
245 | QSize s = size ( ); | ||
246 | bool fs = ( s == qApp-> desktop ( ) -> size ( )); | ||
247 | 248 | ||
248 | // if we are in fullscreen mode, do not rotate the video | 249 | repaint ((( m_thisframe & m_lastframe ) != m_lastframe ) ? m_lastframe : m_thisframe, false ); |
249 | // (!! the paint routine uses m_rotation + qt_screen-> transformOrientation() !!) | 250 | } |
251 | |||
252 | void XineVideoWidget::resizeEvent ( QResizeEvent * ) | ||
253 | { | ||
254 | QSize s = size ( ); | ||
255 | bool fs = ( s == qApp-> desktop ( )-> size ( )); | ||
250 | 256 | ||
251 | m_rotation = fs ? -qt_screen-> transformOrientation ( ) : 0; | 257 | // if we are in fullscreen mode, do not rotate the video |
258 | // (!! the paint routine uses m_rotation + qt_screen-> transformOrientation() !!) | ||
259 | m_rotation = fs ? -qt_screen-> transformOrientation ( ) : 0; | ||
252 | 260 | ||
253 | if ( fs && qt_screen-> isTransformed ( )) | 261 | if ( fs && qt_screen-> isTransformed ( )) |
254 | s = qt_screen-> mapToDevice ( s ); | 262 | s = qt_screen-> mapToDevice ( s ); |
255 | 263 | ||
256 | emit videoResized ( s ); | 264 | emit videoResized ( s ); |
257 | } | 265 | } |
258 | 266 | ||
259 | 267 | ||
260 | void XineVideoWidget::mouseReleaseEvent ( QMouseEvent * ) { | 268 | void XineVideoWidget::mouseReleaseEvent ( QMouseEvent * /*me*/ ) |
261 | emit clicked ( ); | 269 | { |
262 | } | 270 | emit clicked(); |
271 | } | ||
263 | 272 | ||