Improve input args parser to support multiple inputs

This commit is contained in:
jfmcarreira committed 2014-05-09 02:01:42 +01:00
1 parent 3d83d222be
commit bb83147bb3
5 files changed
+28 -11

No files matched your search

+4 -5
View File
@@ -163,7 +163,8 @@ Bool InputStream::open( QString filename, UInt width, UInt height, Int input_for
if( !avStatus )
{
m_pFile = NULL;
m_pFile = fopen( m_cFilename.toLocal8Bit().data(), "rb" );
Char *filename = m_cFilename.toLocal8Bit().data();
m_pFile = fopen( filename, "rb" );
if( m_pFile == NULL )
{
close();
@@ -283,6 +284,8 @@ Bool InputStream::guessFormat( QString filename, UInt& rWidth, UInt& rHeight, In
break;
}
}
if( rWidth >= 0 && rHeight >= 0 && rInputFormat >= 0 )
bRet = false;
}
return bRet;
}
@@ -313,10 +316,6 @@ Void InputStream::readNextFrame()
{
UInt64 bytes_read = 0;
//m_cTimer.restart();
if( m_iStatus == 0 )
{
return;
}
if( m_iCurrFrameNum + 1 >= ( Int )m_uiTotalFrameNum )
{
-1
View File
@@ -53,7 +53,6 @@ class InputStream
private:
Bool m_bInit;
Int m_iStatus;
Int m_iErrorStatus;
#ifdef USE_FFMPEG
-4
View File
@@ -81,10 +81,6 @@ Bool SubWindowHandle::loadFile( const QString &fileName )
{
m_pCurrStream = new InputStream;
}
// else
// {
// m_pCurrStream->close();
// }
m_pCurrStream->getFormat( Width, Height, InputFormat, FrameRate );
+21 -1
View File
@@ -87,6 +87,15 @@ Void plaYUVerApp::parseArgs( Int argc, Char *argv[] )
{
loadFile( argv[1] );
}
if( argc >= 2 )
{
for( Int i = 1; i < argc; i++ )
{
loadFile( argv[i] );
}
mdiArea->tileSubWindows();
zoomToFitAll();
}
}
Void plaYUVerApp::closeEvent( QCloseEvent *event )
@@ -524,6 +533,17 @@ void plaYUVerApp::zoomToFit()
activeSubWindow()->zoomToFit();
}
Void plaYUVerApp::zoomToFitAll()
{
SubWindowHandle *subWindow;
for( Int i = 0; i < mdiArea->subWindowList().size(); i++ )
{
subWindow = qobject_cast<SubWindowHandle *>( mdiArea->subWindowList().at( i ) );
subWindow->zoomToFit();
}
}
void plaYUVerApp::scaleFrame( int ratio )
{
if( activeSubWindow() )
@@ -540,7 +560,7 @@ void plaYUVerApp::scaleFrame( int ratio )
void plaYUVerApp::about()
{
QString about_message;
about_message.append("The <b>plaYUVerApp</b> is an open-source raw video player");
about_message.append( "The <b>plaYUVerApp</b> is an open-source raw video player" );
// about_message.append("\n\r");
// about_message.append("João Carreira");
// about_message.append("\n\r");
+3
View File
@@ -117,6 +117,9 @@ private:
UInt m_uiAveragePlayInterval;
Void loadFile( QString fileName );
Void zoomToFitAll();
//! Playing functions
Void setTimerStatus();
Void updateCurrFrameNum();