author | sandman <sandman> | 2002-12-11 18:35:16 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-12-11 18:35:16 (UTC) |
commit | 8ca42b97de03ac84da04b9be84f9bbb8eb17b52d (patch) (unidiff) | |
tree | 07e9ed49638eadda2dc475aa965562d199932826 | |
parent | b8db7cfea977d20f2d491b0a208a237efb15019a (diff) | |
download | opie-8ca42b97de03ac84da04b9be84f9bbb8eb17b52d.zip opie-8ca42b97de03ac84da04b9be84f9bbb8eb17b52d.tar.gz opie-8ca42b97de03ac84da04b9be84f9bbb8eb17b52d.tar.bz2 |
valgrind complained and here are some off-by-1 fixes
-rw-r--r-- | noncore/multimedia/opieplayer2/xinevideowidget.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/noncore/multimedia/opieplayer2/xinevideowidget.cpp b/noncore/multimedia/opieplayer2/xinevideowidget.cpp index 791818e..0833784 100644 --- a/noncore/multimedia/opieplayer2/xinevideowidget.cpp +++ b/noncore/multimedia/opieplayer2/xinevideowidget.cpp | |||
@@ -1,277 +1,278 @@ | |||
1 | 1 | ||
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> |
7 | =. | 7 | =. |
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, |
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 | ||
34 | #include <qimage.h> | 34 | #include <qimage.h> |
35 | #include <qpainter.h> | 35 | #include <qpainter.h> |
36 | #include <qgfx_qws.h> | 36 | #include <qgfx_qws.h> |
37 | #include <qdirectpainter_qws.h> | 37 | #include <qdirectpainter_qws.h> |
38 | #include <qgfx_qws.h> | 38 | #include <qgfx_qws.h> |
39 | #include <qsize.h> | 39 | #include <qsize.h> |
40 | #include <qapplication.h> | 40 | #include <qapplication.h> |
41 | #include <qpainter.h> | 41 | #include <qpainter.h> |
42 | 42 | ||
43 | #include <qpe/resource.h> | 43 | #include <qpe/resource.h> |
44 | 44 | ||
45 | #include "xinevideowidget.h" | 45 | #include "xinevideowidget.h" |
46 | 46 | ||
47 | 47 | ||
48 | // 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) |
49 | 49 | ||
50 | // 180 deg rot: copy a line from src to dst reversed | 50 | // 180 deg rot: copy a line from src to dst reversed |
51 | 51 | ||
52 | 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 ) |
53 | { | 53 | { |
54 | ((char *) src ) += len; | ||
55 | |||
56 | len >>= 1; | 54 | len >>= 1; |
55 | |||
56 | ((char *) src ) += ( len << 1 ); | ||
57 | |||
57 | while ( len-- ) | 58 | while ( len-- ) |
58 | *((short int *) dst )++ = *--((short int *) src ); | 59 | *((short int *) dst )++ = *--((short int *) src ); |
59 | } | 60 | } |
60 | 61 | ||
61 | // 90 deg rot: copy a column from src to dst | 62 | // 90 deg rot: copy a column from src to dst |
62 | 63 | ||
63 | static inline void memcpy_step ( void *dst, void *src, size_t len, size_t step ) | 64 | static inline void memcpy_step ( void *dst, void *src, size_t len, size_t step ) |
64 | { | 65 | { |
65 | len >>= 1; | 66 | len >>= 1; |
66 | while ( len-- ) { | 67 | while ( len-- ) { |
67 | *((short int *) dst )++ = *((short int *) src ); | 68 | *((short int *) dst )++ = *((short int *) src ); |
68 | ((char *) src ) += step; | 69 | ((char *) src ) += step; |
69 | } | 70 | } |
70 | } | 71 | } |
71 | 72 | ||
72 | // 270 deg rot: copy a column from src to dst reversed | 73 | // 270 deg rot: copy a column from src to dst reversed |
73 | 74 | ||
74 | static inline void memcpy_step_rev ( void *dst, void *src, size_t len, size_t step ) | 75 | static inline void memcpy_step_rev ( void *dst, void *src, size_t len, size_t step ) |
75 | { | 76 | { |
76 | len >>= 1; | 77 | len >>= 1; |
77 | 78 | ||
78 | ((char *) src ) += ( len * step ); | 79 | ((char *) src ) += ( len * step ); |
79 | 80 | ||
80 | while ( len-- ) { | 81 | while ( len-- ) { |
81 | ((char *) src ) -= step; | 82 | ((char *) src ) -= step; |
82 | *((short int *) dst )++ = *((short int *) src ); | 83 | *((short int *) dst )++ = *((short int *) src ); |
83 | } | 84 | } |
84 | } | 85 | } |
85 | 86 | ||
86 | 87 | ||
87 | XineVideoWidget::XineVideoWidget ( QWidget* parent, const char* name ) | 88 | XineVideoWidget::XineVideoWidget ( QWidget* parent, const char* name ) |
88 | : QWidget ( parent, name, WRepaintNoErase | WResizeNoErase ) | 89 | : QWidget ( parent, name, WRepaintNoErase | WResizeNoErase ) |
89 | { | 90 | { |
90 | setBackgroundMode ( NoBackground ); | 91 | setBackgroundMode ( NoBackground ); |
91 | 92 | ||
92 | m_logo = 0; | 93 | m_logo = 0; |
93 | m_buff = 0; | 94 | m_buff = 0; |
94 | m_bytes_per_line_fb = qt_screen-> linestep ( ); | 95 | m_bytes_per_line_fb = qt_screen-> linestep ( ); |
95 | m_bytes_per_pixel = ( qt_screen->depth() + 7 ) / 8; | 96 | m_bytes_per_pixel = ( qt_screen->depth() + 7 ) / 8; |
96 | m_rotation = 0; | 97 | m_rotation = 0; |
97 | } | 98 | } |
98 | 99 | ||
99 | 100 | ||
100 | XineVideoWidget::~XineVideoWidget ( ) | 101 | XineVideoWidget::~XineVideoWidget ( ) |
101 | { | 102 | { |
102 | delete m_logo; | 103 | delete m_logo; |
103 | } | 104 | } |
104 | 105 | ||
105 | void XineVideoWidget::clear ( ) | 106 | void XineVideoWidget::clear ( ) |
106 | { | 107 | { |
107 | m_buff = 0; | 108 | m_buff = 0; |
108 | repaint ( false ); | 109 | repaint ( false ); |
109 | } | 110 | } |
110 | 111 | ||
111 | QSize XineVideoWidget::videoSize() const | 112 | QSize XineVideoWidget::videoSize() const |
112 | { | 113 | { |
113 | QSize s = size(); | 114 | QSize s = size(); |
114 | bool fs = ( s == qApp->desktop()->size() ); | 115 | bool fs = ( s == qApp->desktop()->size() ); |
115 | 116 | ||
116 | // if we are in fullscreen mode, do not rotate the video | 117 | // if we are in fullscreen mode, do not rotate the video |
117 | // (!! the paint routine uses m_rotation + qt_screen-> transformOrientation() !!) | 118 | // (!! the paint routine uses m_rotation + qt_screen-> transformOrientation() !!) |
118 | m_rotation = fs ? - qt_screen->transformOrientation() : 0; | 119 | m_rotation = fs ? - qt_screen->transformOrientation() : 0; |
119 | 120 | ||
120 | if ( fs && qt_screen->isTransformed() ) | 121 | if ( fs && qt_screen->isTransformed() ) |
121 | s = qt_screen->mapToDevice( s ); | 122 | s = qt_screen->mapToDevice( s ); |
122 | 123 | ||
123 | return s; | 124 | return s; |
124 | } | 125 | } |
125 | 126 | ||
126 | void XineVideoWidget::paintEvent ( QPaintEvent * ) | 127 | void XineVideoWidget::paintEvent ( QPaintEvent * ) |
127 | { | 128 | { |
128 | if ( m_buff == 0 ) { | 129 | if ( m_buff == 0 ) { |
129 | QPainter p ( this ); | 130 | QPainter p ( this ); |
130 | p. fillRect ( rect ( ), black ); | 131 | p. fillRect ( rect ( ), black ); |
131 | if ( m_logo ) | 132 | if ( m_logo ) |
132 | p. drawImage ( 0, 0, *m_logo ); | 133 | p. drawImage ( 0, 0, *m_logo ); |
133 | } | 134 | } |
134 | else { | 135 | else { |
135 | // Qt needs to be notified which areas were really updated .. strange | 136 | // Qt needs to be notified which areas were really updated .. strange |
136 | QArray <QRect> qt_bug_workaround_clip_rects; | 137 | QArray <QRect> qt_bug_workaround_clip_rects; |
137 | 138 | ||
138 | { | 139 | { |
139 | QDirectPainter dp ( this ); | 140 | QDirectPainter dp ( this ); |
140 | 141 | ||
141 | int rot = dp. transformOrientation ( ) + m_rotation; // device rotation + custom rotation | 142 | int rot = dp. transformOrientation ( ) + m_rotation; // device rotation + custom rotation |
142 | 143 | ||
143 | uchar *fb = dp. frameBuffer ( ); | 144 | uchar *fb = dp. frameBuffer ( ); |
144 | uchar *frame = m_buff; | 145 | uchar *frame = m_buff; |
145 | 146 | ||
146 | // where is the video frame in fb coordinates | 147 | // where is the video frame in fb coordinates |
147 | QRect framerect = qt_screen-> mapToDevice ( QRect ( mapToGlobal ( m_thisframe. topLeft ( )), m_thisframe. size ( )), QSize ( qt_screen-> width ( ), qt_screen-> height ( ))); | 148 | QRect framerect = qt_screen-> mapToDevice ( QRect ( mapToGlobal ( m_thisframe. topLeft ( )), m_thisframe. size ( )), QSize ( qt_screen-> width ( ), qt_screen-> height ( ))); |
148 | 149 | ||
149 | qt_bug_workaround_clip_rects. resize ( dp. numRects ( )); | 150 | qt_bug_workaround_clip_rects. resize ( dp. numRects ( )); |
150 | 151 | ||
151 | for ( int i = dp. numRects ( ) - 1; i >= 0; i-- ) { | 152 | for ( int i = dp. numRects ( ) - 1; i >= 0; i-- ) { |
152 | const QRect &clip = dp. rect ( i ); | 153 | const QRect &clip = dp. rect ( i ); |
153 | 154 | ||
154 | qt_bug_workaround_clip_rects [ i ] = qt_screen-> mapFromDevice ( clip, QSize ( qt_screen-> width ( ), qt_screen-> height ( ))); | 155 | qt_bug_workaround_clip_rects [ i ] = qt_screen-> mapFromDevice ( clip, QSize ( qt_screen-> width ( ), qt_screen-> height ( ))); |
155 | 156 | ||
156 | uchar *dst = fb + ( clip. x ( ) * m_bytes_per_pixel ) + ( clip. y ( ) * m_bytes_per_line_fb ); // clip x/y in the fb | 157 | uchar *dst = fb + ( clip. x ( ) * m_bytes_per_pixel ) + ( clip. y ( ) * m_bytes_per_line_fb ); // clip x/y in the fb |
157 | uchar *src = frame; | 158 | uchar *src = frame; |
158 | 159 | ||
159 | // Adjust the start the source data based on the rotation (xine frame) | 160 | // Adjust the start the source data based on the rotation (xine frame) |
160 | switch ( rot ) { | 161 | switch ( rot ) { |
161 | case 0: src += ((( clip. x ( ) - framerect. x ( )) * m_bytes_per_pixel ) + (( clip. y ( ) - framerect. y ( )) * m_bytes_per_line_frame )); break; | 162 | case 0: src += ((( clip. x ( ) - framerect. x ( )) * m_bytes_per_pixel ) + (( clip. y ( ) - framerect. y ( )) * m_bytes_per_line_frame )); break; |
162 | case 1: src += ((( clip. y ( ) - framerect. y ( )) * m_bytes_per_pixel ) + (( clip. x ( ) - framerect. x ( )) * m_bytes_per_line_frame ) + (( framerect. height ( ) - 1 ) * m_bytes_per_pixel )); break; | 163 | case 1: src += ((( clip. y ( ) - framerect. y ( )) * m_bytes_per_pixel ) + (( clip. x ( ) - framerect. x ( )) * m_bytes_per_line_frame ) + (( framerect. height ( ) - 1 ) * m_bytes_per_pixel )); break; |
163 | case 2: src += ((( clip. x ( ) - framerect. x ( )) * m_bytes_per_pixel ) + (( clip. y ( ) - framerect. y ( )) * m_bytes_per_line_frame ) + (( framerect. height ( ) - 1 ) * m_bytes_per_line_frame )); break; | 164 | case 2: src += ((( clip. x ( ) - framerect. x ( )) * m_bytes_per_pixel ) + (( clip. y ( ) - framerect. y ( )) * m_bytes_per_line_frame ) + (( framerect. height ( ) - 1 ) * m_bytes_per_line_frame )); break; |
164 | case 3: src += ((( clip. y ( ) - framerect. y ( )) * m_bytes_per_pixel ) + (( clip. x ( ) - framerect. x ( )) * m_bytes_per_line_frame )); break; | 165 | case 3: src += ((( clip. y ( ) - framerect. y ( )) * m_bytes_per_pixel ) + (( clip. x ( ) - framerect. x ( )) * m_bytes_per_line_frame )); break; |
165 | default: break; | 166 | default: break; |
166 | } | 167 | } |
167 | 168 | ||
168 | // all of the following widths/heights are fb relative (0deg rotation) | 169 | // all of the following widths/heights are fb relative (0deg rotation) |
169 | 170 | ||
170 | uint leftfill = 0; // black border on the "left" side of the video frame | 171 | uint leftfill = 0; // black border on the "left" side of the video frame |
171 | uint framefill = 0; // "width" of the video frame | 172 | uint framefill = 0; // "width" of the video frame |
172 | uint rightfill = 0; // black border on the "right" side of the video frame | 173 | uint rightfill = 0; // black border on the "right" side of the video frame |
173 | uint clipwidth = clip. width ( ) * m_bytes_per_pixel; // "width" of the current clip rect | 174 | uint clipwidth = clip. width ( ) * m_bytes_per_pixel; // "width" of the current clip rect |
174 | 175 | ||
175 | if ( clip. left ( ) < framerect. left ( )) | 176 | if ( clip. left ( ) < framerect. left ( )) |
176 | leftfill = (( framerect. left ( ) - clip. left ( )) * m_bytes_per_pixel ) <? clipwidth; | 177 | leftfill = (( framerect. left ( ) - clip. left ( )) * m_bytes_per_pixel ) <? clipwidth; |
177 | if ( clip. right ( ) > framerect. right ( )) | 178 | if ( clip. right ( ) > framerect. right ( )) |
178 | rightfill = (( clip. right ( ) - framerect. right ( )) * m_bytes_per_pixel ) <? clipwidth; | 179 | rightfill = (( clip. right ( ) - framerect. right ( )) * m_bytes_per_pixel ) <? clipwidth; |
179 | 180 | ||
180 | framefill = clipwidth - ( leftfill + rightfill ); | 181 | framefill = clipwidth - ( leftfill + rightfill ); |
181 | 182 | ||
182 | for ( int y = clip. top ( ); y <= clip. bottom ( ); y++ ) { | 183 | for ( int y = clip. top ( ); y <= clip. bottom ( ); y++ ) { |
183 | if (( y < framerect. top ( )) || ( y > framerect. bottom ( ))) { | 184 | if (( y < framerect. top ( )) || ( y > framerect. bottom ( ))) { |
184 | // "above" or "below" the video -> black | 185 | // "above" or "below" the video -> black |
185 | memset ( dst, 0, clipwidth ); | 186 | memset ( dst, 0, clipwidth ); |
186 | } | 187 | } |
187 | else { | 188 | else { |
188 | if ( leftfill ) | 189 | if ( leftfill ) |
189 | memset ( dst, 0, leftfill ); // "left" border -> black | 190 | memset ( dst, 0, leftfill ); // "left" border -> black |
190 | 191 | ||
191 | if ( framefill ) { // blit in the video frame | 192 | if ( framefill ) { // blit in the video frame |
192 | // see above for an explanation of the different memcpys | 193 | // see above for an explanation of the different memcpys |
193 | 194 | ||
194 | switch ( rot ) { | 195 | switch ( rot ) { |
195 | case 0: memcpy ( dst + leftfill, src, framefill ); break; | 196 | case 0: memcpy ( dst + leftfill, src, framefill & ~1 ); break; |
196 | case 1: memcpy_step ( dst + leftfill, src, framefill, m_bytes_per_line_frame ); break; | 197 | case 1: memcpy_step ( dst + leftfill, src, framefill, m_bytes_per_line_frame ); break; |
197 | case 2: memcpy_rev ( dst + leftfill, src, framefill ); break; | 198 | case 2: memcpy_rev ( dst + leftfill, src, framefill ); break; |
198 | case 3: memcpy_step_rev ( dst + leftfill, src, framefill, m_bytes_per_line_frame ); break; | 199 | case 3: memcpy_step_rev ( dst + leftfill, src, framefill, m_bytes_per_line_frame ); break; |
199 | default: break; | 200 | default: break; |
200 | } | 201 | } |
201 | } | 202 | } |
202 | if ( rightfill ) | 203 | if ( rightfill ) |
203 | memset ( dst + leftfill + framefill, 0, rightfill ); // "right" border -> black | 204 | memset ( dst + leftfill + framefill, 0, rightfill ); // "right" border -> black |
204 | } | 205 | } |
205 | 206 | ||
206 | dst += m_bytes_per_line_fb; // advance one line in the framebuffer | 207 | dst += m_bytes_per_line_fb; // advance one line in the framebuffer |
207 | 208 | ||
208 | // advance one "line" in the xine frame data | 209 | // advance one "line" in the xine frame data |
209 | switch ( rot ) { | 210 | switch ( rot ) { |
210 | case 0: src += m_bytes_per_line_frame;break; | 211 | case 0: src += m_bytes_per_line_frame;break; |
211 | case 1: src -= m_bytes_per_pixel; break; | 212 | case 1: src -= m_bytes_per_pixel; break; |
212 | case 2: src -= m_bytes_per_line_frame; break; | 213 | case 2: src -= m_bytes_per_line_frame; break; |
213 | case 3: src += m_bytes_per_pixel; break; | 214 | case 3: src += m_bytes_per_pixel; break; |
214 | default: break; | 215 | default: break; |
215 | } | 216 | } |
216 | } | 217 | } |
217 | } | 218 | } |
218 | } | 219 | } |
219 | 220 | ||
220 | { | 221 | { |
221 | // QVFB hack by Martin Jones | 222 | // QVFB hack by Martin Jones |
222 | // We need to "touch" all affected clip rects with a normal QPainter in addition to the QDirectPainter | 223 | // We need to "touch" all affected clip rects with a normal QPainter in addition to the QDirectPainter |
223 | 224 | ||
224 | QPainter p ( this ); | 225 | QPainter p ( this ); |
225 | 226 | ||
226 | for ( int i = qt_bug_workaround_clip_rects. size ( ) - 1; i >= 0; i-- ) { | 227 | for ( int i = qt_bug_workaround_clip_rects. size ( ) - 1; i >= 0; i-- ) { |
227 | p. fillRect ( QRect ( mapFromGlobal ( qt_bug_workaround_clip_rects [ i ]. topLeft ( )), qt_bug_workaround_clip_rects [ i ]. size ( )), QBrush ( NoBrush )); | 228 | p. fillRect ( QRect ( mapFromGlobal ( qt_bug_workaround_clip_rects [ i ]. topLeft ( )), qt_bug_workaround_clip_rects [ i ]. size ( )), QBrush ( NoBrush )); |
228 | } | 229 | } |
229 | } | 230 | } |
230 | } | 231 | } |
231 | } | 232 | } |
232 | 233 | ||
233 | 234 | ||
234 | QImage *XineVideoWidget::logo ( ) const | 235 | QImage *XineVideoWidget::logo ( ) const |
235 | { | 236 | { |
236 | return m_logo; | 237 | return m_logo; |
237 | } | 238 | } |
238 | 239 | ||
239 | 240 | ||
240 | void XineVideoWidget::setLogo ( QImage* logo ) | 241 | void XineVideoWidget::setLogo ( QImage* logo ) |
241 | { | 242 | { |
242 | delete m_logo; | 243 | delete m_logo; |
243 | m_logo = logo; | 244 | m_logo = logo; |
244 | } | 245 | } |
245 | 246 | ||
246 | void XineVideoWidget::setVideoFrame ( uchar* img, int w, int h, int bpl ) | 247 | void XineVideoWidget::setVideoFrame ( uchar* img, int w, int h, int bpl ) |
247 | { | 248 | { |
248 | bool rot90 = (( -m_rotation ) & 1 ); | 249 | bool rot90 = (( -m_rotation ) & 1 ); |
249 | 250 | ||
250 | if ( rot90 ) { // if the rotation is 90 or 270 we have to swap width / height | 251 | if ( rot90 ) { // if the rotation is 90 or 270 we have to swap width / height |
251 | int d = w; | 252 | int d = w; |
252 | w = h; | 253 | w = h; |
253 | h = d; | 254 | h = d; |
254 | } | 255 | } |
255 | 256 | ||
256 | m_lastframe = m_thisframe; | 257 | m_lastframe = m_thisframe; |
257 | m_thisframe. setRect (( width ( ) - w ) / 2, ( height ( ) - h ) / 2, w , h ); | 258 | m_thisframe. setRect (( width ( ) - w ) / 2, ( height ( ) - h ) / 2, w , h ); |
258 | 259 | ||
259 | m_buff = img; | 260 | m_buff = img; |
260 | m_bytes_per_line_frame = bpl; | 261 | m_bytes_per_line_frame = bpl; |
261 | 262 | ||
262 | // only repaint the area that *really* needs to be repainted | 263 | // only repaint the area that *really* needs to be repainted |
263 | 264 | ||
264 | repaint ((( m_thisframe & m_lastframe ) != m_lastframe ) ? m_lastframe : m_thisframe, false ); | 265 | repaint ((( m_thisframe & m_lastframe ) != m_lastframe ) ? m_lastframe : m_thisframe, false ); |
265 | } | 266 | } |
266 | 267 | ||
267 | void XineVideoWidget::resizeEvent ( QResizeEvent * ) | 268 | void XineVideoWidget::resizeEvent ( QResizeEvent * ) |
268 | { | 269 | { |
269 | emit videoResized( videoSize() ); | 270 | emit videoResized( videoSize() ); |
270 | } | 271 | } |
271 | 272 | ||
272 | 273 | ||
273 | void XineVideoWidget::mouseReleaseEvent ( QMouseEvent * /*me*/ ) | 274 | void XineVideoWidget::mouseReleaseEvent ( QMouseEvent * /*me*/ ) |
274 | { | 275 | { |
275 | emit clicked(); | 276 | emit clicked(); |
276 | } | 277 | } |
277 | 278 | ||