Updated ogg analyser

This commit is contained in:
Erik Zandvliet 2013-06-24 09:37:16 +02:00 committed by Thulinma
parent 3ab6bfcf4c
commit 4364199f50

View file

@ -1,13 +1,17 @@
#include <cstdlib>
#include <cstdio>
#include <iostream>
#include <fstream>
#include <string>
#include <map>
#include <string.h>
#include <mist/ogg.h>
#include <mist/config.h>
#include <mist/theora.h>
namespace Analysers{
int analyseOGG(){
std::map<int,std::string> sn2Codec;
std::string oggBuffer;
OGG::Page oggPage;
//Read all of std::cin to oggBuffer
@ -18,6 +22,13 @@ namespace Analysers{
}
//while OGG::page check function read
while (oggPage.read(oggBuffer)){//reading ogg to string
oggPage.setInternalCodec("");
if (oggPage.getHeaderType() & 0x02){
if (memcmp("theora",oggPage.getFullPayload() + 1,6) == 0){
sn2Codec[oggPage.getBitstreamSerialNumber()] = "theora";
}
}
oggPage.setInternalCodec(sn2Codec[oggPage.getBitstreamSerialNumber()]);
std::cout << oggPage.toPrettyString() << std::endl;
}
}