author | alwin <alwin> | 2005-04-11 21:53:59 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-04-11 21:53:59 (UTC) |
commit | df382ea245959ed4d27012358e24c4c95767270f (patch) (unidiff) | |
tree | c1d71289d9773461692c8c181fef3b27e402eb0d /noncore/multimedia | |
parent | 840e44417402bbc6048ca5e8ff3dd6be966e753f (diff) | |
download | opie-df382ea245959ed4d27012358e24c4c95767270f.zip opie-df382ea245959ed4d27012358e24c4c95767270f.tar.gz opie-df382ea245959ed4d27012358e24c4c95767270f.tar.bz2 |
next stage of bug hunting
seems that errors/problems in pure display are fixed. removed all qpaint
stuff may invoked in xine-thread (evil,evil!) - I think it isn't needed
there.
so I deactivated the mutex this moment
-rw-r--r-- | noncore/multimedia/opieplayer2/xinevideowidget.cpp | 101 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinevideowidget.h | 42 |
2 files changed, 57 insertions, 86 deletions
diff --git a/noncore/multimedia/opieplayer2/xinevideowidget.cpp b/noncore/multimedia/opieplayer2/xinevideowidget.cpp index 78ebe19..b27b8e1 100644 --- a/noncore/multimedia/opieplayer2/xinevideowidget.cpp +++ b/noncore/multimedia/opieplayer2/xinevideowidget.cpp | |||
@@ -1,5 +1,5 @@ | |||
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 L. Potter <ljp@llornkcor.com> |
@@ -8,21 +8,21 @@ | |||
8 | .=l. | 8 | .=l. |
9 | .>+-= | 9 | .>+-= |
10 | _;:, .> :=|. This program is free software; you can | 10 | _;:, .> :=|. This program is free software; you can |
11 | .> <`_, > . <= redistribute it and/or modify it under | 11 | .> <`_, > . <= redistribute it and/or modify it under |
12 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 12 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
13 | .="- .-=="i, .._ License as published by the Free Software | 13 | .="- .-=="i, .._ License as published by the Free Software |
14 | - . .-<_> .<> Foundation; either version 2 of the License, | 14 | - . .-<_> .<> Foundation; either version 2 of the License, |
15 | ._= =} : or (at your option) any later version. | 15 | ._= =} : or (at your option) any later version. |
16 | .%`+i> _;_. | 16 | .%`+i> _;_. |
17 | .i_,=:_. -<s. This program is distributed in the hope that | 17 | .i_,=:_. -<s. This program is distributed in the hope that |
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
19 | : .. .:, . . . without even the implied warranty of | 19 | : .. .:, . . . without even the implied warranty of |
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 | ..}^=.= = ; Library 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 | -_. . . )=. = Library 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, |
@@ -172,6 +172,2 @@ void XineVideoWidget::paintEvent ( QPaintEvent * ) | |||
172 | { | 172 | { |
173 | if (m_bufmutex.isLocked()) { | ||
174 | return; | ||
175 | } | ||
176 | ThreadUtil::AutoLock a(m_bufmutex); | ||
177 | QPainter p ( this ); | 173 | QPainter p ( this ); |
@@ -184,19 +180,9 @@ void XineVideoWidget::paintEvent2 ( QPaintEvent * ) | |||
184 | { | 180 | { |
185 | ThreadUtil::AutoLock a(m_bufmutex); | ||
186 | QPainter p (this); | ||
187 | if ( m_buff == 0 ) { | 181 | if ( m_buff == 0 ) { |
188 | p. fillRect ( rect ( ), black ); | 182 | return; |
189 | if ( m_logo ) | ||
190 | p. drawImage ( 0, 0, *m_logo ); | ||
191 | } else if (m_lastsize){ | 183 | } else if (m_lastsize){ |
192 | // Qt needs to be notified which areas were really updated .. strange | ||
193 | QArray <QRect> qt_bug_workaround_clip_rects; | ||
194 | |||
195 | { | 184 | { |
196 | QDirectPainter dp ( this ); | 185 | QDirectPainter dp ( this ); |
197 | |||
198 | int rot = dp. transformOrientation ( ) + m_rotation; // device rotation + custom rotation | 186 | int rot = dp. transformOrientation ( ) + m_rotation; // device rotation + custom rotation |
199 | |||
200 | bool rot90 = (( -m_rotation ) & 1 ); | 187 | bool rot90 = (( -m_rotation ) & 1 ); |
201 | |||
202 | int _vw,_vh; | 188 | int _vw,_vh; |
@@ -216,25 +202,2 @@ void XineVideoWidget::paintEvent2 ( QPaintEvent * ) | |||
216 | m_thisframe.setRect(width()/2-middle_w,height()/2-middle_h,_vw,_vh); | 202 | m_thisframe.setRect(width()/2-middle_w,height()/2-middle_h,_vw,_vh); |
217 | |||
218 | { | ||
219 | // is this stuff realy needed? it seems working without, too. | ||
220 | QRect topFill,rightFill,leftFill,downFill; | ||
221 | topFill. setRect(0,0 ,width(),m_thisframe.top()); | ||
222 | downFill.setCoords(0,m_thisframe.bottom(),width(),height()); | ||
223 | rightFill.setCoords(m_thisframe.right(),0,width(),height()); | ||
224 | leftFill.setCoords(0,0,m_thisframe.left(),height()); | ||
225 | |||
226 | if (topFill.isValid()) { | ||
227 | p.fillRect(topFill,black); | ||
228 | } | ||
229 | if (downFill.isValid()) { | ||
230 | p.fillRect(downFill,black); | ||
231 | } | ||
232 | if (rightFill.isValid()) { | ||
233 | p.fillRect(rightFill,black); | ||
234 | } | ||
235 | if (leftFill.isValid()) { | ||
236 | p.fillRect(leftFill,black); | ||
237 | } | ||
238 | |||
239 | } | ||
240 | uchar *fb = dp. frameBuffer ( ); | 203 | uchar *fb = dp. frameBuffer ( ); |
@@ -249,3 +212,6 @@ void XineVideoWidget::paintEvent2 ( QPaintEvent * ) | |||
249 | 212 | ||
250 | for (int y=framerect.top();y<=framerect.bottom();++y) { | 213 | if (framerect.height()!=m_framesize.height()) { |
214 | odebug << "Hoehm: " << framerect.height() << " <-> " << m_framesize.height() << oendl; | ||
215 | } | ||
216 | for (int y = 0;y<framerect.height();++y) { | ||
251 | switch (rot) { | 217 | switch (rot) { |
@@ -292,7 +258,9 @@ void XineVideoWidget::setVideoFrame ( uchar* img, int w, int h, int bpl ) | |||
292 | { | 258 | { |
293 | if (m_bufmutex.isLocked()||w>width()||h>height()) { | 259 | #if 0 |
294 | // no time to wait - drop frame | 260 | ThreadUtil::AutoLock a(m_bufmutex); |
261 | #endif | ||
262 | if (!isVisible()||w>width()||h>height()/*||m_bufmutex.isLocked()*/) { | ||
263 | //drop frame | ||
295 | return; | 264 | return; |
296 | } | 265 | } |
297 | ThreadUtil::AutoLock a(m_bufmutex); | ||
298 | bool rot90 = (( -m_rotation ) & 1 ); | 266 | bool rot90 = (( -m_rotation ) & 1 ); |
@@ -317,5 +285,4 @@ void XineVideoWidget::setVideoFrame ( uchar* img, int w, int h, int bpl ) | |||
317 | m_bytes_per_line_frame = bpl; | 285 | m_bytes_per_line_frame = bpl; |
286 | if (m_buff) paintEvent2(0); | ||
318 | } // Release Mutex | 287 | } // Release Mutex |
319 | |||
320 | if (m_buff) paintEvent2(0); | ||
321 | } | 288 | } |
@@ -324,3 +291,7 @@ void XineVideoWidget::resizeEvent ( QResizeEvent * ) | |||
324 | { | 291 | { |
292 | #if 0 | ||
293 | ThreadUtil::AutoLock a(m_bufmutex); | ||
294 | #endif | ||
325 | emit videoResized( videoSize() ); | 295 | emit videoResized( videoSize() ); |
296 | odebug << "All resize done" << oendl; | ||
326 | } | 297 | } |
diff --git a/noncore/multimedia/opieplayer2/xinevideowidget.h b/noncore/multimedia/opieplayer2/xinevideowidget.h index eccff1a..a0ec5bc 100644 --- a/noncore/multimedia/opieplayer2/xinevideowidget.h +++ b/noncore/multimedia/opieplayer2/xinevideowidget.h | |||
@@ -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 Max Reiss <harlekin@handhelds.org> | 5 | Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> |
6 | Copyright (c) 2002 L. Potter <ljp@llornkcor.com> | 6 | Copyright (c) 2002 L. Potter <ljp@llornkcor.com> |
@@ -9,21 +9,21 @@ | |||
9 | .=l. | 9 | .=l. |
10 | .>+-= | 10 | .>+-= |
11 | _;:, .> :=|. This program is free software; you can | 11 | _;:, .> :=|. This program is free software; you can |
12 | .> <`_, > . <= redistribute it and/or modify it under | 12 | .> <`_, > . <= redistribute it and/or modify it under |
13 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 13 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
14 | .="- .-=="i, .._ License as published by the Free Software | 14 | .="- .-=="i, .._ License as published by the Free Software |
15 | - . .-<_> .<> Foundation; either version 2 of the License, | 15 | - . .-<_> .<> Foundation; either version 2 of the License, |
16 | ._= =} : or (at your option) any later version. | 16 | ._= =} : or (at your option) any later version. |
17 | .%`+i> _;_. | 17 | .%`+i> _;_. |
18 | .i_,=:_. -<s. This program is distributed in the hope that | 18 | .i_,=:_. -<s. This program is distributed in the hope that |
19 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 19 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
20 | : .. .:, . . . without even the implied warranty of | 20 | : .. .:, . . . without even the implied warranty of |
21 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 21 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
22 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 22 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
23 | ..}^=.= = ; Library General Public License for more | 23 | ..}^=.= = ; Library General Public License for more |
24 | ++= -. .` .: details. | 24 | ++= -. .` .: details. |
25 | : = ...= . :.=- | 25 | : = ...= . :.=- |
26 | -. .:....=;==+<; You should have received a copy of the GNU | 26 | -. .:....=;==+<; You should have received a copy of the GNU |
27 | -_. . . )=. = Library General Public License along with | 27 | -_. . . )=. = Library General Public License along with |
28 | -- :-=` this library; see the file COPYING.LIB. | 28 | -- :-=` this library; see the file COPYING.LIB. |
29 | If not, write to the Free Software Foundation, | 29 | If not, write to the Free Software Foundation, |