Added Meta.updatePosOverride for efficient conversions from streams to DTSC files.
This commit is contained in:
parent
1798db4602
commit
6d67bcdd67
2 changed files with 10 additions and 1 deletions
|
@ -341,6 +341,7 @@ namespace DTSC {
|
||||||
Meta(JSON::Value & meta);
|
Meta(JSON::Value & meta);
|
||||||
void reinit(const DTSC::Packet & source);
|
void reinit(const DTSC::Packet & source);
|
||||||
void update(DTSC::Packet & pack, unsigned long segment_size = 5000);
|
void update(DTSC::Packet & pack, unsigned long segment_size = 5000);
|
||||||
|
void updatePosOverride(DTSC::Packet & pack, unsigned long bpos);
|
||||||
void update(JSON::Value & pack, unsigned long segment_size = 5000);
|
void update(JSON::Value & pack, unsigned long segment_size = 5000);
|
||||||
void update(long long packTime, long long packOffset, long long packTrack, long long packDataSize, long long packBytePos, bool isKeyframe, long long packSendSize = 0, unsigned long segment_size = 5000);
|
void update(long long packTime, long long packOffset, long long packTrack, long long packDataSize, long long packBytePos, bool isKeyframe, long long packSendSize = 0, unsigned long segment_size = 5000);
|
||||||
unsigned int getSendLen();
|
unsigned int getSendLen();
|
||||||
|
|
|
@ -1458,6 +1458,14 @@ namespace DTSC {
|
||||||
update(pack.getTime(), pack.hasMember("offset")?pack.getInt("offset"):0, pack.getTrackId(), dataLen, pack.hasMember("bpos")?pack.getInt("bpos"):-1, pack.hasMember("keyframe"), pack.getDataLen(), segment_size);
|
update(pack.getTime(), pack.hasMember("offset")?pack.getInt("offset"):0, pack.getTrackId(), dataLen, pack.hasMember("bpos")?pack.getInt("bpos"):-1, pack.hasMember("keyframe"), pack.getDataLen(), segment_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///\brief Updates a meta object given a DTSC::Packet with byte position override.
|
||||||
|
void Meta::updatePosOverride(DTSC::Packet & pack, unsigned long bpos) {
|
||||||
|
char * data;
|
||||||
|
unsigned int dataLen;
|
||||||
|
pack.getString("data", data, dataLen);
|
||||||
|
update(pack.getTime(), pack.hasMember("offset")?pack.getInt("offset"):0, pack.getTrackId(), dataLen, bpos, pack.hasMember("keyframe"), pack.getDataLen());
|
||||||
|
}
|
||||||
|
|
||||||
void Meta::update(long long packTime, long long packOffset, long long packTrack, long long packDataSize, long long packBytePos, bool isKeyframe, long long packSendSize, unsigned long segment_size){
|
void Meta::update(long long packTime, long long packOffset, long long packTrack, long long packDataSize, long long packBytePos, bool isKeyframe, long long packSendSize, unsigned long segment_size){
|
||||||
if (!packSendSize){
|
if (!packSendSize){
|
||||||
//time and trackID are part of the 20-byte header.
|
//time and trackID are part of the 20-byte header.
|
||||||
|
|
Loading…
Add table
Reference in a new issue