Diffstat (limited to 'noncore/multimedia/opieplayer2/xinevideowidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/xinevideowidget.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/noncore/multimedia/opieplayer2/xinevideowidget.cpp b/noncore/multimedia/opieplayer2/xinevideowidget.cpp index 3e28e54..bc95d86 100644 --- a/noncore/multimedia/opieplayer2/xinevideowidget.cpp +++ b/noncore/multimedia/opieplayer2/xinevideowidget.cpp | |||
@@ -132,24 +132,25 @@ void XineVideoWidget::paintEvent ( QPaintEvent * ) | |||
132 | const QRect &clip = dp. rect ( i ); | 132 | const QRect &clip = dp. rect ( i ); |
133 | 133 | ||
134 | qt_bug_workaround_clip_rects [i] = qt_screen-> mapFromDevice ( clip, QSize ( qt_screen-> width ( ), qt_screen-> height ( ))); | 134 | qt_bug_workaround_clip_rects [i] = qt_screen-> mapFromDevice ( clip, QSize ( qt_screen-> width ( ), qt_screen-> height ( ))); |
135 | 135 | ||
136 | uchar *dst = fb + ( clip. x ( ) * m_bytes_per_pixel ) + ( clip. y ( ) * m_bytes_per_line_fb ); | 136 | uchar *dst = fb + ( clip. x ( ) * m_bytes_per_pixel ) + ( clip. y ( ) * m_bytes_per_line_fb ); |
137 | uchar *src = frame; | 137 | uchar *src = frame; |
138 | 138 | ||
139 | switch ( rot ) { | 139 | switch ( rot ) { |
140 | case 0: src += ( (( clip. x ( ) - framerect. x ( )) * m_bytes_per_pixel ) + (( clip. y ( ) - framerect. y ( )) * m_bytes_per_line_frame ) ); break; | 140 | case 0: src += ( (( clip. x ( ) - framerect. x ( )) * m_bytes_per_pixel ) + (( clip. y ( ) - framerect. y ( )) * m_bytes_per_line_frame ) ); break; |
141 | 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; | 141 | 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; |
142 | 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; | 142 | 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; |
143 | case 3: src += ( (( clip. y ( ) - framerect. y ( )) * m_bytes_per_pixel ) + (( clip. x ( ) - framerect. x ( )) * m_bytes_per_line_frame ) ); break; | 143 | case 3: src += ( (( clip. y ( ) - framerect. y ( )) * m_bytes_per_pixel ) + (( clip. x ( ) - framerect. x ( )) * m_bytes_per_line_frame ) ); break; |
144 | default: break; | ||
144 | } | 145 | } |
145 | 146 | ||
146 | uint leftfill = 0; | 147 | uint leftfill = 0; |
147 | uint framefill = 0; | 148 | uint framefill = 0; |
148 | uint rightfill = 0; | 149 | uint rightfill = 0; |
149 | uint clipwidth = clip. width ( ) * m_bytes_per_pixel; | 150 | uint clipwidth = clip. width ( ) * m_bytes_per_pixel; |
150 | 151 | ||
151 | if ( clip. left ( ) < framerect. left ( )) | 152 | if ( clip. left ( ) < framerect. left ( )) |
152 | leftfill = (( framerect. left ( ) - clip. left ( )) * m_bytes_per_pixel ) <? clipwidth; | 153 | leftfill = (( framerect. left ( ) - clip. left ( )) * m_bytes_per_pixel ) <? clipwidth; |
153 | if ( clip. right ( ) > framerect. right ( )) | 154 | if ( clip. right ( ) > framerect. right ( )) |
154 | rightfill = (( clip. right ( ) - framerect. right ( )) * m_bytes_per_pixel ) <? clipwidth; | 155 | rightfill = (( clip. right ( ) - framerect. right ( )) * m_bytes_per_pixel ) <? clipwidth; |
155 | 156 | ||
@@ -160,37 +161,39 @@ void XineVideoWidget::paintEvent ( QPaintEvent * ) | |||
160 | memset ( dst, 0, clipwidth ); | 161 | memset ( dst, 0, clipwidth ); |
161 | } | 162 | } |
162 | else { | 163 | else { |
163 | if ( leftfill ) | 164 | if ( leftfill ) |
164 | memset ( dst, 0, leftfill ); | 165 | memset ( dst, 0, leftfill ); |
165 | 166 | ||
166 | if ( framefill ) { | 167 | if ( framefill ) { |
167 | switch ( rot ) { | 168 | switch ( rot ) { |
168 | case 0: memcpy ( dst + leftfill, src, framefill ); break; | 169 | case 0: memcpy ( dst + leftfill, src, framefill ); break; |
169 | case 1: memcpy_step ( dst + leftfill, src, framefill, m_bytes_per_line_frame ); break; | 170 | case 1: memcpy_step ( dst + leftfill, src, framefill, m_bytes_per_line_frame ); break; |
170 | case 2: memcpy_rev ( dst + leftfill, src, framefill ); break; | 171 | case 2: memcpy_rev ( dst + leftfill, src, framefill ); break; |
171 | case 3: memcpy_step_rev ( dst + leftfill, src, framefill, m_bytes_per_line_frame ); break; | 172 | case 3: memcpy_step_rev ( dst + leftfill, src, framefill, m_bytes_per_line_frame ); break; |
173 | default: break; | ||
172 | } | 174 | } |
173 | } | 175 | } |
174 | if ( rightfill ) | 176 | if ( rightfill ) |
175 | memset ( dst + leftfill + framefill, 0, rightfill ); | 177 | memset ( dst + leftfill + framefill, 0, rightfill ); |
176 | } | 178 | } |
177 | 179 | ||
178 | dst += m_bytes_per_line_fb; | 180 | dst += m_bytes_per_line_fb; |
179 | 181 | ||
180 | switch ( rot ) { | 182 | switch ( rot ) { |
181 | case 0: src += m_bytes_per_line_frame; break; | 183 | case 0: src += m_bytes_per_line_frame; break; |
182 | case 1: src -= m_bytes_per_pixel; break; | 184 | case 1: src -= m_bytes_per_pixel; break; |
183 | case 2: src -= m_bytes_per_line_frame; break; | 185 | case 2: src -= m_bytes_per_line_frame; break; |
184 | case 3: src += m_bytes_per_pixel; break; | 186 | case 3: src += m_bytes_per_pixel; break; |
187 | default: break; | ||
185 | } | 188 | } |
186 | } | 189 | } |
187 | } | 190 | } |
188 | } | 191 | } |
189 | //qWarning ( " ||| painting |||" ); | 192 | //qWarning ( " ||| painting |||" ); |
190 | { | 193 | { |
191 | // QVFB hack by MArtin Jones | 194 | // QVFB hack by MArtin Jones |
192 | QPainter p ( this ); | 195 | QPainter p ( this ); |
193 | 196 | ||
194 | for ( int i = qt_bug_workaround_clip_rects. size ( ) - 1; i >= 0; i-- ) { | 197 | for ( int i = qt_bug_workaround_clip_rects. size ( ) - 1; i >= 0; i-- ) { |
195 | p. fillRect ( QRect ( mapFromGlobal ( qt_bug_workaround_clip_rects [i]. topLeft ( )), qt_bug_workaround_clip_rects [i]. size ( )), QBrush ( NoBrush ) ); | 198 | p. fillRect ( QRect ( mapFromGlobal ( qt_bug_workaround_clip_rects [i]. topLeft ( )), qt_bug_workaround_clip_rects [i]. size ( )), QBrush ( NoBrush ) ); |
196 | } | 199 | } |
@@ -235,36 +238,36 @@ void XineVideoWidget::resizeEvent ( QResizeEvent * ) | |||
235 | m_rotation = fs ? -qt_screen-> transformOrientation ( ) : 0; | 238 | m_rotation = fs ? -qt_screen-> transformOrientation ( ) : 0; |
236 | 239 | ||
237 | if ( fs && qt_screen-> isTransformed ( )) { | 240 | if ( fs && qt_screen-> isTransformed ( )) { |
238 | s = qt_screen-> mapToDevice ( s ); | 241 | s = qt_screen-> mapToDevice ( s ); |
239 | } | 242 | } |
240 | 243 | ||
241 | // qDebug ( "\n\nResize: %dx%d, Rot: %d", s.width(),s.height(),m_rotation ); | 244 | // qDebug ( "\n\nResize: %dx%d, Rot: %d", s.width(),s.height(),m_rotation ); |
242 | 245 | ||
243 | emit videoResized ( s ); | 246 | emit videoResized ( s ); |
244 | } | 247 | } |
245 | 248 | ||
246 | 249 | ||
247 | void XineVideoWidget::mousePressEvent ( QMouseEvent *me ) | 250 | void XineVideoWidget::mousePressEvent ( QMouseEvent * /*me*/ ) |
248 | { | 251 | { |
249 | QWidget *p = parentWidget ( ); | 252 | QWidget *p = parentWidget ( ); |
250 | 253 | ||
251 | if ( p ) { | 254 | if ( p ) { |
252 | // QMouseEvent pme ( QEvent::MouseButtonPress, mapToParent ( me-> pos ( )), me-> globalPos ( ), me-> button ( ), me-> state ( )); | 255 | // QMouseEvent pme ( QEvent::MouseButtonPress, mapToParent ( me-> pos ( )), me-> globalPos ( ), me-> button ( ), me-> state ( )); |
253 | 256 | ||
254 | // QApplication::sendEvent ( p, &pme ); | 257 | // QApplication::sendEvent ( p, &pme ); |
255 | // emit clicked(); | 258 | // emit clicked(); |
256 | } | 259 | } |
257 | } | 260 | } |
258 | 261 | ||
259 | void XineVideoWidget::mouseReleaseEvent ( QMouseEvent *me ) | 262 | void XineVideoWidget::mouseReleaseEvent ( QMouseEvent * /*me*/ ) |
260 | { | 263 | { |
261 | QWidget *p = parentWidget ( ); | 264 | QWidget *p = parentWidget ( ); |
262 | 265 | ||
263 | if ( p ) { | 266 | if ( p ) { |
264 | // QMouseEvent pme ( QEvent::MouseButtonRelease, mapToParent ( me-> pos ( )), me-> globalPos ( ), me-> button ( ), me-> state ( )); | 267 | // QMouseEvent pme ( QEvent::MouseButtonRelease, mapToParent ( me-> pos ( )), me-> globalPos ( ), me-> button ( ), me-> state ( )); |
265 | 268 | ||
266 | // QApplication::sendEvent ( p, &pme ); | 269 | // QApplication::sendEvent ( p, &pme ); |
267 | emit clicked(); | 270 | emit clicked(); |
268 | } | 271 | } |
269 | } | 272 | } |
270 | 273 | ||