Diffstat (limited to 'noncore/multimedia/opieplayer2/xinevideowidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/xinevideowidget.cpp | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/noncore/multimedia/opieplayer2/xinevideowidget.cpp b/noncore/multimedia/opieplayer2/xinevideowidget.cpp index e46c4df..8e8f139 100644 --- a/noncore/multimedia/opieplayer2/xinevideowidget.cpp +++ b/noncore/multimedia/opieplayer2/xinevideowidget.cpp | |||
@@ -55,6 +55,10 @@ static inline void memcpy_step ( void *dst, void *src, size_t len, size_t step ) | |||
55 | { | 55 | { |
56 | len >>= 1; | 56 | len >>= 1; |
57 | while ( len-- ) { | 57 | while ( len-- ) { |
58 | // *((char *) dst ) = *((char *) src + 1); | ||
59 | // *((char *) dst + 1) = *((char *) src ); | ||
60 | // ((char *) dst ) += 2; | ||
61 | |||
58 | *((short int *) dst )++ = *((short int *) src ); | 62 | *((short int *) dst )++ = *((short int *) src ); |
59 | ((char *) src ) += step; | 63 | ((char *) src ) += step; |
60 | } | 64 | } |
@@ -69,6 +73,10 @@ static inline void memcpy_step_rev ( void *dst, void *src, size_t len, size_t st | |||
69 | while ( len-- ) { | 73 | while ( len-- ) { |
70 | ((char *) src ) -= step; | 74 | ((char *) src ) -= step; |
71 | *((short int *) dst )++ = *((short int *) src ); | 75 | *((short int *) dst )++ = *((short int *) src ); |
76 | |||
77 | // *((char *) dst ) = *((char *) src + 1); | ||
78 | // *((char *) dst + 1) = *((char *) src ); | ||
79 | // ((char *) dst ) += 2; | ||
72 | } | 80 | } |
73 | } | 81 | } |
74 | 82 | ||
@@ -101,7 +109,7 @@ void XineVideoWidget::clear ( ) | |||
101 | 109 | ||
102 | void XineVideoWidget::paintEvent ( QPaintEvent * ) | 110 | void XineVideoWidget::paintEvent ( QPaintEvent * ) |
103 | { | 111 | { |
104 | qWarning( "painting" ); | 112 | qWarning( "painting <<<" ); |
105 | if ( m_buff == 0 ) { | 113 | if ( m_buff == 0 ) { |
106 | QPainter p ( this ); | 114 | QPainter p ( this ); |
107 | p. fillRect ( rect ( ), black ); | 115 | p. fillRect ( rect ( ), black ); |
@@ -109,13 +117,15 @@ void XineVideoWidget::paintEvent ( QPaintEvent * ) | |||
109 | qWarning ( "logo\n" ); | 117 | qWarning ( "logo\n" ); |
110 | } | 118 | } |
111 | else { | 119 | else { |
112 | qWarning ( "paintevent\n" ); | 120 | // qWarning ( "paintevent\n" ); |
113 | 121 | ||
114 | QArray <QRect> qt_bug_workaround_clip_rects; | 122 | QArray <QRect> qt_bug_workaround_clip_rects; |
115 | 123 | ||
116 | { | 124 | { |
117 | QDirectPainter dp ( this ); | 125 | QDirectPainter dp ( this ); |
118 | 126 | ||
127 | int rot = dp. transformOrientation ( ); | ||
128 | |||
119 | uchar *fb = dp. frameBuffer ( ); | 129 | uchar *fb = dp. frameBuffer ( ); |
120 | uchar *frame = m_buff; // rot == 0 ? m_buff : m_buff + ( m_thisframe. height ( ) - 1 ) * m_bytes_per_line_frame; | 130 | uchar *frame = m_buff; // rot == 0 ? m_buff : m_buff + ( m_thisframe. height ( ) - 1 ) * m_bytes_per_line_frame; |
121 | 131 | ||
@@ -128,8 +138,6 @@ void XineVideoWidget::paintEvent ( QPaintEvent * ) | |||
128 | 138 | ||
129 | qt_bug_workaround_clip_rects [i] = clip; | 139 | qt_bug_workaround_clip_rects [i] = clip; |
130 | 140 | ||
131 | int rot = dp. transformOrientation ( ); | ||
132 | |||
133 | if ( rot == 0 || rot == 180 ) { | 141 | if ( rot == 0 || rot == 180 ) { |
134 | uchar *dst = fb + ( clip. x ( ) * m_bytes_per_pixel ) + ( clip. y ( ) * m_bytes_per_line_fb ); | 142 | uchar *dst = fb + ( clip. x ( ) * m_bytes_per_pixel ) + ( clip. y ( ) * m_bytes_per_line_fb ); |
135 | uchar *src = frame + (( clip. x ( ) - framerect. x ( )) * m_bytes_per_pixel ) + (( clip. y ( ) - framerect. y ( )) * m_bytes_per_line_frame ); | 143 | uchar *src = frame + (( clip. x ( ) - framerect. x ( )) * m_bytes_per_pixel ) + (( clip. y ( ) - framerect. y ( )) * m_bytes_per_line_frame ); |
@@ -176,7 +184,7 @@ void XineVideoWidget::paintEvent ( QPaintEvent * ) | |||
176 | uchar *src = frame + (( clip. x ( ) - framerect. x ( )) * m_bytes_per_pixel ) + (( clip. y ( ) - framerect. y ( )) * m_bytes_per_line_frame ); | 184 | uchar *src = frame + (( clip. x ( ) - framerect. x ( )) * m_bytes_per_pixel ) + (( clip. y ( ) - framerect. y ( )) * m_bytes_per_line_frame ); |
177 | 185 | ||
178 | if ( rot == 270 ) | 186 | if ( rot == 270 ) |
179 | src += (( framerect. height ( ) - 1 ) * m_bytes_per_line_frame ); | 187 | src += (( framerect. height ( ) - 1 ) * m_bytes_per_pixel ); |
180 | 188 | ||
181 | uint leftfill = 0; | 189 | uint leftfill = 0; |
182 | uint framefill = 0; | 190 | uint framefill = 0; |
@@ -200,16 +208,16 @@ void XineVideoWidget::paintEvent ( QPaintEvent * ) | |||
200 | 208 | ||
201 | if ( framefill ) { | 209 | if ( framefill ) { |
202 | if ( rot == 90 ) | 210 | if ( rot == 90 ) |
203 | memcpy_step ( dst + leftfill, src, framefill, m_bytes_per_line_frame ); | ||
204 | else | ||
205 | memcpy_step_rev ( dst + leftfill, src, framefill, m_bytes_per_line_frame ); | 211 | memcpy_step_rev ( dst + leftfill, src, framefill, m_bytes_per_line_frame ); |
212 | else | ||
213 | memcpy_step ( dst + leftfill, src, framefill, m_bytes_per_line_frame ); | ||
206 | } | 214 | } |
207 | if ( rightfill ) | 215 | if ( rightfill ) |
208 | memset ( dst + leftfill + framefill, 0, rightfill ); | 216 | memset ( dst + leftfill + framefill, 0, rightfill ); |
209 | } | 217 | } |
210 | 218 | ||
211 | dst += m_bytes_per_line_fb; | 219 | dst += m_bytes_per_line_fb; |
212 | src += ( rot == 90 ? +1 : -1 ); // m_bytes_per_line_frame : -m_bytes_per_line_frame ); | 220 | src += ( rot == 270 ? -m_bytes_per_pixel : m_bytes_per_pixel ); |
213 | } | 221 | } |
214 | } | 222 | } |
215 | } | 223 | } |
@@ -223,6 +231,7 @@ void XineVideoWidget::paintEvent ( QPaintEvent * ) | |||
223 | } | 231 | } |
224 | } | 232 | } |
225 | } | 233 | } |
234 | qWarning( "painting >>>" ); | ||
226 | } | 235 | } |
227 | 236 | ||
228 | int XineVideoWidget::height ( ) const | 237 | int XineVideoWidget::height ( ) const |