-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/nullvideo.c | 17 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinevideowidget.cpp | 79 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinevideowidget.h | 3 |
4 files changed, 49 insertions, 52 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 | |||
@@ -204,6 +204,6 @@ void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) { | |||
204 | int linestep = qt_screen->linestep(); | 204 | int linestep = qt_screen->linestep(); |
205 | 205 | ||
206 | m_wid->setImage( frame, yoffset, xoffset, width, height, linestep, bytes, m_bytes_per_pixel ); | 206 | m_wid->setImage( frame, yoffset, xoffset, width, height, linestep, bytes, m_bytes_per_pixel ); |
207 | m_wid->repaint(); | 207 | // m_wid->repaint(false); |
208 | 208 | ||
209 | } | 209 | } |
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 | |||
@@ -72,7 +72,7 @@ struct opie_frame_s { | |||
72 | int bytes_per_line; | 72 | int bytes_per_line; |
73 | uint8_t *data; | 73 | uint8_t *data; |
74 | 74 | ||
75 | int show_video; | 75 | // int show_video; |
76 | null_driver_t *output; | 76 | null_driver_t *output; |
77 | }; | 77 | }; |
78 | 78 | ||
@@ -85,7 +85,7 @@ static uint32_t null_get_capabilities(vo_driver_t *self ){ | |||
85 | static void null_frame_copy (vo_frame_t *vo_img, uint8_t **src) { | 85 | static void null_frame_copy (vo_frame_t *vo_img, uint8_t **src) { |
86 | opie_frame_t *frame = (opie_frame_t *) vo_img ; | 86 | opie_frame_t *frame = (opie_frame_t *) vo_img ; |
87 | printf("frame copy\n"); | 87 | printf("frame copy\n"); |
88 | if(!frame->show_video ){ printf("no video\n"); return; } // no video | 88 | if(!frame->output->m_show_video ){ printf("no video\n"); return; } // no video |
89 | 89 | ||
90 | if (frame->format == IMGFMT_YV12) { | 90 | if (frame->format == IMGFMT_YV12) { |
91 | frame->yuv2rgb->yuv2rgb_fun (frame->yuv2rgb, frame->rgb_dst, | 91 | frame->yuv2rgb->yuv2rgb_fun (frame->yuv2rgb, frame->rgb_dst, |
@@ -94,7 +94,6 @@ static void null_frame_copy (vo_frame_t *vo_img, uint8_t **src) { | |||
94 | 94 | ||
95 | frame->yuv2rgb->yuy22rgb_fun (frame->yuv2rgb, frame->rgb_dst, | 95 | frame->yuv2rgb->yuy22rgb_fun (frame->yuv2rgb, frame->rgb_dst, |
96 | src[0]); | 96 | src[0]); |
97 | |||
98 | } | 97 | } |
99 | 98 | ||
100 | frame->rgb_dst += frame->stripe_inc; | 99 | frame->rgb_dst += frame->stripe_inc; |
@@ -145,7 +144,7 @@ static vo_frame_t* null_alloc_frame( vo_driver_t* self ){ | |||
145 | frame->name = "opie\0"; | 144 | frame->name = "opie\0"; |
146 | frame->version = 1; | 145 | frame->version = 1; |
147 | frame->output = this; | 146 | frame->output = this; |
148 | frame->show_video = this->m_show_video; | 147 | // frame->show_video = this->m_show_video; |
149 | /* initialize the frame*/ | 148 | /* initialize the frame*/ |
150 | frame->frame.driver = self; | 149 | frame->frame.driver = self; |
151 | /*frame.frame.free = null_frame_free;*/ | 150 | /*frame.frame.free = null_frame_free;*/ |
@@ -165,7 +164,7 @@ static vo_frame_t* null_alloc_frame( vo_driver_t* self ){ | |||
165 | // size specific | 164 | // size specific |
166 | static void null_compute_ideal_size (null_driver_t *this, opie_frame_t *frame) { | 165 | static void null_compute_ideal_size (null_driver_t *this, opie_frame_t *frame) { |
167 | 166 | ||
168 | if (!this->m_is_scaling || !this->m_show_video) { | 167 | if (!this->m_is_scaling /*|| !this->m_show_video*/) { |
169 | printf("Not scaling\n"); | 168 | printf("Not scaling\n"); |
170 | frame->ideal_width = frame->width; | 169 | frame->ideal_width = frame->width; |
171 | frame->ideal_height = frame->height; | 170 | frame->ideal_height = frame->height; |
@@ -301,7 +300,7 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, | |||
301 | frame->format = format; | 300 | frame->format = format; |
302 | frame->user_ratio = this->user_ratio; | 301 | frame->user_ratio = this->user_ratio; |
303 | this->gui_changed = 0; | 302 | this->gui_changed = 0; |
304 | frame->show_video = this->m_show_video; | 303 | //frame->show_video = this->m_show_video; |
305 | 304 | ||
306 | 305 | ||
307 | null_compute_ideal_size (this, frame); | 306 | null_compute_ideal_size (this, frame); |
@@ -355,7 +354,7 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, | |||
355 | /* | 354 | /* |
356 | * set up colorspace converter | 355 | * set up colorspace converter |
357 | */ | 356 | */ |
358 | if(this->m_show_video ){ | 357 | if(1 /*this->m_show_video*/ ){ |
359 | printf("showing video\n"); | 358 | printf("showing video\n"); |
360 | 359 | ||
361 | switch (flags) { | 360 | switch (flags) { |
@@ -414,7 +413,7 @@ static void null_display_frame( vo_driver_t* self, vo_frame_t *frame_gen ){ | |||
414 | display_xine_frame_t display = this->frameDis; | 413 | display_xine_frame_t display = this->frameDis; |
415 | 414 | ||
416 | printf("display frame\n"); | 415 | printf("display frame\n"); |
417 | // if( this->m_show_video ) { // return if not displaying | 416 | // if( this->m_show_video ) { // return if not displaying |
418 | printf("calling home aye\n" ); | 417 | printf("calling home aye\n" ); |
419 | if( display != NULL ) { | 418 | if( display != NULL ) { |
420 | (*display)(this->caller, frame->data, | 419 | (*display)(this->caller, frame->data, |
@@ -422,7 +421,7 @@ static void null_display_frame( vo_driver_t* self, vo_frame_t *frame_gen ){ | |||
422 | frame->bytes_per_line ); | 421 | frame->bytes_per_line ); |
423 | printf("display done hope you enyoyed the frame"); | 422 | printf("display done hope you enyoyed the frame"); |
424 | } | 423 | } |
425 | // } | 424 | // } |
426 | 425 | ||
427 | frame->frame.displayed (&frame->frame); | 426 | frame->frame.displayed (&frame->frame); |
428 | } | 427 | } |
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 | |||
@@ -46,7 +46,7 @@ XineVideoWidget::XineVideoWidget( int width, | |||
46 | int height, | 46 | int height, |
47 | QWidget* parent, | 47 | QWidget* parent, |
48 | const char* name ) | 48 | const char* name ) |
49 | : QWidget( parent, name ) | 49 | : QWidget( parent, name, WRepaintNoErase | WResizeNoErase ) |
50 | { | 50 | { |
51 | m_image = new QImage( width, height, qt_screen->depth() ); | 51 | m_image = new QImage( width, height, qt_screen->depth() ); |
52 | m_buff = 0; | 52 | m_buff = 0; |
@@ -61,32 +61,43 @@ XineVideoWidget::~XineVideoWidget() { | |||
61 | } | 61 | } |
62 | void XineVideoWidget::clear() { | 62 | void XineVideoWidget::clear() { |
63 | m_buff = 0; | 63 | m_buff = 0; |
64 | repaint(); | 64 | repaint(false); |
65 | } | 65 | } |
66 | void XineVideoWidget::paintEvent( QPaintEvent* e ) { | 66 | void XineVideoWidget::paintEvent( QPaintEvent* e ) { |
67 | qWarning("painting"); | 67 | qWarning("painting"); |
68 | QPainter p(this ); | 68 | if (m_buff == 0 ) { |
69 | p.setBrush( QBrush( Qt::black ) ); | 69 | QPainter p(this ); |
70 | p.drawRect( rect() ); | 70 | p.fillRect( rect(), black ); |
71 | if (m_buff == 0 ) | ||
72 | p.drawImage( 0, 0, *m_image ); | 71 | p.drawImage( 0, 0, *m_image ); |
73 | else { | 72 | qWarning ( "logo\n" ); |
73 | } | ||
74 | else { | ||
74 | qWarning("paitnevent\n"); | 75 | qWarning("paitnevent\n"); |
75 | 76 | { | |
76 | QDirectPainter dp( this ); | 77 | |
77 | uchar* dst = dp.frameBuffer() + (m_yOff + dp.yOffset() ) * linestep + | 78 | if (( m_thisframe & m_lastframe ) != m_lastframe ) { |
78 | (m_xOff + dp.xOffset() ) * m_bytes_per_pixel; | 79 | QPainter p ( this ); |
79 | uchar* frame = m_buff; | 80 | p. fillRect ( m_lastframe, black ); |
80 | for(int y = 0; y < m_Height; y++ ) { | 81 | } |
81 | memcpy( dst, frame, m_bytes ); | 82 | } |
82 | frame += m_bytes; | 83 | { |
83 | dst += linestep; | 84 | QDirectPainter dp ( this ); |
85 | |||
86 | uchar* dst = dp.frameBuffer() + (m_thisframe. y ( ) + dp.yOffset() ) * linestep + | ||
87 | (m_thisframe. x ( ) + dp.xOffset() ) * m_bytes_per_pixel; | ||
88 | uchar* frame = m_buff; | ||
89 | for(int y = 0; y < m_thisframe. height ( ); y++ ) { | ||
90 | memcpy( dst, frame, m_bytes ); | ||
91 | frame += m_bytes; | ||
92 | dst += linestep; | ||
93 | } | ||
84 | } | 94 | } |
85 | // QVFB hack by MArtin Jones | 95 | { |
86 | // QPainter dp2(this); | 96 | // QVFB hack by MArtin Jones |
87 | // dp2.fillRect( rect(), QBrush( NoBrush ) ); | 97 | QPainter p ( this ); |
98 | p. fillRect ( m_thisframe, QBrush ( NoBrush )); | ||
99 | } | ||
88 | } | 100 | } |
89 | // QWidget::paintEvent( e ); | ||
90 | } | 101 | } |
91 | int XineVideoWidget::height() const{ | 102 | int XineVideoWidget::height() const{ |
92 | return m_image->height(); | 103 | return m_image->height(); |
@@ -101,30 +112,14 @@ void XineVideoWidget::setImage( QImage* image ) { | |||
101 | void XineVideoWidget::setImage( uchar* image, int yoffsetXLine, | 112 | void XineVideoWidget::setImage( uchar* image, int yoffsetXLine, |
102 | int xoffsetXBytes, int width, | 113 | int xoffsetXBytes, int width, |
103 | int height, int linestep, int bytes, int bpp ) { | 114 | int height, int linestep, int bytes, int bpp ) { |
104 | /* if (m_buff != 0 ) | 115 | |
105 | free(m_buff ); | 116 | m_lastframe = m_thisframe; |
106 | */ | 117 | m_thisframe. setRect ( xoffsetXBytes, yoffsetXLine, width, height ); |
118 | |||
107 | m_buff = image; | 119 | m_buff = image; |
108 | m_yOff = yoffsetXLine; | ||
109 | m_xOff = xoffsetXBytes; | ||
110 | m_Width = width; | ||
111 | m_Height = height; | ||
112 | this->linestep = linestep; | 120 | this->linestep = linestep; |
113 | m_bytes = bytes; | 121 | m_bytes = bytes; |
114 | m_bytes_per_pixel = bpp; | 122 | m_bytes_per_pixel = bpp; |
115 | //// | 123 | |
116 | qWarning("width %d %d", width, height ); | 124 | repaint ( false ); |
117 | /* QDirectPainter dp( this ); | ||
118 | uchar* dst = dp.frameBuffer() + (m_yOff + dp.yOffset() ) * linestep + | ||
119 | (m_xOff + dp.xOffset() ) * m_bytes_per_pixel; | ||
120 | uchar* frame = m_buff; | ||
121 | for(int y = 0; y < m_Height; y++ ) { | ||
122 | memcpy( dst, frame, m_bytes ); | ||
123 | frame += m_bytes; | ||
124 | dst += linestep; | ||
125 | } | ||
126 | // QVFB hack | ||
127 | QPainter dp2(this); | ||
128 | dp2.fillRect( rect(), QBrush( NoBrush ) ); | ||
129 | */ | ||
130 | } | 125 | } |
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 | |||
@@ -51,6 +51,9 @@ public: | |||
51 | protected: | 51 | protected: |
52 | void paintEvent( QPaintEvent* p ); | 52 | void paintEvent( QPaintEvent* p ); |
53 | private: | 53 | private: |
54 | QRect m_lastframe; | ||
55 | QRect m_thisframe; | ||
56 | |||
54 | int m_wid; | 57 | int m_wid; |
55 | int m_height; | 58 | int m_height; |
56 | int m_yOff, m_xOff; | 59 | int m_yOff, m_xOff; |