jahshaka-cvs Mailing List for The Jahshaka Project
Status: Beta
Brought to you by:
jahshaka
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(218) |
Aug
(350) |
Sep
(401) |
Oct
(117) |
Nov
(190) |
Dec
(205) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(135) |
Feb
(53) |
Mar
(413) |
Apr
(291) |
May
(211) |
Jun
(71) |
Jul
(138) |
Aug
(20) |
Sep
(217) |
Oct
(127) |
Nov
(33) |
Dec
(26) |
2008 |
Jan
(11) |
Feb
(32) |
Mar
(59) |
Apr
(31) |
May
(14) |
Jun
(36) |
Jul
(16) |
Aug
(33) |
Sep
(19) |
Oct
(17) |
Nov
(40) |
Dec
(11) |
2009 |
Jan
(48) |
Feb
(21) |
Mar
|
Apr
(4) |
May
(5) |
Jun
(2) |
Jul
(2) |
Aug
(1) |
Sep
(2) |
Oct
(1) |
Nov
(1) |
Dec
|
2010 |
Jan
(1) |
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <tim...@us...> - 2010-03-31 12:51:18
|
Revision: 1483 http://openlibraries.svn.sourceforge.net/openlibraries/?rev=1483&view=rev Author: timdewhirst Date: 2010-03-31 12:51:12 +0000 (Wed, 31 Mar 2010) Log Message: ----------- OML * add support for loading plugins generated by VC9 Modified Paths: -------------- trunk/src/openmedialib/plugins/avformat/avformat_plugin.opl trunk/src/openmedialib/plugins/openal/openal_plugin.opl trunk/src/openmedialib/plugins/sdl/sdl_plugin.opl Modified: trunk/src/openmedialib/plugins/avformat/avformat_plugin.opl =================================================================== --- trunk/src/openmedialib/plugins/avformat/avformat_plugin.opl 2010-02-12 17:11:53 UTC (rev 1482) +++ trunk/src/openmedialib/plugins/avformat/avformat_plugin.opl 2010-03-31 12:51:12 UTC (rev 1483) @@ -2,8 +2,8 @@ <openlibraries version="1.0"> <!-- plugins go here --> <openmedialib name="oml" version="0.1.0"> - <plugin name="OpenLibraries avformat plugin" type="input" in_filter="*.m2v *.avi *.dv *.dif *.mpe *.mpg *.mpeg *.mp3 *.mp2 *.mp4 *.wav *.aif *.mov *.ogg *.mkv *.flv *.qt *.wmv *.3gp *.m4v *.divx" extension='"avformat:.*", "oml:.*", ".*\.m2v", ".*\.avi", ".*\.dv", ".*\.dif", ".*\.mp4", ".*\.mov", ".*\.mpe", ".*\.mpg", ".*\.mpeg", ".*\.mp3", ".*\.mp2", ".*\.wav", ".*\.wmv", ".*\.aif", ".*\.ogg", ".*\.mkv", "/dev/.*1394.*", "dv:-", "mpeg:-", ".*\.flv", ".*\.qt", ".*\.swf", ".*\.asf", ".*\.ts", ".*\.vob" ".*\.3gp" ".*\.m4v" ".*\.divx"' merit="5" filename='"libopenmedialib_avformat.so", "libopenmedialib_avformat.dylib", "openmedialib_avformat-vc80-d-0_5_0.dll", "openmedialib_avformat-vc80-r-0_5_0.dll"'/> - <plugin name="OpenLibraries avformat plugin" type="output" extension='"pipe:", ".*\.mpg", ".*\.avi", ".*\.dv", ".*\.mov", ".*\.ogg", ".*\.mp2", ".*\.mp3", ".*\.mp4", ".*\.vob", ".*\.wav", ".*\.flv", ".*\.swf", ".*\.wmv" ".*\.divx"' merit="5" filename='"libopenmedialib_avformat.so", "libopenmedialib_avformat.dylib", "openmedialib_avformat-vc80-d-0_5_0.dll", "openmedialib_avformat-vc80-r-0_5_0.dll"'/> - <plugin name="OpenLibraries avformat plugin" type="filter" extension='"resampler"' merit="0" filename='"libopenmedialib_avformat.so", "libopenmedialib_avformat.dylib", "openmedialib_avformat-vc80-d-0_5_0.dll", "openmedialib_avformat-vc80-r-0_5_0.dll"'/> + <plugin name="OpenLibraries avformat plugin" type="input" in_filter="*.avi *.dv *.dif *.mpe *.mpg *.mpeg *.mp3 *.mp2 *.mp4 *.wav *.aif *.mov *.ogg *.mkv *.flv *.qt *.wmv *.3gp *.m4v" extension='"avformat:.*", "offset:.*", "oml:.*", ".*\.avi", ".*\.dv", ".*\.dif", ".*\.mp4", ".*\.mov", ".*\.mpe", ".*\.mpg", ".*\.mpeg", ".*\.mp3", ".*\.mp2", ".*\.wav", ".*\.wmv", ".*\.aif", ".*\.ogg", ".*\.mkv", "/dev/.*1394.*", "dv:-", "mpeg:-", ".*\.flv", ".*\.qt", ".*\.swf", ".*\.asf", ".*\.ts", ".*\.vob" ".*\.3gp" ".*\.m4v"' merit="5" filename='"libopenmedialib_avformat.so", "libopenmedialib_avformat.dylib", "openmedialib_avformat-vc80-d-0_5_0.dll", "openmedialib_avformat-vc80-r-0_5_0.dll","openmedialib_avformat-vc90-d-0_5_0.dll", "openmedialib_avformat-vc90-r-0_5_0.dll"'/> + <plugin name="OpenLibraries avformat plugin" type="output" extension='"pipe:", ".*\.mpg", ".*\.avi", ".*\.dv", ".*\.mov", ".*\.ogg", ".*\.mp2", ".*\.mp3", ".*\.mp4", ".*\.vob", ".*\.wav", ".*\.flv", ".*\.swf", ".*\.wmv" ".*\.divx"' merit="5" filename='"libopenmedialib_avformat.so", "libopenmedialib_avformat.dylib", "openmedialib_avformat-vc80-d-0_5_0.dll", "openmedialib_avformat-vc80-r-0_5_0.dll", "openmedialib_avformat-vc90-d-0_5_0.dll", "openmedialib_avformat-vc90-r-0_5_0.dll"'/> + <plugin name="OpenLibraries avformat plugin" type="filter" extension='"resampler"' merit="0" filename='"libopenmedialib_avformat.so", "libopenmedialib_avformat.dylib", "openmedialib_avformat-vc80-d-0_5_0.dll", "openmedialib_avformat-vc80-r-0_5_0.dll", "openmedialib_avformat-vc90-d-0_5_0.dll", "openmedialib_avformat-vc90-r-0_5_0.dll"'/> </openmedialib> </openlibraries> Modified: trunk/src/openmedialib/plugins/openal/openal_plugin.opl =================================================================== --- trunk/src/openmedialib/plugins/openal/openal_plugin.opl 2010-02-12 17:11:53 UTC (rev 1482) +++ trunk/src/openmedialib/plugins/openal/openal_plugin.opl 2010-03-31 12:51:12 UTC (rev 1483) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <openlibraries version="1.0"> - <!-- plugins go here --> - <openmedialib name="oml" version="0.1.0"> - <plugin name="OpenLibraries openal plugin" type="output" extension='"openal:"' merit="0" filename='"libopenmedialib_openal.so", "libopenmedialib_openal.dylib", "openmedialib_openal-vc80-d-0_5_0.dll", "openmedialib_openal-vc80-r-0_5_0.dll"'/> - </openmedialib> + <!-- plugins go here --> + <openmedialib name="oml" version="0.1.0"> + <plugin name="OpenLibraries openal plugin" type="output" extension='"openal:"' merit="0" filename='"libopenmedialib_openal.so", "libopenmedialib_openal.dylib", "openmedialib_openal-vc80-d-0_5_0.dll", "openmedialib_openal-vc80-r-0_5_0.dll", "openmedialib_openal-vc90-d-0_5_0.dll", "openmedialib_openal-vc90-r-0_5_0.dll"'/> + </openmedialib> </openlibraries> Modified: trunk/src/openmedialib/plugins/sdl/sdl_plugin.opl =================================================================== --- trunk/src/openmedialib/plugins/sdl/sdl_plugin.opl 2010-02-12 17:11:53 UTC (rev 1482) +++ trunk/src/openmedialib/plugins/sdl/sdl_plugin.opl 2010-03-31 12:51:12 UTC (rev 1483) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <openlibraries version="1.0"> - <!-- plugins go here --> - <openmedialib name="oml" version="0.1.0"> - <plugin name="OpenLibraries sdl plugin" type="output" extension='"sdl:", "sdl_video:", "sdl_audio:"' merit="0" filename='"libopenmedialib_sdl.so", "libopenmedialib_sdl.dylib", "openmedialib_sdl-vc71-d-0_5_0.dll", "openmedialib_sdl-vc71-r-0_5_0.dll", "openmedialib_sdl-vc80-d-0_5_0.dll", "openmedialib_sdl-vc80-r-0_5_0.dll"'/> - </openmedialib> + <!-- plugins go here --> + <openmedialib name="oml" version="0.1.0"> + <plugin name="OpenLibraries sdl plugin" type="output" extension='"sdl:", "sdl_video:", "sdl_audio:"' merit="0" filename='"libopenmedialib_sdl.so", "libopenmedialib_sdl.dylib", "openmedialib_sdl-vc71-d-0_5_0.dll", "openmedialib_sdl-vc71-r-0_5_0.dll", "openmedialib_sdl-vc80-d-0_5_0.dll", "openmedialib_sdl-vc80-r-0_5_0.dll", "openmedialib_sdl-vc90-d-0_5_0.dll", "openmedialib_sdl-vc90-r-0_5_0.dll"'/> + </openmedialib> </openlibraries> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-02-12 17:12:02
|
Revision: 1482 http://openlibraries.svn.sourceforge.net/openlibraries/?rev=1482&view=rev Author: timdewhirst Date: 2010-02-12 17:11:53 +0000 (Fri, 12 Feb 2010) Log Message: ----------- openimagelib * fix compilation break under 64-bit w/ gcc 4.3 and above Modified Paths: -------------- trunk/src/openimagelib/il/basic_image.hpp Modified: trunk/src/openimagelib/il/basic_image.hpp =================================================================== --- trunk/src/openimagelib/il/basic_image.hpp 2009-10-23 11:02:42 UTC (rev 1481) +++ trunk/src/openimagelib/il/basic_image.hpp 2010-02-12 17:11:53 UTC (rev 1482) @@ -1,4 +1,4 @@ - +/* -*- mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*- */ // il - A image library representation. // Copyright (C) 2005-2006 Editopia Inc. @@ -212,7 +212,7 @@ // Default method that works for most single plane images virtual void allocplanes( planes &planes ) { - plane plane = { 0, ( ( width_ * block_size_ + 3 ) & -4 ) * sizeof( T ), width_, height_, width_ * block_size_ * sizeof( T ) }; + plane plane = { 0, (size_type)(( ( width_ * block_size_ + 3 ) & -4 ) * sizeof( T )), width_, height_, (size_type)(width_ * block_size_ * sizeof( T )) }; planes.push_back( plane ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-01-19 03:04:58
|
Revision: 304 http://editopia.svn.sourceforge.net/editopia/?rev=304&view=rev Author: timdewhirst Date: 2010-01-19 03:04:49 +0000 (Tue, 19 Jan 2010) Log Message: ----------- cinecode * avoid name collision with olibs * fix Command.cpp (missing ostream include) Modified Paths: -------------- cinesuite/cineplay-cinecode/trunk/src/CineCode.cpp cinesuite/cineplay-cinecode/trunk/src/CinePlay.cpp cinesuite/cineplay-cinecode/trunk/src/Command.cpp cinesuite/cineplay-cinecode/trunk/src/Common.cpp cinesuite/cineplay-cinecode/trunk/src/Download.cpp cinesuite/cineplay-cinecode/trunk/src/FilterGraph.cpp cinesuite/cineplay-cinecode/trunk/src/GridLayoutCallback.cpp cinesuite/cineplay-cinecode/trunk/src/HttpGetter.cpp cinesuite/cineplay-cinecode/trunk/src/Info.cpp cinesuite/cineplay-cinecode/trunk/src/OpenGLStore.cpp cinesuite/cineplay-cinecode/trunk/src/PlayList.cpp cinesuite/cineplay-cinecode/trunk/src/Player.cpp cinesuite/cineplay-cinecode/trunk/src/PlayerMultiplexer.cpp cinesuite/cineplay-cinecode/trunk/src/Release.cpp cinesuite/cineplay-cinecode/trunk/src/Utils.cpp cinesuite/cineplay-cinecode/trunk/src/log.hpp Modified: cinesuite/cineplay-cinecode/trunk/src/CineCode.cpp =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/CineCode.cpp 2009-11-25 16:37:48 UTC (rev 303) +++ cinesuite/cineplay-cinecode/trunk/src/CineCode.cpp 2010-01-19 03:04:49 UTC (rev 304) @@ -75,7 +75,7 @@ CineCode::CineCode( QWidget *parent ) : QWidget( parent ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; ui.setupUi( this ); setWindowFlags( Qt::FramelessWindowHint | Qt::Window ); @@ -112,7 +112,7 @@ bool CineCode::init( QStringList& args ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if ( !m_impl->init( args ) ) return false; @@ -251,7 +251,7 @@ bool CineCode::LoadCmdLineInput( const QString& fname ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; return m_impl->LoadCmdLineInput( fname ); } @@ -317,7 +317,7 @@ void CineCode::onResetInOutPoints() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; jw::TimelineSlider* s = dynamic_cast< jw::TimelineSlider* >( m_impl->m_timeSlider ); @@ -336,7 +336,7 @@ void CineCode::onSetInPoint() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; jw::TimelineSlider* s = dynamic_cast< jw::TimelineSlider* >( m_impl->m_timeSlider ); @@ -360,7 +360,7 @@ void CineCode::onSetOutPoint() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if ( !m_frameRanges.back().isInValid() ) return; @@ -374,7 +374,7 @@ void CineCode::onEncode() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; // ensure the tray is visible onShowEncode(); @@ -424,7 +424,7 @@ void CineCode::onCancelAll() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; int ret = QMessageBox::warning( this, QApplication::instance()->applicationName(), @@ -445,12 +445,12 @@ void CineCode::onEncodeOptions() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; } void CineCode::onCleanup() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; QList< QObject* > children = m_encodeTrayPlaceholder->children(); QList< QObject* >::iterator I = children.begin(); @@ -474,7 +474,7 @@ void CineCode::onFiltersEnabled( bool b ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if ( !m_impl->activePlayer()->filter() ) return; @@ -505,14 +505,14 @@ void destroy( QWidget* w ) { - DEBUG_LOG << w; + CINECODE_DEBUG_LOG << w; w->deleteLater(); } void clearLayout( QLayout* l ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if ( !l ) return; @@ -524,7 +524,7 @@ void CineCode::onFavouritesChanged() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; // destroy all and build again std::for_each( m_favouriteTrayEntries.begin(), m_favouriteTrayEntries.end(), cineplay::destroy ); @@ -567,7 +567,7 @@ void CineCode::onRemoveFavorite( int id ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; m_impl->m_favList->removeEntry( id ); m_impl->m_favList->BuildMenu( m_impl->m_favMenu, m_impl, SLOT( onFavSelected(int) ) ); @@ -576,14 +576,14 @@ void CineCode::onSelectFavorite( int id ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; m_impl->onFavSelected( id ); } void CineCode::onShowEncode() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; QPushButton* fb = static_cast< QPushButton* >( CineUtils::FindWidget( "favorites", m_encodeTray ) ); QPushButton* eb = static_cast< QPushButton* >( CineUtils::FindWidget( "encode", m_encodeTray ) ); @@ -596,7 +596,7 @@ void CineCode::onShowFavourites() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; QPushButton* fb = static_cast< QPushButton* >( CineUtils::FindWidget( "favorites", m_encodeTray ) ); QPushButton* eb = static_cast< QPushButton* >( CineUtils::FindWidget( "encode", m_encodeTray ) ); @@ -609,7 +609,7 @@ void CineCode::setFilterValue( const char* key, double v ) { - DEBUG_LOG << key << ", " << v; + CINECODE_DEBUG_LOG << key << ", " << v; if ( !m_impl->activePlayer()->filter() ) return; @@ -647,7 +647,7 @@ if ( !w->init( arguments ) ) return 1; - { DEBUG_LOG << "starting app"; } + { CINECODE_DEBUG_LOG << "starting app"; } if( arguments.size() == 2 ) { Modified: cinesuite/cineplay-cinecode/trunk/src/CinePlay.cpp =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/CinePlay.cpp 2009-11-25 16:37:48 UTC (rev 303) +++ cinesuite/cineplay-cinecode/trunk/src/CinePlay.cpp 2010-01-19 03:04:49 UTC (rev 304) @@ -47,7 +47,7 @@ CinePlay::CinePlay( QWidget* parent ) : QWidget( parent ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; ui.setupUi( this ); setWindowFlags( Qt::FramelessWindowHint | Qt::Window ); @@ -59,7 +59,7 @@ bool CinePlay::init( QStringList& args ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if ( !m_impl->init( args ) ) return false; @@ -114,21 +114,21 @@ bool CinePlay::LoadCmdLineInput( const QString& fname ) { - DEBUG_LOG << qPrintable( fname ); + CINECODE_DEBUG_LOG << qPrintable( fname ); return m_impl->LoadCmdLineInput( fname ); } void destroy( QWidget* w ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; w->deleteLater(); } void clearLayout( QLayout* l ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if ( !l ) return; @@ -140,7 +140,7 @@ void CinePlay::onFavouritesChanged() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; // destroy all and build again std::for_each( m_trayEntries.begin(), m_trayEntries.end(), cineplay::destroy ); @@ -183,7 +183,7 @@ void CinePlay::onRemoveFavorite( int id ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; m_impl->m_favList->removeEntry( id ); m_impl->m_favList->BuildMenu( m_impl->m_favMenu, m_impl, SLOT( onFavSelected(int) ) ); @@ -192,14 +192,14 @@ void CinePlay::onSelectFavorite( int id ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; m_impl->onFavSelected( id ); } void CinePlay::keyPressEvent( QKeyEvent* e ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; QWidget::keyPressEvent( e ); m_impl->keyPressEvent( e ); @@ -265,7 +265,7 @@ if ( !w->init( arguments ) ) return 1; - { DEBUG_LOG << "starting app"; } + { CINECODE_DEBUG_LOG << "starting app"; } if( arguments.size() == 2 ) { Modified: cinesuite/cineplay-cinecode/trunk/src/Command.cpp =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/Command.cpp 2009-11-25 16:37:48 UTC (rev 303) +++ cinesuite/cineplay-cinecode/trunk/src/Command.cpp 2010-01-19 03:04:49 UTC (rev 304) @@ -52,7 +52,7 @@ } else { - DEBUG_LOG << "CommandQueue::postCommand: failed to push command"; + CINECODE_DEBUG_LOG << "CommandQueue::postCommand: failed to push command"; } } Modified: cinesuite/cineplay-cinecode/trunk/src/Common.cpp =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/Common.cpp 2009-11-25 16:37:48 UTC (rev 303) +++ cinesuite/cineplay-cinecode/trunk/src/Common.cpp 2010-01-19 03:04:49 UTC (rev 304) @@ -133,7 +133,7 @@ , m_lastMoveTime( QTime::currentTime() ) , m_editor( NULL ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; #ifdef Q_OS_WIN32 // hLib = LoadLibraryA( "bblogger.dll" ); @@ -267,7 +267,7 @@ Common::~Common() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; QPoint pt = m_parent->pos(); QSize sz = m_parent->size(); @@ -284,7 +284,7 @@ bool Common::init( QStringList& args ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; #if defined( Q_OS_WIN32 ) // temporary workaround for bug in QVistaStyle causing menus not to @@ -315,11 +315,11 @@ QDir::temp() .absoluteFilePath( QString( "cinefx-%1.log" ) .arg( QDateTime::currentDateTime().toString( "yyyy-MM-ddThh-mm-ss" ) ) ) ) ); - DEBUG_LOG << "log file: " << qPrintable( outputFile ); + CINECODE_DEBUG_LOG << "log file: " << qPrintable( outputFile ); log_stream.open( qPrintable( outputFile ) ); if ( log_stream.fail() ) { - DEBUG_LOG << "failed to open log file for writing"; + CINECODE_DEBUG_LOG << "failed to open log file for writing"; } else { @@ -400,7 +400,7 @@ bool Common::SetupStores() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; //Setup the store object QWidget *storePlace = CineUtils::FindWidget( WIDGET_STOREPLACE, m_parent ); @@ -432,7 +432,7 @@ m_jwStore = store; m_storeAsWidget = store; m_handlePush = true; - DEBUG_LOG << "created opengl store"; + CINECODE_DEBUG_LOG << "created opengl store"; } else { @@ -458,7 +458,7 @@ return false; } - DEBUG_LOG << "m_storeAsWidget: " << m_storeAsWidget; + CINECODE_DEBUG_LOG << "m_storeAsWidget: " << m_storeAsWidget; lo->addWidget( m_storeAsWidget ); bool succ = m_jwStore->init( ml::frame_type_ptr() ); @@ -492,7 +492,7 @@ bool audio_success = true; while( !m_audioStore ) { - DEBUG_LOG << "Common::SetupStores: creating audio store: " << storeTypeAudio.toStdString() << "\n"; + CINECODE_DEBUG_LOG << "Common::SetupStores: creating audio store: " << storeTypeAudio.toStdString() << "\n"; storeTypeAudio += ":"; m_audioStore = ml::create_store( storeTypeAudio.toStdWString(), ml::frame_type_ptr() ); @@ -518,7 +518,7 @@ audio_success = true; } - DEBUG_LOG << "m_audioStore: " << m_audioStore; + CINECODE_DEBUG_LOG << "m_audioStore: " << m_audioStore; if ( !m_audioStore ) { QMessageBox::critical( NULL, @@ -542,10 +542,10 @@ bool Common::LoadDefaultInput() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; QResource qr( ":/images/splash" ); - DEBUG_LOG << "Common::LoadDefaultInput:" << qr.isValid(); + CINECODE_DEBUG_LOG << "Common::LoadDefaultInput:" << qr.isValid(); m_jwStore->set_store_count( 1 ); m_players->setPlayerCount( 1 ); @@ -561,7 +561,7 @@ void Common::SetVideoSizeFromStore(float scale /*= 1.0f*/) { - DEBUG_LOG_V; + CINECODE_DEBUG_LOG_V; if ( !m_frameCache || !m_frameCache->get_image() ) return; @@ -574,7 +574,7 @@ void Common::SetVideoSize(const QSize &newSize, float scale /*= 1.0f*/) { - DEBUG_LOG << "[" << newSize.width() << ", " << newSize.height() << "], " << scale; + CINECODE_DEBUG_LOG << "[" << newSize.width() << ", " << newSize.height() << "], " << scale; QSize storeSize = m_storeAsWidget->size(); QSize sz = m_parent->size(); @@ -589,7 +589,7 @@ bool Common::LoadInput( const QString& fname, const QString& title ) { - DEBUG_LOG << qPrintable( fname ) << ", " << qPrintable( title ); + CINECODE_DEBUG_LOG << qPrintable( fname ) << ", " << qPrintable( title ); return LoadInput( QStringList() << fname, title ); } @@ -597,7 +597,7 @@ bool Common::LoadInput( const QStringList& fnames, QString title ) { QString joinedFnames( fnames.join( ", " ) ); - DEBUG_LOG << qPrintable( joinedFnames ); + CINECODE_DEBUG_LOG << qPrintable( joinedFnames ); emit LoadInputStarted( joinedFnames ); @@ -632,7 +632,7 @@ bool Common::LoadCmdLineInput( const QString& fname ) { - DEBUG_LOG << qPrintable( fname ); + CINECODE_DEBUG_LOG << qPrintable( fname ); if( LoadInput(fname) ) { @@ -645,7 +645,7 @@ void Common::SimulatePlayClick() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if(m_playButton) { @@ -691,7 +691,7 @@ void Common::toggleMaximized() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if( m_parent->isMaximized() ) { @@ -707,14 +707,14 @@ void Common::onShowMinimized() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; m_parent->showMinimized(); } void Common::ShowBorderWidgets(bool show) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; CineUtils::ShowWidget( m_parent, "titlebar", show ); CineUtils::ShowWidget( m_parent, "titlebar_left", show ); @@ -798,7 +798,7 @@ void Common::toggleFullScreen() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if ( m_fullScreen ) { @@ -834,7 +834,7 @@ void Common::onHelp() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; #ifdef BUILD_CINECODE QString helpFile = "help_cinecode.html"; @@ -848,13 +848,13 @@ QString helpfilepath = QString( "file:///%1/help/%2" ).arg( qApp->applicationDirPath() ).arg( helpFile ); #endif //Q_OS_MACX - DEBUG_LOG << "opening: " << helpfilepath.toStdString(); + CINECODE_DEBUG_LOG << "opening: " << helpfilepath.toStdString(); QDesktopServices::openUrl( QUrl( helpfilepath ) ); } void Common::onAbout() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; AboutDialog about; about.exec(); @@ -862,7 +862,7 @@ void Common::onCheckVersion() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if(m_release == 0) m_release = new Release( this ); @@ -872,7 +872,7 @@ void Common::checkVersionDone( const bool upgrade ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if ( ( m_ver_appload && upgrade ) || !m_ver_appload ) onCheckRelease( upgrade ); @@ -881,7 +881,7 @@ void Common::onCheckRelease( const bool upgrade ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if(m_release_dialog == 0) m_release_dialog = new ReleaseDlg(); @@ -891,7 +891,7 @@ void Common::checkReleaseDone( const bool /*OpenURL*/, const bool CheckRelease ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; m_release_dialog->close(); @@ -903,7 +903,7 @@ void Common::onGotoWebsite() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; #ifdef BUILD_CINECODE QDesktopServices::openUrl( QUrl( "http://cinefx.org/cinecode" ) ); @@ -914,7 +914,7 @@ void Common::onPlay() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; //check player state if(m_playButton) @@ -929,21 +929,21 @@ void Common::onStepFwd() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; activePlayer()->seek(1, true); } void Common::onStepBack() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; activePlayer()->seek(-1, true); } void Common::onLoad( bool isSequence ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; QString filters = QString::fromStdString( pl::to_string( pl::registered_filters( true ) ) ); QStringList filtersAsList = filters.split( " ", QString::SkipEmptyParts ); @@ -1021,21 +1021,21 @@ void Common::onLoad() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; onLoad( false ); } void Common::onLoadSequence() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; onLoad( true ); } void Common::onLoadUrl() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if ( !m_download ) { @@ -1051,7 +1051,7 @@ void Common::UrlLoadDone( const QUrl& local, const QString& title ) { - DEBUG_LOG << qPrintable( local.toString() ) << ", " << qPrintable( title ); + CINECODE_DEBUG_LOG << qPrintable( local.toString() ) << ", " << qPrintable( title ); // update info and MRU list if( m_info ) @@ -1066,7 +1066,7 @@ void Common::UrlStream( const QUrl& remote, const QString& title ) { - DEBUG_LOG << qPrintable( remote.toString() ) << ", " << qPrintable( title ); + CINECODE_DEBUG_LOG << qPrintable( remote.toString() ) << ", " << qPrintable( title ); emit LoadInputStarted( remote.toString() ); @@ -1087,7 +1087,7 @@ void Common::onStart() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; activePlayer()->seek(0); } @@ -1095,7 +1095,7 @@ void Common::onEnd() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; activePlayer()->seek(activePlayer()->frameCount() - 1); } @@ -1103,7 +1103,7 @@ void Common::onClose() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; LoadDefaultInput(); } @@ -1111,12 +1111,12 @@ void Common::onSaveAs() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; } void Common::onQuit() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; activePlayer()->stop(); qApp->quit(); @@ -1124,7 +1124,7 @@ void Common::onMruSelected() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; QAction* a = qobject_cast< QAction* >( sender() ); if ( !a ) @@ -1142,14 +1142,14 @@ void Common::onMruChanged() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; m_mruList.BuildMenu( m_mruMenu, this, SLOT( onMruSelected() ) ); } void Common::onFavSelected() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; QAction* a = qobject_cast< QAction* >( sender() ); if ( !a ) @@ -1160,7 +1160,7 @@ void Common::onFavSelected( int index ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; // skip on until we find a valid favourite while ( !m_favList->isValid( index ) && index < m_favList->getEntryCount() ) ++index; @@ -1180,7 +1180,7 @@ void Common::onFavAdd() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if(!m_lastFile.isEmpty()) { @@ -1197,7 +1197,7 @@ void Common::onFavRemove() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; unsigned int count = m_favList->getEntryCount(); @@ -1215,14 +1215,14 @@ void Common::updateFavMenu() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; m_favItemAction->setEnabled( m_favList->getEntryCount() != 0 ); } void Common::onShowMovieInfo() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; m_info->show(); } @@ -1230,7 +1230,7 @@ void Common::ClearSizeChecks() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; m_menuViewHalfAction->setChecked( false ); m_menuViewNormalAction->setChecked( false ); @@ -1240,7 +1240,7 @@ void Common::onViewHalfSize( bool checked ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if ( !checked ) return; @@ -1253,7 +1253,7 @@ void Common::onViewNormalSize( bool checked ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if ( !checked ) return; @@ -1266,7 +1266,7 @@ void Common::onViewDoubleSize( bool checked ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if ( !checked ) return; @@ -1279,7 +1279,7 @@ void Common::onViewHideVideo() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; bool hidden = m_menuViewShowAction->isChecked(); m_storeAsWidget->setHidden( hidden ); @@ -1304,12 +1304,12 @@ void Common::onViewLoop() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; } void Common::onPlayAll() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if ( m_menuViewPlayAllAction->isChecked() ) { @@ -1320,25 +1320,25 @@ void Common::onWindowInfo() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; } void Common::onWindowFavourites() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; } void Common::onWindowAddFav() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; } void Common::timeSliderPressed() { - DEBUG_LOG_V; + CINECODE_DEBUG_LOG_V; m_timeSliderPlayState = activePlayer()->isPlaying(); activePlayer()->stop(); @@ -1347,7 +1347,7 @@ void Common::timeSliderReleased() { - DEBUG_LOG_V; + CINECODE_DEBUG_LOG_V; if(m_timeSliderPlayState) activePlayer()->play(); @@ -1357,7 +1357,7 @@ void Common::timeSliderMoved( int val) { - DEBUG_LOG_VV; + CINECODE_DEBUG_LOG_VV; timeValueChanged(val); } @@ -1365,7 +1365,7 @@ int Common::SliderToFrame(int val) { - DEBUG_LOG_VV; + CINECODE_DEBUG_LOG_VV; int frameCount = activePlayer()->frameCount(); if(frameCount) @@ -1382,7 +1382,7 @@ int Common::FrameToSlider(int val) { - DEBUG_LOG_VV; + CINECODE_DEBUG_LOG_VV; int frameCount = activePlayer()->frameCount(); if(frameCount) @@ -1400,7 +1400,7 @@ void Common::UpdateSliderPos(int pos) { - DEBUG_LOG_VV; + CINECODE_DEBUG_LOG_VV; m_timeSliderBlock = true; int sliderPos = FrameToSlider(pos); @@ -1412,7 +1412,7 @@ void Common::SetPlaybuttonState(bool on) { - DEBUG_LOG_VV; + CINECODE_DEBUG_LOG_VV; if( m_playButton && on != m_playButton->isChecked() ) m_playButton->setChecked( on ); @@ -1421,7 +1421,7 @@ void Common::timeValueChanged( int val ) { - DEBUG_LOG_VV; + CINECODE_DEBUG_LOG_VV; if(!m_timeSliderBlock) { @@ -1438,7 +1438,7 @@ void Common::timeInValueChanged( int pt ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if(!m_ioPointBlock) { @@ -1456,7 +1456,7 @@ void Common::timeOutValueChanged( int pt ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if(!m_ioPointBlock) { @@ -1474,7 +1474,7 @@ void Common::timeMinValueChanged( int min ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; m_timeSliderMin = min; } @@ -1482,7 +1482,7 @@ void Common::timeMaxValueChanged( int max ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; m_timeSliderMax = max; } @@ -1490,7 +1490,7 @@ void Common::volumeSliderMoved( int val ) { - DEBUG_LOG_VV; + CINECODE_DEBUG_LOG_VV; int min = m_volumeSlider->property("minValue").toInt(); int max = m_volumeSlider->property("maxValue").toInt(); @@ -1506,7 +1506,7 @@ void Common::muteToggled( bool on ) { - DEBUG_LOG_V; + CINECODE_DEBUG_LOG_V; activePlayer()->setMute( on ); } @@ -1516,7 +1516,7 @@ bool Common::IsResizePos( const QPoint &pt ) { - DEBUG_LOG_VV; + CINECODE_DEBUG_LOG_VV; //within a square in the bottom right int sz = 30; @@ -1651,7 +1651,7 @@ void Common::dragEnterEvent( QDragEnterEvent* de ) { - DEBUG_LOG << de->format(); + CINECODE_DEBUG_LOG << de->format(); QString fmt = de->format(); if( fmt.contains( "list" ) || fmt.contains( "mime" ) ) @@ -1695,7 +1695,7 @@ void Common::FrameUpdate( IPlayerPtr player, const ml::frame_type_ptr& frame ) { - DEBUG_LOG_VV; + CINECODE_DEBUG_LOG_VV; // copy the video frame's image! @@ -1822,11 +1822,11 @@ void Common::onVideoSelected( int i ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if ( i < 0 || i >= m_players->playerCount() ) { - WARNING_LOG << "found an invalid index: " << i; + CINECODE_WARNING_LOG << "found an invalid index: " << i; return; } Modified: cinesuite/cineplay-cinecode/trunk/src/Download.cpp =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/Download.cpp 2009-11-25 16:37:48 UTC (rev 303) +++ cinesuite/cineplay-cinecode/trunk/src/Download.cpp 2010-01-19 03:04:49 UTC (rev 304) @@ -104,7 +104,7 @@ // ensure nothing is running cancel(); - DEBUG_LOG << qPrintable( url.host() ) << ", " << qPrintable( url.toString() ); + CINECODE_DEBUG_LOG << qPrintable( url.host() ) << ", " << qPrintable( url.toString() ); Resolved result; @@ -135,7 +135,7 @@ if ( start < 0 ) { - WARNING_LOG << "failed to find swfArgs"; + CINECODE_WARNING_LOG << "failed to find swfArgs"; return result; } @@ -150,13 +150,13 @@ if ( !video_id_re.indexIn( dataAsString ) < 0 ) { - WARNING_LOG << "failed to find video_id"; + CINECODE_WARNING_LOG << "failed to find video_id"; return result; } if ( !t_re.indexIn( dataAsString ) < 0 ) { - WARNING_LOG << "failed to find t"; + CINECODE_WARNING_LOG << "failed to find t"; return result; } @@ -194,7 +194,7 @@ if ( r != request ) return; - WARNING_LOG << qPrintable( error ); + CINECODE_WARNING_LOG << qPrintable( error ); } void onRequestFinished( const Request& r ) @@ -230,7 +230,7 @@ QStringList decomposedPath( path.split( "/" ) ); if ( decomposedPath.isEmpty() ) { - WARNING_LOG << "URL appears to be malformed"; + CINECODE_WARNING_LOG << "URL appears to be malformed"; return result; } @@ -239,7 +239,7 @@ QStringList splitFilename( filename.split( SEPARATOR ) ); if ( splitFilename.size() < 2 ) { - WARNING_LOG << "cannot parse filename: " << qPrintable( filename ); + CINECODE_WARNING_LOG << "cannot parse filename: " << qPrintable( filename ); return result; } @@ -325,7 +325,7 @@ if ( r != request ) return; - WARNING_LOG << qPrintable( error ); + CINECODE_WARNING_LOG << qPrintable( error ); f.close(); ui.cancel->setEnabled( false ); } @@ -388,14 +388,14 @@ f.setFileName( resolved.local.toString() ); if ( !f.open( QIODevice::ReadWrite ) ) { - WARNING_LOG << "failed to open file: " << qPrintable( f.fileName() ); + CINECODE_WARNING_LOG << "failed to open file: " << qPrintable( f.fileName() ); return; } ui.progress_label->setText( tr( "downloading..." ) ); request = http.get( resolved.remote.toString(), &f ); - DEBUG_LOG << "downloading: " << qPrintable( resolved.remote.toString() ) + CINECODE_DEBUG_LOG << "downloading: " << qPrintable( resolved.remote.toString() ) << " to: " << qPrintable( f.fileName() ); } Modified: cinesuite/cineplay-cinecode/trunk/src/FilterGraph.cpp =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/FilterGraph.cpp 2009-11-25 16:37:48 UTC (rev 303) +++ cinesuite/cineplay-cinecode/trunk/src/FilterGraph.cpp 2010-01-19 03:04:49 UTC (rev 304) @@ -89,7 +89,7 @@ FilterGraphInput::FilterGraphInput( const ml::input_type_ptr &node, const std::wstring& name ) { - DEBUG_LOG << opl::to_string( name ); + CINECODE_DEBUG_LOG << opl::to_string( name ); m_node = node; m_name = name; @@ -99,7 +99,7 @@ FilterGraphNode::FilterGraphNode( const ml::filter_type_ptr &node, const std::wstring& name ) : FilterGraphInput(node, name) { - DEBUG_LOG << opl::to_string( name ); + CINECODE_DEBUG_LOG << opl::to_string( name ); m_fnode = node; } @@ -108,7 +108,7 @@ FilterGraphStore::FilterGraphStore( const ml::store_type_ptr &node, const std::wstring& name ) { - DEBUG_LOG << opl::to_string( name ); + CINECODE_DEBUG_LOG << opl::to_string( name ); m_node = node; m_name = name; @@ -118,7 +118,7 @@ FilterGraphStore::~FilterGraphStore() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; m_input = 0; } @@ -126,14 +126,14 @@ void FilterGraphStore::SetInput(FilterGraphInput *ip) { - DEBUG_LOG << ip; + CINECODE_DEBUG_LOG << ip; m_input = ip; } void FilterGraphStore::Init() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; bool succ = m_node->init(); if(succ == false) @@ -143,7 +143,7 @@ void FilterGraphStore::PushFrame(const ml::frame_type_ptr &frame) { - DEBUG_LOG << frame; + CINECODE_DEBUG_LOG << frame; m_node->push(frame); @@ -152,7 +152,7 @@ void FilterGraphStore::Seek(int pos, bool rel) { - DEBUG_LOG << pos << rel; + CINECODE_DEBUG_LOG << pos << rel; if(m_input) m_input->node()->seek(pos, rel); @@ -161,7 +161,7 @@ bool FilterGraphStore::FrameUpdate() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if(m_input) { @@ -190,7 +190,7 @@ void FilterGraphStore::Complete() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; m_node->complete(); } @@ -198,7 +198,7 @@ unsigned int FilterGraphStore::GetProgress() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; ml::input_type_ptr input = m_input->node(); return (unsigned int) input->get_position(); @@ -211,13 +211,13 @@ FilterGraph::FilterGraph() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; } FilterGraph::~FilterGraph() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; for(size_t t=0; t<m_filters.size(); t++) delete m_filters[t]; @@ -235,7 +235,7 @@ bool FilterGraph::ShouldSet(const std::wstring& name, bool overwrite) { - DEBUG_LOG << opl::to_string( name ) << overwrite; + CINECODE_DEBUG_LOG << opl::to_string( name ) << overwrite; bool have = HaveVar(name); return ((have && overwrite) || !have); @@ -244,7 +244,7 @@ bool FilterGraph::HaveVar(const std::wstring& name) { - DEBUG_LOG << opl::to_string( name ); + CINECODE_DEBUG_LOG << opl::to_string( name ); if ( m_vars.empty() ) return false; @@ -255,7 +255,7 @@ std::wstring FilterGraph::Var(const std::wstring& str) { - DEBUG_LOG << opl::to_string( str ); + CINECODE_DEBUG_LOG << opl::to_string( str ); return HaveVar(str) ? m_vars[str] : str; } @@ -263,7 +263,7 @@ void FilterGraph::SetDefaultInput( const std::wstring& name ) { - DEBUG_LOG << opl::to_string( name ); + CINECODE_DEBUG_LOG << opl::to_string( name ); m_defaultInput = name; } @@ -271,7 +271,7 @@ void FilterGraph::SetDefaultStore( const std::wstring& name ) { - DEBUG_LOG << opl::to_string( name ); + CINECODE_DEBUG_LOG << opl::to_string( name ); m_defaultStore = name; } @@ -279,7 +279,7 @@ FilterGraphNode *FilterGraph::PushFilter( const std::wstring& name, const std::wstring& type ) { - DEBUG_LOG << opl::to_string( name ) << opl::to_string( type ); + CINECODE_DEBUG_LOG << opl::to_string( name ) << opl::to_string( type ); ml::filter_type_ptr filter = ml::create_filter( type ); @@ -294,7 +294,7 @@ FilterGraphNode *FilterGraph::SearchFilter(const std::wstring &name, bool thrw /*= true*/) { - DEBUG_LOG << opl::to_string( name ) << thrw; + CINECODE_DEBUG_LOG << opl::to_string( name ) << thrw; for(size_t t=0;t<m_filters.size();t++) { @@ -310,7 +310,7 @@ FilterGraphInput *FilterGraph::PushInput(const std::wstring &name, const std::wstring &type) { - DEBUG_LOG << opl::to_string( name ) << opl::to_string( type ); + CINECODE_DEBUG_LOG << opl::to_string( name ) << opl::to_string( type ); ml::input_type_ptr input = ml::create_input( type ); Modified: cinesuite/cineplay-cinecode/trunk/src/GridLayoutCallback.cpp =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/GridLayoutCallback.cpp 2009-11-25 16:37:48 UTC (rev 303) +++ cinesuite/cineplay-cinecode/trunk/src/GridLayoutCallback.cpp 2010-01-19 03:04:49 UTC (rev 304) @@ -142,7 +142,7 @@ if ( total == quads_.size() ) return; - DEBUG_LOG << total; + CINECODE_DEBUG_LOG << total; static const unsigned int MAX_COLS = 3; const unsigned int cols = ((total < MAX_COLS) ? total : MAX_COLS); Modified: cinesuite/cineplay-cinecode/trunk/src/HttpGetter.cpp =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/HttpGetter.cpp 2009-11-25 16:37:48 UTC (rev 303) +++ cinesuite/cineplay-cinecode/trunk/src/HttpGetter.cpp 2010-01-19 03:04:49 UTC (rev 304) @@ -170,20 +170,20 @@ public slots: void onRequestFinished( int id, bool e ) { - DEBUG_LOG << "id: " << id << " error: " << e; + CINECODE_DEBUG_LOG << "id: " << id << " error: " << e; RequestStateList::iterator I = std::find_if( requestStateList.begin(), requestStateList.end(), CurrentIdP( id ) ); if ( I == requestStateList.end() ) { - DEBUG_LOG << "no request found"; + CINECODE_DEBUG_LOG << "no request found"; return; } if ( e ) { - WARNING_LOG << "error: " << qPrintable( http.errorString() ); + CINECODE_WARNING_LOG << "error: " << qPrintable( http.errorString() ); // notify of the error, pop item from list emit error( Request( httpGetter, I->originalId ), http.errorString() ); @@ -194,7 +194,7 @@ // this is a request we know something about // check for a redirect QHttpResponseHeader response = http.lastResponse(); - { DEBUG_LOG << qPrintable( response.toString() ); } + { CINECODE_DEBUG_LOG << qPrintable( response.toString() ); } switch( response.statusCode() ) { case 301: @@ -208,7 +208,7 @@ http.setHost( url.host() ); I->currentId = http.get( url.toString(), I->io ); - DEBUG_LOG << "redirect: " << qPrintable( I->toString() ) << " url: " << qPrintable( url.toString() ); + CINECODE_DEBUG_LOG << "redirect: " << qPrintable( I->toString() ) << " url: " << qPrintable( url.toString() ); return; } else @@ -256,7 +256,7 @@ int requestkey = impl_->http.get( url.toString(), output ); impl_->requestStateList.push_back( RequestState( requestkey, requestkey, output ) ); - DEBUG_LOG << "path: " << qPrintable( path ) << " request: " << qPrintable( impl_->requestStateList.back().toString() ); + CINECODE_DEBUG_LOG << "path: " << qPrintable( path ) << " request: " << qPrintable( impl_->requestStateList.back().toString() ); return Request( this, requestkey ); } Modified: cinesuite/cineplay-cinecode/trunk/src/Info.cpp =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/Info.cpp 2009-11-25 16:37:48 UTC (rev 303) +++ cinesuite/cineplay-cinecode/trunk/src/Info.cpp 2010-01-19 03:04:49 UTC (rev 304) @@ -74,12 +74,12 @@ : QObject( parent ), impl_( new InfoImpl( this ) ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; } void Info::update( const QString& filename ) { - DEBUG_LOG << qPrintable( filename ); + CINECODE_DEBUG_LOG << qPrintable( filename ); QFileInfo fi( filename ); @@ -140,7 +140,7 @@ void Info::clear() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; impl_->ui.filename->setText( tr( "n/a" ) ); impl_->ui.filesize->setText( tr( "n/a" ) ); @@ -152,7 +152,7 @@ void Info::show() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; impl_->show(); } Modified: cinesuite/cineplay-cinecode/trunk/src/OpenGLStore.cpp =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/OpenGLStore.cpp 2009-11-25 16:37:48 UTC (rev 303) +++ cinesuite/cineplay-cinecode/trunk/src/OpenGLStore.cpp 2010-01-19 03:04:49 UTC (rev 304) @@ -408,7 +408,7 @@ if ( !pixels ) { - DEBUG_LOG << "failed to get image data"; + CINECODE_DEBUG_LOG << "failed to get image data"; return; } @@ -1056,7 +1056,7 @@ impl_->m_lastUploaderPf = pf; else { - WARNING_LOG << "failed to find uploader for: " << pl::to_string( pf ); + CINECODE_WARNING_LOG << "failed to find uploader for: " << pl::to_string( pf ); impl_->m_lastUploaderPf.clear(); } } @@ -1091,7 +1091,7 @@ { if ( glewInit() != GLEW_OK ) { - WARNING_LOG << "failed to initialize glew"; + CINECODE_WARNING_LOG << "failed to initialize glew"; return; } @@ -1110,7 +1110,7 @@ { if ( formats[i]->IsSupported() ) { - DEBUG_LOG << "adding uploader: " << i; + CINECODE_DEBUG_LOG << "adding uploader: " << i; impl_->AddUploader( formats[i] ); } ++i; @@ -1144,7 +1144,7 @@ cap = true; delete formats[i]; - DEBUG_LOG << "trying format: " << i << " success: " << cap; + CINECODE_DEBUG_LOG << "trying format: " << i << " success: " << cap; if ( cap ) break; Modified: cinesuite/cineplay-cinecode/trunk/src/PlayList.cpp =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/PlayList.cpp 2009-11-25 16:37:48 UTC (rev 303) +++ cinesuite/cineplay-cinecode/trunk/src/PlayList.cpp 2010-01-19 03:04:49 UTC (rev 304) @@ -34,7 +34,7 @@ CMruList::CMruList( int maxSize ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; m_maxSize = maxSize; readSettings(); @@ -42,7 +42,7 @@ void CMruList::setMaxSize( int maxSize ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; m_maxSize = maxSize; while( m_urls.size() > m_maxSize ) @@ -51,7 +51,7 @@ void CMruList::readSettings() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; QSettings settings; int count = settings.beginReadArray( SETTINGS_MRUROOT ); @@ -68,7 +68,7 @@ void CMruList::writeSettings() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; QSettings settings; settings.beginWriteArray( SETTINGS_MRUROOT, m_urls.size() ); @@ -82,7 +82,7 @@ void CMruList::pushUrl(const QString &str1) { - DEBUG_LOG << qPrintable( str1 ); + CINECODE_DEBUG_LOG << qPrintable( str1 ); //strip sequence tag if its there QString str = str1; @@ -115,7 +115,7 @@ QString CMruList::getUrl(unsigned int index) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if ( m_urls.isEmpty() ) return QString(); @@ -124,7 +124,7 @@ QString CMruList::getLatestUrl() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if ( m_urls.isEmpty() ) return QString(); @@ -133,7 +133,7 @@ void CMruList::BuildMenu( QMenu *menu, QObject *receiver, const char *slot ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; menu->clear(); @@ -175,14 +175,14 @@ CFavourites::CFavourites( QObject* parent ) : QObject( parent ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; readSettings(); } void CFavourites::readSettings() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; QSettings settings; int count = settings.beginReadArray( SETTINGS_FAVROOT ); @@ -212,7 +212,7 @@ void CFavourites::writeSettings() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; QSettings settings; settings.remove( SETTINGS_FAVROOT ); @@ -230,7 +230,7 @@ void CFavourites::pushUrl( const QString &str1, const QString &name, const QImage& thumb, int index ) { - DEBUG_LOG << qPrintable( str1 ) << qPrintable( name ); + CINECODE_DEBUG_LOG << qPrintable( str1 ) << qPrintable( name ); //strip sequence tag if its there QString str = str1; @@ -249,42 +249,42 @@ QString CFavourites::getUrl(unsigned int index) const { - DEBUG_LOG; + CINECODE_DEBUG_LOG; return m_data[index].url; } int CFavourites::getFrameNumber(unsigned int index) const { - DEBUG_LOG; + CINECODE_DEBUG_LOG; return m_data[index].frameNumber; } QString CFavourites::getName(unsigned int index) const { - DEBUG_LOG; + CINECODE_DEBUG_LOG; return m_data[index].name; } QImage CFavourites::getThumbnail( unsigned int index ) const { - DEBUG_LOG; + CINECODE_DEBUG_LOG; return m_data[index].thumbnail; } bool CFavourites::isValid( unsigned int index ) const { - DEBUG_LOG; + CINECODE_DEBUG_LOG; return QFile::exists( getUrl( index ) ); } void CFavourites::removeEntry( unsigned int ref ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if( ref < m_data.size() ) { @@ -298,7 +298,7 @@ void CFavourites::BuildMenu( QMenu* menu, QObject* receiver, const char* slot ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; menu->clear(); Modified: cinesuite/cineplay-cinecode/trunk/src/Player.cpp =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/Player.cpp 2009-11-25 16:37:48 UTC (rev 303) +++ cinesuite/cineplay-cinecode/trunk/src/Player.cpp 2010-01-19 03:04:49 UTC (rev 304) @@ -399,7 +399,7 @@ void LoadCommand::execute() { - DEBUG_LOG << this; + CINECODE_DEBUG_LOG << this; if( m_pPlayer ) { @@ -430,7 +430,7 @@ if ( !m_pPlayer->m_input ) { - DEBUG_LOG << this << " failed to create an input for " << qPrintable( m_fname ); + CINECODE_DEBUG_LOG << this << " failed to create an input for " << qPrintable( m_fname ); m_pPlayer->notifyLoadFailed( m_fname ); return; } @@ -460,7 +460,7 @@ void PlayCommand::execute() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if( m_pPlayer && m_pPlayer->m_input @@ -473,7 +473,7 @@ void StopCommand::execute() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if( m_pPlayer && m_pPlayer->m_playing) @@ -484,7 +484,7 @@ void SeekCommand::execute() { - // DEBUG_LOG << m_frame << m_flags; + // CINECODE_DEBUG_LOG << m_frame << m_flags; if( m_pPlayer ) { @@ -495,7 +495,7 @@ void RefreshVideoCommand::execute() { - DEBUG_LOG_VV; + CINECODE_DEBUG_LOG_VV; if( m_pPlayer && m_pPlayer->m_input @@ -510,7 +510,7 @@ void TerminateThreadCommand::execute() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; m_pPlayer->m_threadRunning = false; } @@ -535,7 +535,7 @@ Player::~Player() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; m_commandQueue.postCommand( TerminateThreadCommand::create(this) ); wait(); @@ -543,7 +543,7 @@ void Player::registerCallback(IPlayerCallbackPtr pCallbackRecipient) { - DEBUG_LOG << pCallbackRecipient; + CINECODE_DEBUG_LOG << pCallbackRecipient; if ( !pCallbackRecipient ) return; @@ -553,7 +553,7 @@ void Player::unRegisterCallback(IPlayerCallbackPtr pCallbackRecipient) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; QMutexLocker lock( &m_mutex ); std::remove(m_callbacks.begin(), m_callbacks.end(), pCallbackRecipient); @@ -561,7 +561,7 @@ void Player::notifyPlaying() { - DEBUG_LOG_VV; + CINECODE_DEBUG_LOG_VV; QMutexLocker lock( &m_mutex ); for_each( m_callbacks.begin(), m_callbacks.end(), callbackPlaying() ); @@ -569,7 +569,7 @@ void Player::notifyStopping() { - DEBUG_LOG_VV; + CINECODE_DEBUG_LOG_VV; QMutexLocker lock( &m_mutex ); for_each( m_callbacks.begin(), m_callbacks.end(), callbackStopping() ); @@ -577,7 +577,7 @@ void Player::notifyPosition() { - DEBUG_LOG_VV; + CINECODE_DEBUG_LOG_VV; QMutexLocker lock( &m_mutex ); for_each( m_callbacks.begin(), m_callbacks.end(), callbackPosition( m_currentFrame, m_input->get_frames() ) ); @@ -585,7 +585,7 @@ void Player::notifyReachedEnd() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; QMutexLocker lock( &m_mutex ); for_each( m_callbacks.begin(), m_callbacks.end(), callbackReachedEnd( m_currentFrame ) ); @@ -593,7 +593,7 @@ void Player::notifyLoadComplete( const QString& fname, int width, int height ) { - DEBUG_LOG << this << " file: " << qPrintable( fname ); + CINECODE_DEBUG_LOG << this << " file: " << qPrintable( fname ); QMutexLocker lock( &m_mutex ); for_each( m_callbacks.begin(), m_callbacks.end(), callbackLoadComplete( fname, width, height ) ); @@ -601,7 +601,7 @@ void Player::notifyLoadFailed( const QString& fname ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; QMutexLocker lock( &m_mutex ); for_each( m_callbacks.begin(), m_callbacks.end(), callbackLoadFailed( fname ) ); @@ -622,7 +622,7 @@ void Player::setVolume(float volume) { - DEBUG_LOG_VV; + CINECODE_DEBUG_LOG_VV; QMutexLocker lock( &m_mutex ); m_volume = volume; @@ -635,7 +635,7 @@ void Player::setMute(bool on) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; QMutexLocker lock( &m_mutex ); m_mute = on; @@ -648,7 +648,7 @@ void Player::load( const QString& fname ) { - DEBUG_LOG << this << " loading: " << fname.toStdString(); + CINECODE_DEBUG_LOG << this << " loading: " << fname.toStdString(); m_commandQueue.postCommand( LoadCommand::create( this, fname ) ); } @@ -660,14 +660,14 @@ void Player::play() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; m_commandQueue.postCommand( PlayCommand::create(this) ); } void Player::stop() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; m_commandQueue.postCommand( StopCommand::create(this) ); } @@ -684,14 +684,14 @@ void Player::setVideoConvertFormat( const std::wstring &pf ) { - DEBUG_LOG << pl::to_string( pf ); + CINECODE_DEBUG_LOG << pl::to_string( pf ); m_videoConvert = pf; } void Player::setFilter( ml::filter_type_ptr filter ) { - DEBUG_LOG << filter.get(); + CINECODE_DEBUG_LOG << filter.get(); m_filter = filter; @@ -709,7 +709,7 @@ void Player::storeFrame( bool pushAudio ) { - DEBUG_LOG_VV << this; + CINECODE_DEBUG_LOG_VV << this; // don't flush() the audio frame on mute, as this will cause the playback speed // to runaway @@ -787,7 +787,7 @@ void Player::run() { { - DEBUG_LOG << "starting player thread"; + CINECODE_DEBUG_LOG << "starting player thread"; } do @@ -828,7 +828,7 @@ } while( m_threadRunning ); { - DEBUG_LOG << "player thread terminating"; + CINECODE_DEBUG_LOG << "player thread terminating"; } } Modified: cinesuite/cineplay-cinecode/trunk/src/PlayerMultiplexer.cpp =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/PlayerMultiplexer.cpp 2009-11-25 16:37:48 UTC (rev 303) +++ cinesuite/cineplay-cinecode/trunk/src/PlayerMultiplexer.cpp 2010-01-19 03:04:49 UTC (rev 304) @@ -74,7 +74,7 @@ void PlayerMultiplexer::setPlayerCount( unsigned int count ) { - DEBUG_LOG << "count: " << count << " (" << playerCount() << ") format: " << opl::to_string( format_ ); + CINECODE_DEBUG_LOG << "count: " << count << " (" << playerCount() << ") format: " << opl::to_string( format_ ); if ( count == playerCount() ) return; Modified: cinesuite/cineplay-cinecode/trunk/src/Release.cpp =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/Release.cpp 2009-11-25 16:37:48 UTC (rev 303) +++ cinesuite/cineplay-cinecode/trunk/src/Release.cpp 2010-01-19 03:04:49 UTC (rev 304) @@ -53,7 +53,7 @@ { if ( !f.open( QIODevice::ReadOnly ) ) { - WARNING_LOG << "failed to open file"; + CINECODE_WARNING_LOG << "failed to open file"; return; } @@ -68,7 +68,7 @@ if ( str.isEmpty() ) return; - DEBUG_LOG << qPrintable( str ) << ", " << qPrintable( version ); + CINECODE_DEBUG_LOG << qPrintable( str ) << ", " << qPrintable( version ); QStringList target = str.split( '.' ); QStringList local = str.split( '.' ); @@ -134,7 +134,7 @@ { if ( error ) { - WARNING_LOG << "failed to get version information: " << qPrintable( http.errorString() ); + CINECODE_WARNING_LOG << "failed to get version information: " << qPrintable( http.errorString() ); return; } @@ -177,7 +177,7 @@ impl_->f.setFileName( str ); if ( !impl_->f.open( QIODevice::ReadWrite | QIODevice::Truncate ) ) { - WARNING_LOG << "failed to open file"; + CINECODE_WARNING_LOG << "failed to open file"; return; } Modified: cinesuite/cineplay-cinecode/trunk/src/Utils.cpp =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/Utils.cpp 2009-11-25 16:37:48 UTC (rev 303) +++ cinesuite/cineplay-cinecode/trunk/src/Utils.cpp 2010-01-19 03:04:49 UTC (rev 304) @@ -54,7 +54,7 @@ QString createTemporaryFilename() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; const static int BUFFERSIZE = 100; char dir[ BUFFERSIZE ]; @@ -63,14 +63,14 @@ int result = GetTempPathA( BUFFERSIZE, dir ); if ( result == 0 || result > BUFFERSIZE ) { - WARNING_LOG << "failed to get temporary directory"; + CINECODE_WARNING_LOG << "failed to get temporary directory"; return QString(); } result = GetTempFileNameA( dir, "cineplay", 0, file ); if ( result == 0 ) { - WARNING_LOG << "failed to get temporary filename"; + CINECODE_WARNING_LOG << "failed to get temporary filename"; return QString(); } @@ -82,7 +82,7 @@ WCHAR fsRepr[260]; if ( S_OK != SHGetFolderPath( NULL, csidl, NULL, SHGFP_TYPE_CURRENT, fsRepr ) ) { - WARNING_LOG << "error doing SHGetFolderPath:"; + CINECODE_WARNING_LOG << "error doing SHGetFolderPath:"; return QDir(); } @@ -91,14 +91,14 @@ QString createStandardEncodeLocation() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; return getFolderPath__( CSIDL_DESKTOPDIRECTORY ).absolutePath(); } bool movefile(const QString &srcFile, const QString &dstLocation, bool dstIsFile /*= false*/) { - DEBUG_LOG << qPrintable( srcFile ) << " -> " << qPrintable( dstLocation ) << (dstIsFile ? "true" : "false"); + CINECODE_DEBUG_LOG << qPrintable( srcFile ) << " -> " << qPrintable( dstLocation ) << (dstIsFile ? "true" : "false"); if(dstIsFile) { @@ -120,7 +120,7 @@ bool deletefile(const QString &file) { - DEBUG_LOG << qPrintable( file ); + CINECODE_DEBUG_LOG << qPrintable( file ); return DeleteFile( (WCHAR*)file.utf16() ) != FALSE; } @@ -150,7 +150,7 @@ { char tmp[] = "/tmp/cinecode-XXXXXX"; strncpy( tmp, mktemp( tmp ), 20 ); - DEBUG_LOG << "createTemporaryFilename: " << tmp; + CINECODE_DEBUG_LOG << "createTemporaryFilename: " << tmp; return tmp; } @@ -158,7 +158,7 @@ QString createStandardEncodeLocation() { - DEBUG_LOG; + CINECODE_DEBUG_LOG; QString path = QDir::homePath(); path += "/Desktop"; @@ -167,7 +167,7 @@ bool movefile(const QString &srcFile, const QString &dstLocation, bool ) { - DEBUG_LOG << qPrintable( srcFile ) << " -> " << qPrintable( dstLocation ); + CINECODE_DEBUG_LOG << qPrintable( srcFile ) << " -> " << qPrintable( dstLocation ); return ::rename( qPrintable( srcFile ), qPrintable( dstLocation ) ) == 0; } @@ -175,7 +175,7 @@ bool deletefile(const QString &file) { - DEBUG_LOG << qPrintable( file ); + CINECODE_DEBUG_LOG << qPrintable( file ); return QFile::remove( file ); } @@ -189,7 +189,7 @@ FSRef fs; OSErr err = FSFindFolder( kUserDomain, ft, kDontCreateFolder, &fs ); if (err != noErr) { - WARNING_LOG << "error doing FSFindFolder: " << err; + CINECODE_WARNING_LOG << "error doing FSFindFolder: " << err; return QDir(); } @@ -197,7 +197,7 @@ char fsRepr[1024]; if ( !CFURLGetFileSystemRepresentation( dirURL, true, (UInt8*)fsRepr, 1024 ) ) { - WARNING_LOG << "error invoking CFURLGetFileSystemRepresentation"; + CINECODE_WARNING_LOG << "error invoking CFURLGetFileSystemRepresentation"; return QDir(); } @@ -241,7 +241,7 @@ QString makeUniqueDstFilename(const QString &start) { - DEBUG_LOG << qPrintable( start ); + CINECODE_DEBUG_LOG << qPrintable( start ); QString dstFile = start; QFileInfo info(dstFile); @@ -266,7 +266,7 @@ void AddWidgetToParentLayout( QWidget* parent, QWidget* w ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if ( parent ) { @@ -291,14 +291,14 @@ if ( !objList.isEmpty() ) result = objList.first(); - DEBUG_LOG << "name: " << qPrintable( name ) << " parent: " << parent << " result: " << result; + CINECODE_DEBUG_LOG << "name: " << qPrintable( name ) << " parent: " << parent << " result: " << result; return result; } QWidget* ConnectSignalTo( QWidget* parent, const char* nm, const char* signal, QObject* receiver, const char* slot ) { - DEBUG_LOG << parent << nm << signal << receiver << slot; + CINECODE_DEBUG_LOG << parent << nm << signal << receiver << slot; QWidget *ht = FindWidget(nm, parent); @@ -307,7 +307,7 @@ bool succ = QObject::connect(ht, signal, receiver, slot ); if(!succ) { - WARNING_LOG << "Couldnt connect \"" << nm << "::" << signal + CINECODE_WARNING_LOG << "Couldnt connect \"" << nm << "::" << signal << "\" to \"" << qPrintable( receiver->objectName() ) << "::" << slot; } } @@ -318,14 +318,14 @@ QWidget* ConnectButtonTo( QWidget* parent, const char* nm, QObject* receiver, const char* slot ) { - DEBUG_LOG << parent << nm << receiver << slot; + CINECODE_DEBUG_LOG << parent << nm << receiver << slot; return ConnectSignalTo( parent, nm, SIGNAL(clicked()), receiver, slot ); } void ShowWidget( QWidget* parent, const char* name, bool show ) { - DEBUG_LOG << parent << name << show; + CINECODE_DEBUG_LOG << parent << name << show; QWidget *w = FindWidget( name, parent ); if(w) @@ -334,7 +334,7 @@ void InitOpenLibraries( const QString& appDirPath ) { - DEBUG_LOG << qPrintable( appDirPath ); + CINECODE_DEBUG_LOG << qPrintable( appDirPath ); #if defined( Q_OS_MACX ) pl::init( (appDirPath + "/../PlugIns/").toStdString() ); @@ -343,7 +343,7 @@ QString pluginPath = appDirPath; pluginPath += "/plugins"; - DEBUG_LOG << "checking for plugins: " << qPrintable( pluginPath ); + CINECODE_DEBUG_LOG << "checking for plugins: " << qPrintable( pluginPath ); pl::init( pluginPath.toStdString(), 0 ); } #else // !mac && !windows @@ -353,7 +353,7 @@ il::image_type_ptr QImageToImage( const QImage& qimage ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; typedef il::image< unsigned char, il::b8g8r8a8 > b8g8r8a8_image_type; @@ -370,7 +370,7 @@ if ( qimage.format() != QImage::Format_ARGB32 ) { - WARNING_LOG << "format must be ARGB32: " << qimage.format(); + CINECODE_WARNING_LOG << "format must be ARGB32: " << qimage.format(); return image; } @@ -391,18 +391,18 @@ } else { - WARNING_LOG << "only supports 32bit images"; + CINECODE_WARNING_LOG << "only supports 32bit images"; return il::image_type_ptr(); } } QImage ImageToQImage( il::image_type_ptr image ) { - DEBUG_LOG; + CINECODE_DEBUG_LOG; if ( !image ) { - WARNING_LOG << "passed NULL image_type_ptr"; + CINECODE_WARNING_LOG << "passed NULL image_type_ptr"; return QImage(); } @@ -411,7 +411,7 @@ if ( !dst_img ) { - WARNING_LOG << "unable to convert to QImage byte order"; + CINECODE_WARNING_LOG << "unable to convert to QImage byte order"; return QImage(); } Modified: cinesuite/cineplay-cinecode/trunk/src/log.hpp =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/log.hpp 2009-11-25 16:37:48 UTC (rev 303) +++ cinesuite/cineplay-cinecode/trunk/src/log.hpp 2010-01-19 03:04:49 UTC (rev 304) @@ -22,7 +22,7 @@ #pragma once // std -#include <iosfwd> +#include <ostream> #include <string> /// Basic logging class; don't use directly, but rather through @@ -60,32 +60,9 @@ std::ostream* os_; }; -#ifdef STANDARD_PREAMBLE -#undef STANDARD_PREAMBLE -#endif -#define STANDARD_PREAMBLE __FILE__ << ", L" << __LINE__ << ", " << __FUNCTION__ << ":" - -#ifdef DEBUG_LOG -#undef DEBUG_LOG -#endif -#define DEBUG_LOG Log( Log::Debug( 3, "debug: " ) ) << STANDARD_PREAMBLE - -#ifdef DEBUG_LOG_V -#undef DEBUG_LOG_V -#endif -#define DEBUG_LOG_V Log( Log::Debug( 4, "debug: " ) ) << STANDARD_PREAMBLE - -#ifdef DEBUG_LOG_VV -#undef DEBUG_LOG_VV -#endif -#define DEBUG_LOG_VV Log( Log::Debug( 5, "debug: " ) ) << STANDARD_PREAMBLE - -#ifdef WARNING_LOG -#undef WARNING_LOG -#endif -#define WARNING_LOG Log( Log::Warning( "warning: " ) ) << STANDARD_PREAMBLE - -#ifdef CRITICAL_LOG -#undef CRITICAL_LOG -#endif -#define CRITICAL_LOG Log( Log::Critical( "critical: " ) ) << STANDARD_PREAMBLE +#define CINECODE_STANDARD_PREAMBLE __FILE__ << ", L" << __LINE__ << ", " << __FUNCTION__ << ":" +#define CINECODE_DEBUG_LOG Log( Log::Debug( 3, "debug: " ) ) << CINECODE_STANDARD_PREAMBLE +#define CINECODE_DEBUG_LOG_V Log( Log::Debug( 4, "debug: " ) ) << CINECODE_STANDARD_PREAMBLE +#define CINECODE_DEBUG_LOG_VV Log( Log::Debug( 5, "debug: " ) ) << CINECODE_STANDARD_PREAMBLE +#define CINECODE_WARNING_LOG Log( Log::Warning( "warning: " ) ) << CINECODE_STANDARD_PREAMBLE +#define CINECODE_CRITICAL_LOG Log( Log::Critical( "critical: " ) ) << CINECODE_STANDARD_PREAMBLE This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2009-11-25 16:37:56
|
Revision: 303 http://editopia.svn.sourceforge.net/editopia/?rev=303&view=rev Author: timdewhirst Date: 2009-11-25 16:37:48 +0000 (Wed, 25 Nov 2009) Log Message: ----------- cinecode * add support for yuv422p Modified Paths: -------------- cinesuite/cineplay-cinecode/trunk/src/OpenGLStore.cpp Modified: cinesuite/cineplay-cinecode/trunk/src/OpenGLStore.cpp =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/OpenGLStore.cpp 2009-02-18 09:32:58 UTC (rev 302) +++ cinesuite/cineplay-cinecode/trunk/src/OpenGLStore.cpp 2009-11-25 16:37:48 UTC (rev 303) @@ -47,11 +47,16 @@ GLuint CreateTexture(int &inOutWidth, int &inoutHeight); void DrawTexQuad(float *verts, float *texcoords); void PillarLetterBox(float *verts, float aspect, const QRect &drawRect); - void SpliceBuffer( const unsigned char *yPixels, - const unsigned char *uPixels, - const unsigned char *vPixels, - int w, int h, - unsigned char *outbuffer ); + void SpliceBuffer420( const unsigned char *yPixels, + const unsigned char *uPixels, + const unsigned char *vPixels, + int w, int h, + unsigned char *outbuffer ); + void SpliceBuffer422( const unsigned char *yPixels, + const unsigned char *uPixels, + const unsigned char *vPixels, + int w, int h, + unsigned char *outbuffer ); private: bool m_initialised; @@ -125,7 +130,23 @@ void Draw( const QRect &r ); }; + class GLYuv422pFormat : public GLUploadFormat + { + protected: + GLuint m_tex; + GLhandleARB m_program; + unsigned char* m_uploadBuffer; + public: + GLYuv422pFormat(); + ~GLYuv422pFormat(); + std::wstring Pf() { return L"yuv422p"; } + bool IsSupported(); + void Init(); + void UpdateImage( const ml::image_type_ptr &image ); + void Draw( const QRect &r ); + }; + class GLYuv420pFPFormat : public GLUploadFormat { protected: @@ -224,11 +245,11 @@ } } - void GLUploadFormat::SpliceBuffer( const unsigned char *yPixels, - const unsigned char *uPixels, - const unsigned char *vPixels, - int w, int h, - unsigned char *outbuffer ) + void GLUploadFormat::SpliceBuffer420( const unsigned char *yPixels, + const unsigned char *uPixels, + const unsigned char *vPixels, + int w, int h, + unsigned char *outbuffer ) { //This is a yuv420 planar to yuv444 kinda translation, for the upload speed of an rgba buffer int sz = w * h; @@ -273,6 +294,33 @@ } + void GLUploadFormat::SpliceBuffer422( const unsigned char *yPixels, + const unsigned char *uPixels, + const unsigned char *vPixels, + int w, int h, + unsigned char *outbuffer ) + { + //This is a yuv422p to yuv4444 kinda translation, for the upload speed of an rgba buffer + int sz = w * h; + unsigned char *ptr = outbuffer; + + for(int y=0;y<h;++y) + { + for(int x=0; x<w; x+=2) + { + *ptr++ = *yPixels++; + *ptr++ = *uPixels; + *ptr++ = *vPixels; + *ptr++ = 0; + *ptr++ = *yPixels++; + *ptr++ = *uPixels++; + *ptr++ = *vPixels++; + *ptr++ = 0; + } + } + + } + GLuint GLUploadFormat::CreateTexture(int &width, int &height) { GLuint tex; @@ -491,7 +539,7 @@ int h = m_iHeight; glBindTexture( GL_TEXTURE_2D, m_tex ); - SpliceBuffer(yPixels, uPixels, vPixels, w, h, m_uploadBuffer); + SpliceBuffer420(yPixels, uPixels, vPixels, w, h, m_uploadBuffer); glTexSubImage2D( GL_TEXTURE_2D, 0, 0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, m_uploadBuffer ); } } @@ -518,7 +566,139 @@ glUseProgramObjectARB(0); } + //////////////////////////////////// + + GLYuv422pFormat::GLYuv422pFormat() + : m_tex( 0 ), + m_uploadBuffer( NULL ) + {} + + + bool GLYuv422pFormat::IsSupported() + { + return glShaderSourceARB; + } + + + void GLYuv422pFormat::Init() + { + m_program = glCreateProgramObjectARB(); + GLhandleARB fragProg = glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB); + + GLint succ; + const GLcharARB* src = "\ + uniform sampler2D inColor0;\n\ + \n\ + const vec4 shift = vec4( 0.0625, 0.5, 0.5, 0.0 ); \n\ + \n\ + void main( void )\n\ + {\n\ + vec4 col = texture2D( inColor0, gl_TexCoord[0].xy ); \n\ + col = col - shift; \n\ + gl_FragColor.r = 1.1640625 * col.r + 1.5957 * col.b ; \n\ + gl_FragColor.g = 1.1640625 * col.r - 0.8125 * col.b - 0.390625 * col.g; \n\ + gl_FragColor.b = 1.1640625 * col.r + 2.0176 * col.g; \n\ + }";; + glShaderSourceARB( fragProg, 1, &src, 0 ); + glCompileShaderARB( fragProg ); + glGetObjectParameterivARB( fragProg, GL_OBJECT_COMPILE_STATUS_ARB, &succ ); + if(succ == 0) + { + char buffer[250]; + GLsizei length = 250; + glGetShaderInfoLog(fragProg, 250, &length, buffer); + ++length; + } + + glAttachObjectARB( m_program, fragProg ); + + glLinkProgramARB( m_program ); + glGetObjectParameterivARB( m_program, GL_OBJECT_LINK_STATUS_ARB, &succ ); + + glUseProgramObjectARB(m_program); + glUseProgramObjectARB(0); + + GLUploadFormat::Init(); + } + + + GLYuv422pFormat::~GLYuv422pFormat() + { + if ( !WasInitialised() ) + return; + + if(m_uploadBuffer) + delete[] m_uploadBuffer; + m_uploadBuffer = 0; + + if ( m_program ) + glDeleteObjectARB(m_program); + + if(m_tex) + glDeleteTextures(1, &m_tex); + } + + + void GLYuv422pFormat::UpdateImage( const ml::image_type_ptr &image ) + { + m_iWidth = image->width(); + m_iHeight = image->height(); + + if(m_iWidth > m_texWidth || m_iHeight > m_texHeight) + { + if(m_tex) + glDeleteTextures(1, &m_tex); + int w = m_iWidth; + int h = m_iHeight; + m_tex = CreateTexture(w, h); + m_texWidth = w; + m_texHeight = h; + + //software splice buffer big enough also + if(m_uploadBuffer) + delete[] m_uploadBuffer; + m_uploadBuffer = new unsigned char[w * h * 4]; + } + + unsigned char *yPixels = image->data(); + unsigned char *uPixels = image->data(1); + unsigned char *vPixels = image->data(2); + + if(yPixels) + { + int w = m_iWidth; + int h = m_iHeight; + + glBindTexture( GL_TEXTURE_2D, m_tex ); + SpliceBuffer422(yPixels, uPixels, vPixels, w, h, m_uploadBuffer); + glTexSubImage2D( GL_TEXTURE_2D, 0, 0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, m_uploadBuffer ); + } + } + + + void GLYuv422pFormat::Draw( const QRect &r ) + { + glUseProgramObjectARB(m_program); + + float aspect = (float)m_iWidth / (float)m_iHeight; + float verts[4] = {-1.0f, 1.0f, -1.0f, 1.0f}; //l,r,b,t + + PillarLetterBox(verts, aspect, r); + + glEnable(GL_TEXTURE_2D); + glBindTexture( GL_TEXTURE_2D, m_tex ); + + //this should be 1/2 a texel less + float texcoords[4] = {0.0f, m_iWidth / (float)m_texWidth, 0.0f, m_iHeight / (float)m_texHeight}; + + DrawTexQuad(verts, texcoords); + + glBindTexture( GL_TEXTURE_2D, 0 ); + glUseProgramObjectARB(0); + } + + //////////////////////////////////// @@ -611,7 +791,7 @@ int h = m_iHeight; glBindTexture( GL_TEXTURE_2D, m_tex ); - SpliceBuffer(yPixels, uPixels, vPixels, w, h, m_uploadBuffer); + SpliceBuffer420(yPixels, uPixels, vPixels, w, h, m_uploadBuffer); glTexSubImage2D( GL_TEXTURE_2D, 0, 0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, m_uploadBuffer ); } } @@ -724,7 +904,7 @@ glLoadMatrixf(Matrix_YCbCr2RGB); glBindTexture( GL_TEXTURE_2D, m_yTex ); - SpliceBuffer(yPixels, uPixels, vPixels, w, h, m_uploadBuffer); + SpliceBuffer420(yPixels, uPixels, vPixels, w, h, m_uploadBuffer); glTexSubImage2D( GL_TEXTURE_2D, 0, 0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, m_uploadBuffer ); glPixelTransferf(GL_RED_BIAS, 0.0); @@ -918,6 +1098,7 @@ GLUploadFormat* formats[] = { new GLYuv420pFPFormat, new GLYuv420pSlowFormat, new GLYuv420pFormat, + new GLYuv422pFormat, new GLBgraFormat, new GLAbgrFormat, new GLRgbaFormat, @@ -951,6 +1132,7 @@ GLUploadFormat* formats[] = { new GLYuv420pFPFormat, new GLYuv420pSlowFormat, new GLYuv420pFormat, + new GLYuv422pFormat, new GLYuv420pSlowConvertFormat, NULL }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2009-10-23 11:02:52
|
Revision: 1481 http://openlibraries.svn.sourceforge.net/openlibraries/?rev=1481&view=rev Author: timdewhirst Date: 2009-10-23 11:02:42 +0000 (Fri, 23 Oct 2009) Log Message: ----------- cmake * add support for MSVC2008 Modified Paths: -------------- trunk/CMakeLists.txt Modified: trunk/CMakeLists.txt =================================================================== --- trunk/CMakeLists.txt 2009-09-16 10:11:02 UTC (rev 1480) +++ trunk/CMakeLists.txt 2009-10-23 11:02:42 UTC (rev 1481) @@ -74,6 +74,9 @@ add_definitions( -DUNICODE ) add_definitions( -D_CRT_SECURE_NO_DEPRECATE ) + if( MSVC90 ) + set( COMPILER "vc90" ) + endif( MSVC90 ) if( MSVC80 ) set( COMPILER "vc80" ) endif( MSVC80 ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2009-09-16 10:11:17
|
Revision: 1480 http://openlibraries.svn.sourceforge.net/openlibraries/?rev=1480&view=rev Author: timdewhirst Date: 2009-09-16 10:11:02 +0000 (Wed, 16 Sep 2009) Log Message: ----------- OML * fix for typo Modified Paths: -------------- trunk/src/openmedialib/plugins/avformat/avformat_plugin.cpp Modified: trunk/src/openmedialib/plugins/avformat/avformat_plugin.cpp =================================================================== --- trunk/src/openmedialib/plugins/avformat/avformat_plugin.cpp 2009-09-11 13:53:37 UTC (rev 1479) +++ trunk/src/openmedialib/plugins/avformat/avformat_plugin.cpp 2009-09-16 10:11:02 UTC (rev 1480) @@ -1487,7 +1487,7 @@ if ( !context_->streams[ video_index ] ) return NULL; - return context_->streams[ video_indexes_[ video_index ] ]; + return context_->streams[ video_index ]; } // Returns the current audio stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2009-09-11 13:53:45
|
Revision: 1479 http://openlibraries.svn.sourceforge.net/openlibraries/?rev=1479&view=rev Author: timdewhirst Date: 2009-09-11 13:53:37 +0000 (Fri, 11 Sep 2009) Log Message: ----------- OML * avoid crash on loading files with no audio Modified Paths: -------------- trunk/src/openmedialib/plugins/avformat/avformat_plugin.cpp Modified: trunk/src/openmedialib/plugins/avformat/avformat_plugin.cpp =================================================================== --- trunk/src/openmedialib/plugins/avformat/avformat_plugin.cpp 2009-08-24 11:33:31 UTC (rev 1478) +++ trunk/src/openmedialib/plugins/avformat/avformat_plugin.cpp 2009-09-11 13:53:37 UTC (rev 1479) @@ -1446,7 +1446,7 @@ // Work around for inefficiencies on I frame only seeking // - this should be covered by the AVStream discard and need_parsing values // but they're either wrong or poorly documented... - if ( has_video( ) ) + if ( get_video_stream() ) { std::string codec( get_video_stream( )->codec->codec->name ); if ( codec == "mjpeg" ) @@ -1477,27 +1477,45 @@ // Returns the current video stream inline AVStream *get_video_stream( ) { - assert( context_ && context_->streams[ video_indexes_[ prop_video_index_.value< int >( ) ] ] ); - if ( prop_video_index_.value< int >( ) >= 0 && video_indexes_.size( ) > 0 ) - return context_->streams[ video_indexes_[ prop_video_index_.value< int >( ) ] ]; - else - return 0; + assert( context_ ); + + int prop_video_index = prop_video_index_.value< int >(); + if ( video_indexes_.size() == 0 || prop_video_index < 0 ) + return NULL; + + int video_index = video_indexes_[ prop_video_index ]; + if ( !context_->streams[ video_index ] ) + return NULL; + + return context_->streams[ video_indexes_[ video_index ] ]; } // Returns the current audio stream inline AVStream *get_audio_stream( ) { - assert( context_ && context_->streams[ audio_indexes_[ prop_audio_index_.value< int >( ) ] ] ); - if ( prop_audio_index_.value< int >( ) >= 0 && audio_indexes_.size( ) > 0 ) - return context_->streams[ audio_indexes_[ prop_audio_index_.value< int >( ) ] ]; - else - return 0; + assert( context_ ); + + int prop_audio_index = prop_audio_index_.value< int >(); + if ( audio_indexes_.size() == 0 || prop_audio_index < 0 ) + return NULL; + + int audio_index = audio_indexes_[ prop_audio_index ]; + if ( !context_->streams[ audio_index ] ) + return NULL; + + return context_->streams[ audio_index ]; } // Opens the video codec associated to the current stream void open_video_codec( ) { AVStream *stream = get_video_stream( ); + if ( !stream ) + { + WARNING_LOG << "failed to get_video_stream"; + return; + } + AVCodecContext *codec_context = stream->codec; video_codec_ = avcodec_find_decoder( codec_context->codec_id ); if ( video_codec_ == NULL || avcodec_open( codec_context, video_codec_ ) < 0 ) @@ -1515,6 +1533,12 @@ void open_audio_codec( ) { AVStream *stream = get_audio_stream( ); + if ( !stream ) + { + WARNING_LOG << "failed to get_audio_stream"; + return; + } + AVCodecContext *codec_context = stream->codec; audio_codec_ = avcodec_find_decoder( codec_context->codec_id ); if ( audio_codec_ == NULL || avcodec_open( codec_context, audio_codec_ ) < 0 ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2009-08-24 11:33:44
|
Revision: 1478 http://openlibraries.svn.sourceforge.net/openlibraries/?rev=1478&view=rev Author: timdewhirst Date: 2009-08-24 11:33:31 +0000 (Mon, 24 Aug 2009) Log Message: ----------- OML * guard against divide by zero errors in audio channel conversion Modified Paths: -------------- trunk/src/openmedialib/ml/utilities.cpp Modified: trunk/src/openmedialib/ml/utilities.cpp =================================================================== --- trunk/src/openmedialib/ml/utilities.cpp 2009-07-28 15:18:58 UTC (rev 1477) +++ trunk/src/openmedialib/ml/utilities.cpp 2009-08-24 11:33:31 UTC (rev 1478) @@ -631,7 +631,7 @@ if(input_audio == audio_type_ptr()) return audio_type_ptr(); - if(sampling_freq <= 0) + if(sampling_freq <= 0 || input_audio->channels() == 0) return audio_type_ptr(); if(input_audio->frequency() == sampling_freq) @@ -835,8 +835,8 @@ if(input_audio == audio_type_ptr()) return audio_type_ptr(); - // Return input if already in desired form - if(input_audio->channels() == channels_out) + // Return input if already in desired form or no data to convert + if(input_audio->channels() == channels_out || input_audio->channels() == 0) return input_audio; // Reject if convertion isn't supported This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2009-07-28 15:19:11
|
Revision: 1477 http://openlibraries.svn.sourceforge.net/openlibraries/?rev=1477&view=rev Author: timdewhirst Date: 2009-07-28 15:18:58 +0000 (Tue, 28 Jul 2009) Log Message: ----------- OML * build fixes * change to use logging class Modified Paths: -------------- trunk/src/openmedialib/ml/filter.hpp trunk/src/openmedialib/plugins/gensys/gensys_plugin.cpp trunk/src/openmedialib/plugins/glew/glew_plugin.cpp Modified: trunk/src/openmedialib/ml/filter.hpp =================================================================== --- trunk/src/openmedialib/ml/filter.hpp 2009-07-06 11:14:29 UTC (rev 1476) +++ trunk/src/openmedialib/ml/filter.hpp 2009-07-28 15:18:58 UTC (rev 1477) @@ -1,3 +1,4 @@ +/* -*- mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*- */ // ml - A media library representation. // Copyright (C) 2005-2006 Editopia Inc. @@ -12,6 +13,7 @@ #include <openmedialib/ml/frame.hpp> #include <openmedialib/ml/input.hpp> #include <openpluginlib/pl/utf8_utils.hpp> +#include <openpluginlib/pl/log.hpp> namespace olib { namespace openmedialib { namespace ml { @@ -170,12 +172,12 @@ // Fetch the name and value property std::string name( ( *it ).as_string( ) ); - if ( debug_level( ) & 4 ) fprintf( stderr, "name = %s\n", name.c_str( ) ); + DEBUG_LOG_V << "name: " << name; if ( name.find( ":" ) != std::string::npos ) name = name.substr( 0, name.find( ":" ) ); - if ( debug_level( ) & 1 ) fprintf( stderr, "found = %s\n", name.c_str( ) ); + DEBUG_LOG << "found: " << name; pcos::property input = properties( ).get_property_with_string( name.c_str( ) ); @@ -203,7 +205,7 @@ // Obtain the src pcos::property src( pcos::property::NULL_PROPERTY ); - if ( debug_level( ) & 2 ) fprintf( stderr, "looking for = %s\n", value.c_str( ) ); + DEBUG_LOG_V << "looking for: " << value; if ( value.substr( 0, 2 ) == "@@" ) src = frame->properties( ).get_property_with_string( value.substr( 2 ).c_str( ) ); else if ( value[ 0 ] == '@' ) Modified: trunk/src/openmedialib/plugins/gensys/gensys_plugin.cpp =================================================================== --- trunk/src/openmedialib/plugins/gensys/gensys_plugin.cpp 2009-07-06 11:14:29 UTC (rev 1476) +++ trunk/src/openmedialib/plugins/gensys/gensys_plugin.cpp 2009-07-28 15:18:58 UTC (rev 1477) @@ -16,6 +16,7 @@ #include <iostream> #include <cstdlib> +#include <cstdio> #include <vector> #include <map> #include <string> @@ -26,6 +27,7 @@ #include <boost/thread/thread.hpp> #include <boost/cstdint.hpp> #include <openpluginlib/pl/pcos/observer.hpp> +#include <openpluginlib/pl/log.hpp> #ifdef _MSC_VER # pragma warning ( push ) @@ -1228,7 +1230,7 @@ } else { - fprintf( stderr, "Not thread safe\n" ); + WARNING_LOG << "Not thread safe"; } } @@ -1276,7 +1278,7 @@ if ( !running_ ) { if ( debug_level( ) ) - fprintf( stderr, "requesting %d from dormant\n", get_position( ) ); + DEBUG_LOG << "requesting " << get_position() << " from dormant"; input->seek( get_position( ) ); result = input->fetch( ); last_position_ = get_position( ); @@ -1288,7 +1290,7 @@ if ( get_position( ) != last_position_ && get_position( ) != last_position_ + 1 ) { if ( debug_level( ) ) - fprintf( stderr, "restarting the thread %d %d\n", get_position( ), last_position_ ); + DEBUG_LOG << "restarting the thread " << get_position( ) << ", " << last_position_; prop_active_.set( 0 ); queue_.clear( ); input->seek( get_position( ) ); @@ -1297,7 +1299,7 @@ else { if ( debug_level( ) ) - fprintf( stderr, "requesting %d from active %d\n", get_position( ), int( queue_.size( ) ) ); + DEBUG_LOG << "requesting " << get_position( ) << " from active " << queue_.size( ); } last_position_ = get_position( ); Modified: trunk/src/openmedialib/plugins/glew/glew_plugin.cpp =================================================================== --- trunk/src/openmedialib/plugins/glew/glew_plugin.cpp 2009-07-06 11:14:29 UTC (rev 1476) +++ trunk/src/openmedialib/plugins/glew/glew_plugin.cpp 2009-07-28 15:18:58 UTC (rev 1477) @@ -1,4 +1,4 @@ - +/* -*- mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*- */ // glew - A glew plugin to ml. // Copyright (C) 2005-2006 Editopia Inc. @@ -11,6 +11,7 @@ #include <openmedialib/ml/openmedialib_plugin.hpp> #include <openpluginlib/pl/string.hpp> +#include <openpluginlib/pl/log.hpp> #ifdef WIN32 #include <windows.h> @@ -346,7 +347,7 @@ # ifndef NDEBUG GLenum error; while( ( error = glGetError( ) ) != GL_NO_ERROR ) - fprintf( stderr, "GLerror:%s\n", gluErrorString( error ) ); + CRITICAL_LOG << "GLerror: " << gluErrorString( error ); # endif glutSwapBuffers( ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2009-07-06 11:14:31
|
Revision: 1476 http://openlibraries.svn.sourceforge.net/openlibraries/?rev=1476&view=rev Author: timdewhirst Date: 2009-07-06 11:14:29 +0000 (Mon, 06 Jul 2009) Log Message: ----------- OML * various fixed to avoid short playback in certain cases e.g. mp3 audio * fixes to ensure all audio data is correctly written Modified Paths: -------------- trunk/src/openmedialib/plugins/avformat/avformat_plugin.cpp Modified: trunk/src/openmedialib/plugins/avformat/avformat_plugin.cpp =================================================================== --- trunk/src/openmedialib/plugins/avformat/avformat_plugin.cpp 2009-06-11 15:18:49 UTC (rev 1475) +++ trunk/src/openmedialib/plugins/avformat/avformat_plugin.cpp 2009-07-06 11:14:29 UTC (rev 1476) @@ -516,23 +516,37 @@ video_pts = 0.0; // Write interleaved audio and video frames + bool did_audio = false; + bool did_video = false; if ( !video_stream_ || ( video_stream_ && audio_stream_ && audio_pts < video_pts ) ) { - if ( !audio_queue_.size( ) ) - break; - if ( !process_audio( ) ) - return false; + if ( audio_queue_.size( ) ) + { + did_audio = true; + + if ( !process_audio( ) ) + { + return false; + } + } } - else if ( video_stream_ ) + + if ( !did_audio && video_stream_ ) { - if ( !video_queue_.size( ) ) - break; - if ( !process_video( ) ) - return false; + if ( video_queue_.size( ) ) + { + did_video = true; + + if ( !process_video( ) ) + { + return false; + } + } } - else + + if ( !did_audio && !did_video ) { - return false; + break; } } @@ -559,7 +573,9 @@ // Playout all queued frames and return when done. The default // implementation applies when the store doesn't queue frames. virtual void complete( ) - { + { + flush_audio(); + if ( prop_show_stats_.value< int >( ) ) { double audio_pts = audio_stream_ != 0 ? double( audio_stream_->pts.val ) * audio_stream_->time_base.num / audio_stream_->time_base.den : 0.0; @@ -914,7 +930,7 @@ int available = current->allocsize( ); int offset = 0; - while ( bytes > 0 && audio_block_used_ + available > bytes ) + while ( bytes > 0 && audio_block_used_ + available >= bytes ) { memcpy( audio_block_->data( ) + audio_block_used_, current->data( ) + offset, bytes - audio_block_used_ ); audio_queue_.push_back( audio_block_ ); @@ -1036,18 +1052,60 @@ // Precondition: the audio queue is not empty bool process_audio( ) { - bool ret = true; - audio_type_ptr audio = *( audio_queue_.begin( ) ); audio_queue_.pop_front( ); + int size = avcodec_encode_audio( audio_stream_->codec, audio_outbuf_, audio_outbuf_size_, ( short * )audio->data( ) ); + + if ( size < 0 ) return false; + + if ( size == 0 ) return true; + + return write_audio_packet( size ); + } + + void flush_audio() + { + // The libmp3lame codec (and maybe others) doesn't produce + // all its data immediately - it needs to be flushed after + // all the input data has been passed to it. To get the + // whole output we call avcodec_encode_audio with no data + // until we don't get anything back. + + if ( !audio_stream_ ) return; + + for (;;) + { + int size = avcodec_encode_audio( audio_stream_->codec, + audio_outbuf_, + audio_outbuf_size_, + NULL ); // means flush + + if ( size < 0 ) + { + WARNING_LOG << "error in avcodec_encode_audio while flushing audio" << size; + break; + } + + if ( size == 0 ) break; // all flushed + + // we write audio packets in the same way as in process_audio above + if ( !write_audio_packet( size ) ) + WARNING_LOG << "failed to write frame while flushing audio"; + } + } + + bool write_audio_packet( int size ) + { + assert( audio_stream_ != NULL ); + assert( size > 0 ); + AVCodecContext *c = audio_stream_->codec; AVPacket pkt; av_init_packet( &pkt ); + pkt.size = size; - pkt.size = avcodec_encode_audio( c, audio_outbuf_, audio_outbuf_size_, ( short * )audio->data( ) ); - // Write the compressed frame in the media file if ( c->coded_frame && uint64_t( c->coded_frame->pts ) != AV_NOPTS_VALUE ) pkt.pts = av_rescale_q( c->coded_frame->pts, c->time_base, audio_stream_->time_base ); @@ -1055,12 +1113,12 @@ pkt.flags |= PKT_FLAG_KEY; pkt.stream_index = audio_stream_->index; pkt.data = audio_outbuf_; - + if ( pkt.size ) if ( av_interleaved_write_frame( oc_, &pkt ) != 0 ) - ret = false; + return false; - return ret; + return true; } // The output file or device @@ -1325,7 +1383,15 @@ start_time_ = context_->start_time; // Set the duration - if ( uint64_t( context_->duration ) != AV_NOPTS_VALUE ) + + // We prefer to get this from the video stream if + // possible. Previously we didn't do this and if the + // audio stream was longer than the video, we would get a + // frame count from the audio but actually fetching a + // frame past the end of the video would fail. + if ( get_video_stream() && get_video_stream()->duration != AV_NOPTS_VALUE ) + frames_ = get_video_stream()->duration; + else if ( uint64_t( context_->duration ) != AV_NOPTS_VALUE ) frames_ = int( ( avformat_input::fps( ) * ( context_->duration - start_time_ ) ) / ( double )AV_TIME_BASE ); else frames_ = 1 << 29; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2009-06-11 15:18:51
|
Revision: 1475 http://openlibraries.svn.sourceforge.net/openlibraries/?rev=1475&view=rev Author: timdewhirst Date: 2009-06-11 15:18:49 +0000 (Thu, 11 Jun 2009) Log Message: ----------- OML * avoid crash on shutdown Modified Paths: -------------- trunk/src/openmedialib/plugins/avformat/avformat_plugin.cpp Modified: trunk/src/openmedialib/plugins/avformat/avformat_plugin.cpp =================================================================== --- trunk/src/openmedialib/plugins/avformat/avformat_plugin.cpp 2009-06-03 09:18:11 UTC (rev 1474) +++ trunk/src/openmedialib/plugins/avformat/avformat_plugin.cpp 2009-06-11 15:18:49 UTC (rev 1475) @@ -1233,9 +1233,9 @@ virtual ~avformat_input( ) { - if ( prop_video_index_.value< int >( ) >= 0 ) + if ( prop_video_index_.value< int >( ) >= 0 && video_indexes_.size( ) > 0 ) close_video_codec( ); - if ( prop_audio_index_.value< int >( ) >= 0 ) + if ( prop_audio_index_.value< int >( ) >= 0 && audio_indexes_.size( ) > 0 ) close_audio_codec( ); if ( context_ ) av_close_input_file( context_ ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2009-06-03 09:18:13
|
Revision: 1474 http://openlibraries.svn.sourceforge.net/openlibraries/?rev=1474&view=rev Author: timdewhirst Date: 2009-06-03 09:18:11 +0000 (Wed, 03 Jun 2009) Log Message: ----------- OPL * ensure correct value is used when allocating memory Modified Paths: -------------- trunk/src/openpluginlib/pl/pool.cpp Modified: trunk/src/openpluginlib/pl/pool.cpp =================================================================== --- trunk/src/openpluginlib/pl/pool.cpp 2009-05-28 11:41:39 UTC (rev 1473) +++ trunk/src/openpluginlib/pl/pool.cpp 2009-06-03 09:18:11 UTC (rev 1474) @@ -114,10 +114,10 @@ if ( self->pools_[ used ].size( ) == 0 ) { - result = new unsigned char[ 1 << index ]; + result = new unsigned char[ 1 << used ]; if ( result != 0 ) { - write_preamble( result, index ); + write_preamble( result, used ); result += preamble_size(); } } @@ -144,12 +144,9 @@ if ( chunk != 0 ) { - // Account for index storage - size += preamble_size(); - int old_index = get_index( chunk - preamble_size() ); int index = 1; - while ( ( 1 << index ) < size ) index ++; + while ( ( 1 << index ) < ( size + preamble_size() ) ) index ++; if ( old_index < index ) { result = pool::malloc( size ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2009-05-28 11:41:48
|
Revision: 1473 http://openlibraries.svn.sourceforge.net/openlibraries/?rev=1473&view=rev Author: timdewhirst Date: 2009-05-28 11:41:39 +0000 (Thu, 28 May 2009) Log Message: ----------- OML * add thread support to avformat plugin * ensure codecs are closed and deleted * change to use log class for debug & warnings * add in some assertions * increase size of audio buffer to support up to 16 channels of 16-bit 48kHz audio Modified Paths: -------------- trunk/src/openmedialib/plugins/avformat/avformat_plugin.cpp Modified: trunk/src/openmedialib/plugins/avformat/avformat_plugin.cpp =================================================================== --- trunk/src/openmedialib/plugins/avformat/avformat_plugin.cpp 2009-05-25 14:05:04 UTC (rev 1472) +++ trunk/src/openmedialib/plugins/avformat/avformat_plugin.cpp 2009-05-28 11:41:39 UTC (rev 1473) @@ -9,6 +9,7 @@ #include <openpluginlib/pl/utf8_utils.hpp> #include <openpluginlib/pl/pcos/isubject.hpp> #include <openpluginlib/pl/pcos/observer.hpp> +#include <openpluginlib/pl/log.hpp> #ifdef WIN32 # include <windows.h> @@ -33,9 +34,8 @@ #include <cmath> #include <cstdio> #include <algorithm> +#include <cassert> -#include <boost/thread/thread.hpp> -#include <boost/thread/condition.hpp> #include <boost/thread/recursive_mutex.hpp> @@ -210,6 +210,7 @@ , prop_comment_( pcos::key::from_string( "comment" ) ) , prop_album_( pcos::key::from_string( "album" ) ) , prop_timestamp_( pcos::key::from_string( "timestamp" ) ) + , prop_thread_count_( pcos::key::from_string( "thread_count" ) ) , log_file_( 0 ) , log_( 0 ) , frame_pos_( 0 ) @@ -218,7 +219,8 @@ properties( ).append( prop_show_stats_ = 100 ); // Define the audio output buffer - audio_outbuf_size_ = 10000; + // enough for 16 channels of 16bit audio at 44Khz/25fps + audio_outbuf_size_ = 0xFA00; audio_outbuf_ = ( uint8_t * )av_malloc( audio_outbuf_size_ ); // Extract rules from the frame @@ -337,6 +339,7 @@ properties( ).append( prop_comment_ = opl::wstring( L"" ) ); properties( ).append( prop_album_ = opl::wstring( L"" ) ); properties( ).append( prop_timestamp_ = 0 ); + properties( ).append( prop_thread_count_ = 1 ); } virtual ~avformat_store( ) @@ -346,9 +349,17 @@ // Write the trailer, if any av_write_trailer( oc_ ); + // free any threads used + if ( video_stream_ && video_stream_->codec->thread_count > 1 ) + avcodec_thread_free( video_stream_->codec ); + // Free the streams for( size_t i = 0; i < oc_->nb_streams; i++ ) + { + avcodec_close( oc_->streams[i]->codec ); + av_free( oc_->streams[i]->codec ); av_freep( &oc_->streams[ i ] ); + } // Close the output file if ( !( fmt_->flags & AVFMT_NOFILE ) ) @@ -388,12 +399,12 @@ // copy in information oc_->timestamp = prop_timestamp_.value< int >(); - copy_wstring_to_c( prop_filename_.value< opl::wstring >(), oc_->filename, 1024 ); - copy_wstring_to_c( prop_title_.value< opl::wstring >(), oc_->title, 512 ); - copy_wstring_to_c( prop_author_.value< opl::wstring >(), oc_->author, 512 ); - copy_wstring_to_c( prop_copyright_.value< opl::wstring >(), oc_->copyright, 512 ); - copy_wstring_to_c( prop_comment_.value< opl::wstring >(), oc_->comment, 512 ); - copy_wstring_to_c( prop_album_.value< opl::wstring >(), oc_->album, 512 ); + copy_wstring_to_c( prop_filename_.value< opl::wstring >(), oc_->filename, sizeof( oc_->filename ) ); + copy_wstring_to_c( prop_title_.value< opl::wstring >(), oc_->title, sizeof( oc_->title ) ); + copy_wstring_to_c( prop_author_.value< opl::wstring >(), oc_->author, sizeof( oc_->author ) ); + copy_wstring_to_c( prop_copyright_.value< opl::wstring >(), oc_->copyright, sizeof( oc_->copyright ) ); + copy_wstring_to_c( prop_comment_.value< opl::wstring >(), oc_->comment, sizeof( oc_->comment ) ); + copy_wstring_to_c( prop_album_.value< opl::wstring >(), oc_->album, sizeof( oc_->album ) ); // Derive the output format fmt_ = alloc_output_format( ); @@ -407,7 +418,7 @@ log_file_ = fopen( opl::to_string( prop_pass_log_.value< opl::wstring >( ) ).c_str( ), "w" ); ret = log_file_ != 0; if ( !ret ) - fprintf( stderr, "Unable to open log file for write %s\n", opl::to_string( prop_pass_log_.value< opl::wstring >( ) ).c_str( ) ); + WARNING_LOG << "Unable to open log file for write: " << opl::to_string( prop_pass_log_.value< opl::wstring >( ) ); } else if ( prop_pass_.value< int >( ) == 2 ) { @@ -427,13 +438,13 @@ } else { - fprintf( stderr, "Unable to allocate log for %s\n", opl::to_string( prop_pass_log_.value< opl::wstring >( ) ).c_str( ) ); + WARNING_LOG << "Unable to allocate log for: " << opl::to_string( prop_pass_log_.value< opl::wstring >( ) ); } fclose( f ); } else { - fprintf( stderr, "Unable to open log file for read %s\n", opl::to_string( prop_pass_log_.value< opl::wstring >( ) ).c_str( ) ); + WARNING_LOG << "Unable to open log file for read: " << opl::to_string( prop_pass_log_.value< opl::wstring >( ) ); } } } @@ -607,13 +618,10 @@ if ( codec != NULL ) codec_id = codec->id; else - std::wcerr << L"obtain_audio_codec_id: failed to find codec for value: " - << prop_acodec_.value< opl::wstring >( ) - << L"\n"; + WARNING_LOG << "obtain_audio_codec_id: failed to find codec for value: " + << opl::to_string( prop_acodec_.value< opl::wstring >( ) ); } -// std::wcerr << L"obtain_audio_codec_id: found: " << codec_id << " for " -// << prop_acodec_.value< opl::wstring >( ) << L"\n"; return codec_id; } @@ -624,119 +632,128 @@ // Create a new stream AVStream *st = av_new_stream( oc_, 0 ); - if ( st != NULL ) + if ( st == NULL ) { - AVCodecContext *c = st->codec; - c->codec_id = codec_id; - c->codec_type = CODEC_TYPE_VIDEO; + WARNING_LOG << "failed to add stream for codec: " << codec_id; + return NULL; + } - // Specify stream parameters - c->bit_rate = prop_video_bit_rate_.value< int >( ); - c->bit_rate_tolerance = prop_video_bit_rate_tolerance_.value< int >( ); - c->width = prop_width_.value< int >( ); - c->height = prop_height_.value< int >( ); - c->time_base.den = prop_fps_num_.value< int >( ); - c->time_base.num = prop_fps_den_.value< int >( ); - c->gop_size = prop_gop_size_.value< int >( ); - opl::string pixfmt = opl::to_string( prop_pix_fmt_.value< opl::wstring >( ) ); - c->pix_fmt = pixfmt != "" ? avcodec_get_pix_fmt( pixfmt.c_str( ) ) : PIX_FMT_YUV420P; - - // Fix b frames - if ( prop_b_frames_.value< int >( ) ) - { - c->max_b_frames = prop_b_frames_.value< int >( ); - c->b_frame_strategy = 0; - c->b_quant_factor = 2.0; - } + AVCodecContext *c = st->codec; + c->codec_id = codec_id; + c->codec_type = CODEC_TYPE_VIDEO; + + // Specify stream parameters + c->bit_rate = prop_video_bit_rate_.value< int >( ); + c->bit_rate_tolerance = prop_video_bit_rate_tolerance_.value< int >( ); + c->width = prop_width_.value< int >( ); + c->height = prop_height_.value< int >( ); + c->time_base.den = prop_fps_num_.value< int >( ); + c->time_base.num = prop_fps_den_.value< int >( ); + c->gop_size = prop_gop_size_.value< int >( ); + opl::string pixfmt = opl::to_string( prop_pix_fmt_.value< opl::wstring >( ) ); + c->pix_fmt = pixfmt != "" ? avcodec_get_pix_fmt( pixfmt.c_str( ) ) : PIX_FMT_YUV420P; + + // Fix b frames + if ( prop_b_frames_.value< int >( ) ) + { + c->max_b_frames = prop_b_frames_.value< int >( ); + c->b_frame_strategy = 0; + c->b_quant_factor = 2.0; + } + + // Specifiy miscellaneous properties + c->mb_decision = prop_mb_decision_.value< int >( ); + c->sample_aspect_ratio = av_d2q( prop_aspect_ratio_.value< double >( ) * c->height / c->width, 255 ); + c->mb_cmp = prop_mb_cmp_.value< int >( ); + c->ildct_cmp = prop_ildct_cmp_.value< int >( ); + c->me_sub_cmp = prop_sub_cmp_.value< int >( ); + c->me_cmp = prop_cmp_.value< int >( ); + c->me_pre_cmp = prop_pre_cmp_.value< int >( ); + c->pre_me = prop_pre_me_.value< int >( ); + c->lumi_masking = prop_lumi_mask_.value< double >( ); + c->dark_masking = prop_dark_mask_.value< double >( ); + c->spatial_cplx_masking = prop_scplx_mask_.value< double >( ); + c->temporal_cplx_masking = prop_tcplx_mask_.value< double >( ); + c->p_masking = prop_p_mask_.value< double >( ); + c->quantizer_noise_shaping= prop_qns_.value< int >( ); + c->qmin = prop_video_qmin_.value< int >( ); + c->qmax = prop_video_qmax_.value< int >( ); + c->lmin = prop_video_lmin_.value< int >( ); + c->lmax = prop_video_lmax_.value< int >( ); + c->mb_qmin = prop_video_mb_qmin_.value< int >( ); + c->mb_qmax = prop_video_mb_qmax_.value< int >( ); + c->max_qdiff = prop_video_qdiff_.value< int >( ); + c->qblur = prop_video_qblur_.value< double >( ); + c->qcompress = prop_video_qcomp_.value< double >( ); + + c->rc_eq = "tex^qComp"; + c->rc_override_count = 0; + + c->timecode_frame_start = prop_timecode_frame_start_.value< int >( ); + + // Handle fixed quality override + if ( prop_qscale_.value< double >( ) > 0.0 ) + { + c->flags |= CODEC_FLAG_QSCALE; + st->quality = float( FF_QP2LAMBDA * prop_qscale_.value< double >( ) ); + } + + // Allow the user to override the video fourcc + opl::string vfourcc = opl::to_string( prop_vfourcc_.value< opl::wstring >( ) ); + if ( vfourcc != "" ) + { + char *tail = NULL; + const char *arg = vfourcc.c_str( ); + int tag = strtol( arg, &tail, 0); + if( !tail || *tail ) + tag = arg[ 0 ] + ( arg[ 1 ] << 8 ) + ( arg[ 2 ] << 16 ) + ( arg[ 3 ] << 24 ); + c->codec_tag = tag; + } + + // Some formats want stream headers to be seperate + if ( oc_->oformat->flags & AVFMT_GLOBALHEADER ) + c->flags |= CODEC_FLAG_GLOBAL_HEADER; + + oc_->preload = int( prop_mux_preload_.value< double >( ) * AV_TIME_BASE ); + oc_->max_delay = int( prop_mux_delay_.value< double >( ) * AV_TIME_BASE ); + oc_->loop_output = AVFMT_NOOUTPUTLOOP; + + oc_->mux_rate = prop_mux_rate_.value< int >( ); + oc_->packet_size = prop_video_packet_size_.value< int >( ); + c->rc_max_rate = prop_video_rc_max_rate_.value< int >( ); + c->rc_min_rate = prop_video_rc_min_rate_.value< int >( ); + c->rc_buffer_size = prop_video_rc_buffer_size_.value< int >( ); + c->rc_buffer_aggressivity = prop_video_rc_buffer_aggressivity_.value< double >( ); + c->rc_initial_cplx= prop_video_rc_initial_cplx_.value< double >( ); + c->i_quant_factor = prop_video_i_qfactor_.value< double >( ); + c->b_quant_factor = prop_video_b_qfactor_.value< double >( ); + c->i_quant_offset = prop_video_i_qoffset_.value< double >( ); + c->b_quant_offset = prop_video_b_qoffset_.value< double >( ); + c->intra_quant_bias = prop_video_intra_quant_bias_.value< int >( ); + c->inter_quant_bias = prop_video_inter_quant_bias_.value< int >( ); + c->dct_algo = prop_dct_algo_.value< int >( ); + c->idct_algo = prop_idct_algo_.value< int >( ); + c->rc_initial_buffer_occupancy = c->rc_buffer_size*3/4; + c->me_threshold = prop_me_threshold_.value< int >( ); + c->mb_threshold = prop_mb_threshold_.value< int >( ); + c->intra_dc_precision = prop_intra_dc_precision_.value< int >( ) - 8; + c->strict_std_compliance = prop_strict_.value< int >( ); + c->error_rate = prop_error_rate_.value< int >( ); + c->noise_reduction = prop_noise_reduction_.value< int >( ); + c->scenechange_threshold = prop_sc_threshold_.value< int >( ); + c->me_range = prop_me_range_.value< int >( ); + c->coder_type = prop_coder_.value< int >( ); + c->context_model = prop_context_.value< int >( ); + c->prediction_method = prop_predictor_.value< int >( ); + c->me_method = prop_me_method_.value< int >( ); - // Specifiy miscellaneous properties - c->mb_decision = prop_mb_decision_.value< int >( ); - c->sample_aspect_ratio = av_d2q( prop_aspect_ratio_.value< double >( ) * c->height / c->width, 255 ); - c->mb_cmp = prop_mb_cmp_.value< int >( ); - c->ildct_cmp = prop_ildct_cmp_.value< int >( ); - c->me_sub_cmp = prop_sub_cmp_.value< int >( ); - c->me_cmp = prop_cmp_.value< int >( ); - c->me_pre_cmp = prop_pre_cmp_.value< int >( ); - c->pre_me = prop_pre_me_.value< int >( ); - c->lumi_masking = prop_lumi_mask_.value< double >( ); - c->dark_masking = prop_dark_mask_.value< double >( ); - c->spatial_cplx_masking = prop_scplx_mask_.value< double >( ); - c->temporal_cplx_masking = prop_tcplx_mask_.value< double >( ); - c->p_masking = prop_p_mask_.value< double >( ); - c->quantizer_noise_shaping= prop_qns_.value< int >( ); - c->qmin = prop_video_qmin_.value< int >( ); - c->qmax = prop_video_qmax_.value< int >( ); - c->lmin = prop_video_lmin_.value< int >( ); - c->lmax = prop_video_lmax_.value< int >( ); - c->mb_qmin = prop_video_mb_qmin_.value< int >( ); - c->mb_qmax = prop_video_mb_qmax_.value< int >( ); - c->max_qdiff = prop_video_qdiff_.value< int >( ); - c->qblur = prop_video_qblur_.value< double >( ); - c->qcompress = prop_video_qcomp_.value< double >( ); + // initialize threads if required + if ( prop_thread_count_.value< int >( ) > 1 ) + { + if ( avcodec_thread_init( c, prop_thread_count_.value< int >( ) ) < 0 ) + WARNING_LOG << "failed to initialize threads; requested:" << prop_thread_count_.value< int >( ); + } - c->rc_eq = "tex^qComp"; - c->rc_override_count = 0; - c->thread_count = 1; - - c->timecode_frame_start = prop_timecode_frame_start_.value< int >( ); - - // Handle fixed quality override - if ( prop_qscale_.value< double >( ) > 0.0 ) - { - c->flags |= CODEC_FLAG_QSCALE; - st->quality = float( FF_QP2LAMBDA * prop_qscale_.value< double >( ) ); - } - - // Allow the user to override the video fourcc - opl::string vfourcc = opl::to_string( prop_vfourcc_.value< opl::wstring >( ) ); - if ( vfourcc != "" ) - { - char *tail = NULL; - const char *arg = vfourcc.c_str( ); - int tag = strtol( arg, &tail, 0); - if( !tail || *tail ) - tag = arg[ 0 ] + ( arg[ 1 ] << 8 ) + ( arg[ 2 ] << 16 ) + ( arg[ 3 ] << 24 ); - c->codec_tag = tag; - } - - // Some formats want stream headers to be seperate - if ( oc_->oformat->flags & AVFMT_GLOBALHEADER ) - c->flags |= CODEC_FLAG_GLOBAL_HEADER; - - oc_->preload = int( prop_mux_preload_.value< double >( ) * AV_TIME_BASE ); - oc_->max_delay = int( prop_mux_delay_.value< double >( ) * AV_TIME_BASE ); - oc_->loop_output = AVFMT_NOOUTPUTLOOP; - - oc_->mux_rate = prop_mux_rate_.value< int >( ); - oc_->packet_size = prop_video_packet_size_.value< int >( ); - c->rc_max_rate = prop_video_rc_max_rate_.value< int >( ); - c->rc_min_rate = prop_video_rc_min_rate_.value< int >( ); - c->rc_buffer_size = prop_video_rc_buffer_size_.value< int >( ); - c->rc_buffer_aggressivity = prop_video_rc_buffer_aggressivity_.value< double >( ); - c->rc_initial_cplx= prop_video_rc_initial_cplx_.value< double >( ); - c->i_quant_factor = prop_video_i_qfactor_.value< double >( ); - c->b_quant_factor = prop_video_b_qfactor_.value< double >( ); - c->i_quant_offset = prop_video_i_qoffset_.value< double >( ); - c->b_quant_offset = prop_video_b_qoffset_.value< double >( ); - c->intra_quant_bias = prop_video_intra_quant_bias_.value< int >( ); - c->inter_quant_bias = prop_video_inter_quant_bias_.value< int >( ); - c->dct_algo = prop_dct_algo_.value< int >( ); - c->idct_algo = prop_idct_algo_.value< int >( ); - c->rc_initial_buffer_occupancy = c->rc_buffer_size*3/4; - c->me_threshold = prop_me_threshold_.value< int >( ); - c->mb_threshold = prop_mb_threshold_.value< int >( ); - c->intra_dc_precision = prop_intra_dc_precision_.value< int >( ) - 8; - c->strict_std_compliance = prop_strict_.value< int >( ); - c->error_rate = prop_error_rate_.value< int >( ); - c->noise_reduction = prop_noise_reduction_.value< int >( ); - c->scenechange_threshold = prop_sc_threshold_.value< int >( ); - c->me_range = prop_me_range_.value< int >( ); - c->coder_type = prop_coder_.value< int >( ); - c->context_model = prop_context_.value< int >( ); - c->prediction_method = prop_predictor_.value< int >( ); - c->me_method = prop_me_method_.value< int >( ); - } - return st; } @@ -1152,6 +1169,7 @@ pcos::property /* wstring */ prop_comment_; pcos::property /* wstring */ prop_album_; pcos::property /* int */ prop_timestamp_; + pcos::property /* int */ prop_thread_count_; FILE *log_file_; char *log_; @@ -1249,6 +1267,7 @@ for( size_t i = 0; i < context_->nb_streams; i++ ) { // Get the codec context + assert( context_ && context_->streams[i] ); AVCodecContext *codec_context = context_->streams[ i ]->codec; // Ignore streams that we don't have a decoder for @@ -1272,6 +1291,7 @@ // Configure video input properties if ( video_indexes_.size( ) > 0 ) { + assert( context_ && context_->streams[0] ); AVStream *stream = get_video_stream( ) ? get_video_stream( ) : context_->streams[ 0 ]; width_ = stream->codec->width; @@ -1391,6 +1411,7 @@ // Returns the current video stream inline AVStream *get_video_stream( ) { + assert( context_ && context_->streams[ video_indexes_[ prop_video_index_.value< int >( ) ] ] ); if ( prop_video_index_.value< int >( ) >= 0 && video_indexes_.size( ) > 0 ) return context_->streams[ video_indexes_[ prop_video_index_.value< int >( ) ] ]; else @@ -1400,6 +1421,7 @@ // Returns the current audio stream inline AVStream *get_audio_stream( ) { + assert( context_ && context_->streams[ audio_indexes_[ prop_audio_index_.value< int >( ) ] ] ); if ( prop_audio_index_.value< int >( ) >= 0 && audio_indexes_.size( ) > 0 ) return context_->streams[ audio_indexes_[ prop_audio_index_.value< int >( ) ] ]; else @@ -2175,11 +2197,10 @@ { if ( debug_level( ) ) { - fprintf( stderr, "ante %d: ", current_pos ); + DEBUG_LOG << "ante: " << current_pos; std::map< int, frame_type_ptr >::iterator iter = cache_.begin( ); while( iter != cache_.end( ) ) - fprintf( stderr, "%d ", ( iter ++ )->first ); - fprintf( stderr, "\n" ); + DEBUG_LOG << " current: " << ( iter ++ )->first; } int index = current_pos - 1; @@ -2215,11 +2236,10 @@ if ( debug_level( ) ) { - fprintf( stderr, "post %d: ", current_pos ); + DEBUG_LOG << "post: " << current_pos; std::map< int, frame_type_ptr >::iterator iter = cache_.begin( ); while( iter != cache_.end( ) ) - fprintf( stderr, "%d ", ( iter ++ )->first ); - fprintf( stderr, "\n" ); + DEBUG_LOG << " current: " << ( iter ++ )->first; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2009-05-25 14:05:20
|
Revision: 1472 http://openlibraries.svn.sourceforge.net/openlibraries/?rev=1472&view=rev Author: timdewhirst Date: 2009-05-25 14:05:04 +0000 (Mon, 25 May 2009) Log Message: ----------- OPL * clarify pool logic * add extra information to memory pre-amble to help catch freeing of non-pool memory * add dump of pool Modified Paths: -------------- trunk/src/openpluginlib/pl/pool.cpp trunk/src/openpluginlib/pl/pool.hpp Modified: trunk/src/openpluginlib/pl/pool.cpp =================================================================== --- trunk/src/openpluginlib/pl/pool.cpp 2009-05-12 09:42:33 UTC (rev 1471) +++ trunk/src/openpluginlib/pl/pool.cpp 2009-05-25 14:05:04 UTC (rev 1472) @@ -1,3 +1,4 @@ +/* -*- mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*- */ // pool - A pooled memory allocator // Copyright (C) 2005-2007 Editopia Inc. @@ -5,9 +6,12 @@ // For more information, see http://www.openlibraries.org. #include "pool.hpp" +#include "log.hpp" // std #include <cstring> +#include <cassert> +#include <sstream> using namespace std; using namespace olib::openpluginlib; @@ -15,6 +19,8 @@ // Declaration of mutex OPENPLUGINLIB_DECLSPEC boost::mutex pool::mutex_; +const unsigned int POOL_COUNT = 31; + // Constructor creates 31 pools sized at 2^i pool::pool( ) { @@ -23,7 +29,7 @@ // Destroys pools pool::~pool( ) { - for( int i = 0; i < 31; i ++ ) + for( int i = 0; i < POOL_COUNT; i ++ ) { typedef std::vector< unsigned char * >::iterator iterator; for( iterator I = pools_[ i ].begin( ); I != pools_[ i ].end( ); ++I ) @@ -45,41 +51,81 @@ } // Singleton destructor + +static const char PREAMBLE_TEXT[] = { 'p', 'o', 'o', 'l' }; + +template < typename T > +int array_size( T& a ) { return sizeof( a )/sizeof( a[0] ); } + void pool::destroy( ) { delete get_instance( ); } +int preamble_size() +{ + return array_size( PREAMBLE_TEXT ) + sizeof( int ); +} + +void write_preamble( unsigned char* p, int index ) +{ + int s = array_size( PREAMBLE_TEXT ); + ::memcpy( p, PREAMBLE_TEXT, s ); + *(int*)(p+s) = index; +} + +bool is_valid_preamble( unsigned char* p ) +{ + int s = array_size( PREAMBLE_TEXT ); + return (::memcmp( p, PREAMBLE_TEXT, s ) == 0) && ( *(int*)(p+s) < POOL_COUNT ) ; +} + +int get_index( unsigned char* p ) +{ + if ( !is_valid_preamble( p ) ) + { + WARNING_LOG << "invalid preamble found"; + return -1; + } + + return *(int *)(p+array_size( PREAMBLE_TEXT )); +} + // Allocate memory >= size unsigned char *pool::malloc( int size ) { #ifdef HAVE_POOL - unsigned char *result = 0; + unsigned char *result = NULL; if ( size > 0 ) { // Account for index storage - size += sizeof(int); + size += preamble_size(); pool *self = get_instance( ); int index = 1; while ( ( 1 << index ) < size ) index ++; + boost::mutex::scoped_lock scoped_lock( mutex_ ); + int used = index; - while ( used < 31 && self->pools_[ index ].size( ) == 0 ) used ++; - if ( used == 31 ) used = index; + while ( used < POOL_COUNT && self->pools_[ used ].size( ) == 0 ) used ++; + if ( used == POOL_COUNT ) used = index; + if ( self->pools_[ used ].size( ) == 0 ) { result = new unsigned char[ 1 << index ]; if ( result != 0 ) { - *( int * )( result ) = index; - result += sizeof( int ); + write_preamble( result, index ); + result += preamble_size(); } } else { - result = *( self->pools_[ used ].end( ) - 1 ) + sizeof( int ); + result = *( self->pools_[ used ].end( ) - 1 ); + write_preamble( result, used ); + result += preamble_size(); self->pools_[ used ].pop_back( ); } } @@ -99,9 +145,9 @@ if ( chunk != 0 ) { // Account for index storage - size += sizeof(int); + size += preamble_size(); - int old_index = *( int * )( chunk - sizeof( int ) ); + int old_index = get_index( chunk - preamble_size() ); int index = 1; while ( ( 1 << index ) < size ) index ++; if ( old_index < index ) @@ -129,12 +175,33 @@ if ( chunk != 0 ) { pool *self = get_instance( ); - int index = *( int * )( chunk - sizeof( int ) ); + + chunk -= preamble_size(); + if ( !is_valid_preamble( chunk ) ) + { + WARNING_LOG << "possibly trying to recycle memory that wasn't allocated by pool"; + abort(); + return; + } + + int index = get_index( chunk ); boost::mutex::scoped_lock scoped_lock( mutex_ ); - self->pools_[ index ].push_back( chunk - sizeof( int ) ); + self->pools_[ index ].push_back( chunk ); } #else std::free( chunk ); #endif } +void pool::dump_state() +{ +#ifdef HAVE_POOL + std::stringstream ss; + + ss << "\npool counts:\n"; + for ( unsigned int i=0; i<POOL_COUNT; ++i ) + ss << " [" << i << "]: " << get_instance()->pools_[i].size() << "\n"; + + DEBUG_LOG << ss.str(); +#endif +} Modified: trunk/src/openpluginlib/pl/pool.hpp =================================================================== --- trunk/src/openpluginlib/pl/pool.hpp 2009-05-12 09:42:33 UTC (rev 1471) +++ trunk/src/openpluginlib/pl/pool.hpp 2009-05-25 14:05:04 UTC (rev 1472) @@ -1,3 +1,4 @@ +/* -*- mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*- */ // pool - A pooled memory allocator // Copyright (C) 2005-2007 Editopia Inc. @@ -21,28 +22,31 @@ class OPENPLUGINLIB_DECLSPEC pool { - private: - // Private constructor and destructor - pool( ); - ~pool( ); +private: + // Private constructor and destructor + pool( ); + ~pool( ); + + // Singleton accessor and destructor + static pool *get_instance( ); + static void destroy( ); + + // The boost pools + std::vector< unsigned char * > pools_[ 32 ]; + static boost::mutex mutex_; + +public: + // Provide a chunk >= size + static unsigned char *malloc( int size ); + + // Reallocate a chunk to a new size + static unsigned char *realloc( unsigned char *chunk, int size ); + + // Return a chunk to the pool + static void free( unsigned char *chunk ); - // Singleton accessor and destructor - static pool *get_instance( ); - static void destroy( ); - - // The boost pools - std::vector< unsigned char * > pools_[ 32 ]; - static boost::mutex mutex_; - - public: - // Provide a chunk >= size - static unsigned char *malloc( int size ); - - // Reallocate a chunk to a new size - static unsigned char *realloc( unsigned char *chunk, int size ); - - // Return a chunk to the pool - static void free( unsigned char *chunk ); + // dump some information about the pool + static void dump_state(); }; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2009-05-12 09:42:42
|
Revision: 1471 http://openlibraries.svn.sourceforge.net/openlibraries/?rev=1471&view=rev Author: timdewhirst Date: 2009-05-12 09:42:33 +0000 (Tue, 12 May 2009) Log Message: ----------- OML * missed cast to long; no longer required. Modified Paths: -------------- trunk/src/openmedialib/plugins/avformat/avformat_plugin.cpp Modified: trunk/src/openmedialib/plugins/avformat/avformat_plugin.cpp =================================================================== --- trunk/src/openmedialib/plugins/avformat/avformat_plugin.cpp 2009-05-08 16:47:47 UTC (rev 1470) +++ trunk/src/openmedialib/plugins/avformat/avformat_plugin.cpp 2009-05-12 09:42:33 UTC (rev 1471) @@ -2519,7 +2519,7 @@ { priv_stream_handler *priv = static_cast< priv_stream_handler * >( h->priv_data ); if ( priv && priv->ptr ) - return priv->ptr->seek( long( pos ), whence ); + return priv->ptr->seek( pos, whence ); return int64_t( -1 ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2009-05-08 16:48:01
|
Revision: 1470 http://openlibraries.svn.sourceforge.net/openlibraries/?rev=1470&view=rev Author: timdewhirst Date: 2009-05-08 16:47:47 +0000 (Fri, 08 May 2009) Log Message: ----------- OML * build fix for windows Modified Paths: -------------- trunk/src/openmedialib/ml/utilities.hpp Modified: trunk/src/openmedialib/ml/utilities.hpp =================================================================== --- trunk/src/openmedialib/ml/utilities.hpp 2009-05-08 15:07:27 UTC (rev 1469) +++ trunk/src/openmedialib/ml/utilities.hpp 2009-05-08 16:47:47 UTC (rev 1470) @@ -8,6 +8,13 @@ #ifndef OPENMEDIALIB_UTILITIES_INC_ #define OPENMEDIALIB_UTILITIES_INC_ +#ifdef _MSC_VER +// we should be able to use inttypes on windows too, but if we do it stops +// the SDL plugin from building, because that has a definition of int8_t +// which clashes with the one in msinttypes. +typedef __int64 int64_t; +#endif + #include <deque> #include <openimagelib/il/utility.hpp> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2009-05-08 15:07:35
|
Revision: 1469 http://openlibraries.svn.sourceforge.net/openlibraries/?rev=1469&view=rev Author: timdewhirst Date: 2009-05-08 15:07:27 +0000 (Fri, 08 May 2009) Log Message: ----------- OML * add support for large file stream handling Modified Paths: -------------- trunk/src/openmedialib/ml/utilities.hpp trunk/src/openmedialib/py/ml.cpp Modified: trunk/src/openmedialib/ml/utilities.hpp =================================================================== --- trunk/src/openmedialib/ml/utilities.hpp 2009-04-19 19:20:20 UTC (rev 1468) +++ trunk/src/openmedialib/ml/utilities.hpp 2009-05-08 15:07:27 UTC (rev 1469) @@ -70,7 +70,7 @@ virtual bool open( const openpluginlib::wstring, int ) { return false; } virtual openpluginlib::string read( int ) { return openpluginlib::string( "" ); } virtual int write( const openpluginlib::string & ) { return -1; } - virtual long seek( long, int ) { return long( -1 ); } + virtual int64_t seek( int64_t, int ) { return -1; } virtual int close( ) { return 0; } virtual bool is_stream( ) { return true; } virtual bool is_thread_safe( ) { return false; } Modified: trunk/src/openmedialib/py/ml.cpp =================================================================== --- trunk/src/openmedialib/py/ml.cpp 2009-04-19 19:20:20 UTC (rev 1468) +++ trunk/src/openmedialib/py/ml.cpp 2009-05-08 15:07:27 UTC (rev 1469) @@ -287,12 +287,12 @@ return result; } - virtual long seek( long position, int whence ) + virtual int64_t seek( int64_t position, int whence ) { - long result = -1; + int64_t result = -1; py::override method = get_override( "seek" ); if ( method ) - result = py::call<long>( method.ptr( ), position, whence ); + result = py::call<int64_t>( method.ptr( ), position, whence ); return result; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2009-04-19 19:20:23
|
Revision: 1468 http://openlibraries.svn.sourceforge.net/openlibraries/?rev=1468&view=rev Author: timdewhirst Date: 2009-04-19 19:20:20 +0000 (Sun, 19 Apr 2009) Log Message: ----------- OIL * add direct conversions from yuv422 and yuv411 to yuv444 Modified Paths: -------------- trunk/src/openimagelib/il/utility.cpp Modified: trunk/src/openimagelib/il/utility.cpp =================================================================== --- trunk/src/openimagelib/il/utility.cpp 2009-04-18 18:28:35 UTC (rev 1467) +++ trunk/src/openimagelib/il/utility.cpp 2009-04-19 19:20:20 UTC (rev 1468) @@ -700,6 +700,76 @@ return dst_img; } +static image_type_ptr yuv422_to_yuv444( const image_type_ptr &src_img ) +{ + if ( !src_img ) + return image_type_ptr(); + + image_type_ptr dst_img = allocate( src_img, L"yuv444" ); + + const size_type height = src_img->height(); + const size_type width = src_img->width(); + + for ( size_type h=0; h<height; ++h ) + { + const_pointer in = src_img->data( ) + ( h * src_img->pitch( ) ); + pointer out = dst_img->data( ) + ( h * dst_img->pitch( ) ); + + for ( size_type w=0; w<width; w+=2 ) + { + // input pixel order should be Y1 U Y2 V + *out++ = in[w + 0]; + *out++ = in[w + 1]; + *out++ = in[w + 3]; + + *out++ = in[w + 2]; + *out++ = in[w + 1]; + *out++ = in[w + 3]; + } + } + + return dst_img; +} + +static image_type_ptr yuv411_to_yuv444( const image_type_ptr &src_img ) +{ + if ( !src_img ) + return image_type_ptr(); + + image_type_ptr dst_img = allocate( src_img, L"yuv444" ); + + const size_type height = src_img->height(); + const size_type width = src_img->width(); + + for ( size_type h=0; h<height; ++h ) + { + const_pointer in = src_img->data( ) + ( h * src_img->pitch( ) ); + pointer out = dst_img->data( ) + ( h * dst_img->pitch( ) ); + + for ( size_type w=0; w<width; w+=4 ) + { + // input pixel order should be Y1 Y2 U Y3 Y4 V + *out++ = in[w + 0]; + *out++ = in[w + 2]; + *out++ = in[w + 5]; + + *out++ = in[w + 1]; + *out++ = in[w + 2]; + *out++ = in[w + 5]; + + *out++ = in[w + 3]; + *out++ = in[w + 2]; + *out++ = in[w + 5]; + + *out++ = in[w + 4]; + *out++ = in[w + 2]; + *out++ = in[w + 5]; + } + } + + return dst_img; +} + static image_type_ptr yuv422_to_rgb( const image_type_ptr &src_img, const opl::wstring &format, int r, int g, int b, int a ) { size_type width = src_img->width( ); @@ -2076,6 +2146,8 @@ return yuv422_to_rgb( src, dst_pf, 0, 1, 2, 3 ); else if ( dst_pf == L"b8g8r8a8" ) return yuv422_to_rgb( src, dst_pf, 2, 1, 0, 3 ); + else if ( dst_pf == L"yuv444" ) + return yuv422_to_yuv444( src ); } else if ( src_pf == L"yuv411" ) { @@ -2087,6 +2159,8 @@ return yuv411_to_rgb( src, dst_pf, 0, 1, 2, 3 ); else if ( dst_pf == L"b8g8r8a8" ) return yuv411_to_rgb( src, dst_pf, 2, 1, 0, 3 ); + else if ( dst_pf == L"yuv444" ) + return yuv411_to_yuv444( src ); } else if( src_pf == L"l8a8" ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2009-04-18 18:28:38
|
Revision: 1467 http://openlibraries.svn.sourceforge.net/openlibraries/?rev=1467&view=rev Author: timdewhirst Date: 2009-04-18 18:28:35 +0000 (Sat, 18 Apr 2009) Log Message: ----------- OML * add debug in audio mixing code Modified Paths: -------------- trunk/src/openmedialib/ml/utilities.cpp Modified: trunk/src/openmedialib/ml/utilities.cpp =================================================================== --- trunk/src/openmedialib/ml/utilities.cpp 2009-04-08 11:32:47 UTC (rev 1466) +++ trunk/src/openmedialib/ml/utilities.cpp 2009-04-18 18:28:35 UTC (rev 1467) @@ -879,11 +879,19 @@ for(int ch = 0; ch < channels_out; ++ch) { + sum[ch] /= channels_in; + // clip channels appropriately if(sum[ch] < min_short) + { + WARNING_LOG << "signal too low"; clipped[ch] = min_short; + } else if(sum[ch] > max_short) + { + WARNING_LOG << "signal too high"; clipped[ch] = max_short; + } else clipped[ch] = sum[ch]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2009-04-08 11:32:54
|
Revision: 1466 http://openlibraries.svn.sourceforge.net/openlibraries/?rev=1466&view=rev Author: timdewhirst Date: 2009-04-08 11:32:47 +0000 (Wed, 08 Apr 2009) Log Message: ----------- OML * add 16 & 8 channel audio conversion Modified Paths: -------------- trunk/src/openmedialib/ml/utilities.cpp Modified: trunk/src/openmedialib/ml/utilities.cpp =================================================================== --- trunk/src/openmedialib/ml/utilities.cpp 2009-04-02 09:42:39 UTC (rev 1465) +++ trunk/src/openmedialib/ml/utilities.cpp 2009-04-08 11:32:47 UTC (rev 1466) @@ -1,4 +1,4 @@ - +/* -*- mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*- */ // ml - A media library representation. // Copyright (C) 2005-2006 Editopia Inc. @@ -17,6 +17,7 @@ #include <openmedialib/ml/openmedialib_plugin.hpp> #include <openpluginlib/pl/openpluginlib.hpp> #include <openpluginlib/pl/utf8_utils.hpp> +#include <openpluginlib/pl/log.hpp> #include <deque> namespace pl = olib::openpluginlib; @@ -31,7 +32,7 @@ // Define min and max values for shorts // Note: Syntax used to avoid clash with min & max macro definitions - // see http://www.boost.org/more/lib_guide.htm + // see http://www.boost.org/more/lib_guide.htm const short min_short = (std::numeric_limits<short>::min)(); const short max_short = (std::numeric_limits<short>::max)(); @@ -59,8 +60,8 @@ int calculate_cycle_size(double frames_per_second, int samplefreq, double samples_per_frame, int &deficit) { - int cycle_size = int(floor(frames_per_second + 0.5)); - double extra_samples = (int(floor(samples_per_frame + 0.5)) * int(floor(frames_per_second + 0.5))) - (samplefreq * int(floor(frames_per_second + 0.5)) / frames_per_second); + int cycle_size = int(floor(frames_per_second + 0.5)); + double extra_samples = (int(floor(samples_per_frame + 0.5)) * int(floor(frames_per_second + 0.5))) - (samplefreq * int(floor(frames_per_second + 0.5)) / frames_per_second); while(int(extra_samples*1000) % 1000 != 0 && cycle_size <= 3000) { @@ -196,6 +197,8 @@ case 3: case 4: case 6: + case 8: + case 16: return true; } break; @@ -207,19 +210,35 @@ case 4: case 5: case 6: + case 8: + case 16: return true; } break; case 4: switch(channels_in) { - //case 1: + case 1: case 2: - //case 3: + case 3: case 6: + case 8: + case 16: return true; } break; + case 8: + switch(channels_in) + { + case 1: + case 2: + case 3: + case 4: + case 6: + case 16: + return true; + } + break; } return false; @@ -234,7 +253,7 @@ { case 2: { - const unsigned char CHANNEL_IDX_LEFT = 0; + const unsigned char CHANNEL_IDX_LEFT = 0; const unsigned char CHANNEL_IDX_RIGHT = 1; sum[0] = ( float( input[ CHANNEL_IDX_LEFT ] ) + float( input[ CHANNEL_IDX_RIGHT ] ) ); @@ -242,18 +261,18 @@ break; case 3: { - const unsigned char CHANNEL_IDX_LEFT = 0; + const unsigned char CHANNEL_IDX_LEFT = 0; const unsigned char CHANNEL_IDX_CENTRE = 1; const unsigned char CHANNEL_IDX_RIGHT = 2; - sum[0] = ( float(input[ CHANNEL_IDX_LEFT ]) - + float(input[ CHANNEL_IDX_RIGHT ]) ) - + float(input[ CHANNEL_IDX_CENTRE ]); + sum[0] = ( float(input[ CHANNEL_IDX_LEFT ]) + + float(input[ CHANNEL_IDX_RIGHT ]) ) + + float(input[ CHANNEL_IDX_CENTRE ]); } break; case 4: { - const unsigned char CHANNEL_IDX_LEFT = 0; + const unsigned char CHANNEL_IDX_LEFT = 0; const unsigned char CHANNEL_IDX_RIGHT = 1; const unsigned char CHANNEL_IDX_LEFT_SURROUND = 2; const unsigned char CHANNEL_IDX_RIGHT_SURROUND = 3; @@ -266,7 +285,7 @@ break; case 6: { - const unsigned char CHANNEL_IDX_LEFT = 0; + const unsigned char CHANNEL_IDX_LEFT = 0; const unsigned char CHANNEL_IDX_CENTRE = 1; const unsigned char CHANNEL_IDX_RIGHT = 2; const unsigned char CHANNEL_IDX_LEFT_SURROUND = 3; @@ -281,6 +300,34 @@ + float(input[ CHANNEL_IDX_LOW_FREQ_EFFECTS ]); } break; + case 8: + { + const unsigned char CHANNEL_IDX_LEFT = 0; + const unsigned char CHANNEL_IDX_RIGHT = 1; + const unsigned char CHANNEL_IDX_CENTER = 2; + const unsigned char CHANNEL_IDX_LOW_FREQ_EFFECTS = 3; + const unsigned char CHANNEL_IDX_LEFT_BACK = 4; + const unsigned char CHANNEL_IDX_RIGHT_BACK = 5; + const unsigned char CHANNEL_IDX_LEFT_SIDE = 6; + const unsigned char CHANNEL_IDX_RIGHT_SIDE = 7; + + sum[0] = ( float(input[ CHANNEL_IDX_LEFT ] ) + + float(input[ CHANNEL_IDX_RIGHT ] ) + + float(input[ CHANNEL_IDX_CENTER ] ) + + float(input[ CHANNEL_IDX_LOW_FREQ_EFFECTS ] ) + + float(input[ CHANNEL_IDX_LEFT_BACK ] ) + + float(input[ CHANNEL_IDX_RIGHT_BACK ] ) + + float(input[ CHANNEL_IDX_LEFT_SIDE ] ) + + float(input[ CHANNEL_IDX_RIGHT_SIDE ] ) ); + } + break; + case 16: + { + sum[0] = 0; + for ( unsigned int i=0; i<16; ++i ) + sum[0] += float(input[ i ]); + } + break; } break; case 2: @@ -292,7 +339,7 @@ break; case 3: { - const unsigned char CHANNEL_IDX_LEFT = 0; + const unsigned char CHANNEL_IDX_LEFT = 0; const unsigned char CHANNEL_IDX_CENTRE = 1; const unsigned char CHANNEL_IDX_RIGHT = 2; @@ -305,38 +352,38 @@ break; case 4: { - const unsigned char CHANNEL_IDX_LEFT = 0; + const unsigned char CHANNEL_IDX_LEFT = 0; const unsigned char CHANNEL_IDX_RIGHT = 1; const unsigned char CHANNEL_IDX_LEFT_SURROUND = 2; const unsigned char CHANNEL_IDX_RIGHT_SURROUND = 3; sum[0] = float(input[ CHANNEL_IDX_LEFT ]) - + float(input[ CHANNEL_IDX_LEFT_SURROUND ]); + + float(input[ CHANNEL_IDX_LEFT_SURROUND ]); sum[1] = float(input[ CHANNEL_IDX_RIGHT ]) - + float(input[ CHANNEL_IDX_RIGHT_SURROUND ]); + + float(input[ CHANNEL_IDX_RIGHT_SURROUND ]); } break; case 5: { - const unsigned char CHANNEL_IDX_LEFT = 0; - const unsigned char CHANNEL_IDX_CENTRE = 1; + const unsigned char CHANNEL_IDX_LEFT = 0; + const unsigned char CHANNEL_IDX_CENTRE = 1; const unsigned char CHANNEL_IDX_RIGHT = 2; const unsigned char CHANNEL_IDX_LEFT_SURROUND = 3; const unsigned char CHANNEL_IDX_RIGHT_SURROUND = 4; sum[0] = float(input[ CHANNEL_IDX_LEFT ]) - + float(input[ CHANNEL_IDX_LEFT_SURROUND ]) + + float(input[ CHANNEL_IDX_LEFT_SURROUND ]) + float(input[ CHANNEL_IDX_CENTRE ]); sum[1] = float(input[ CHANNEL_IDX_RIGHT ]) - + float(input[ CHANNEL_IDX_RIGHT_SURROUND ]) + + float(input[ CHANNEL_IDX_RIGHT_SURROUND ]) + float(input[ CHANNEL_IDX_CENTRE ]); } break; case 6: { - const unsigned char CHANNEL_IDX_LEFT = 0; + const unsigned char CHANNEL_IDX_LEFT = 0; const unsigned char CHANNEL_IDX_CENTRE = 1; const unsigned char CHANNEL_IDX_RIGHT = 2; const unsigned char CHANNEL_IDX_LEFT_SURROUND = 3; @@ -344,16 +391,51 @@ const unsigned char CHANNEL_IDX_LOW_FREQ_EFFECTS = 5; sum[0] = float(input[ CHANNEL_IDX_LEFT ]) - + float(input[ CHANNEL_IDX_LEFT_SURROUND ]) + + float(input[ CHANNEL_IDX_LEFT_SURROUND ]) + float(input[ CHANNEL_IDX_CENTRE ]) + float(input[ CHANNEL_IDX_LOW_FREQ_EFFECTS ]); sum[1] = float(input[ CHANNEL_IDX_RIGHT ]) - + float(input[ CHANNEL_IDX_RIGHT_SURROUND ]) + + float(input[ CHANNEL_IDX_RIGHT_SURROUND ]) + float(input[ CHANNEL_IDX_CENTRE ]) + float(input[ CHANNEL_IDX_LOW_FREQ_EFFECTS ]); } break; + case 8: + { + const unsigned char CHANNEL_IDX_LEFT = 0; + const unsigned char CHANNEL_IDX_RIGHT = 1; + const unsigned char CHANNEL_IDX_CENTER = 2; + const unsigned char CHANNEL_IDX_LOW_FREQ_EFFECTS = 3; + const unsigned char CHANNEL_IDX_LEFT_BACK = 4; + const unsigned char CHANNEL_IDX_RIGHT_BACK = 5; + const unsigned char CHANNEL_IDX_LEFT_SIDE = 6; + const unsigned char CHANNEL_IDX_RIGHT_SIDE = 7; + + sum[0] = ( float(input[ CHANNEL_IDX_LEFT ] ) + + float(input[ CHANNEL_IDX_CENTER ] ) + + float(input[ CHANNEL_IDX_LOW_FREQ_EFFECTS ] ) + + float(input[ CHANNEL_IDX_LEFT_BACK ] ) + + float(input[ CHANNEL_IDX_LEFT_SIDE ] ) ); + sum[1] = ( float(input[ CHANNEL_IDX_RIGHT ] ) + + float(input[ CHANNEL_IDX_CENTER ] ) + + float(input[ CHANNEL_IDX_LOW_FREQ_EFFECTS ] ) + + float(input[ CHANNEL_IDX_RIGHT_BACK ] ) + + float(input[ CHANNEL_IDX_RIGHT_SIDE ] ) ); + } + break; + case 16: + { + sum[0] = 0; + sum[1] = 0; + for ( unsigned int i=0; i<16; i+=2 ) + { + sum[0] += float(input[ i ]); + sum[1] += float(input[ i+1 ]); + } + } + break; + } break; case 4: @@ -367,7 +449,7 @@ break; case 2: { - const unsigned char CHANNEL_IDX_LEFT = 0; + const unsigned char CHANNEL_IDX_LEFT = 0; const unsigned char CHANNEL_IDX_RIGHT = 1; sum[0] = float(input[ CHANNEL_IDX_LEFT ]); @@ -378,7 +460,7 @@ break; case 3: { - const unsigned char CHANNEL_IDX_LEFT = 0; + const unsigned char CHANNEL_IDX_LEFT = 0; const unsigned char CHANNEL_IDX_CENTRE = 1; const unsigned char CHANNEL_IDX_RIGHT = 2; @@ -393,7 +475,7 @@ break; case 6: { - const unsigned char CHANNEL_IDX_LEFT = 0; + const unsigned char CHANNEL_IDX_LEFT = 0; const unsigned char CHANNEL_IDX_CENTRE = 1; const unsigned char CHANNEL_IDX_RIGHT = 2; const unsigned char CHANNEL_IDX_LEFT_SURROUND = 3; @@ -401,11 +483,11 @@ const unsigned char CHANNEL_IDX_LOW_FREQ_EFFECTS = 5; sum[0] = float(input[ CHANNEL_IDX_LEFT ]) - + float(input[ CHANNEL_IDX_CENTRE ]) + + float(input[ CHANNEL_IDX_CENTRE ]) + float(input[ CHANNEL_IDX_LOW_FREQ_EFFECTS ]); sum[1] = float(input[ CHANNEL_IDX_RIGHT ]) - + float(input[ CHANNEL_IDX_CENTRE ]) + + float(input[ CHANNEL_IDX_CENTRE ]) + float(input[ CHANNEL_IDX_LOW_FREQ_EFFECTS ]); sum[2] = float(input[ CHANNEL_IDX_LEFT_SURROUND ]); @@ -413,6 +495,45 @@ } break; + case 8: + { + const unsigned char CHANNEL_IDX_LEFT = 0; + const unsigned char CHANNEL_IDX_RIGHT = 1; + const unsigned char CHANNEL_IDX_CENTER = 2; + const unsigned char CHANNEL_IDX_LOW_FREQ_EFFECTS = 3; + const unsigned char CHANNEL_IDX_LEFT_BACK = 4; + const unsigned char CHANNEL_IDX_RIGHT_BACK = 5; + const unsigned char CHANNEL_IDX_LEFT_SIDE = 6; + const unsigned char CHANNEL_IDX_RIGHT_SIDE = 7; + + sum[0] = ( float(input[ CHANNEL_IDX_LEFT ] ) + + float(input[ CHANNEL_IDX_CENTER ] ) + + float(input[ CHANNEL_IDX_LOW_FREQ_EFFECTS ] ) ); + sum[1] = ( float(input[ CHANNEL_IDX_RIGHT ] ) + + float(input[ CHANNEL_IDX_CENTER ] ) + + float(input[ CHANNEL_IDX_LOW_FREQ_EFFECTS ] ) ); + sum[2] = ( float(input[ CHANNEL_IDX_LEFT_BACK ] ) + + float(input[ CHANNEL_IDX_LEFT_SIDE ] ) ); + sum[3] = ( float(input[ CHANNEL_IDX_RIGHT_BACK ] ) + + float(input[ CHANNEL_IDX_RIGHT_SIDE ] ) ); + } + break; + case 16: + { + sum[0] = 0; + sum[1] = 0; + sum[2] = 0; + sum[3] = 0; + for ( unsigned int i=0; i<16; i+=4 ) + { + sum[0] += float(input[ i ]); + sum[1] += float(input[ i+1 ]); + sum[2] += float(input[ i+2 ]); + sum[3] += float(input[ i+3 ]); + } + } + break; + } break; } @@ -459,7 +580,7 @@ { openmedialib_plugin_ptr plug = get_plug( resource, L"input" ); if ( plug == 0 ) - std::cerr << "create_input: failed to find a plugin for: " << pl::to_string( resource ) << "\n"; + std::cerr << "create_input: failed to find a plugin for: " << pl::to_string( resource ) << "\n"; return plug == 0 ? input_type_ptr( ) : plug->input( resource ); } @@ -484,7 +605,7 @@ store_type_ptr result = store_type_ptr( ); openmedialib_plugin_ptr plug = get_plug( resource, L"output" ); if ( plug == 0 ) - std::cerr << "create_store: failed to find a plugin for: " << pl::to_string( resource ) << "\n"; + std::cerr << "create_store: failed to find a plugin for: " << pl::to_string( resource ) << "\n"; return plug == 0 ? result : plug->store( resource, frame ); } @@ -534,7 +655,7 @@ double offset = 0.0, delta_offset = 0.0; - int offset_rounded = 0; + int offset_rounded = 0; short sample_a = 0, sample_b = 0; @@ -662,7 +783,7 @@ || (b->af().compare(AUDIO_FORMAT_PCM16) != 0) ) return audio_type_ptr(); - const audio_type::size_type samples_out = a->samples(); // a & b are the same. + const audio_type::size_type samples_out = a->samples(); // a & b are the same. const audio_type::size_type channels_out = a->channels(); audio_type_ptr mix = audio_type_ptr(new audio_type(audio<unsigned char, pcm16>(a->frequency(), channels_out, samples_out))); @@ -707,47 +828,56 @@ return mix; } -ML_DECLSPEC audio_type_ptr audio_channel_convert(const audio_type_ptr& input_audio, int channels) +ML_DECLSPEC audio_type_ptr audio_channel_convert( const audio_type_ptr& input_audio, + int channels_out ) { // Reject if given dodgy input if(input_audio == audio_type_ptr()) return audio_type_ptr(); // Return input if already in desired form - if(input_audio->channels() == channels) + if(input_audio->channels() == channels_out) return input_audio; // Reject if convertion isn't supported - if(!is_channel_convertion_supported(input_audio->channels(), channels)) + if(!is_channel_convertion_supported(input_audio->channels(), channels_out)) + { + DEBUG_LOG << "channel conversion unsupported: " + << "input: " << input_audio->channels() << ", " + << "output: " << channels_out; return audio_type_ptr(); + } // Reject if audio format isn't 16-bit PCM if(input_audio->af().compare(AUDIO_FORMAT_PCM16) != 0) + { + WARNING_LOG << "audio must be 16bit"; return audio_type_ptr(); + } // Create audio object for output const audio_type::size_type samples = input_audio->samples(); - audio_type_ptr output_audio = audio_type_ptr(new audio_type(audio<unsigned char, pcm16>(input_audio->frequency(), channels, samples))); + audio_type_ptr output_audio = audio_type_ptr(new audio_type(audio<unsigned char, pcm16>(input_audio->frequency(), channels_out, samples))); // upfront filter calcs - const double cutoff_to_fs_ratio = 0.5; - const double exponent = exp(-2.0 * M_PI * cutoff_to_fs_ratio); - const double one_minus_exponent = 1 - exponent; + const double cutoff_to_fs_ratio = 0.5; + const double exponent = exp(-2.0 * M_PI * cutoff_to_fs_ratio); + const double one_minus_exponent = 1 - exponent; short *output = (short*)output_audio->data(); - short *input = (short*)input_audio->data(); + short *input = (short*)input_audio->data(); int channels_in = input_audio->channels( ); - std::vector< float > sum( channels ); - std::vector< float > clipped( channels ); + std::vector< float > sum( channels_out ); + std::vector< float > clipped( channels_out ); for(audio_type::size_type sample_idx = 0; sample_idx < samples; ++sample_idx) { // Add appropriate channels together with appropriate weightings requested channels - mix_sample( input, channels_in, channels, sum ); + mix_sample( input, channels_in, channels_out, sum ); input += channels_in; - for(int ch = 0; ch < channels; ++ch) + for(int ch = 0; ch < channels_out; ++ch) { // clip channels appropriately if(sum[ch] < min_short) @@ -761,9 +891,9 @@ if(sample_idx == 0) *output = short( one_minus_exponent * clipped[ch] ); else - *output = short( one_minus_exponent * clipped[ch] + exponent * ( *( output - channels ) ) ); + *output = short( one_minus_exponent * clipped[ch] + exponent * ( *( output - channels_out ) ) ); - output ++; + ++output; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2009-04-02 09:42:46
|
Revision: 1465 http://openlibraries.svn.sourceforge.net/openlibraries/?rev=1465&view=rev Author: timdewhirst Date: 2009-04-02 09:42:39 +0000 (Thu, 02 Apr 2009) Log Message: ----------- olibs * update options in INSTALL Modified Paths: -------------- trunk/INSTALL Modified: trunk/INSTALL =================================================================== --- trunk/INSTALL 2009-02-18 09:22:36 UTC (rev 1464) +++ trunk/INSTALL 2009-04-02 09:42:39 UTC (rev 1465) @@ -52,6 +52,7 @@ * -D WITH_OPENAL:BOOL [default is TRUE] * -D WITH_OPENFXL:BOOL [default is FALSE] * -D WITH_OPENOL:BOOL [default is TRUE] + * -D WITH_POOL:BOOL [default is TRUE] To get a list of all possible generators, run cmake --help This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2009-02-18 09:33:02
|
Revision: 302 http://editopia.svn.sourceforge.net/editopia/?rev=302&view=rev Author: timdewhirst Date: 2009-02-18 09:32:58 +0000 (Wed, 18 Feb 2009) Log Message: ----------- cinesuite * bump version Modified Paths: -------------- cinesuite/cineplay-cinecode/trunk/installer/windows/common.nsh cinesuite/cineplay-cinecode/trunk/src/Version.hpp Modified: cinesuite/cineplay-cinecode/trunk/installer/windows/common.nsh =================================================================== --- cinesuite/cineplay-cinecode/trunk/installer/windows/common.nsh 2009-02-17 17:01:49 UTC (rev 301) +++ cinesuite/cineplay-cinecode/trunk/installer/windows/common.nsh 2009-02-18 09:32:58 UTC (rev 302) @@ -4,7 +4,7 @@ !ifndef VERSION ;!define /date VERSION "%Y%m%d" - !define VERSION "1.3.6.beta" + !define VERSION "1.3.7.beta" !endif !ifndef OLIB_VERSION Modified: cinesuite/cineplay-cinecode/trunk/src/Version.hpp =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/Version.hpp 2009-02-17 17:01:49 UTC (rev 301) +++ cinesuite/cineplay-cinecode/trunk/src/Version.hpp 2009-02-18 09:32:58 UTC (rev 302) @@ -18,4 +18,4 @@ // Copyright (C) 2008 the cinefx project // For more information, see http://www.cinefx.org -#define CINE_VERSION "1.3.6.beta" +#define CINE_VERSION "1.3.7.beta" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2009-02-18 09:22:40
|
Revision: 1464 http://openlibraries.svn.sourceforge.net/openlibraries/?rev=1464&view=rev Author: timdewhirst Date: 2009-02-18 09:22:36 +0000 (Wed, 18 Feb 2009) Log Message: ----------- olibs * remove warning Modified Paths: -------------- trunk/src/openmedialib/plugins/glew/glew_plugin.cpp Modified: trunk/src/openmedialib/plugins/glew/glew_plugin.cpp =================================================================== --- trunk/src/openmedialib/plugins/glew/glew_plugin.cpp 2009-02-12 16:15:16 UTC (rev 1463) +++ trunk/src/openmedialib/plugins/glew/glew_plugin.cpp 2009-02-18 09:22:36 UTC (rev 1464) @@ -377,7 +377,8 @@ { // Initialise the glut environment int fake_argc = 1; - char* fake_argv[ ] = { "" }; + static char argv_value[] = ""; + char* fake_argv[ ] = { argv_value }; glutInit( &fake_argc, fake_argv ); glutInitWindowSize( WIN_WIDTH, WIN_HEIGHT ); glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGBA ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2009-02-17 17:01:58
|
Revision: 301 http://editopia.svn.sourceforge.net/editopia/?rev=301&view=rev Author: timdewhirst Date: 2009-02-17 17:01:49 +0000 (Tue, 17 Feb 2009) Log Message: ----------- cinesuite * install appropriate .map file only Modified Paths: -------------- cinesuite/cineplay-cinecode/trunk/installer/windows/common.nsh Modified: cinesuite/cineplay-cinecode/trunk/installer/windows/common.nsh =================================================================== --- cinesuite/cineplay-cinecode/trunk/installer/windows/common.nsh 2009-02-17 16:59:55 UTC (rev 300) +++ cinesuite/cineplay-cinecode/trunk/installer/windows/common.nsh 2009-02-17 17:01:49 UTC (rev 301) @@ -119,7 +119,7 @@ SetOutPath $INSTDIR File "..\..\src\${APP_NAME}.exe" ;File "..\..\src\${APP_NAME}.exe.manifest" - File "..\..\src\*.map" + File "..\..\src\${APP_NAME}.map" ; Help SetOutPath $INSTDIR\help This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2009-02-17 17:00:01
|
Revision: 300 http://editopia.svn.sourceforge.net/editopia/?rev=300&view=rev Author: timdewhirst Date: 2009-02-17 16:59:55 +0000 (Tue, 17 Feb 2009) Log Message: ----------- cinesuite * have a slow yuv420p converter Modified Paths: -------------- cinesuite/cineplay-cinecode/trunk/src/OpenGLStore.cpp Modified: cinesuite/cineplay-cinecode/trunk/src/OpenGLStore.cpp =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/OpenGLStore.cpp 2009-02-17 16:59:20 UTC (rev 299) +++ cinesuite/cineplay-cinecode/trunk/src/OpenGLStore.cpp 2009-02-17 16:59:55 UTC (rev 300) @@ -159,7 +159,21 @@ void Draw( const QRect &r ); }; + class GLYuv420pSlowConvertFormat : public GLUploadFormat + { + private: + GLRgbaFormat* uf; + public: + GLYuv420pSlowConvertFormat(); + ~GLYuv420pSlowConvertFormat(); + std::wstring Pf() { return L"yuv420p"; } + bool IsSupported() { return uf->IsSupported(); } + void Init() { uf->Init(); } + void UpdateImage( const ml::image_type_ptr &image ); + void Draw( const QRect& r ) { uf->Draw( r ); } + }; + int nextPower(int val) { int pw = 1; @@ -742,7 +756,23 @@ glBindTexture( GL_TEXTURE_2D, 0 ); } + //////////////////////////////////// + GLYuv420pSlowConvertFormat::GLYuv420pSlowConvertFormat() + : uf( new GLRgbaFormat ) + {} + + GLYuv420pSlowConvertFormat::~GLYuv420pSlowConvertFormat() + { + delete uf; + } + void GLYuv420pSlowConvertFormat::UpdateImage( const ml::image_type_ptr& image ) + { + ml::image_type_ptr imageAsRgba( il::convert( image, L"r8g8b8a8" ) ); + uf->UpdateImage( imageAsRgba ); + } + + //////////////////////////////////// class GLStore::GLStorePrivate : public ml::store_type { @@ -891,6 +921,7 @@ new GLBgraFormat, new GLAbgrFormat, new GLRgbaFormat, + new GLYuv420pSlowConvertFormat, NULL }; int i=0; @@ -920,6 +951,7 @@ GLUploadFormat* formats[] = { new GLYuv420pFPFormat, new GLYuv420pSlowFormat, new GLYuv420pFormat, + new GLYuv420pSlowConvertFormat, NULL }; int i=0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |