Minor changes in stream handling class and fix some code only supported by qt5
This commit is contained in:
1 parent
db5b6ffa62
commit
c34a16e61c
2 files changed
+11
-18
No files matched your search
@@ -189,7 +189,11 @@ Void plaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* streamInfo )
|
||||
m_aRecentFileStreamInfo.remove( idx );
|
||||
m_aRecentFileStreamInfo.prepend( interfaceChild->getStreamInfo() );
|
||||
while ( m_aRecentFileStreamInfo.size() > MAX_RECENT_FILES )
|
||||
m_aRecentFileStreamInfo.removeLast();
|
||||
//#if( QT_VERSION_PLAYUVER == 5)
|
||||
// m_aRecentFileStreamInfo.removeLast();
|
||||
//#else
|
||||
m_aRecentFileStreamInfo.removeAt( m_aRecentFileStreamInfo.size() - 1);
|
||||
//#endif
|
||||
updateRecentFileActions();
|
||||
|
||||
statusBar()->showMessage( tr( "File loaded" ), 2000 );
|
||||
|
||||
@@ -70,14 +70,11 @@ QDataStream& operator>>( QDataStream& in, PlaYUVerStreamInfoVector& array )
|
||||
Int findPlaYUVerStreamInfo( PlaYUVerStreamInfoVector array, QString filename )
|
||||
{
|
||||
for( Int i = 0; i < array.size(); i++ )
|
||||
if( array.at( i ).m_cFilename == filename)
|
||||
if( array.at( i ).m_cFilename == filename )
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
PlaYUVerStream::PlaYUVerStream()
|
||||
{
|
||||
m_bInit = false;
|
||||
@@ -209,11 +206,6 @@ Bool PlaYUVerStream::open( QString filename, UInt width, UInt height, Int input_
|
||||
|
||||
if( !avStatus && m_iFileFormat == YUVINPUT )
|
||||
{
|
||||
if( !openFile() )
|
||||
{
|
||||
close();
|
||||
return m_bInit;
|
||||
}
|
||||
if( m_bIsInput )
|
||||
{
|
||||
fseek( m_pFile, 0, SEEK_END );
|
||||
@@ -222,7 +214,7 @@ Bool PlaYUVerStream::open( QString filename, UInt width, UInt height, Int input_
|
||||
if( fileSize % frame_bytes_input )
|
||||
{
|
||||
Int remaining = fileSize % frame_bytes_input;
|
||||
qDebug( ) << "Incorrect configuration: failed ( fileSize % frame_bytes_input = " << remaining << " )" ;
|
||||
qDebug( ) << "Incorrect configuration: failed ( fileSize % frame_bytes_input = " << remaining << " )";
|
||||
close();
|
||||
return m_bInit;
|
||||
}
|
||||
@@ -230,8 +222,7 @@ Bool PlaYUVerStream::open( QString filename, UInt width, UInt height, Int input_
|
||||
m_uiTotalFrameNum = fileSize / frame_bytes_input;
|
||||
fseek( m_pFile, 0, SEEK_SET );
|
||||
}
|
||||
m_cFormatName = QString::fromUtf8( "YUV" );
|
||||
m_cCodedName = QString::fromUtf8( "Raw Video" );
|
||||
|
||||
}
|
||||
|
||||
if( m_bIsInput && m_uiTotalFrameNum <= 0 )
|
||||
@@ -292,9 +283,8 @@ Bool PlaYUVerStream::openFile()
|
||||
|
||||
Void PlaYUVerStream::closeFile()
|
||||
{
|
||||
if( !m_bInit && m_pFile )
|
||||
return;
|
||||
fclose( m_pFile );
|
||||
if( m_pFile )
|
||||
fclose( m_pFile );
|
||||
}
|
||||
|
||||
Void PlaYUVerStream::close()
|
||||
@@ -405,8 +395,7 @@ Bool PlaYUVerStream::guessFormat( QString filename, UInt& rWidth, UInt& rHeight,
|
||||
{
|
||||
resolutionString.remove( "_" );
|
||||
QStringList resolutionArgs = resolutionString.split( "x" );
|
||||
qDebug( ) << "Found resolution = "
|
||||
<< resolutionArgs;
|
||||
qDebug( ) << "Found resolution = " << resolutionArgs;
|
||||
if( resolutionArgs.size() == 2 )
|
||||
{
|
||||
rWidth = resolutionArgs.at( 0 ).toUInt();
|
||||
|
||||
Reference in new issue
Block a user