summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-10-10 10:17:20 (UTC)
committer harlekin <harlekin>2002-10-10 10:17:20 (UTC)
commit6e766588ca61322c59d0a527cb240522d9d8210e (patch) (unidiff)
tree4a4114876f4bfaac699177a0b44f3424644d256f
parent2cbc91d6aff15c931426f3c835b5126c7da3ba2b (diff)
downloadopie-6e766588ca61322c59d0a527cb240522d9d8210e.zip
opie-6e766588ca61322c59d0a527cb240522d9d8210e.tar.gz
opie-6e766588ca61322c59d0a527cb240522d9d8210e.tar.bz2
little changes to the gamma
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp1
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp2
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidgetgui.cpp4
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp6
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.cpp4
-rw-r--r--noncore/multimedia/opieplayer2/yuv2rgb.h15
6 files changed, 17 insertions, 15 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp
index 85030de..c0e5acd 100644
--- a/noncore/multimedia/opieplayer2/lib.cpp
+++ b/noncore/multimedia/opieplayer2/lib.cpp
@@ -214,71 +214,72 @@ QString Lib::metaInfo( int number) {
214int Lib::error() { 214int Lib::error() {
215 return xine_get_error( m_xine ); 215 return xine_get_error( m_xine );
216}; 216};
217 217
218void Lib::handleXineEvent( xine_event_t* t ) { 218void Lib::handleXineEvent( xine_event_t* t ) {
219 if ( t->type == XINE_EVENT_PLAYBACK_FINISHED ) { 219 if ( t->type == XINE_EVENT_PLAYBACK_FINISHED ) {
220 emit stopped(); 220 emit stopped();
221 } 221 }
222} 222}
223 223
224 224
225void Lib::setShowVideo( bool video ) { 225void Lib::setShowVideo( bool video ) {
226 m_video = video; 226 m_video = video;
227 ::null_set_show_video( m_videoOutput, video ); 227 ::null_set_show_video( m_videoOutput, video );
228} 228}
229 229
230bool Lib::isShowingVideo() { 230bool Lib::isShowingVideo() {
231 return ::null_is_showing_video( m_videoOutput ); 231 return ::null_is_showing_video( m_videoOutput );
232} 232}
233 233
234bool Lib::hasVideo() { 234bool Lib::hasVideo() {
235 //looks like it is not implemented yet 235 //looks like it is not implemented yet
236 //return xine_get_stream_info( m_xine, XINE_STREAM_INFO_VIDEO_CHANNELS ); 236 //return xine_get_stream_info( m_xine, XINE_STREAM_INFO_VIDEO_CHANNELS );
237 // ugly hack until xine is ready, look for the width of the video 237 // ugly hack until xine is ready, look for the width of the video
238 int test = xine_get_stream_info( m_xine, 2 ); 238 int test = xine_get_stream_info( m_xine, 2 );
239 if( test > 0 ) { 239 if( test > 0 ) {
240 // qDebug( QString(" has video: %1").arg( test ) ); 240 // qDebug( QString(" has video: %1").arg( test ) );
241 return true; 241 return true;
242 } else { 242 } else {
243 //qDebug ( "does not have video "); 243 //qDebug ( "does not have video ");
244 return false; 244 return false;
245 } 245 }
246} 246}
247 247
248void Lib::showVideoFullScreen( bool fullScreen ) { 248void Lib::showVideoFullScreen( bool fullScreen ) {
249 ::null_set_fullscreen( m_videoOutput, fullScreen ); 249 ::null_set_fullscreen( m_videoOutput, fullScreen );
250} 250}
251 251
252bool Lib::isVideoFullScreen() { 252bool Lib::isVideoFullScreen() {
253 return ::null_is_fullscreen( m_videoOutput ); 253 return ::null_is_fullscreen( m_videoOutput );
254} 254}
255 255
256void Lib::setScaling( bool scale ) { 256void Lib::setScaling( bool scale ) {
257 ::null_set_scaling( m_videoOutput, scale ); 257 ::null_set_scaling( m_videoOutput, scale );
258} 258}
259 259
260void Lib::setGamma( int value ) { 260void Lib::setGamma( int value ) {
261 //qDebug( QString( "%1").arg(value) ); 261 //qDebug( QString( "%1").arg(value) );
262 int gammaValue = ( 100 + value );
262 ::null_set_videoGamma( m_videoOutput, value ); 263 ::null_set_videoGamma( m_videoOutput, value );
263} 264}
264 265
265bool Lib::isScaling() { 266bool Lib::isScaling() {
266 return ::null_is_scaling( m_videoOutput ); 267 return ::null_is_scaling( m_videoOutput );
267} 268}
268 269
269void Lib::xine_event_handler( void* user_data, xine_event_t* t ) { 270void Lib::xine_event_handler( void* user_data, xine_event_t* t ) {
270 ( (Lib*)user_data)->handleXineEvent( t ); 271 ( (Lib*)user_data)->handleXineEvent( t );
271} 272}
272 273
273void Lib::xine_display_frame( void* user_data, uint8_t *frame, 274void Lib::xine_display_frame( void* user_data, uint8_t *frame,
274 int width, int height, int bytes ) { 275 int width, int height, int bytes ) {
275 ( (Lib*)user_data)->drawFrame( frame, width, height, bytes ); 276 ( (Lib*)user_data)->drawFrame( frame, width, height, bytes );
276} 277}
277 278
278void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) { 279void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) {
279 if ( !m_video ) { 280 if ( !m_video ) {
280 qWarning("not showing video now"); 281 qWarning("not showing video now");
281 return; 282 return;
282 } 283 }
283 m_wid-> setVideoFrame ( frame, width, height, bytes ); 284 m_wid-> setVideoFrame ( frame, width, height, bytes );
284} 285}
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp
index 5069a49..606f8e9 100644
--- a/noncore/multimedia/opieplayer2/mediaplayer.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp
@@ -1,86 +1,86 @@
1#include <qpe/qpeapplication.h> 1#include <qpe/qpeapplication.h>
2#include <qpe/qlibrary.h> 2#include <qpe/qlibrary.h>
3#include <qpe/resource.h> 3#include <qpe/resource.h>
4#include <qpe/config.h> 4#include <qpe/config.h>
5#include <qpe/qcopenvelope_qws.h> 5#include <qpe/qcopenvelope_qws.h>
6#include <qfileinfo.h> 6#include <qfileinfo.h>
7 7
8#include <qmainwindow.h> 8#include <qmainwindow.h>
9#include <qmessagebox.h> 9#include <qmessagebox.h>
10#include <qwidgetstack.h> 10#include <qwidgetstack.h>
11#include <qfile.h> 11#include <qfile.h>
12 12
13#include "mediaplayer.h" 13#include "mediaplayer.h"
14#include "playlistwidget.h" 14#include "playlistwidget.h"
15#include "audiowidget.h" 15#include "audiowidget.h"
16#include "videowidget.h" 16#include "videowidget.h"
17#include "volumecontrol.h" 17#include "volumecontrol.h"
18 18
19#include "mediaplayerstate.h" 19#include "mediaplayerstate.h"
20 20
21// for setBacklight() 21// for setBacklight()
22#include <linux/fb.h> 22#include <linux/fb.h>
23#include <sys/file.h> 23#include <sys/file.h>
24#include <sys/ioctl.h> 24#include <sys/ioctl.h>
25 25
26 26
27extern AudioWidget *audioUI; 27extern AudioWidget *audioUI;
28extern VideoWidget *videoUI; 28extern VideoWidget *videoUI;
29extern PlayListWidget *playList; 29extern PlayListWidget *playList;
30extern MediaPlayerState *mediaPlayerState; 30extern MediaPlayerState *mediaPlayerState;
31 31
32 32
33#define FBIOBLANK 0x4611 33#define FBIOBLANK 0x4611
34 34
35MediaPlayer::MediaPlayer( QObject *parent, const char *name ) 35MediaPlayer::MediaPlayer( QObject *parent, const char *name )
36 : QObject( parent, name ), volumeDirection( 0 ), currentFile( NULL ) { 36 : QObject( parent, name ), volumeDirection( 0 ), currentFile( NULL ) {
37 37
38 playList->setCaption(tr("OpiePlayer: Initializating")); 38 playList->setCaption( tr( "OpiePlayer: Initializating" ) );
39 39
40 qApp->processEvents(); 40 qApp->processEvents();
41 // QPEApplication::grabKeyboard(); // EVIL 41 // QPEApplication::grabKeyboard(); // EVIL
42 connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); 42 connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
43 43
44 connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( setPlaying( bool ) ) ); 44 connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( setPlaying( bool ) ) );
45 45
46 connect( mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pauseCheck( bool ) ) ); 46 connect( mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pauseCheck( bool ) ) );
47 47
48 connect( mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) ); 48 connect( mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) );
49 connect( mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) ); 49 connect( mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) );
50 connect( mediaPlayerState, SIGNAL( blankToggled( bool ) ), this, SLOT ( blank( bool ) ) ); 50 connect( mediaPlayerState, SIGNAL( blankToggled( bool ) ), this, SLOT ( blank( bool ) ) );
51 51
52 connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); 52 connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
53 connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); 53 connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
54 connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); 54 connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
55 connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); 55 connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
56 56
57 connect( videoUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); 57 connect( videoUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
58 connect( videoUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); 58 connect( videoUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
59 connect( videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); 59 connect( videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
60 connect( videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); 60 connect( videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
61 61
62 volControl = new VolumeControl; 62 volControl = new VolumeControl;
63 xineControl = new XineControl(); 63 xineControl = new XineControl();
64 playList->setCaption(tr("OpiePlayer")); 64 playList->setCaption(tr("OpiePlayer"));
65} 65}
66 66
67MediaPlayer::~MediaPlayer() { 67MediaPlayer::~MediaPlayer() {
68 delete xineControl; 68 delete xineControl;
69 delete volControl; 69 delete volControl;
70} 70}
71 71
72void MediaPlayer::pauseCheck( bool b ) { 72void MediaPlayer::pauseCheck( bool b ) {
73 if ( b && !mediaPlayerState->playing() ) { 73 if ( b && !mediaPlayerState->playing() ) {
74 mediaPlayerState->setPaused( FALSE ); 74 mediaPlayerState->setPaused( FALSE );
75 } 75 }
76} 76}
77 77
78void MediaPlayer::play() { 78void MediaPlayer::play() {
79 mediaPlayerState->setPlaying( FALSE ); 79 mediaPlayerState->setPlaying( FALSE );
80 mediaPlayerState->setPlaying( TRUE ); 80 mediaPlayerState->setPlaying( TRUE );
81} 81}
82 82
83void MediaPlayer::setPlaying( bool play ) { 83void MediaPlayer::setPlaying( bool play ) {
84 if ( !play ) { 84 if ( !play ) {
85 return; 85 return;
86 } 86 }
diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp
index 1042a0c..49356d3 100644
--- a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp
@@ -58,100 +58,100 @@
58#include "audiowidget.h" 58#include "audiowidget.h"
59#include "videowidget.h" 59#include "videowidget.h"
60#include "mediaplayerstate.h" 60#include "mediaplayerstate.h"
61 61
62extern MediaPlayerState *mediaPlayerState; 62extern MediaPlayerState *mediaPlayerState;
63 63
64PlayListWidgetGui::PlayListWidgetGui( QWidget* parent, const char* name, WFlags fl ) 64PlayListWidgetGui::PlayListWidgetGui( QWidget* parent, const char* name, WFlags fl )
65 : QMainWindow( parent, name, fl ) { 65 : QMainWindow( parent, name, fl ) {
66 66
67 d = new PlayListWidgetPrivate; 67 d = new PlayListWidgetPrivate;
68 d->setDocumentUsed = FALSE; 68 d->setDocumentUsed = FALSE;
69 d->current = NULL; 69 d->current = NULL;
70 70
71 setBackgroundMode( PaletteButton ); 71 setBackgroundMode( PaletteButton );
72 setToolBarsMovable( FALSE ); 72 setToolBarsMovable( FALSE );
73 73
74 // Create Toolbar 74 // Create Toolbar
75 QPEToolBar *toolbar = new QPEToolBar( this ); 75 QPEToolBar *toolbar = new QPEToolBar( this );
76 toolbar->setHorizontalStretchable( TRUE ); 76 toolbar->setHorizontalStretchable( TRUE );
77 77
78 // Create Menubar 78 // Create Menubar
79 QPEMenuBar *menu = new QPEMenuBar( toolbar ); 79 QPEMenuBar *menu = new QPEMenuBar( toolbar );
80 menu->setMargin( 0 ); 80 menu->setMargin( 0 );
81 81
82 bar = new QPEToolBar( this ); 82 bar = new QPEToolBar( this );
83 bar->setLabel( tr( "Play Operations" ) ); 83 bar->setLabel( tr( "Play Operations" ) );
84 84
85 tbDeletePlaylist = new QPushButton( Resource::loadIconSet( "trash" ), "", bar, "close" ); 85 tbDeletePlaylist = new QPushButton( Resource::loadIconSet( "trash" ), "", bar, "close" );
86 tbDeletePlaylist->setFlat( TRUE ); 86 tbDeletePlaylist->setFlat( TRUE );
87 tbDeletePlaylist->setFixedSize( 20, 20 ); 87 tbDeletePlaylist->setFixedSize( 20, 20 );
88 88
89 tbDeletePlaylist->hide(); 89 tbDeletePlaylist->hide();
90 90
91 pmPlayList = new QPopupMenu( this ); 91 pmPlayList = new QPopupMenu( this );
92 menu->insertItem( tr( "File" ), pmPlayList ); 92 menu->insertItem( tr( "File" ), pmPlayList );
93 93
94 pmView = new QPopupMenu( this ); 94 pmView = new QPopupMenu( this );
95 menu->insertItem( tr( "View" ), pmView ); 95 menu->insertItem( tr( "View" ), pmView );
96 pmView->isCheckable(); 96 pmView->isCheckable();
97 97
98 skinsMenu = new QPopupMenu( this ); 98 skinsMenu = new QPopupMenu( this );
99 pmView->insertItem( tr( "Skins" ), skinsMenu ); 99 pmView->insertItem( tr( "Skins" ), skinsMenu );
100 skinsMenu->isCheckable(); 100 skinsMenu->isCheckable();
101 101
102 gammaMenu = new QPopupMenu( this ); 102 gammaMenu = new QPopupMenu( this );
103 pmView->insertItem( tr( "Gamma (Video)" ), gammaMenu ); 103 pmView->insertItem( tr( "Gamma (Video)" ), gammaMenu );
104 104
105 gammaSlider = new QSlider( QSlider::Vertical, gammaMenu ); 105 gammaSlider = new QSlider( QSlider::Vertical, gammaMenu );
106 gammaSlider->setRange( -100, 100 ); 106 gammaSlider->setRange( -40, 40 );
107 gammaSlider->setTickmarks( QSlider::Left ); 107 gammaSlider->setTickmarks( QSlider::Left );
108 gammaSlider->setTickInterval( 20 ); 108 gammaSlider->setTickInterval( 20 );
109 gammaSlider->setFocusPolicy( QWidget::NoFocus ); 109 //gammaSlider->setFocusPolicy( QWidget::NoFocus );
110 gammaSlider->setValue( 0 ); 110 gammaSlider->setValue( 0 );
111 gammaSlider->setMinimumHeight( 50 ); 111 gammaSlider->setMinimumHeight( 50 );
112 112
113 gammaLCD = new QLCDNumber( 3, gammaMenu ); 113 gammaLCD = new QLCDNumber( 3, gammaMenu );
114 114
115 gammaMenu->insertItem( gammaSlider ); 115 gammaMenu->insertItem( gammaSlider );
116 gammaMenu->insertItem( gammaLCD ); 116 gammaMenu->insertItem( gammaLCD );
117 117
118 connect( gammaSlider, SIGNAL( valueChanged( int ) ), gammaLCD, SLOT( display( int ) ) ); 118 connect( gammaSlider, SIGNAL( valueChanged( int ) ), gammaLCD, SLOT( display( int ) ) );
119 119
120 vbox5 = new QVBox( this ); 120 vbox5 = new QVBox( this );
121 QVBox *vbox4 = new QVBox( vbox5 ); 121 QVBox *vbox4 = new QVBox( vbox5 );
122 QHBox *hbox6 = new QHBox( vbox4 ); 122 QHBox *hbox6 = new QHBox( vbox4 );
123 123
124 tabWidget = new QTabWidget( hbox6, "tabWidget" ); 124 tabWidget = new QTabWidget( hbox6, "tabWidget" );
125 125
126 QWidget *pTab; 126 QWidget *pTab;
127 pTab = new QWidget( tabWidget, "pTab" ); 127 pTab = new QWidget( tabWidget, "pTab" );
128 tabWidget->insertTab( pTab, "Playlist"); 128 tabWidget->insertTab( pTab, "Playlist");
129 129
130 QGridLayout *Playout = new QGridLayout( pTab ); 130 QGridLayout *Playout = new QGridLayout( pTab );
131 Playout->setSpacing( 2); 131 Playout->setSpacing( 2);
132 Playout->setMargin( 2); 132 Playout->setMargin( 2);
133 133
134 // Add the playlist area 134 // Add the playlist area
135 QVBox *vbox3 = new QVBox( pTab ); 135 QVBox *vbox3 = new QVBox( pTab );
136 d->playListFrame = vbox3; 136 d->playListFrame = vbox3;
137 137
138 QHBox *hbox2 = new QHBox( vbox3 ); 138 QHBox *hbox2 = new QHBox( vbox3 );
139 d->selectedFiles = new PlayListSelection( hbox2 ); 139 d->selectedFiles = new PlayListSelection( hbox2 );
140 140
141 vbox1 = new QVBox( hbox2 ); 141 vbox1 = new QVBox( hbox2 );
142 QPEApplication::setStylusOperation( d->selectedFiles->viewport(), QPEApplication::RightOnHold ); 142 QPEApplication::setStylusOperation( d->selectedFiles->viewport(), QPEApplication::RightOnHold );
143 QVBox *stretch1 = new QVBox( vbox1 ); // add stretch 143 QVBox *stretch1 = new QVBox( vbox1 ); // add stretch
144 144
145 Playout->addMultiCellWidget( vbox3, 0, 0, 0, 1 ); 145 Playout->addMultiCellWidget( vbox3, 0, 0, 0, 1 );
146 146
147 QWidget *aTab; 147 QWidget *aTab;
148 aTab = new QWidget( tabWidget, "aTab" ); 148 aTab = new QWidget( tabWidget, "aTab" );
149 149
150 QGridLayout *Alayout = new QGridLayout( aTab ); 150 QGridLayout *Alayout = new QGridLayout( aTab );
151 Alayout->setSpacing( 2 ); 151 Alayout->setSpacing( 2 );
152 Alayout->setMargin( 2 ); 152 Alayout->setMargin( 2 );
153 audioView = new QListView( aTab, "Audioview" ); 153 audioView = new QListView( aTab, "Audioview" );
154 audioView->addColumn( tr( "Title" ), 140 ); 154 audioView->addColumn( tr( "Title" ), 140 );
155 audioView->addColumn( tr( "Size" ), -1 ); 155 audioView->addColumn( tr( "Size" ), -1 );
156 audioView->addColumn( tr( "Media" ), -1 ); 156 audioView->addColumn( tr( "Media" ), -1 );
157 audioView->addColumn( tr( "Path" ), 0 ); 157 audioView->addColumn( tr( "Path" ), 0 );
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp
index f5f5c37..7b8ad7a 100644
--- a/noncore/multimedia/opieplayer2/videowidget.cpp
+++ b/noncore/multimedia/opieplayer2/videowidget.cpp
@@ -89,97 +89,97 @@ QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) {
89 89
90 setCaption( tr("OpiePlayer - Video") ); 90 setCaption( tr("OpiePlayer - Video") );
91 91
92 videoFrame = new XineVideoWidget ( this, "Video frame" ); 92 videoFrame = new XineVideoWidget ( this, "Video frame" );
93 93
94 connect ( videoFrame, SIGNAL( videoResized ( const QSize & )), this, SIGNAL( videoResized ( const QSize & ))); 94 connect ( videoFrame, SIGNAL( videoResized ( const QSize & )), this, SIGNAL( videoResized ( const QSize & )));
95 connect ( videoFrame, SIGNAL( clicked () ), this, SLOT ( backToNormal() ) ); 95 connect ( videoFrame, SIGNAL( clicked () ), this, SLOT ( backToNormal() ) );
96 96
97 Config cfg("OpiePlayer"); 97 Config cfg("OpiePlayer");
98 cfg.setGroup("Options"); 98 cfg.setGroup("Options");
99 skin = cfg.readEntry("Skin","default"); 99 skin = cfg.readEntry("Skin","default");
100 100
101 QString skinPath = "opieplayer2/skins/" + skin; 101 QString skinPath = "opieplayer2/skins/" + skin;
102 pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); 102 pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) );
103 imgUp = new QImage( Resource::loadImage( QString("%1/skinV_up").arg(skinPath) ) ); 103 imgUp = new QImage( Resource::loadImage( QString("%1/skinV_up").arg(skinPath) ) );
104 imgDn = new QImage( Resource::loadImage( QString("%1/skinV_down").arg(skinPath) ) ); 104 imgDn = new QImage( Resource::loadImage( QString("%1/skinV_down").arg(skinPath) ) );
105 105
106 imgButtonMask = new QImage( imgUp->width(), imgUp->height(), 8, 255 ); 106 imgButtonMask = new QImage( imgUp->width(), imgUp->height(), 8, 255 );
107 imgButtonMask->fill( 0 ); 107 imgButtonMask->fill( 0 );
108 108
109 for ( int i = 0; i < 7; i++ ) { 109 for ( int i = 0; i < 7; i++ ) {
110 QString filename = QString( QPEApplication::qpeDir() + "/pics/" + skinPath + "/skinV_mask_" + skinV_mask_file_names[i] + ".png" ); 110 QString filename = QString( QPEApplication::qpeDir() + "/pics/" + skinPath + "/skinV_mask_" + skinV_mask_file_names[i] + ".png" );
111 masks[i] = new QBitmap( filename ); 111 masks[i] = new QBitmap( filename );
112 112
113 if ( !masks[i]->isNull() ) { 113 if ( !masks[i]->isNull() ) {
114 QImage imgMask = masks[i]->convertToImage(); 114 QImage imgMask = masks[i]->convertToImage();
115 uchar **dest = imgButtonMask->jumpTable(); 115 uchar **dest = imgButtonMask->jumpTable();
116 for ( int y = 0; y < imgUp->height(); y++ ) { 116 for ( int y = 0; y < imgUp->height(); y++ ) {
117 uchar *line = dest[y]; 117 uchar *line = dest[y];
118 for ( int x = 0; x < imgUp->width(); x++ ) { 118 for ( int x = 0; x < imgUp->width(); x++ ) {
119 if ( !qRed( imgMask.pixel( x, y ) ) ) 119 if ( !qRed( imgMask.pixel( x, y ) ) )
120 line[x] = i + 1; 120 line[x] = i + 1;
121 } 121 }
122 } 122 }
123 } 123 }
124 } 124 }
125 125
126 for ( int i = 0; i < 7; i++ ) { 126 for ( int i = 0; i < 7; i++ ) {
127 buttonPixUp[i] = NULL; 127 buttonPixUp[i] = NULL;
128 buttonPixDown[i] = NULL; 128 buttonPixDown[i] = NULL;
129 } 129 }
130 130
131 setBackgroundPixmap( *pixBg ); 131 setBackgroundPixmap( *pixBg );
132 132
133 slider = new QSlider( Qt::Horizontal, this ); 133 slider = new QSlider( Qt::Horizontal, this );
134 slider->setMinValue( 0 ); 134 slider->setMinValue( 0 );
135 slider->setMaxValue( 1 ); 135 slider->setMaxValue( 1 );
136 slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); 136 slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) );
137 slider->setFocusPolicy( QWidget::NoFocus ); 137 //slider->setFocusPolicy( QWidget::NoFocus );
138 138
139 resizeEvent( NULL ); 139 resizeEvent( NULL );
140 140
141 connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); 141 connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
142 connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); 142 connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) );
143 connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); 143 connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) );
144 connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); 144 connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) );
145 connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); 145 connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) );
146 146
147 setLength( mediaPlayerState->length() ); 147 setLength( mediaPlayerState->length() );
148 setPosition( mediaPlayerState->position() ); 148 setPosition( mediaPlayerState->position() );
149 setFullscreen( mediaPlayerState->fullscreen() ); 149 setFullscreen( mediaPlayerState->fullscreen() );
150 setPlaying( mediaPlayerState->playing() ); 150 setPlaying( mediaPlayerState->playing() );
151} 151}
152 152
153 153
154VideoWidget::~VideoWidget() { 154VideoWidget::~VideoWidget() {
155 155
156 for ( int i = 0; i < 7; i++ ) { 156 for ( int i = 0; i < 7; i++ ) {
157 delete buttonPixUp[i]; 157 delete buttonPixUp[i];
158 delete buttonPixDown[i]; 158 delete buttonPixDown[i];
159 } 159 }
160 160
161 delete pixBg; 161 delete pixBg;
162 delete imgUp; 162 delete imgUp;
163 delete imgDn; 163 delete imgDn;
164 delete imgButtonMask; 164 delete imgButtonMask;
165 for ( int i = 0; i < 7; i++ ) { 165 for ( int i = 0; i < 7; i++ ) {
166 delete masks[i]; 166 delete masks[i];
167 } 167 }
168 168
169} 169}
170 170
171QPixmap *combineVImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { 171QPixmap *combineVImageWithBackground( QImage img, QPixmap bg, QPoint offset ) {
172 QPixmap pix( img.width(), img.height() ); 172 QPixmap pix( img.width(), img.height() );
173 QPainter p( &pix ); 173 QPainter p( &pix );
174 p.drawTiledPixmap( pix.rect(), bg, offset ); 174 p.drawTiledPixmap( pix.rect(), bg, offset );
175 p.drawImage( 0, 0, img ); 175 p.drawImage( 0, 0, img );
176 return new QPixmap( pix ); 176 return new QPixmap( pix );
177} 177}
178 178
179QPixmap *maskVPixToMask( QPixmap pix, QBitmap mask ) { 179QPixmap *maskVPixToMask( QPixmap pix, QBitmap mask ) {
180 QPixmap *pixmap = new QPixmap( pix ); 180 QPixmap *pixmap = new QPixmap( pix );
181 pixmap->setMask( mask ); 181 pixmap->setMask( mask );
182 return pixmap; 182 return pixmap;
183} 183}
184 184
185void VideoWidget::resizeEvent( QResizeEvent * ) { 185void VideoWidget::resizeEvent( QResizeEvent * ) {
@@ -391,98 +391,98 @@ void VideoWidget::makeVisible() {
391 setBackgroundPixmap( *pixBg ); 391 setBackgroundPixmap( *pixBg );
392 if ( mediaPlayerState->streaming() ) { 392 if ( mediaPlayerState->streaming() ) {
393 slider->hide(); 393 slider->hide();
394 disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); 394 disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
395 disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); 395 disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
396 } else { 396 } else {
397 slider->show(); 397 slider->show();
398 connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); 398 connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
399 connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); 399 connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
400 } 400 }
401 QWidget *d = QApplication::desktop(); 401 QWidget *d = QApplication::desktop();
402 int w=d->width(); 402 int w=d->width();
403 int h=d->height(); 403 int h=d->height();
404 404
405 if(w>h) { 405 if(w>h) {
406 int newW=(w/2)-(246/2); //this will only work with 320x240 406 int newW=(w/2)-(246/2); //this will only work with 320x240
407 videoFrame->setGeometry( QRect( newW, 4, 240, 170 ) ); 407 videoFrame->setGeometry( QRect( newW, 4, 240, 170 ) );
408 } else 408 } else
409 videoFrame->setGeometry( QRect( 0, 30, 240, 170 ) ); 409 videoFrame->setGeometry( QRect( 0, 30, 240, 170 ) );
410 410
411// qApp->processEvents(); 411// qApp->processEvents();
412 } 412 }
413} 413}
414 414
415 415
416void VideoWidget::paintEvent( QPaintEvent * pe) { 416void VideoWidget::paintEvent( QPaintEvent * pe) {
417 QPainter p( this ); 417 QPainter p( this );
418 418
419 if ( mediaPlayerState->fullscreen() ) { 419 if ( mediaPlayerState->fullscreen() ) {
420 // Clear the background 420 // Clear the background
421 p.setBrush( QBrush( Qt::black ) ); 421 p.setBrush( QBrush( Qt::black ) );
422 } else { 422 } else {
423 if ( !pe->erased() ) { 423 if ( !pe->erased() ) {
424 // Combine with background and double buffer 424 // Combine with background and double buffer
425 QPixmap pix( pe->rect().size() ); 425 QPixmap pix( pe->rect().size() );
426 QPainter p( &pix ); 426 QPainter p( &pix );
427 p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); 427 p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() );
428 p.drawTiledPixmap( pe->rect(), *pixBg, pe->rect().topLeft() ); 428 p.drawTiledPixmap( pe->rect(), *pixBg, pe->rect().topLeft() );
429 for ( int i = 0; i < numVButtons; i++ ) { 429 for ( int i = 0; i < numVButtons; i++ ) {
430 paintButton( &p, i ); 430 paintButton( &p, i );
431 } 431 }
432 QPainter p2( this ); 432 QPainter p2( this );
433 p2.drawPixmap( pe->rect().topLeft(), pix ); 433 p2.drawPixmap( pe->rect().topLeft(), pix );
434 } else { 434 } else {
435 QPainter p( this ); 435 QPainter p( this );
436 for ( int i = 0; i < numVButtons; i++ ) 436 for ( int i = 0; i < numVButtons; i++ )
437 paintButton( &p, i ); 437 paintButton( &p, i );
438 } 438 }
439 slider->repaint( TRUE ); 439 //slider->repaint( TRUE );
440 } 440 }
441} 441}
442 442
443 443
444void VideoWidget::closeEvent( QCloseEvent* ) { 444void VideoWidget::closeEvent( QCloseEvent* ) {
445 mediaPlayerState->setList(); 445 mediaPlayerState->setList();
446} 446}
447 447
448 448
449 449
450void VideoWidget::keyReleaseEvent( QKeyEvent *e) { 450void VideoWidget::keyReleaseEvent( QKeyEvent *e) {
451 switch ( e->key() ) { 451 switch ( e->key() ) {
452////////////////////////////// Zaurus keys 452////////////////////////////// Zaurus keys
453 case Key_Home: 453 case Key_Home:
454 break; 454 break;
455 case Key_F9: //activity 455 case Key_F9: //activity
456 break; 456 break;
457 case Key_F10: //contacts 457 case Key_F10: //contacts
458// hide(); 458// hide();
459 break; 459 break;
460 case Key_F11: //menu 460 case Key_F11: //menu
461 break; 461 break;
462 case Key_F12: //home 462 case Key_F12: //home
463 break; 463 break;
464 case Key_F13: //mail 464 case Key_F13: //mail
465 break; 465 break;
466 case Key_Space: { 466 case Key_Space: {
467 if(mediaPlayerState->playing()) { 467 if(mediaPlayerState->playing()) {
468 mediaPlayerState->setPlaying(FALSE); 468 mediaPlayerState->setPlaying(FALSE);
469 } else { 469 } else {
470 mediaPlayerState->setPlaying(TRUE); 470 mediaPlayerState->setPlaying(TRUE);
471 } 471 }
472 } 472 }
473 break; 473 break;
474 case Key_Down: 474 case Key_Down:
475// toggleButton(6); 475// toggleButton(6);
476 emit lessClicked(); 476 emit lessClicked();
477 emit lessReleased(); 477 emit lessReleased();
478// toggleButton(6); 478// toggleButton(6);
479 break; 479 break;
480 case Key_Up: 480 case Key_Up:
481// toggleButton(5); 481// toggleButton(5);
482 emit moreClicked(); 482 emit moreClicked();
483 emit moreReleased(); 483 emit moreReleased();
484// toggleButton(5); 484// toggleButton(5);
485 break; 485 break;
486 case Key_Right: 486 case Key_Right:
487 mediaPlayerState->setNext(); 487 mediaPlayerState->setNext();
488 break; 488 break;
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp
index 81693e1..31ac9dc 100644
--- a/noncore/multimedia/opieplayer2/xinecontrol.cpp
+++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp
@@ -1,98 +1,98 @@
1/* 1/*
2                This file is part of the Opie Project 2                This file is part of the Opie Project
3 3
4              Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> 4              Copyright (c) 2002 Max Reiss <harlekin@handhelds.org>
5 Copyright (c) 2002 L. Potter <ljp@llornkcor.com> 5 Copyright (c) 2002 L. Potter <ljp@llornkcor.com>
6 Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> 6 Copyright (c) 2002 Holger Freyther <zecke@handhelds.org>
7 =. 7 =.
8 .=l. 8 .=l.
9           .>+-= 9           .>+-=
10 _;:,     .>    :=|. This program is free software; you can 10 _;:,     .>    :=|. This program is free software; you can
11.> <`_,   >  .   <= redistribute it and/or modify it under 11.> <`_,   >  .   <= redistribute it and/or modify it under
12:`=1 )Y*s>-.--   : the terms of the GNU General Public 12:`=1 )Y*s>-.--   : the terms of the GNU General Public
13.="- .-=="i,     .._ License as published by the Free Software 13.="- .-=="i,     .._ License as published by the Free Software
14 - .   .-<_>     .<> Foundation; either version 2 of the License, 14 - .   .-<_>     .<> Foundation; either version 2 of the License,
15     ._= =}       : or (at your option) any later version. 15     ._= =}       : or (at your option) any later version.
16    .%`+i>       _;_. 16    .%`+i>       _;_.
17    .i_,=:_.      -<s. This program is distributed in the hope that 17    .i_,=:_.      -<s. This program is distributed in the hope that
18     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 18     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
19    : ..    .:,     . . . without even the implied warranty of 19    : ..    .:,     . . . without even the implied warranty of
20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
22..}^=.=       =       ; General Public License for more 22..}^=.=       =       ; General Public License for more
23++=   -.     .`     .: details. 23++=   -.     .`     .: details.
24 :     =  ...= . :.=- 24 :     =  ...= . :.=-
25 -.   .:....=;==+<; You should have received a copy of the GNU 25 -.   .:....=;==+<; You should have received a copy of the GNU
26  -_. . .   )=.  = General Public License along with 26  -_. . .   )=.  = General Public License along with
27    --        :-=` this library; see the file COPYING.LIB. 27    --        :-=` this library; see the file COPYING.LIB.
28 If not, write to the Free Software Foundation, 28 If not, write to the Free Software Foundation,
29 Inc., 59 Temple Place - Suite 330, 29 Inc., 59 Temple Place - Suite 330,
30 Boston, MA 02111-1307, USA. 30 Boston, MA 02111-1307, USA.
31 31
32*/ 32*/
33 33
34 34
35#include <qtimer.h> 35#include <qtimer.h>
36#include <qmessagebox.h> 36#include <qmessagebox.h>
37#include <qpe/qcopenvelope_qws.h> 37#include <qpe/qcopenvelope_qws.h>
38#include <qpe/qpeapplication.h> 38#include <qpe/qpeapplication.h>
39#include "xinecontrol.h" 39#include "xinecontrol.h"
40#include "mediaplayerstate.h" 40#include "mediaplayerstate.h"
41#include "videowidget.h" 41#include "videowidget.h"
42 42
43extern MediaPlayerState *mediaPlayerState; 43extern MediaPlayerState *mediaPlayerState;
44extern VideoWidget *videoUI; 44extern VideoWidget *videoUI;
45XineControl::XineControl( QObject *parent, const char *name ) 45XineControl::XineControl( QObject *parent, const char *name )
46 : QObject( parent, name ) { 46 : QObject( parent, name ) {
47 47
48 libXine = new XINE::Lib(videoUI->vidWidget() ); 48 libXine = new XINE::Lib( videoUI->vidWidget() );
49 49
50 connect ( videoUI, SIGNAL( videoResized ( const QSize & )), this, SLOT( videoResized ( const QSize & ) ) ); 50 connect ( videoUI, SIGNAL( videoResized( const QSize & )), this, SLOT( videoResized ( const QSize & ) ) );
51 connect( mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pause( bool ) ) ); 51 connect( mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pause( bool ) ) );
52 connect( this, SIGNAL( positionChanged( long ) ), mediaPlayerState, SLOT( updatePosition( long ) ) ); 52 connect( this, SIGNAL( positionChanged( long ) ), mediaPlayerState, SLOT( updatePosition( long ) ) );
53 connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) ); 53 connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) );
54 connect( mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) ); 54 connect( mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) );
55 connect( mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) ); 55 connect( mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) );
56 connect( mediaPlayerState, SIGNAL( videoGammaChanged( int ) ), this, SLOT( setGamma( int ) ) ); 56 connect( mediaPlayerState, SIGNAL( videoGammaChanged( int ) ), this, SLOT( setGamma( int ) ) );
57 connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) ); 57 connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) );
58 58
59 disabledSuspendScreenSaver = FALSE; 59 disabledSuspendScreenSaver = FALSE;
60} 60}
61 61
62XineControl::~XineControl() { 62XineControl::~XineControl() {
63#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 63#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
64 if ( disabledSuspendScreenSaver ) { 64 if ( disabledSuspendScreenSaver ) {
65 disabledSuspendScreenSaver = FALSE; 65 disabledSuspendScreenSaver = FALSE;
66 // Re-enable the suspend mode 66 // Re-enable the suspend mode
67 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; 67 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable;
68 } 68 }
69#endif 69#endif
70 delete libXine; 70 delete libXine;
71} 71}
72 72
73void XineControl::play( const QString& fileName ) { 73void XineControl::play( const QString& fileName ) {
74 hasVideoChannel = FALSE; 74 hasVideoChannel = FALSE;
75 hasAudioChannel = FALSE; 75 hasAudioChannel = FALSE;
76 m_fileName = fileName; 76 m_fileName = fileName;
77 77
78 //qDebug("<<FILENAME: " + fileName + ">>>>"); 78 //qDebug("<<FILENAME: " + fileName + ">>>>");
79 79
80 if ( !libXine->play( fileName ) ) { 80 if ( !libXine->play( fileName ) ) {
81 QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() ); 81 QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() );
82 return; 82 return;
83 } 83 }
84 mediaPlayerState->setPlaying( true ); 84 mediaPlayerState->setPlaying( true );
85 85
86 char whichGui; 86 char whichGui;
87 // qDebug( QString( "libXine->hasVideo() return : %1 ").arg( libXine->hasVideo() ) ); 87 // qDebug( QString( "libXine->hasVideo() return : %1 ").arg( libXine->hasVideo() ) );
88 if ( !libXine->hasVideo() ) { 88 if ( !libXine->hasVideo() ) {
89 whichGui = 'a'; 89 whichGui = 'a';
90 qDebug("HAS AUDIO"); 90 qDebug("HAS AUDIO");
91 libXine->setShowVideo( false ); 91 libXine->setShowVideo( false );
92 hasAudioChannel = TRUE; 92 hasAudioChannel = TRUE;
93 } else { 93 } else {
94 whichGui = 'v'; 94 whichGui = 'v';
95 qDebug("HAS VIDEO"); 95 qDebug("HAS VIDEO");
96 libXine->setShowVideo( true ); 96 libXine->setShowVideo( true );
97 hasVideoChannel = TRUE; 97 hasVideoChannel = TRUE;
98 } 98 }
diff --git a/noncore/multimedia/opieplayer2/yuv2rgb.h b/noncore/multimedia/opieplayer2/yuv2rgb.h
index 5b9c3f6..e453243 100644
--- a/noncore/multimedia/opieplayer2/yuv2rgb.h
+++ b/noncore/multimedia/opieplayer2/yuv2rgb.h
@@ -46,106 +46,107 @@ struct yuv2rgb_s {
46 * configure converter for scaling factors 46 * configure converter for scaling factors
47 */ 47 */
48 int (*configure) (yuv2rgb_t *this, 48 int (*configure) (yuv2rgb_t *this,
49 int source_width, int source_height, 49 int source_width, int source_height,
50 int y_stride, int uv_stride, 50 int y_stride, int uv_stride,
51 int dest_width, int dest_height, 51 int dest_width, int dest_height,
52 int rgb_stride); 52 int rgb_stride);
53 53
54 /* 54 /*
55 * this is the function to call for the yuv2rgb and scaling process 55 * this is the function to call for the yuv2rgb and scaling process
56 */ 56 */
57 yuv2rgb_fun_t yuv2rgb_fun; 57 yuv2rgb_fun_t yuv2rgb_fun;
58 58
59 /* 59 /*
60 * this is the function to call for the yuy2->rgb and scaling process 60 * this is the function to call for the yuy2->rgb and scaling process
61 */ 61 */
62 yuy22rgb_fun_t yuy22rgb_fun; 62 yuy22rgb_fun_t yuy22rgb_fun;
63 63
64 /* 64 /*
65 * this is the function to call for the yuv2rgb for a single pixel 65 * this is the function to call for the yuv2rgb for a single pixel
66 * (used for converting clut colors) 66 * (used for converting clut colors)
67 */ 67 */
68 68
69 yuv2rgb_single_pixel_fun_t yuv2rgb_single_pixel_fun; 69 yuv2rgb_single_pixel_fun_t yuv2rgb_single_pixel_fun;
70 70
71 /* private stuff below */ 71 /* private stuff below */
72 72
73 int source_width, source_height; 73 int source_width, source_height;
74 int y_stride, uv_stride; 74 int y_stride, uv_stride;
75 int dest_width, dest_height; 75 int dest_width, dest_height;
76 int rgb_stride; 76 int rgb_stride;
77 int step_dx, step_dy; 77 int step_dx, step_dy;
78 int do_scale; 78 int do_scale;
79 79
80 uint8_t *y_buffer; 80 uint8_t *y_buffer;
81 uint8_t *u_buffer; 81 uint8_t *u_buffer;
82 uint8_t *v_buffer; 82 uint8_t *v_buffer;
83 void *y_chunk; 83 void *y_chunk;
84 void *u_chunk; 84 void *u_chunk;
85 void *v_chunk; 85 void *v_chunk;
86 86
87 void **table_rV; 87 void **table_rV;
88 void **table_gU; 88 void **table_gU;
89 int *table_gV; 89 int *table_gV;
90 void **table_bU; 90 void **table_bU;
91 91
92 uint8_t *cmap; 92 uint8_t *cmap;
93 scale_line_func_t scale_line; 93 scale_line_func_t scale_line;
94 94
95} ; 95} ;
96 96
97/* 97/*
98 * convenience class to easily create a lot of converters 98 * convenience class to easily create a lot of converters
99 */ 99 */
100 100
101struct yuv2rgb_factory_s { 101struct yuv2rgb_factory_s {
102 102
103 yuv2rgb_t* (*create_converter) (yuv2rgb_factory_t *this); 103 yuv2rgb_t* (*create_converter) (yuv2rgb_factory_t *this);
104 104
105 /* 105 /*
106 * adjust gamma (-100 to 100 looks fine) 106 * adjust gamma (-100 to 100 looks fine)
107 * for all converters produced by this factory 107 * for all converters produced by this factory
108 */ 108 */
109 void (*set_gamma) (yuv2rgb_factory_t *this, int gamma); 109 void (*set_gamma) (yuv2rgb_factory_t *this, int gamma);
110 110
111 /* 111 /*
112 * get gamma value 112 * get gamma value
113 */ 113 */
114 int (*get_gamma) (yuv2rgb_factory_t *this); 114 int (*get_gamma) (yuv2rgb_factory_t *this);
115 115
116 /* private data */ 116 /* private data */
117 117
118 int mode; 118 int mode;
119 int swapped; 119 int swapped;
120 uint8_t *cmap; 120 uint8_t *cmap;
121 121
122 int gamma; 122 int gamma;
123 int entry_size; 123 int entry_size;
124 124
125 uint32_t matrix_coefficients; 125 uint32_t matrix_coefficients;
126 126
127 void *table_rV[256]; 127 void *table_rV[256];
128 void *table_gU[256]; 128 void *table_gU[256];
129 int table_gV[256]; 129 int table_gV[256];
130 void *table_bU[256]; 130 void *table_bU[256];
131 131
132 /* preselected functions for mode/swap/hardware */ 132 /* preselected functions for mode/swap/hardware */
133 yuv2rgb_fun_t yuv2rgb_fun; 133 yuv2rgb_fun_t yuv2rgb_fun;
134 yuy22rgb_fun_t yuy22rgb_fun; 134 yuy22rgb_fun_t yuy22rgb_fun;
135 yuv2rgb_single_pixel_fun_t yuv2rgb_single_pixel_fun; 135 yuv2rgb_single_pixel_fun_t yuv2rgb_single_pixel_fun;
136 136
137}; 137};
138 138
139yuv2rgb_factory_t *yuv2rgb_factory_init (int mode, int swapped, uint8_t *colormap); 139yuv2rgb_factory_t *yuv2rgb_factory_init (int mode, int swapped, uint8_t *colormap);
140 140
141 141
142/* 142/*
143 * internal stuff below this line 143 * internal stuff below this line
144 */ 144 */
145 145
146void mmx_yuv2rgb_set_gamma(int gamma); 146void mmx_yuv2rgb_set_gamma(int gamma);
147void yuv2rgb_init_mmxext (yuv2rgb_factory_t *this); 147void yuv2rgb_init_mmxext (yuv2rgb_factory_t *this);
148void yuv2rgb_init_mmx (yuv2rgb_factory_t *this); 148void yuv2rgb_init_mmx (yuv2rgb_factory_t *this);
149void yuv2rgb_init_mlib (yuv2rgb_factory_t *this); 149void yuv2rgb_init_mlib (yuv2rgb_factory_t *this);
150void yuv2rgb_init_arm (yuv2rgb_factory_t *this);
150 151
151#endif 152#endif