Added minKeepAway support to DTSC::Track object, senders and parsers
This commit is contained in:
parent
c895a6b7e2
commit
f3f2802844
3 changed files with 34 additions and 6 deletions
|
@ -297,6 +297,7 @@ namespace DTSC {
|
|||
std::string codec;
|
||||
std::string type;
|
||||
std::string lang;///< ISO 639-2 Language of track, empty or und if unknown.
|
||||
uint32_t minKeepAway;///<Time in MS to never seek closer than live point to
|
||||
//audio only
|
||||
int rate;
|
||||
int size;
|
||||
|
|
|
@ -1105,6 +1105,7 @@ namespace DTSC {
|
|||
width = 0;
|
||||
height = 0;
|
||||
fpks = 0;
|
||||
minKeepAway = 0;
|
||||
}
|
||||
|
||||
///\brief Constructs a track from a JSON::Value
|
||||
|
@ -1148,6 +1149,11 @@ namespace DTSC {
|
|||
keySizes.push_back((((long unsigned)tmp[i]) << 24) | (((long unsigned)tmp[i+1]) << 16) | (((long unsigned int)tmp[i+2]) << 8) | tmp[i+3]);
|
||||
}
|
||||
}
|
||||
if (trackRef.isMember("keepaway") && trackRef["keepaway"].isInt()){
|
||||
minKeepAway = trackRef["keepaway"].asInt();
|
||||
}else{
|
||||
minKeepAway = 0;
|
||||
}
|
||||
}
|
||||
|
||||
///\brief Constructs a track from a JSON::Value
|
||||
|
@ -1199,6 +1205,11 @@ namespace DTSC {
|
|||
keySizes.push_back((((long unsigned)tmp[i]) << 24) | (((long unsigned)tmp[i+1]) << 16) | (((long unsigned int)tmp[i+2]) << 8) | tmp[i+3]);
|
||||
}
|
||||
}
|
||||
if (trackRef.getMember("keepaway").getType() == DTSC_INT){
|
||||
minKeepAway = trackRef.getMember("keepaway").asInt();
|
||||
}else{
|
||||
minKeepAway = 0;
|
||||
}
|
||||
}
|
||||
|
||||
///\brief Updates a track and its metadata given new packet properties.
|
||||
|
@ -1641,6 +1652,9 @@ namespace DTSC {
|
|||
if (!skipDynamic && missedFrags) {
|
||||
result += 23;
|
||||
}
|
||||
if (minKeepAway){
|
||||
result += 19;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1736,6 +1750,10 @@ namespace DTSC {
|
|||
writePointer(p, "\000\004fpks\001", 7);
|
||||
writePointer(p, convertLongLong(fpks), 8);
|
||||
}
|
||||
if (minKeepAway){
|
||||
writePointer(p, "\000\010keepaway\001", 11);
|
||||
writePointer(p, convertLongLong(minKeepAway), 8);
|
||||
}
|
||||
writePointer(p, "\000\000\356", 3);//End this track Object
|
||||
}
|
||||
|
||||
|
@ -1813,6 +1831,10 @@ namespace DTSC {
|
|||
conn.SendNow("\000\004fpks\001", 7);
|
||||
conn.SendNow(convertLongLong(fpks), 8);
|
||||
}
|
||||
if (minKeepAway){
|
||||
conn.SendNow("\000\010keepaway\001", 11);
|
||||
conn.SendNow(convertLongLong(minKeepAway), 8);
|
||||
}
|
||||
conn.SendNow("\000\000\356", 3);//End this track Object
|
||||
}
|
||||
|
||||
|
@ -1965,6 +1987,11 @@ namespace DTSC {
|
|||
result["height"] = height;
|
||||
result["fpks"] = fpks;
|
||||
}
|
||||
|
||||
if(minKeepAway){
|
||||
result["keepaway"] = minKeepAway;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue