author | alwin <alwin> | 2005-04-02 21:55:07 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-04-02 21:55:07 (UTC) |
commit | a5020219d43b9dd788cc090ae565c28f27dd6a58 (patch) (unidiff) | |
tree | c60f0ae6554817db54e45ea2eb6b1c9896193b3e /noncore/multimedia/opieplayer2/xinevideowidget.h | |
parent | b92357d5566b9ee220ff5f4e8eb612b2db32e20b (diff) | |
download | opie-a5020219d43b9dd788cc090ae565c28f27dd6a58.zip opie-a5020219d43b9dd788cc090ae565c28f27dd6a58.tar.gz opie-a5020219d43b9dd788cc090ae565c28f27dd6a58.tar.bz2 |
my last try to get mediaplayer2 more stable.
-> protected the videobuffer with mutex, make a deep copy of it so xine may
destruct its internal buffers as wanted
Diffstat (limited to 'noncore/multimedia/opieplayer2/xinevideowidget.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/xinevideowidget.h | 54 |
1 files changed, 29 insertions, 25 deletions
diff --git a/noncore/multimedia/opieplayer2/xinevideowidget.h b/noncore/multimedia/opieplayer2/xinevideowidget.h index 8b3a3ea..7f00aaa 100644 --- a/noncore/multimedia/opieplayer2/xinevideowidget.h +++ b/noncore/multimedia/opieplayer2/xinevideowidget.h | |||
@@ -1,76 +1,80 @@ | |||
1 | |||
1 | /* | 2 | /* |
2 | This file is part of the Opie Project | 3 | Â Â Â Â Â Â Â Â This file is part of the Opie Project |
3 | 4 | ||
4 | Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 5 | Â Â Â Â Â Â Â Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> |
6 | Copyright (c) 2002 L. Potter <ljp@llornkcor.com> | ||
5 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> | 7 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> |
6 | =. | 8 | =. |
7 | .=l. | 9 | .=l. |
8 | .>+-= | 10 | Â Â Â Â Â Â .>+-= |
9 | _;:, .> :=|. This program is free software; you can | 11 | Â _;:, Â Â .> Â Â :=|. This program is free software; you can |
10 | .> <`_, > . <= redistribute it and/or modify it under | 12 | .> <`_, Â > Â . Â <= redistribute it and/or modify it under |
11 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 13 | :`=1 )Y*s>-.-- Â : the terms of the GNU General Public |
12 | .="- .-=="i, .._ License as published by the Free Software | 14 | .="- .-=="i, Â Â .._ License as published by the Free Software |
13 | - . .-<_> .<> Foundation; either version 2 of the License, | 15 | Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, |
14 | ._= =} : or (at your option) any later version. | 16 | Â Â Â ._= =} Â Â Â : or (at your option) any later version. |
15 | .%`+i> _;_. | 17 | Â Â .%`+i> Â Â Â _;_. |
16 | .i_,=:_. -<s. This program is distributed in the hope that | 18 | Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that |
17 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 19 | Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; |
18 | : .. .:, . . . without even the implied warranty of | 20 | Â Â : .. Â Â .:, Â Â . . . without even the implied warranty of |
19 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 21 | Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A |
20 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 22 | Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU |
21 | ..}^=.= = ; Library General Public License for more | 23 | ..}^=.= Â Â Â = Â Â Â ; Library General Public License for more |
22 | ++= -. .` .: details. | 24 | ++= Â -. Â Â .` Â Â .: details. |
23 | : = ...= . :.=- | 25 | Â : Â Â = Â ...= . :.=- |
24 | -. .:....=;==+<; You should have received a copy of the GNU | 26 | Â -. Â .:....=;==+<; You should have received a copy of the GNU |
25 | -_. . . )=. = Library General Public License along with | 27 | Â -_. . . Â )=. Â = Library General Public License along with |
26 | -- :-=` this library; see the file COPYING.LIB. | 28 | Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. |
27 | If not, write to the Free Software Foundation, | 29 | If not, write to the Free Software Foundation, |
28 | Inc., 59 Temple Place - Suite 330, | 30 | Inc., 59 Temple Place - Suite 330, |
29 | Boston, MA 02111-1307, USA. | 31 | Boston, MA 02111-1307, USA. |
30 | 32 | ||
31 | */ | 33 | */ |
32 | 34 | ||
33 | 35 | ||
34 | |||
35 | #include <qwidget.h> | 36 | #include <qwidget.h> |
36 | 37 | ||
37 | #include "lib.h" | 38 | #include "lib.h" |
38 | 39 | ||
39 | class QImage; | 40 | class QImage; |
40 | 41 | ||
41 | 42 | ||
42 | class XineVideoWidget : public QWidget { | 43 | class XineVideoWidget : public QWidget { |
43 | Q_OBJECT | 44 | Q_OBJECT |
44 | 45 | ||
45 | public: | 46 | public: |
46 | XineVideoWidget ( QWidget* parent, const char* name ); | 47 | XineVideoWidget ( QWidget* parent, const char* name ); |
47 | ~XineVideoWidget ( ); | 48 | ~XineVideoWidget ( ); |
48 | QImage *logo ( ) const; | 49 | QImage *logo ( ) const; |
49 | void setLogo ( QImage *image ); | 50 | void setLogo ( QImage *image ); |
50 | void setVideoFrame ( uchar *image, int width, int height, int linestep ); | 51 | void setVideoFrame ( uchar *image, int width, int height, int linestep ); |
51 | void clear ( ); | 52 | void clear ( ); |
52 | 53 | ||
53 | QSize videoSize() const; | 54 | QSize videoSize() const; |
54 | 55 | ||
55 | protected: | 56 | protected: |
56 | void paintEvent( QPaintEvent *p ); | 57 | void paintEvent2( QPaintEvent *p ); |
57 | void resizeEvent ( QResizeEvent *r ); | 58 | virtual void paintEvent(QPaintEvent*); |
59 | virtual void resizeEvent ( QResizeEvent *r ); | ||
58 | 60 | ||
59 | void mouseReleaseEvent ( QMouseEvent *e ); | 61 | void mouseReleaseEvent ( QMouseEvent *e ); |
60 | 62 | ||
61 | signals: | 63 | signals: |
62 | void clicked ( ); | 64 | void clicked ( ); |
63 | void videoResized ( const QSize &s ); | 65 | void videoResized ( const QSize &s ); |
64 | 66 | ||
65 | private: | 67 | private: |
66 | QRect m_lastframe; | 68 | QRect m_lastframe; |
67 | QRect m_thisframe; | 69 | QRect m_thisframe; |
68 | 70 | ||
69 | uchar *m_buff; | 71 | uchar *m_buff; |
70 | int m_bytes_per_line_fb; | 72 | int m_bytes_per_line_fb; |
71 | int m_bytes_per_line_frame; | 73 | int m_bytes_per_line_frame; |
72 | int m_bytes_per_pixel; | 74 | int m_bytes_per_pixel; |
75 | int m_lastsize; | ||
73 | QImage *m_logo; | 76 | QImage *m_logo; |
74 | mutable int m_rotation; | 77 | mutable int m_rotation; |
78 | ThreadUtil::Mutex m_bufmutex; | ||
75 | }; | 79 | }; |
76 | 80 | ||