From b36bbeef7ad759f2aef4bb2c1a2f834f6853dc29 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Tue, 28 May 2019 18:55:34 +0100 Subject: [PATCH] Support for variable number of inputs --- app/VideoSubWindow.cpp | 14 +++++++++++++- tools/CalypTools.cpp | 3 ++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/VideoSubWindow.cpp b/app/VideoSubWindow.cpp index b68cd3b..5bb1dbe 100644 --- a/app/VideoSubWindow.cpp +++ b/app/VideoSubWindow.cpp @@ -311,7 +311,7 @@ bool VideoSubWindow::loadFile( QString cFilename, bool bForceDialog ) { ConfigureFormatDialog formatDialog( this ); unsigned int Width = 0, Height = 0, BitsPel = 8, FrameRate = 30; - int Endianness = CLP_BIG_ENDIAN; + int Endianness = CLP_LITTLE_ENDIAN; int InputFormat = CLP_YUV420P; if( m_pCurrStream ) @@ -550,6 +550,18 @@ bool VideoSubWindow::guessFormat( QString filename, unsigned int& rWidth, unsign rBitsPerPixel = -1; } } + // QRegularExpressionMatch BppOnlybMatch = QRegularExpression( "_\\d*b" ).match( FilenameShort ); + // if( BppOnlybMatch.hasMatch() ) + // { + // QString matchString = BppOnlybMatch.captured( BppMatch.lastCapturedIndex() ); + // matchString.remove( "_" ); + // matchString.remove( "bpp" ); + // rBitsPerPixel = matchString.toUInt(); + // if( !( rBitsPerPixel > 0 && rBitsPerPixel < 16 ) ) + // { + // rBitsPerPixel = -1; + // } + // } // Guess frame rate - match %dbpp QRegularExpressionMatch FpsMatch = QRegularExpression( "_\\d*fps" ).match( FilenameShort ); diff --git a/tools/CalypTools.cpp b/tools/CalypTools.cpp index bd0b5b7..b1bc721 100644 --- a/tools/CalypTools.cpp +++ b/tools/CalypTools.cpp @@ -324,7 +324,8 @@ int CalypTools::Open( int argc, char* argv[] ) return -1; } - if( m_apcInputStreams.size() != m_pcCurrModuleIf->m_uiNumberOfFrames ) + if( !(m_pcCurrModuleIf->m_uiModuleRequirements & CLP_MODULES_VARIABLE_NUM_FRAMES) && + m_apcInputStreams.size() != m_pcCurrModuleIf->m_uiNumberOfFrames ) { log( CLP_LOG_ERROR, "Invalid number of inputs! " ); return -1;