From d4c6a078285dda636e283413fdbd9b1adeab5ade Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sun, 22 Dec 2013 18:04:29 +0100 Subject: Test for InputMpegFile --- src/inputs/Test.cpp | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'src/inputs/Test.cpp') diff --git a/src/inputs/Test.cpp b/src/inputs/Test.cpp index 925f871..29356ed 100644 --- a/src/inputs/Test.cpp +++ b/src/inputs/Test.cpp @@ -8,7 +8,36 @@ using namespace std; TcpLog etiLog; -int main(int argc, char** argv) +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; @@ -37,3 +66,10 @@ int main(int argc, char** argv) cout << endl; } + +int main(int argc, char** argv) +{ + testmpeg(); +} + + -- cgit v1.2.3