FLV analyser output readability improvements, added filter option.
This commit is contained in:
parent
77d00de3d5
commit
39614d9dcf
1 changed files with 15 additions and 18 deletions
|
@ -14,25 +14,22 @@
|
|||
#include <mist/flv_tag.h> //FLV support
|
||||
#include <mist/config.h>
|
||||
|
||||
///\brief Holds everything unique to the analysers.
|
||||
namespace Analysers {
|
||||
///\brief Debugging tool for FLV data.
|
||||
///
|
||||
/// Expects FLV data through stdin, outputs human-readable information to stderr.
|
||||
///\return The return code of the analyser.
|
||||
int analyseFLV(){
|
||||
///Debugging tool for FLV data.
|
||||
/// Expects FLV data through stdin, outputs human-readable information to stderr.
|
||||
int main(int argc, char ** argv){
|
||||
Util::Config conf = Util::Config(argv[0], PACKAGE_VERSION);
|
||||
conf.addOption("filter", JSON::fromString("{\"arg\":\"num\", \"short\":\"f\", \"long\":\"filter\", \"default\":0, \"help\":\"Only print info about this tag type (8 = audio, 9 = video, 0 = all)\"}"));
|
||||
conf.parseArgs(argc, argv);
|
||||
|
||||
long long filter = conf.getInteger("filter");
|
||||
|
||||
FLV::Tag flvData; // Temporary storage for incoming FLV data.
|
||||
while ( !feof(stdin)){
|
||||
if (flvData.FileLoader(stdin)){
|
||||
std::cout << "Tag: " << flvData.tagType() << "\n\tTime: " << flvData.tagTime() << std::endl;
|
||||
if (!filter || filter == flvData.data[0]){
|
||||
std::cout << "[" << flvData.tagTime() << "+" << flvData.offset() << "] " << flvData.tagType() << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char ** argv){
|
||||
Util::Config conf = Util::Config(argv[0], PACKAGE_VERSION);
|
||||
conf.parseArgs(argc, argv);
|
||||
return Analysers::analyseFLV();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue