RDK Documentation (Open Sourced RDK Components)
|
Class for ISO BMFF Buffer. More...
#include <isobmffbuffer.h>
Public Member Functions | |
IsoBmffBuffer (AampLogManager *logObj=NULL) | |
IsoBmffBuffer constructor. | |
~IsoBmffBuffer () | |
IsoBmffBuffer destructor. | |
IsoBmffBuffer (const IsoBmffBuffer &)=delete | |
IsoBmffBuffer & | operator= (const IsoBmffBuffer &)=delete |
void | setBuffer (uint8_t *buf, size_t sz) |
Set buffer. More... | |
bool | parseBuffer (bool correctBoxSize=false, int newTrackId=-1) |
Parse ISOBMFF boxes from buffer. More... | |
void | restampPTS (uint64_t offset, uint64_t basePts, uint8_t *segment, uint32_t bufSz) |
Restamp PTS in a buffer. More... | |
bool | getFirstPTS (uint64_t &pts) |
Get first PTS of buffer. More... | |
bool | getTrack_id (uint32_t &track_id) |
Get track_id from the trak box. More... | |
void | PrintPTS (void) |
Print PTS of buffer. More... | |
bool | getTimeScale (uint32_t &timeScale) |
Get TimeScale value of buffer. More... | |
void | destroyBoxes () |
Release ISOBMFF boxes parsed. More... | |
void | printBoxes () |
Print ISOBMFF boxes. More... | |
bool | isInitSegment () |
Check if buffer is an initialization segment. More... | |
bool | parseMdatBox (uint8_t *buf, size_t &size) |
Get mdat buffer handle and size from parsed buffer. More... | |
bool | getMdatBoxSize (size_t &size) |
Get mdat buffer size. More... | |
bool | getEMSGData (uint8_t *&message, uint32_t &messageLen, uint8_t *&schemeIdUri, uint8_t *&value, uint64_t &presTime, uint32_t &timeScale, uint32_t &eventDuration, uint32_t &id) |
Get information from EMSG box. More... | |
bool | getEMSGInfoInternal (const std::vector< Box * > *boxes, uint8_t *&message, uint32_t &messageLen, uint8_t *&schemeIdUri, uint8_t *&value, uint64_t &presTime, uint32_t &timeScale, uint32_t &eventDuration, uint32_t &id, bool &foundEmsg) |
Get emsg informations. More... | |
bool | getMdatBoxCount (size_t &count) |
Check mdat buffer count in parsed buffer. More... | |
void | printMdatBoxes () |
Print ISOBMFF mdat boxes in parsed buffer. More... | |
bool | getTypeOfBoxes (const char *name, std::vector< Box * > &stBoxes) |
Get list of box handle in parsed bufferr using name. More... | |
Box * | getChunkedfBox () const |
Get list of box handles in a parsed buffer. More... | |
std::vector< Box * > * | getParsedBoxes () |
Get list of box handles in a parsed buffer. More... | |
Box * | getBox (const char *name, size_t &index) |
Get box handle in parsed bufferr using name. More... | |
Box * | getBoxAtIndex (size_t index) |
Get box handle in parsed bufferr using index. More... | |
void | printPTSInternal (const std::vector< Box * > *boxes) |
Print ISOBMFF box PTS. More... | |
void | getSampleDuration (Box *box, uint64_t &fduration) |
Get ISOBMFF box Sample Duration. More... | |
uint64_t | getSampleDurationInernal (const std::vector< Box * > *boxes) |
Get ISOBMFF box Sample Duration. More... | |
void | getPts (Box *box, uint64_t &fpts) |
Get ISOBMFF box PTS. More... | |
uint64_t | getPtsInternal (const std::vector< Box * > *boxes) |
Get ISOBMFF box PTS. More... | |
Private Member Functions | |
bool | getFirstPTSInternal (const std::vector< Box * > *boxes, uint64_t &pts) |
Get first PTS of buffer. More... | |
bool | getTrackIdInternal (const std::vector< Box * > *boxes, uint32_t &track_id) |
Get track id from trak box. More... | |
bool | getTimeScaleInternal (const std::vector< Box * > *boxes, uint32_t &timeScale, bool &foundMdhd) |
Get TimeScale value of buffer. More... | |
void | printBoxesInternal (const std::vector< Box * > *boxes) |
Print ISOBMFF boxes. More... | |
bool | parseBoxInternal (const std::vector< Box * > *boxes, const char *name, uint8_t *buf, size_t &size) |
parse ISOBMFF boxes of a type in a parsed buffer More... | |
bool | getBoxSizeInternal (const std::vector< Box * > *boxes, const char *name, size_t &size) |
get ISOBMFF box size of a type More... | |
bool | getBoxesInternal (const std::vector< Box * > *boxes, const char *name, std::vector< Box * > *pBoxes) |
get ISOBMFF box list of a type in a parsed buffer More... | |
Private Attributes | |
std::vector< Box * > | boxes |
uint8_t * | buffer |
size_t | bufSize |
Box * | chunkedBox |
size_t | mdatCount |
AampLogManager * | mLogObj |
Class for ISO BMFF Buffer.
Definition at line 39 of file isobmffbuffer.h.
|
private |
Get first PTS of buffer.
[in] | boxes | - ISOBMFF boxes |
[out] | pts | - pts value |
Definition at line 191 of file isobmffbuffer.cpp.
|
private |
Get track id from trak box.
[in] | boxes | - ISOBMFF boxes |
[out] | track_id | - track_id |
Definition at line 218 of file isobmffbuffer.cpp.
|
private |
Get TimeScale value of buffer.
[in] | boxes | - ISOBMFF boxes |
[out] | timeScale | - TimeScale value |
[out] | foundMdhd | - flag indicates if MDHD box was seen |
Definition at line 273 of file isobmffbuffer.cpp.
|
private |
Print ISOBMFF boxes.
[in] | boxes | - ISOBMFF boxes |
Definition at line 316 of file isobmffbuffer.cpp.
|
private |
parse ISOBMFF boxes of a type in a parsed buffer
[in] | boxes | - ISOBMFF boxes |
[in] | name | - box name to get |
[out] | buf | - mdat buffer pointer |
[out] | size | - size of mdat buffer |
Definition at line 89 of file isobmffbuffer.cpp.
|
private |
get ISOBMFF box size of a type
[in] | boxes | - ISOBMFF boxes |
[in] | name | - box name to get |
[out] | size | - size of mdat buffer |
Definition at line 117 of file isobmffbuffer.cpp.
|
private |
get ISOBMFF box list of a type in a parsed buffer
[in] | boxes | - ISOBMFF boxes |
[in] | name | - box name to get |
[out] | pBoxes | - size of mdat buffer |
Definition at line 417 of file isobmffbuffer.cpp.
void IsoBmffBuffer::setBuffer | ( | uint8_t * | buf, |
size_t | sz | ||
) |
Set buffer.
[in] | buf | - buffer pointer |
[in] | sz | - buffer size |
Definition at line 47 of file isobmffbuffer.cpp.
bool IsoBmffBuffer::parseBuffer | ( | bool | correctBoxSize = false , |
int | newTrackId = -1 |
||
) |
Parse ISOBMFF boxes from buffer.
@fn parseBuffer
[in] | correctBoxSize | - flag to correct the box size |
[in] | newTrackId | - new track id to overwrite the existing track id, when value is -1, it will not override |
[in] | correctBoxSize | - flag to indicate if box size needs to be corrected |
[in] | newTrackId | - new track id to overwrite the existing track id, when value is -1, it will not override |
Definition at line 59 of file isobmffbuffer.cpp.
IsoBmffBuffer::restampPTS | ( | uint64_t | offset, |
uint64_t | basePts, | ||
uint8_t * | segment, | ||
uint32_t | bufSz | ||
) |
Restamp PTS in a buffer.
[in] | offset | - pts offset |
[in] | basePts | - base pts |
[in] | segment | - buffer pointer |
[in] | bufSz | - buffer size |
Definition at line 134 of file isobmffbuffer.cpp.
IsoBmffBuffer::getFirstPTS | ( | uint64_t & | pts | ) |
Get first PTS of buffer.
[out] | pts | - pts value |
Definition at line 249 of file isobmffbuffer.cpp.
IsoBmffBuffer::getTrack_id | ( | uint32_t & | track_id | ) |
Get track_id from the trak box.
[out] | track_id | - track-id |
Definition at line 265 of file isobmffbuffer.cpp.
IsoBmffBuffer::PrintPTS | ( | void | ) |
bool IsoBmffBuffer::getTimeScale | ( | uint32_t & | timeScale | ) |
Get TimeScale value of buffer.
[out] | timeScale | - TimeScale value |
Definition at line 307 of file isobmffbuffer.cpp.
void IsoBmffBuffer::destroyBoxes | ( | ) |
IsoBmffBuffer::printBoxes | ( | ) |
bool IsoBmffBuffer::isInitSegment | ( | ) |
Check if buffer is an initialization segment.
Definition at line 360 of file isobmffbuffer.cpp.
IsoBmffBuffer::parseMdatBox | ( | uint8_t * | buf, |
size_t & | size | ||
) |
Get mdat buffer handle and size from parsed buffer.
[out] | buf | - mdat buffer pointer |
[out] | size | - size of mdat buffer |
Definition at line 79 of file isobmffbuffer.cpp.
IsoBmffBuffer::getMdatBoxSize | ( | size_t & | size | ) |
Get mdat buffer size.
[out] | size | - size of mdat buffer |
Definition at line 109 of file isobmffbuffer.cpp.
bool IsoBmffBuffer::getEMSGData | ( | uint8_t *& | message, |
uint32_t & | messageLen, | ||
uint8_t *& | schemeIdUri, | ||
uint8_t *& | value, | ||
uint64_t & | presTime, | ||
uint32_t & | timeScale, | ||
uint32_t & | eventDuration, | ||
uint32_t & | id | ||
) |
Get information from EMSG box.
[out] | message | - messageData from EMSG |
[out] | messageLen | - messageLen |
[out] | schemeIdUri | - schemeIdUri |
[out] | value | - value of Id3 |
[out] | presTime | - Presentation time |
[out] | timeScale | - timeScale of ID3 metadata |
[out] | eventDuration | - eventDuration value |
[out] | id | - ID of metadata |
Definition at line 408 of file isobmffbuffer.cpp.
IsoBmffBuffer::getEMSGInfoInternal | ( | const std::vector< Box * > * | boxes, |
uint8_t *& | message, | ||
uint32_t & | messageLen, | ||
uint8_t *& | schemeIdUri, | ||
uint8_t *& | value, | ||
uint64_t & | presTime, | ||
uint32_t & | timeScale, | ||
uint32_t & | eventDuration, | ||
uint32_t & | id, | ||
bool & | foundEmsg | ||
) |
Get emsg informations.
[in] | boxes | - ISOBMFF boxes |
[out] | message | - messageData pointer |
[out] | messageLen | - messageLen value |
[out] | schemeIdUri | - schemeIdUri |
[out] | value | - value of Id3 |
[out] | presTime | - Presentation time |
[out] | timeScale | - timeScale of ID3 metadata |
[out] | eventDuration | - eventDuration value |
[out] | id | - ID of metadata |
[out] | foundEmsg | - flag indicates if EMSG box was seen |
Definition at line 378 of file isobmffbuffer.cpp.
IsoBmffBuffer::getMdatBoxCount | ( | size_t & | count | ) |
Check mdat buffer count in parsed buffer.
[out] | count | - mdat box count |
Definition at line 440 of file isobmffbuffer.cpp.
IsoBmffBuffer::printMdatBoxes | ( | ) |
Print ISOBMFF mdat boxes in parsed buffer.
Definition at line 452 of file isobmffbuffer.cpp.
IsoBmffBuffer::getTypeOfBoxes | ( | const char * | name, |
std::vector< Box * > & | stBoxes | ||
) |
Get list of box handle in parsed bufferr using name.
[in] | name | - box name to get |
[out] | stBoxes | - List of box handles of a type in a parsed buffer |
Definition at line 463 of file isobmffbuffer.cpp.
IsoBmffBuffer::getChunkedfBox | ( | ) | const |
Get list of box handles in a parsed buffer.
Definition at line 473 of file isobmffbuffer.cpp.
IsoBmffBuffer::getParsedBoxes | ( | ) |
Get list of box handles in a parsed buffer.
Definition at line 481 of file isobmffbuffer.cpp.
IsoBmffBuffer::getBox | ( | const char * | name, |
size_t & | index | ||
) |
Get box handle in parsed bufferr using name.
[in] | name | - box name to get |
[out] | index | - index of box in a parsed buffer |
Definition at line 489 of file isobmffbuffer.cpp.
IsoBmffBuffer::getBoxAtIndex | ( | size_t | index | ) |
Get box handle in parsed bufferr using index.
[out] | index | - index of box in a parsed buffer |
Definition at line 509 of file isobmffbuffer.cpp.
IsoBmffBuffer::printPTSInternal | ( | const std::vector< Box * > * | boxes | ) |
Print ISOBMFF box PTS.
[in] | boxes | - ISOBMFF boxes |
Definition at line 521 of file isobmffbuffer.cpp.
IsoBmffBuffer::getSampleDuration | ( | Box * | box, |
uint64_t & | fduration | ||
) |
Get ISOBMFF box Sample Duration.
[in] | box | - ISOBMFF box |
[in] | fduration | - duration to get |
Definition at line 584 of file isobmffbuffer.cpp.
IsoBmffBuffer::getSampleDurationInernal | ( | const std::vector< Box * > * | boxes | ) |
Get ISOBMFF box Sample Duration.
[in] | boxes | - ISOBMFF boxes |
Definition at line 542 of file isobmffbuffer.cpp.
IsoBmffBuffer::getPts | ( | Box * | box, |
uint64_t & | fpts | ||
) |
Get ISOBMFF box PTS.
[in] | box | - ISOBMFF box |
[in] | fpts | - PTS to get |
Definition at line 625 of file isobmffbuffer.cpp.
IsoBmffBuffer::getPtsInternal | ( | const std::vector< Box * > * | boxes | ) |
Get ISOBMFF box PTS.
[in] | boxes | - ISOBMFF boxes |
Definition at line 595 of file isobmffbuffer.cpp.