Seperate command opts by app
This commit is contained in:
1 parent
e924a06a9e
commit
40aa4f95f3
4 files changed
+42
-24
No files matched your search
@@ -62,21 +62,11 @@ po::options_description PlaYUVerCmdParser::GetCommandOpts()
|
|||||||
( "pel_fmts", "list pixel formats" ) /**/
|
( "pel_fmts", "list pixel formats" ) /**/
|
||||||
( "frames,f", po::value<UInt>(), "number of frames" );
|
( "frames,f", po::value<UInt>(), "number of frames" );
|
||||||
|
|
||||||
po::options_description qualityOpts( "Quality" );
|
|
||||||
qualityOpts.add_options() /**/
|
|
||||||
( "quality", po::value<std::string>(), "select a quality metric" ) /**/
|
|
||||||
( "quality_metrics", "list supported quality metrics" );
|
|
||||||
|
|
||||||
po::options_description moduleOpts( "Module" );
|
|
||||||
moduleOpts.add_options() /**/
|
|
||||||
( "module", po::value<std::string>(), "select a module" ) /**/
|
|
||||||
( "module_list", "list supported modules" );
|
|
||||||
|
|
||||||
po::options_description commonOpts( "Common" );
|
po::options_description commonOpts( "Common" );
|
||||||
commonOpts.add_options()/**/
|
commonOpts.add_options()/**/
|
||||||
( "help", "produce help message" )/**/
|
( "help", "produce help message" )/**/
|
||||||
( "version", "show version and exit" );
|
( "version", "show version and exit" );
|
||||||
commonOpts.add( inputOpts ).add( qualityOpts ).add( moduleOpts );
|
commonOpts.add( inputOpts );
|
||||||
return commonOpts;
|
return commonOpts;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,16 +126,6 @@ Bool PlaYUVerCmdParser::checkListingOpts()
|
|||||||
}
|
}
|
||||||
bRet |= true;
|
bRet |= true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( m_cOptionsMap.count( "quality_metrics" ) )
|
|
||||||
{
|
|
||||||
printf( "PlaYUVer supported quality metrics: \n" );
|
|
||||||
for( UInt i = 0; i < PlaYUVerFrame::supportedQualityMetricsList().size(); i++ )
|
|
||||||
{
|
|
||||||
printf( " %s\n", PlaYUVerFrame::supportedQualityMetricsList()[i].c_str() );
|
|
||||||
}
|
|
||||||
bRet |= true;
|
|
||||||
}
|
|
||||||
return bRet;
|
return bRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "CommandLineHandle.h"
|
#include "CommandLineHandle.h"
|
||||||
|
#include "lib/PlaYUVerFrame.h"
|
||||||
|
|
||||||
namespace plaYUVer
|
namespace plaYUVer
|
||||||
{
|
{
|
||||||
@@ -37,5 +38,39 @@ CommandLineHandle::~CommandLineHandle()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Int CommandLineHandle::ParseToolsArgs()
|
||||||
|
{
|
||||||
|
Int iRet = 0;
|
||||||
|
|
||||||
|
po::options_description qualityOpts( "Quality" );
|
||||||
|
qualityOpts.add_options() /**/
|
||||||
|
( "quality", po::value<std::string>(), "select a quality metric" ) /**/
|
||||||
|
( "quality_metrics", "list supported quality metrics" );
|
||||||
|
|
||||||
|
po::options_description moduleOpts( "Module" );
|
||||||
|
moduleOpts.add_options() /**/
|
||||||
|
( "module", po::value<std::string>(), "select a module" ) /**/
|
||||||
|
( "module_list", "list supported modules" );
|
||||||
|
|
||||||
|
addOptions( qualityOpts );
|
||||||
|
addOptions( moduleOpts );
|
||||||
|
|
||||||
|
if( !parse() )
|
||||||
|
{
|
||||||
|
iRet = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( getOptionsMap().count( "quality_metrics" ) )
|
||||||
|
{
|
||||||
|
printf( "PlaYUVer supported quality metrics: \n" );
|
||||||
|
for( UInt i = 0; i < PlaYUVerFrame::supportedQualityMetricsList().size(); i++ )
|
||||||
|
{
|
||||||
|
printf( " %s\n", PlaYUVerFrame::supportedQualityMetricsList()[i].c_str() );
|
||||||
|
}
|
||||||
|
iRet = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return iRet;
|
||||||
|
}
|
||||||
|
|
||||||
} // NAMESPACE
|
} // NAMESPACE
|
||||||
@@ -38,6 +38,7 @@ public:
|
|||||||
CommandLineHandle();
|
CommandLineHandle();
|
||||||
~CommandLineHandle();
|
~CommandLineHandle();
|
||||||
|
|
||||||
|
Int ParseToolsArgs();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -113,10 +113,12 @@ Int PlaYUVerTools::openOutputs()
|
|||||||
|
|
||||||
Int PlaYUVerTools::Open( Int argc, Char *argv[] )
|
Int PlaYUVerTools::Open( Int argc, Char *argv[] )
|
||||||
{
|
{
|
||||||
|
Int iRet = 0;
|
||||||
|
|
||||||
m_cCommandLineParser.Config( argc, argv );
|
m_cCommandLineParser.Config( argc, argv );
|
||||||
if( !m_cCommandLineParser.parse() )
|
if( ( iRet = m_cCommandLineParser.ParseToolsArgs() ) > 0 )
|
||||||
{
|
{
|
||||||
return 1;
|
return iRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( openInputs() > 0 )
|
if( openInputs() > 0 )
|
||||||
@@ -165,7 +167,7 @@ Int PlaYUVerTools::Open( Int argc, Char *argv[] )
|
|||||||
printf( "No operation was selected! " );
|
printf( "No operation was selected! " );
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
return 0;
|
return iRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
Int PlaYUVerTools::Process()
|
Int PlaYUVerTools::Process()
|
||||||
|
|||||||
Reference in new issue
Block a user