summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/lib.cpp
authorsandman <sandman>2002-08-03 23:58:20 (UTC)
committer sandman <sandman>2002-08-03 23:58:20 (UTC)
commit0cecd08dba036f39e414e34a2b7c070008ee3884 (patch) (unidiff)
treec187c9308f0553b1d5d9cd59093bcc3c11740665 /noncore/multimedia/opieplayer2/lib.cpp
parent8fb605fdfbbcbc654f567efcb59f02ec0d26228a (diff)
downloadopie-0cecd08dba036f39e414e34a2b7c070008ee3884.zip
opie-0cecd08dba036f39e414e34a2b7c070008ee3884.tar.gz
opie-0cecd08dba036f39e414e34a2b7c070008ee3884.tar.bz2
Added support for fullscreen playback
Diffstat (limited to 'noncore/multimedia/opieplayer2/lib.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp29
1 files changed, 13 insertions, 16 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp
index eb57b67..00c534a 100644
--- a/noncore/multimedia/opieplayer2/lib.cpp
+++ b/noncore/multimedia/opieplayer2/lib.cpp
@@ -71,14 +71,9 @@ Lib::Lib(XineVideoWidget* widget) {
71 m_videoOutput = ::init_video_out_plugin( m_config, NULL ); 71 m_videoOutput = ::init_video_out_plugin( m_config, NULL );
72 if (m_wid != 0 ) { 72 if (m_wid != 0 ) {
73 printf("!0\n" ); 73 printf("!0\n" );
74 ::null_set_gui_width( m_videoOutput, m_wid->image()->width() ); 74 resize ( m_wid-> size ( ));
75 ::null_set_gui_height(m_videoOutput, m_wid->image()->height() );
76 ::null_set_mode( m_videoOutput, qt_screen->depth(), qt_screen->pixelType() ); 75 ::null_set_mode( m_videoOutput, qt_screen->depth(), qt_screen->pixelType() );
77 m_bytes_per_pixel = ( qt_screen->depth() + 7 ) / 8; 76 m_wid-> setImage ( new QImage ( Resource::loadImage("")));
78 QImage image = Resource::loadImage("");
79 image = image.smoothScale( m_wid->width(), m_wid->height() );
80 QImage* img = new QImage( image );
81 m_wid->setImage( img );
82 m_wid->repaint(); 77 m_wid->repaint();
83 } 78 }
84 null_display_handler( m_videoOutput, 79 null_display_handler( m_videoOutput,
@@ -100,6 +95,14 @@ Lib::~Lib() {
100 95
101} 96}
102 97
98void Lib::resize ( const QSize &s )
99{
100 if ( s. width ( ) && s. height ( )) {
101 ::null_set_gui_width( m_videoOutput, s. width() );
102 ::null_set_gui_height(m_videoOutput, s. height() );
103 }
104}
105
103QCString Lib::version() { 106QCString Lib::version() {
104 QCString str( xine_get_str_version() ); 107 QCString str( xine_get_str_version() );
105 return str; 108 return str;
@@ -187,9 +190,8 @@ void Lib::xine_event_handler( void* user_data, xine_event_t* t ) {
187} 190}
188void Lib::xine_display_frame( void* user_data, uint8_t *frame, 191void Lib::xine_display_frame( void* user_data, uint8_t *frame,
189 int width, int height, int bytes ) { 192 int width, int height, int bytes ) {
190// printf("display x frame"); 193
191 ((Lib*)user_data)->drawFrame( frame, width, height, bytes ); 194 ((Lib*)user_data)->drawFrame( frame, width, height, bytes );
192// printf("displayed x frame\n");
193} 195}
194void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) { 196void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) {
195 if (!m_video ) { 197 if (!m_video ) {
@@ -198,12 +200,7 @@ void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) {
198 } 200 }
199// qWarning("called draw frame %d %d", width, height); 201// qWarning("called draw frame %d %d", width, height);
200 202
201 QSize size = m_wid->size(); 203 m_wid->setImage( frame, width, height, bytes );
202 int xoffset = (size.width() - width) / 2;
203 int yoffset = (size.height() - height) / 2;
204 int linestep = qt_screen->linestep();
205
206 m_wid->setImage( frame, yoffset, xoffset, width, height, linestep, bytes, m_bytes_per_pixel );
207// m_wid->repaint(false); 204// m_wid->repaint(false);
208 205
209} 206}