summaryrefslogtreecommitdiff
path: root/noncore
authorsandman <sandman>2002-08-01 21:18:11 (UTC)
committer sandman <sandman>2002-08-01 21:18:11 (UTC)
commit54eb82d90a4ee254c0abb6d33937e76aeb32ddf1 (patch) (unidiff)
treee9628916c721262232efc3314a8ccd29613a7189 /noncore
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') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp6
-rw-r--r--noncore/multimedia/opieplayer2/nullvideo.c2
-rw-r--r--noncore/multimedia/opieplayer2/xinevideowidget.cpp25
3 files changed, 22 insertions, 11 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp
index ac5cdd5..5ae6c21 100644
--- a/noncore/multimedia/opieplayer2/lib.cpp
+++ b/noncore/multimedia/opieplayer2/lib.cpp
@@ -188,7 +188,7 @@ void Lib::xine_event_handler( void* user_data, xine_event_t* t ) {
188void Lib::xine_display_frame( void* user_data, uint8_t *frame, 188void Lib::xine_display_frame( void* user_data, uint8_t *frame,
189 int width, int height, int bytes ) { 189 int width, int height, int bytes ) {
190 printf("display x frame"); 190// printf("display x frame");
191 ((Lib*)user_data)->drawFrame( frame, width, height, bytes ); 191 ((Lib*)user_data)->drawFrame( frame, width, height, bytes );
192 printf("displayed x frame\n"); 192// printf("displayed x frame\n");
193} 193}
194void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) { 194void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) {
@@ -197,5 +197,5 @@ void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) {
197 return; 197 return;
198 } 198 }
199 qWarning("called draw frame %d %d", width, height); 199// qWarning("called draw frame %d %d", width, height);
200 200
201 QSize size = m_wid->size(); 201 QSize size = m_wid->size();
diff --git a/noncore/multimedia/opieplayer2/nullvideo.c b/noncore/multimedia/opieplayer2/nullvideo.c
index 63d5752..3a18a40 100644
--- a/noncore/multimedia/opieplayer2/nullvideo.c
+++ b/noncore/multimedia/opieplayer2/nullvideo.c
@@ -15,4 +15,6 @@
15#include "yuv2rgb.h" 15#include "yuv2rgb.h"
16 16
17#define printf(x,...)
18
17/* the caller for our event draw handler */ 19/* the caller for our event draw handler */
18typedef void (*display_xine_frame_t) (void *user_data, uint8_t* frame, 20typedef void (*display_xine_frame_t) (void *user_data, uint8_t* frame,
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 )
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;
@@ -70,4 +74,8 @@ static inline void memcpy_step_rev ( void *dst, void *src, size_t len, size_t st
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}
@@ -102,5 +110,5 @@ void XineVideoWidget::clear ( )
102void XineVideoWidget::paintEvent ( QPaintEvent * ) 110void 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 );
@@ -110,5 +118,5 @@ void XineVideoWidget::paintEvent ( QPaintEvent * )
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;
@@ -117,4 +125,6 @@ void XineVideoWidget::paintEvent ( QPaintEvent * )
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;
@@ -129,6 +139,4 @@ void XineVideoWidget::paintEvent ( QPaintEvent * )
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 );
@@ -177,5 +185,5 @@ void XineVideoWidget::paintEvent ( QPaintEvent * )
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;
@@ -201,7 +209,7 @@ void XineVideoWidget::paintEvent ( QPaintEvent * )
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 )
@@ -210,5 +218,5 @@ void XineVideoWidget::paintEvent ( QPaintEvent * )
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 }
@@ -224,4 +232,5 @@ void XineVideoWidget::paintEvent ( QPaintEvent * )
224 } 232 }
225 } 233 }
234 qWarning( "painting >>>" );
226} 235}
227 236