#include #include #include #include "TcpLog.h" #include "Input.h" using namespace std; TcpLog etiLog; void testmpeg() { const int bufsize = 96; const int num = 30; const string fname = "/home/bram/dab/mmbtools-aux/dings.mp2"; cout << "Hello" << endl; InputMpegFile input(fname, 1, bufsize, 100); cout << "Open " << input.Open() << endl; cout << "Opened " << input.GetName() << endl; std::vector buffer(bufsize); for (int i = 0; i < num; i++) { int rc = input.ReadFrame(&buffer.front(), bufsize); cout << "ReadFrame " << dec << rc << endl; for(std::vector::iterator it = buffer.begin(); it != buffer.end(); ++it) { cout << hex << (unsigned int)*it << ","; } } cout << endl; } void testdabp() { const int bufsize = 188; const int num = 10; const string fname = "/home/bram/dab/mmbtools-aux/fb.dab"; cout << "Hello" << endl; InputDabplusFile input(fname, 1, 5*bufsize, 100); //InputFile input(fname); cout << "Open " << input.Open() << endl; cout << "Opened " << input.GetName() << endl; std::vector buffer(bufsize); for (int i = 0; i < num; i++) { int rc = input.ReadFrame(&buffer.front(), bufsize); cout << "ReadFrame " << dec << rc << endl; for(std::vector::iterator it = buffer.begin(); it != buffer.end(); ++it) { cout << hex << (unsigned int)*it << ", "; } } cout << endl; } int main(int argc, char** argv) { testmpeg(); }