Converted nearly everything to new config object from library.

This commit is contained in:
Thulinma 2012-07-21 04:32:37 +02:00
parent cecb015a4b
commit ffff1f9577
14 changed files with 147 additions and 330 deletions

View file

@ -7,10 +7,13 @@
#include <fstream>
#include <string>
#include <mist/amf.h>
#include <mist/config.h>
/// Debugging tool for AMF data.
/// Expects AMF data through stdin, outputs human-readable information to stderr.
int main() {
int main(int argc, char ** argv) {
Util::Config conf = Util::Config(argv[0], PACKAGE_VERSION);
conf.parseArgs(argc, argv);
std::string temp;
while (std::cin.good()){temp += std::cin.get();}//read all of std::cin to temp
temp.erase(temp.size()-1, 1);//strip the invalid last character

View file

@ -11,9 +11,13 @@
#include <unistd.h>
#include <signal.h>
#include <mist/dtsc.h> //DTSC support
#include <mist/config.h>
/// Reads DTSC from stdin and outputs human-readable information to stderr.
int main() {
int main(int argc, char ** argv) {
Util::Config conf = Util::Config(argv[0], PACKAGE_VERSION);
conf.parseArgs(argc, argv);
DTSC::Stream Strm;
std::string inBuffer;

View file

@ -11,9 +11,12 @@
#include <unistd.h>
#include <signal.h>
#include <mist/flv_tag.h> //FLV support
#include <mist/config.h>
/// Reads FLV from stdin and outputs human-readable information to stderr.
int main() {
int main(int argc, char ** argv) {
Util::Config conf = Util::Config(argv[0], PACKAGE_VERSION);
conf.parseArgs(argc, argv);
FLV::Tag FLV_in; // Temporary storage for incoming FLV data.
while (!feof(stdin)){
if (FLV_in.FileLoader(stdin)){

View file

@ -17,6 +17,7 @@
#include <mist/flv_tag.h>
#include <mist/amf.h>
#include <mist/rtmpchunks.h>
#include <mist/config.h>
int Detail = 0;
#define DETAIL_RECONSTRUCT 1
@ -28,9 +29,12 @@ int Detail = 0;
/// Will output FLV file to stdout, if available
/// Automatically skips 3073 bytes of handshake data.
int main(int argc, char ** argv){
if (argc > 1){
Detail = atoi(argv[1]);
Util::Config conf = Util::Config(argv[0], PACKAGE_VERSION);
conf.addOption("detail", JSON::fromString("{\"arg_num\":1, \"arg\":\"integer\", \"default\":0, \"help\":\"Bitmask, 1 = Reconstruct, 2 = Explicit media info, 4 = Verbose chunks\"}"));
conf.parseArgs(argc, argv);
Detail = conf.getInteger("detail");
if (Detail > 0){
fprintf(stderr, "Detail level set:\n");
if ((Detail & DETAIL_RECONSTRUCT) == DETAIL_RECONSTRUCT){
fprintf(stderr, " - Will reconstuct FLV file to stdout\n");