diff --git a/lib/PlaYUVerCmdParser.cpp b/lib/PlaYUVerCmdParser.cpp index 7a9ef94..ae9c4f8 100644 --- a/lib/PlaYUVerCmdParser.cpp +++ b/lib/PlaYUVerCmdParser.cpp @@ -62,17 +62,21 @@ po::options_description PlaYUVerCmdParser::GetCommandOpts() ( "pel_fmts", "list pixel formats" ) /**/ ( "frames,f", po::value(), "number of frames" ); - po::options_description operationOpts( "Operation" ); - operationOpts.add_options() /**/ - ( "module", po::value(), "select a module" ) /**/ + po::options_description qualityOpts( "Quality" ); + qualityOpts.add_options() /**/ ( "quality", po::value(), "select a quality metric" ) /**/ ( "quality_metrics", "list supported quality metrics" ); + po::options_description moduleOpts( "Module" ); + moduleOpts.add_options() /**/ + ( "module", po::value(), "select a module" ) /**/ + ( "module_list", "list supported modules" ); + po::options_description commonOpts( "Common" ); commonOpts.add_options()/**/ ( "help", "produce help message" )/**/ ( "version", "show version and exit" ); - commonOpts.add( inputOpts ).add( operationOpts ); + commonOpts.add( inputOpts ).add( qualityOpts ).add( moduleOpts ); return commonOpts; } diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 3e90e92..f45ce07 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -9,9 +9,9 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/../ ) set(plaYUver_Tools_SRCS - # Main main.cpp PlaYUVerTools.cpp + CommandLineHandle.cpp ) ADD_EXECUTABLE( ${PROJECT_NAME}Tools ${plaYUver_Tools_SRCS} ) diff --git a/tools/CommandLineHandle.cpp b/tools/CommandLineHandle.cpp new file mode 100644 index 0000000..be0f49d --- /dev/null +++ b/tools/CommandLineHandle.cpp @@ -0,0 +1,41 @@ +/* This file is a part of plaYUVer project + * Copyright (C) 2014-2015 by Luis Lucas (luisfrlucas@gmail.com) + * Joao Carreira (jfmcarreira@gmail.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + * \file CommandLineHandle.cpp + * \brief Handle for command line + */ + +#include "CommandLineHandle.h" + +namespace plaYUVer +{ + +CommandLineHandle::CommandLineHandle() +{ + +} + +CommandLineHandle::~CommandLineHandle() +{ + +} + + +} // NAMESPACE diff --git a/tools/CommandLineHandle.h b/tools/CommandLineHandle.h new file mode 100644 index 0000000..b4a6ad6 --- /dev/null +++ b/tools/CommandLineHandle.h @@ -0,0 +1,46 @@ +/* This file is a part of plaYUVer project + * Copyright (C) 2014-2015 by Luis Lucas (luisfrlucas@gmail.com) + * Joao Carreira (jfmcarreira@gmail.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + * \file CommandLineHandle.h + * \brief Handle for command line + */ + +#ifndef __COMMANDLINEHANDLE_H__ +#define __COMMANDLINEHANDLE_H__ + +#include "config.h" +#include "lib/PlaYUVerDefs.h" +#include "lib/PlaYUVerCmdParser.h" + +namespace plaYUVer +{ + +class CommandLineHandle: public PlaYUVerCmdParser +{ +public: + CommandLineHandle(); + ~CommandLineHandle(); + + +}; + +} // NAMESPACE + +#endif // __COMMANDLINEHANDLE_H__ diff --git a/tools/PlaYUVerTools.cpp b/tools/PlaYUVerTools.cpp index 358a558..1216b2d 100644 --- a/tools/PlaYUVerTools.cpp +++ b/tools/PlaYUVerTools.cpp @@ -52,7 +52,7 @@ Int PlaYUVerTools::openInputs() */ if( m_cCommandLineParser.getOptionsMap().count( "input" ) ) { - std::string resolutionString; + std::string resolutionString(""); if( m_cCommandLineParser.getOptionsMap().count( "size" ) ) { resolutionString = m_cCommandLineParser.getOptionsMap()["size"].as(); @@ -80,8 +80,8 @@ Int PlaYUVerTools::openInputs() } catch( const char *msg ) { - printf( "Cannot open input stream %s with the following error: \n%s", inputFileNames[i].c_str(), msg ); - return false; + printf( "Cannot open input stream %s with the following error: \n%s\n", inputFileNames[i].c_str(), msg ); + return 2; } } m_uiNumberOfFrames = MAX_UINT; diff --git a/tools/PlaYUVerTools.h b/tools/PlaYUVerTools.h index 75314f1..4d1464b 100644 --- a/tools/PlaYUVerTools.h +++ b/tools/PlaYUVerTools.h @@ -22,14 +22,14 @@ * \brief Main definition of the PlaYUVerTools app */ -#ifndef __PLAYUVERAPP_H__ -#define __PLAYUVERAPP_H__ +#ifndef __PLAYUVERTOOLS_H__ +#define __PLAYUVERTOOLS_H__ #include "config.h" #include "lib/PlaYUVerDefs.h" -#include -#include -#include +#include "lib/PlaYUVerFrame.h" +#include "lib/PlaYUVerStream.h" +#include "CommandLineHandle.h" namespace plaYUVer { @@ -45,7 +45,7 @@ public: Int Close(); private: - PlaYUVerCmdParser m_cCommandLineParser; + CommandLineHandle m_cCommandLineParser; UInt m_uiOperation; Int m_uiOperationIndex;