From 937669d3c9abf1cf84e2fa7998d41292a835875c Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Tue, 16 Apr 2019 15:43:12 +0100 Subject: [PATCH] Finishing adding log information about input and output streams --- tools/CalypTools.cpp | 16 ++++++++++++---- tools/CalypTools.h | 1 + 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/tools/CalypTools.cpp b/tools/CalypTools.cpp index a82f36c..c1f1162 100644 --- a/tools/CalypTools.cpp +++ b/tools/CalypTools.cpp @@ -59,11 +59,11 @@ CalypTools::~CalypTools() #define GET_PARAM( X, i ) X[X.size() > i ? i : X.size() - 1] -void reportStreamInfo( const CalypStream& stream ) +void CalypTools::reportStreamInfo( const CalypStream* stream ) { - log( CLP_LOG_INFO, "Found input: %s ", stream.getFileName() ); - log( CLP_LOG_INFO, " resolution: %s ", stream.getWidth(), stream.getHeight(), stream.getFrameRate() ); - log( CLP_LOG_INFO, " bits/pel: %d (%s)", stream.getEndianess() == 1 ? "big" : "little" ); + log( CLP_LOG_INFO, "Stream name: %s \n", stream->getFileName().c_str() ); + log( CLP_LOG_INFO, "Resolution: %dx%d@%d \n", stream->getWidth(), stream->getHeight(), stream->getFrameRate() ); + log( CLP_LOG_INFO, "Bits/pel: %d (%s)\n", stream->getBitsPerPixel(), stream->getEndianess() == CLP_BIG_ENDIAN ? "BE" : "LE" ); } int CalypTools::openInputs() @@ -115,6 +115,8 @@ int CalypTools::openInputs() return -1; } m_apcInputStreams.push_back( pcStream ); + log( CLP_LOG_INFO, "Found input %d \n", m_apcInputStreams.size() ); + reportStreamInfo( pcStream ); } catch( const char* msg ) { @@ -146,6 +148,8 @@ int CalypTools::Open( int argc, char* argv[] ) { int iRet = 0; + log( CLP_LOG_ERROR, "calypTools - The command line interface for Calyp modules! \n" ); + // check requirements if( CalypPixel::getMaxNumberOfComponents() > MAX_NUMBER_CHANNELS ) { @@ -232,6 +236,8 @@ int CalypTools::Open( int argc, char* argv[] ) pcOutputStream->open( m_pcOutputFileNames[0], pcInputFrame->getWidth(), pcInputFrame->getHeight(), pcInputFrame->getPelFormat(), pcInputFrame->getBitsPel(), CLP_LITTLE_ENDIAN, 1, false ); + log( CLP_LOG_INFO, "Output stream from rate-reduction!\n" ); + reportStreamInfo( pcOutputStream ); } catch( const char* msg ) { @@ -364,6 +370,8 @@ int CalypTools::Open( int argc, char* argv[] ) { pcModStream->open( outputFileNames[0], pcModFrame->getWidth(), pcModFrame->getHeight(), pcModFrame->getPelFormat(), pcModFrame->getBitsPel(), CLP_LITTLE_ENDIAN, 1, false ); + log( CLP_LOG_INFO, "Output stream from module!\n" ); + reportStreamInfo( pcModStream ); } catch( const char* msg ) { diff --git a/tools/CalypTools.h b/tools/CalypTools.h index ae72f7f..857ab9f 100644 --- a/tools/CalypTools.h +++ b/tools/CalypTools.h @@ -83,6 +83,7 @@ private: std::vector m_apcInputStreams; std::vector m_apcOutputStreams; + void reportStreamInfo( const CalypStream* stream ); int openInputs(); std::vector readInput();