summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/xinevideowidget.cpp
authorsandman <sandman>2002-08-01 21:18:11 (UTC)
committer sandman <sandman>2002-08-01 21:18:11 (UTC)
commit54eb82d90a4ee254c0abb6d33937e76aeb32ddf1 (patch) (side-by-side diff)
treee9628916c721262232efc3314a8ccd29613a7189 /noncore/multimedia/opieplayer2/xinevideowidget.cpp
parentc80b2060a6f051f16690db4b8f0ccbc7dde84ec5 (diff)
downloadopie-54eb82d90a4ee254c0abb6d33937e76aeb32ddf1.zip
opie-54eb82d90a4ee254c0abb6d33937e76aeb32ddf1.tar.gz
opie-54eb82d90a4ee254c0abb6d33937e76aeb32ddf1.tar.bz2
video in qvfb works now with 0/90/180/270° rotation
Diffstat (limited to 'noncore/multimedia/opieplayer2/xinevideowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/xinevideowidget.cpp25
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
@@ -56,4 +56,8 @@ static inline void memcpy_step ( void *dst, void *src, size_t len, size_t step )
len >>= 1;
while ( len-- ) {
+// *((char *) dst ) = *((char *) src + 1);
+// *((char *) dst + 1) = *((char *) src );
+// ((char *) dst ) += 2;
+
*((short int *) dst )++ = *((short int *) src );
((char *) src ) += step;
@@ -70,4 +74,8 @@ static inline void memcpy_step_rev ( void *dst, void *src, size_t len, size_t st
((char *) src ) -= step;
*((short int *) dst )++ = *((short int *) src );
+
+// *((char *) dst ) = *((char *) src + 1);
+// *((char *) dst + 1) = *((char *) src );
+// ((char *) dst ) += 2;
}
}
@@ -102,5 +110,5 @@ void XineVideoWidget::clear ( )
void XineVideoWidget::paintEvent ( QPaintEvent * )
{
- qWarning( "painting" );
+ qWarning( "painting <<<" );
if ( m_buff == 0 ) {
QPainter p ( this );
@@ -110,5 +118,5 @@ void XineVideoWidget::paintEvent ( QPaintEvent * )
}
else {
- qWarning ( "paintevent\n" );
+// qWarning ( "paintevent\n" );
QArray <QRect> qt_bug_workaround_clip_rects;
@@ -117,4 +125,6 @@ void XineVideoWidget::paintEvent ( QPaintEvent * )
QDirectPainter dp ( this );
+ int rot = dp. transformOrientation ( );
+
uchar *fb = dp. frameBuffer ( );
uchar *frame = m_buff; // rot == 0 ? m_buff : m_buff + ( m_thisframe. height ( ) - 1 ) * m_bytes_per_line_frame;
@@ -129,6 +139,4 @@ void XineVideoWidget::paintEvent ( QPaintEvent * )
qt_bug_workaround_clip_rects [i] = clip;
- int rot = dp. transformOrientation ( );
-
if ( rot == 0 || rot == 180 ) {
uchar *dst = fb + ( clip. x ( ) * m_bytes_per_pixel ) + ( clip. y ( ) * m_bytes_per_line_fb );
@@ -177,5 +185,5 @@ void XineVideoWidget::paintEvent ( QPaintEvent * )
if ( rot == 270 )
- src += (( framerect. height ( ) - 1 ) * m_bytes_per_line_frame );
+ src += (( framerect. height ( ) - 1 ) * m_bytes_per_pixel );
uint leftfill = 0;
@@ -201,7 +209,7 @@ void XineVideoWidget::paintEvent ( QPaintEvent * )
if ( framefill ) {
if ( rot == 90 )
- memcpy_step ( dst + leftfill, src, framefill, m_bytes_per_line_frame );
- else
memcpy_step_rev ( dst + leftfill, src, framefill, m_bytes_per_line_frame );
+ else
+ memcpy_step ( dst + leftfill, src, framefill, m_bytes_per_line_frame );
}
if ( rightfill )
@@ -210,5 +218,5 @@ void XineVideoWidget::paintEvent ( QPaintEvent * )
dst += m_bytes_per_line_fb;
- src += ( rot == 90 ? +1 : -1 ); // m_bytes_per_line_frame : -m_bytes_per_line_frame );
+ src += ( rot == 270 ? -m_bytes_per_pixel : m_bytes_per_pixel );
}
}
@@ -224,4 +232,5 @@ void XineVideoWidget::paintEvent ( QPaintEvent * )
}
}
+ qWarning( "painting >>>" );
}