Added new functions to OGG
This commit is contained in:
parent
04500e4694
commit
4ea8fe0327
2 changed files with 32 additions and 0 deletions
|
@ -34,6 +34,21 @@ namespace theora{
|
|||
return ntohl(result);
|
||||
}
|
||||
|
||||
uint32_t header::getInt24(size_t index){
|
||||
/*if (index + 3 >= datasize){
|
||||
if ( !reserve(index, 0, 4)){
|
||||
return 0;
|
||||
}
|
||||
setInt32(0, index);
|
||||
}*/
|
||||
uint32_t result = 0;
|
||||
//memcpy(((char*) &result)+1, data + index, 3);
|
||||
result += data[index] << 16;
|
||||
result += data[index+1] << 8;
|
||||
result += data[index+2];
|
||||
return result;
|
||||
}
|
||||
|
||||
uint16_t header::getInt16(size_t index){
|
||||
/*if (index + 3 >= datasize){
|
||||
if ( !reserve(index, 0, 4)){
|
||||
|
@ -109,6 +124,20 @@ namespace theora{
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
long unsigned int header::getPICH(){
|
||||
if (getHeaderType() == 0){
|
||||
return getInt24(17);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
long unsigned int header::getPICW(){
|
||||
if (getHeaderType() == 0){
|
||||
return getInt24(14);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
long unsigned int header::getFRD(){
|
||||
if (getHeaderType() == 0){
|
||||
|
|
|
@ -8,10 +8,13 @@ namespace theora{
|
|||
bool read(char* newData, unsigned int length);
|
||||
int getHeaderType();
|
||||
char getKFGShift();
|
||||
long unsigned int getPICH();//movie height
|
||||
long unsigned int getPICW();//movie width
|
||||
long unsigned int getFRN();//frame rate numerator
|
||||
long unsigned int getFRD();//frame rate denominator
|
||||
protected:
|
||||
uint32_t getInt32(size_t index);
|
||||
uint32_t getInt24(size_t index);
|
||||
uint16_t getInt16(size_t index);
|
||||
private:
|
||||
char* data;
|
||||
|
|
Loading…
Add table
Reference in a new issue