Merge branch 'development' into LTS_development
# Conflicts: # src/output/output.cpp # src/output/output_http_internal.cpp
This commit is contained in:
commit
dadb1ebde8
9 changed files with 190 additions and 167 deletions
|
@ -3460,67 +3460,67 @@ namespace MP4 {
|
|||
return getInt32(4);
|
||||
}
|
||||
|
||||
void ELST::setSegmentDuration(uint64_t newVal) {
|
||||
void ELST::setSegmentDuration(uint32_t cnt, uint64_t newVal) {
|
||||
if (getVersion() == 1) {
|
||||
setInt64(newVal, 8);
|
||||
setInt64(newVal, 28*cnt+8);
|
||||
} else {
|
||||
setInt32(newVal, 8);
|
||||
setInt32(newVal, 20*cnt+8);
|
||||
}
|
||||
}
|
||||
|
||||
uint64_t ELST::getSegmentDuration() {
|
||||
uint64_t ELST::getSegmentDuration(uint32_t cnt) {
|
||||
if (getVersion() == 1) {
|
||||
return getInt64(8);
|
||||
return getInt64(28*cnt+8);
|
||||
} else {
|
||||
return getInt32(8);
|
||||
return getInt32(20*cnt+8);
|
||||
}
|
||||
}
|
||||
|
||||
void ELST::setMediaTime(uint64_t newVal) {
|
||||
void ELST::setMediaTime(uint32_t cnt, uint64_t newVal) {
|
||||
if (getVersion() == 1) {
|
||||
setInt64(newVal, 16);
|
||||
setInt64(newVal, 28*cnt+16);
|
||||
} else {
|
||||
setInt32(newVal, 12);
|
||||
setInt32(newVal, 20*cnt+12);
|
||||
}
|
||||
}
|
||||
|
||||
uint64_t ELST::getMediaTime() {
|
||||
uint64_t ELST::getMediaTime(uint32_t cnt) {
|
||||
if (getVersion() == 1) {
|
||||
return getInt64(16);
|
||||
return getInt64(28*cnt+16);
|
||||
} else {
|
||||
return getInt32(12);
|
||||
return getInt32(20*cnt+12);
|
||||
}
|
||||
}
|
||||
|
||||
void ELST::setMediaRateInteger(uint16_t newVal) {
|
||||
void ELST::setMediaRateInteger(uint32_t cnt, uint16_t newVal) {
|
||||
if (getVersion() == 1) {
|
||||
setInt16(newVal, 24);
|
||||
setInt16(newVal, 28*cnt+24);
|
||||
} else {
|
||||
setInt16(newVal, 16);
|
||||
setInt16(newVal, 20*cnt+16);
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t ELST::getMediaRateInteger() {
|
||||
uint16_t ELST::getMediaRateInteger(uint32_t cnt) {
|
||||
if (getVersion() == 1) {
|
||||
return getInt16(24);
|
||||
return getInt16(28*cnt+24);
|
||||
} else {
|
||||
return getInt16(16);
|
||||
return getInt16(20*cnt+16);
|
||||
}
|
||||
}
|
||||
|
||||
void ELST::setMediaRateFraction(uint16_t newVal) {
|
||||
void ELST::setMediaRateFraction(uint32_t cnt, uint16_t newVal) {
|
||||
if (getVersion() == 1) {
|
||||
setInt16(newVal, 26);
|
||||
setInt16(newVal, 28*cnt+26);
|
||||
} else {
|
||||
setInt16(newVal, 18);
|
||||
setInt16(newVal, 20*cnt+18);
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t ELST::getMediaRateFraction() {
|
||||
uint16_t ELST::getMediaRateFraction(uint32_t cnt) {
|
||||
if (getVersion() == 1) {
|
||||
return getInt16(26);
|
||||
return getInt16(28*cnt+26);
|
||||
} else {
|
||||
return getInt16(18);
|
||||
return getInt16(20*cnt+18);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3528,11 +3528,15 @@ namespace MP4 {
|
|||
std::stringstream r;
|
||||
r << std::string(indent, ' ') << "[elst] Edit List Box (" << boxedSize() << ")" << std::endl;
|
||||
r << fullBox::toPrettyString(indent);
|
||||
r << std::string(indent + 1, ' ') << "Count: " << getCount() << std::endl;
|
||||
r << std::string(indent + 1, ' ') << "SegmentDuration: " << getSegmentDuration() << std::endl;
|
||||
r << std::string(indent + 1, ' ') << "MediaTime: " << getMediaTime() << std::endl;
|
||||
r << std::string(indent + 1, ' ') << "MediaRateInteger: " << getMediaRateInteger() << std::endl;
|
||||
r << std::string(indent + 1, ' ') << "MediaRateFraction: " << getMediaRateFraction() << std::endl;
|
||||
uint32_t cnt = getCount();
|
||||
r << std::string(indent + 1, ' ') << "Count: " << cnt << std::endl;
|
||||
for (uint32_t i = 0; i < cnt; ++i){
|
||||
r << std::string(indent + 1, ' ') << "[Entry " << i << "] " << std::endl;
|
||||
r << std::string(indent + 2, ' ') << "SegmentDuration: " << getSegmentDuration(i) << std::endl;
|
||||
r << std::string(indent + 2, ' ') << "MediaTime: " << getMediaTime(i) << std::endl;
|
||||
r << std::string(indent + 2, ' ') << "MediaRateInteger: " << getMediaRateInteger(i) << std::endl;
|
||||
r << std::string(indent + 2, ' ') << "MediaRateFraction: " << getMediaRateFraction(i) << std::endl;
|
||||
}
|
||||
return r.str();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -783,14 +783,14 @@ namespace MP4 {
|
|||
ELST();
|
||||
void setCount(uint32_t newVal);
|
||||
uint32_t getCount();
|
||||
void setSegmentDuration(uint64_t newVal);
|
||||
uint64_t getSegmentDuration();
|
||||
void setMediaTime(uint64_t newVal);
|
||||
uint64_t getMediaTime();
|
||||
void setMediaRateInteger(uint16_t newVal);
|
||||
uint16_t getMediaRateInteger();
|
||||
void setMediaRateFraction(uint16_t newVal);
|
||||
uint16_t getMediaRateFraction();
|
||||
void setSegmentDuration(uint32_t cnt, uint64_t newVal);
|
||||
uint64_t getSegmentDuration(uint32_t cnt);
|
||||
void setMediaTime(uint32_t cnt, uint64_t newVal);
|
||||
uint64_t getMediaTime(uint32_t cnt);
|
||||
void setMediaRateInteger(uint32_t cnt, uint16_t newVal);
|
||||
uint16_t getMediaRateInteger(uint32_t cnt);
|
||||
void setMediaRateFraction(uint32_t cnt, uint16_t newVal);
|
||||
uint16_t getMediaRateFraction(uint32_t cnt);
|
||||
std::string toPrettyString(uint32_t indent = 0);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -807,11 +807,15 @@ namespace IPC {
|
|||
|
||||
///\brief Creates the next page with the correct size
|
||||
void sharedServer::newPage() {
|
||||
sharedPage tmp(std::string(baseName.substr(1) + (char)(myPages.size() + (int)'A')), std::min(((8192 * 2) << myPages.size()), (32 * 1024 * 1024)), true);
|
||||
sharedPage tmp(std::string(baseName.substr(1) + (char)(myPages.size() + (int)'A')), std::min(((8192 * 2) << myPages.size()), (32 * 1024 * 1024)), false);
|
||||
if (!tmp.mapped){
|
||||
tmp.init(std::string(baseName.substr(1) + (char)(myPages.size() + (int)'A')), std::min(((8192 * 2) << myPages.size()), (32 * 1024 * 1024)), true);
|
||||
tmp.master = false;
|
||||
}
|
||||
myPages.push_back(tmp);
|
||||
tmp.master = false;
|
||||
DEBUG_MSG(DLVL_VERYHIGH, "Created a new page: %s", tmp.name.c_str());
|
||||
amount += tmp.len / (payLen + (hasCounter ? 1 : 0)) - 1;
|
||||
myPages.back().master = true;
|
||||
VERYHIGH_MSG("Created a new page: %s", tmp.name.c_str());
|
||||
amount += (32 * 1024 * 1024)*myPages.size();//assume maximum load - we don't want to miss any entries
|
||||
}
|
||||
|
||||
///\brief Deletes the highest allocated page
|
||||
|
@ -982,12 +986,12 @@ namespace IPC {
|
|||
if (countNum == 127 || countNum == 126){
|
||||
semGuard tmpGuard(&mySemaphore);
|
||||
if (disconCallback){
|
||||
disconCallback(it->mapped + offset + 1, payLen, id);
|
||||
disconCallback(counter + 1, payLen, id);
|
||||
}
|
||||
memset(it->mapped + offset + 1, 0, payLen);
|
||||
it->mapped[offset] = 0;
|
||||
memset(counter + 1, 0, payLen);
|
||||
*counter = 0;
|
||||
} else {
|
||||
it->mapped[offset] ++;
|
||||
++(*counter);
|
||||
}
|
||||
} else {
|
||||
//stop if we're past the amount counted and we're empty
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue