From a7fb2db9ae274b479ce632b7575ed7fbd707e24a Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Sat, 29 Mar 2014 01:26:45 +0000 Subject: [PATCH] init format guessing --- source/app/InputStream.cpp | 10 ++++------ source/app/InputStream.h | 1 + source/app/SubWindowHandle.cpp | 4 +++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/source/app/InputStream.cpp b/source/app/InputStream.cpp index 9685cd5..9ca41af 100755 --- a/source/app/InputStream.cpp +++ b/source/app/InputStream.cpp @@ -117,17 +117,15 @@ QStringList InputStream::supportedWriteFormatsList() return formats; } -Bool InputStream::needFormatDialog( QString filename ) +Bool InputStream::guessFormat( QString filename, UInt& rWidth, UInt& rHeight, Int& rInputFormat, UInt& rFrameRate ) { + Bool bRet = false; QString fileExtension = QFileInfo( filename ).completeSuffix(); if( !fileExtension.compare( QString( "yuv" ) ) ) { - return true; - } - else - { - return false; + bRet = true; } + return bRet; } Void InputStream::init( QString filename, UInt width, UInt height, Int input_format, UInt frame_rate ) diff --git a/source/app/InputStream.h b/source/app/InputStream.h index 6b16451..aca70eb 100755 --- a/source/app/InputStream.h +++ b/source/app/InputStream.h @@ -100,6 +100,7 @@ public: }; Bool needFormatDialog( QString filename ); + Bool guessFormat( QString filename, UInt& rWidth, UInt& rHeight, Int& rInputFormat, UInt& rFrameRate ); Void init( QString filename, UInt width, UInt height, Int input_format, UInt frame_rate ); Void close(); diff --git a/source/app/SubWindowHandle.cpp b/source/app/SubWindowHandle.cpp index bd85f40..63d738a 100644 --- a/source/app/SubWindowHandle.cpp +++ b/source/app/SubWindowHandle.cpp @@ -74,9 +74,11 @@ SubWindowHandle::~SubWindowHandle() Bool SubWindowHandle::loadFile( const QString &fileName ) { + UInt Width, Height, rFrameRate; + Int InputFormat; ConfigureFormatDialog formatDialog( this ); - if( m_pCurrStream->needFormatDialog( fileName ) ) + if( m_pCurrStream->guessFormat( fileName, Width, Height, InputFormat, rFrameRate ) ) { if( formatDialog.exec() == QDialog::Rejected ) {