Updated ogg analyser
This commit is contained in:
parent
3ab6bfcf4c
commit
4364199f50
1 changed files with 11 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue