summaryrefslogtreecommitdiff
authorsandman <sandman>2002-08-01 01:33:23 (UTC)
committer sandman <sandman>2002-08-01 01:33:23 (UTC)
commit32b7fdb0e9e5ec6cb6f791962efe68c40564b178 (patch) (side-by-side diff)
tree86044a8b3884536f65d38b32d3e0552c30f13a81
parentba034bf4cb91b83654056945fc27313a28528015 (diff)
downloadopie-32b7fdb0e9e5ec6cb6f791962efe68c40564b178.zip
opie-32b7fdb0e9e5ec6cb6f791962efe68c40564b178.tar.gz
opie-32b7fdb0e9e5ec6cb6f791962efe68c40564b178.tar.bz2
Fixed video output (frames allocated before video was enabled via
show_video flag have never been displayes thereafter) Also optimized the video widget
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp2
-rw-r--r--noncore/multimedia/opieplayer2/nullvideo.c13
-rw-r--r--noncore/multimedia/opieplayer2/xinevideowidget.cpp61
-rw-r--r--noncore/multimedia/opieplayer2/xinevideowidget.h3
4 files changed, 38 insertions, 41 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp
index aa37cd7..ac5cdd5 100644
--- a/noncore/multimedia/opieplayer2/lib.cpp
+++ b/noncore/multimedia/opieplayer2/lib.cpp
@@ -206,3 +206,3 @@ void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) {
m_wid->setImage( frame, yoffset, xoffset, width, height, linestep, bytes, m_bytes_per_pixel );
- m_wid->repaint();
+// m_wid->repaint(false);
diff --git a/noncore/multimedia/opieplayer2/nullvideo.c b/noncore/multimedia/opieplayer2/nullvideo.c
index f356e76..63d5752 100644
--- a/noncore/multimedia/opieplayer2/nullvideo.c
+++ b/noncore/multimedia/opieplayer2/nullvideo.c
@@ -74,3 +74,3 @@ struct opie_frame_s {
- int show_video;
+// int show_video;
null_driver_t *output;
@@ -87,3 +87,3 @@ static void null_frame_copy (vo_frame_t *vo_img, uint8_t **src) {
printf("frame copy\n");
- if(!frame->show_video ){ printf("no video\n"); return; } // no video
+ if(!frame->output->m_show_video ){ printf("no video\n"); return; } // no video
@@ -96,3 +96,2 @@ static void null_frame_copy (vo_frame_t *vo_img, uint8_t **src) {
src[0]);
-
}
@@ -147,3 +146,3 @@ static vo_frame_t* null_alloc_frame( vo_driver_t* self ){
frame->output = this;
- frame->show_video = this->m_show_video;
+// frame->show_video = this->m_show_video;
/* initialize the frame*/
@@ -167,3 +166,3 @@ static void null_compute_ideal_size (null_driver_t *this, opie_frame_t *frame) {
- if (!this->m_is_scaling || !this->m_show_video) {
+ if (!this->m_is_scaling /*|| !this->m_show_video*/) {
printf("Not scaling\n");
@@ -303,3 +302,3 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img,
this->gui_changed = 0;
- frame->show_video = this->m_show_video;
+// frame->show_video = this->m_show_video;
@@ -357,3 +356,3 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img,
*/
- if(this->m_show_video ){
+ if(1 /*this->m_show_video*/ ){
printf("showing video\n");
diff --git a/noncore/multimedia/opieplayer2/xinevideowidget.cpp b/noncore/multimedia/opieplayer2/xinevideowidget.cpp
index d665f16..b5a714e 100644
--- a/noncore/multimedia/opieplayer2/xinevideowidget.cpp
+++ b/noncore/multimedia/opieplayer2/xinevideowidget.cpp
@@ -48,3 +48,3 @@ XineVideoWidget::XineVideoWidget( int width,
const char* name )
- : QWidget( parent, name )
+ : QWidget( parent, name, WRepaintNoErase | WResizeNoErase )
{
@@ -63,3 +63,3 @@ void XineVideoWidget::clear() {
m_buff = 0;
- repaint();
+ repaint(false);
}
@@ -67,15 +67,24 @@ void XineVideoWidget::paintEvent( QPaintEvent* e ) {
qWarning("painting");
+ if (m_buff == 0 ) {
QPainter p(this );
- p.setBrush( QBrush( Qt::black ) );
- p.drawRect( rect() );
- if (m_buff == 0 )
+ p.fillRect( rect(), black );
p.drawImage( 0, 0, *m_image );
+ qWarning ( "logo\n" );
+ }
else {
qWarning("paitnevent\n");
+ {
+ if (( m_thisframe & m_lastframe ) != m_lastframe ) {
+ QPainter p ( this );
+ p. fillRect ( m_lastframe, black );
+ }
+ }
+ {
QDirectPainter dp( this );
- uchar* dst = dp.frameBuffer() + (m_yOff + dp.yOffset() ) * linestep +
- (m_xOff + dp.xOffset() ) * m_bytes_per_pixel;
+
+ uchar* dst = dp.frameBuffer() + (m_thisframe. y ( ) + dp.yOffset() ) * linestep +
+ (m_thisframe. x ( ) + dp.xOffset() ) * m_bytes_per_pixel;
uchar* frame = m_buff;
- for(int y = 0; y < m_Height; y++ ) {
+ for(int y = 0; y < m_thisframe. height ( ); y++ ) {
memcpy( dst, frame, m_bytes );
@@ -84,7 +93,9 @@ void XineVideoWidget::paintEvent( QPaintEvent* e ) {
}
+ }
+ {
// QVFB hack by MArtin Jones
-// QPainter dp2(this);
- // dp2.fillRect( rect(), QBrush( NoBrush ) );
+ QPainter p ( this );
+ p. fillRect ( m_thisframe, QBrush ( NoBrush ));
+ }
}
-// QWidget::paintEvent( e );
}
@@ -103,10 +114,7 @@ void XineVideoWidget::setImage( uchar* image, int yoffsetXLine,
int height, int linestep, int bytes, int bpp ) {
-/* if (m_buff != 0 )
- free(m_buff );
-*/
+
+ m_lastframe = m_thisframe;
+ m_thisframe. setRect ( xoffsetXBytes, yoffsetXLine, width, height );
+
m_buff = image;
- m_yOff = yoffsetXLine;
- m_xOff = xoffsetXBytes;
- m_Width = width;
- m_Height = height;
this->linestep = linestep;
@@ -114,17 +122,4 @@ void XineVideoWidget::setImage( uchar* image, int yoffsetXLine,
m_bytes_per_pixel = bpp;
- ////
- qWarning("width %d %d", width, height );
-/* QDirectPainter dp( this );
- uchar* dst = dp.frameBuffer() + (m_yOff + dp.yOffset() ) * linestep +
- (m_xOff + dp.xOffset() ) * m_bytes_per_pixel;
- uchar* frame = m_buff;
- for(int y = 0; y < m_Height; y++ ) {
- memcpy( dst, frame, m_bytes );
- frame += m_bytes;
- dst += linestep;
- }
- // QVFB hack
- QPainter dp2(this);
- dp2.fillRect( rect(), QBrush( NoBrush ) );
-*/
+
+ repaint ( false );
}
diff --git a/noncore/multimedia/opieplayer2/xinevideowidget.h b/noncore/multimedia/opieplayer2/xinevideowidget.h
index b670fa0..5656194 100644
--- a/noncore/multimedia/opieplayer2/xinevideowidget.h
+++ b/noncore/multimedia/opieplayer2/xinevideowidget.h
@@ -53,2 +53,5 @@ protected:
private:
+ QRect m_lastframe;
+ QRect m_thisframe;
+
int m_wid;