Fixed all ARM-related issues/warnings/etc

This commit is contained in:
Thulinma 2021-05-21 17:54:24 +02:00
parent dae32ede11
commit 6733bf2a20
44 changed files with 123 additions and 120 deletions

View file

@ -410,7 +410,10 @@ namespace CMAF{
trunBox.setSampleInformation(sampleInfo, trunOffset++);
}
}else{
WARN_MSG("Empty CMAF header for track %zu: %zu-%zu contains no packets (first: %" PRIu64 ", last: %" PRIu64 "), firstPart=%zu, lastPart=%zu", track, startTime, endTime, M.getFirstms(track), M.getLastms(track), firstPart, endPart);
WARN_MSG("Empty CMAF header for track %zu: %" PRIu64 "-%" PRIu64 " contains no packets (first: %" PRIu64
", last: %" PRIu64 "), firstPart=%zu, lastPart=%zu",
track, startTime, endTime, M.getFirstms(track), M.getLastms(track), firstPart,
endPart);
}
trafBox.setContent(trunBox, 2);

View file

@ -55,7 +55,7 @@ namespace Comms{
protected:
bool master;
size_t index;
uint64_t index;
size_t currentSize;
IPC::semaphore sem;
IPC::sharedPage dataPage;

View file

@ -318,7 +318,7 @@ namespace DTSC{
Bit::htobl(data + offset, Bit::btohl(data + offset) + appendLen);
}
size_t Packet::getDataStringLen(){return Bit::btohl(data + getDataStringLenOffset());}
uint32_t Packet::getDataStringLen(){return Bit::btohl(data + getDataStringLenOffset());}
/// Method can only be used when using internal functions to build the data.
size_t Packet::getDataStringLenOffset(){
@ -472,11 +472,11 @@ namespace DTSC{
///\brief Returns the size of this packet.
///\return The size of this packet.
uint64_t Packet::getDataLen() const{return dataLen;}
uint32_t Packet::getDataLen() const{return dataLen;}
///\brief Returns the size of the payload of this packet.
///\return The size of the payload of this packet.
size_t Packet::getPayloadLen() const{
uint32_t Packet::getPayloadLen() const{
if (version == DTSC_V2){
return dataLen - 20;
}else{

View file

@ -123,9 +123,9 @@ namespace DTSC{
void nullMember(const std::string & memb);
size_t getTrackId() const;
char *getData() const;
size_t getDataLen() const;
size_t getPayloadLen() const;
size_t getDataStringLen();
uint32_t getDataLen() const;
uint32_t getPayloadLen() const;
uint32_t getDataStringLen();
size_t getDataStringLenOffset();
JSON::Value toJSON() const;
std::string toSummary() const;
@ -136,8 +136,8 @@ namespace DTSC{
packType version;
void resize(size_t size);
char *data;
size_t bufferLen;
size_t dataLen;
uint32_t bufferLen;
uint32_t dataLen;
uint64_t prevNalSize;
};

View file

@ -493,14 +493,14 @@ bool FLV::Tag::DTSCAudioInit(const std::string & codec, unsigned int sampleRate,
return true;
}
bool FLV::Tag::DTSCMetaInit(const DTSC::Meta &M, std::set<long unsigned int> &selTracks){
bool FLV::Tag::DTSCMetaInit(const DTSC::Meta &M, std::set<size_t> &selTracks){
AMF::Object amfdata("root", AMF::AMF0_DDV_CONTAINER);
amfdata.addContent(AMF::Object("", "onMetaData"));
amfdata.addContent(AMF::Object("", AMF::AMF0_ECMA_ARRAY));
AMF::Object trinfo = AMF::Object("trackinfo", AMF::AMF0_STRICT_ARRAY);
int i = 0;
uint64_t mediaLen = 0;
for (std::set<long unsigned int>::iterator it = selTracks.begin(); it != selTracks.end(); it++){
for (std::set<size_t>::iterator it = selTracks.begin(); it != selTracks.end(); it++){
if (M.getLastms(*it) - M.getFirstms(*it) > mediaLen){
mediaLen = M.getLastms(*it) - M.getFirstms(*it);
}

View file

@ -52,7 +52,7 @@ namespace FLV{
bool DTSCLoader(DTSC::Packet &packData, const DTSC::Meta &M, size_t idx);
bool DTSCVideoInit(DTSC::Meta &meta, uint32_t vTrack);
bool DTSCAudioInit(const std::string & codec, unsigned int sampleRate, unsigned int sampleSize, unsigned int channels, const std::string & initData);
bool DTSCMetaInit(const DTSC::Meta &M, std::set<long unsigned int> &selTracks);
bool DTSCMetaInit(const DTSC::Meta &M, std::set<size_t> &selTracks);
void toMeta(DTSC::Meta &meta, AMF::Object &amf_storage);
void toMeta(DTSC::Meta &meta, AMF::Object &amf_storage, size_t &reTrack, const std::map<std::string, std::string> &targetParams);
bool MemLoader(char *D, unsigned int S, unsigned int &P);

View file

@ -38,10 +38,10 @@ namespace h264{
return false;
}
std::deque<nalu::nalData> analysePackets(const char *data, unsigned long len){
std::deque<nalu::nalData> analysePackets(const char *data, size_t len){
std::deque<nalu::nalData> res;
int offset = 0;
size_t offset = 0;
// Make sure entire packet is within len
while (offset + 5 < len && Bit::btohl(data + offset) + offset + 4 <= len){
nalu::nalData entry;

View file

@ -110,7 +110,7 @@ namespace MP4{
fseek(newData, 0, SEEK_END);
return true;
}
DONTEVEN_MSG("skipping size 0x%.8lX", size);
DONTEVEN_MSG("skipping box of size %" PRIu64, size);
if (fseek(newData, pos + size, SEEK_SET) == 0){
return true;
}else{

View file

@ -2772,7 +2772,7 @@ namespace MP4{
if (count == index){
setBox(box, offset);
}else{
INFO_MSG("Should not be here! Index is %zu, count is %zu, offset is %zu, payloadSize is %zu",
INFO_MSG("Should not be here! Index is %zu, count is %zu, offset is %zu, payloadSize is %" PRIu64,
index, count, offset, payloadSize());
}
}
@ -2916,7 +2916,7 @@ namespace MP4{
if (count == index){
setBox(box, offset);
}else{
INFO_MSG("Should not be here! Index is %zu, count is %zu, offset is %zu, payloadSize is %zu",
INFO_MSG("Should not be here! Index is %zu, count is %zu, offset is %zu, payloadSize is %" PRIu64,
index, count, offset, payloadSize());
}
}

View file

@ -98,8 +98,8 @@ namespace OGG{
/// Reads an OGG Page from the source and if valid, removes it from source.
bool Page::read(std::string &newData){
int len = newData.size();
int total = 0;
size_t len = newData.size();
size_t total = 0;
segments.clear();
if (newData.size() < 27){return false;}
if (newData.substr(0, 4) != "OggS"){
@ -127,7 +127,7 @@ namespace OGG{
newData.erase(0, *it);
}
INFO_MSG("Erased %lu bytes from the input", len - newData.size());
INFO_MSG("Erased %zu bytes from the input", len - newData.size());
return true;
}
@ -203,12 +203,12 @@ namespace OGG{
void Page::setGranulePosition(long long unsigned int newVal){set_64(data + 6, newVal);}
long unsigned int Page::getBitstreamSerialNumber(){
uint32_t Page::getBitstreamSerialNumber(){
// return ntohl(((long unsigned int*)(data+14))[0]);
return get_32(data + 14);
}
void Page::setBitstreamSerialNumber(long unsigned int newVal){set_32(data + 14, newVal);}
void Page::setBitstreamSerialNumber(uint32_t newVal){set_32(data + 14, newVal);}
long unsigned int Page::getPageSequenceNumber(){return get_32(data + 18);}

View file

@ -45,8 +45,8 @@ namespace OGG{
void setHeaderType(char newVal);
long long unsigned int getGranulePosition();
void setGranulePosition(long long unsigned int newVal);
long unsigned int getBitstreamSerialNumber();
void setBitstreamSerialNumber(long unsigned int newVal);
uint32_t getBitstreamSerialNumber();
void setBitstreamSerialNumber(uint32_t newVal);
long unsigned int getCRCChecksum();
void setCRCChecksum(long unsigned int newVal);
long unsigned int getPageSequenceNumber();

View file

@ -498,7 +498,7 @@ bool RTMPStream::doHandshake(){
char Version;
// Read C0
if (handshake_in.size() < 1537){
FAIL_MSG("Handshake wasn't filled properly (%lu/1537) - aborting!", handshake_in.size());
FAIL_MSG("Handshake wasn't filled properly (%zu/1537) - aborting!", handshake_in.size());
return false;
}
Version = RTMPStream::handshake_in[0];

View file

@ -771,7 +771,7 @@ namespace RTP{
return;
}
if (fuaBuffer.size() && ((pl[2] & 0x80) || missed)){
WARN_MSG("H265 FU packet incompleted: %lu", fuaBuffer.size());
WARN_MSG("H265 FU packet incompleted: %zu", fuaBuffer.size());
Bit::htobl(fuaBuffer, fuaBuffer.size() - 4); // size-prepend
fuaBuffer[4] |= 0x80; // set error bit
handleHEVCSingle(msTime, fuaBuffer, fuaBuffer.size(),
@ -794,7 +794,7 @@ namespace RTP{
}
if (pl[2] & 0x40){// last packet
VERYHIGH_MSG("H265 FU packet type %s (%u) completed: %lu",
VERYHIGH_MSG("H265 FU packet type %s (%u) completed: %zu",
h265::typeToStr((fuaBuffer[4] & 0x7E) >> 1),
(uint8_t)((fuaBuffer[4] & 0x7E) >> 1), fuaBuffer.size());
Bit::htobl(fuaBuffer, fuaBuffer.size() - 4); // size-prepend
@ -923,7 +923,7 @@ namespace RTP{
}
if (fuaBuffer.size() && ((pl[1] & 0x80) || missed)){
WARN_MSG("Ending unfinished FU-A");
INSANE_MSG("H264 FU-A packet incompleted: %lu", fuaBuffer.size());
INSANE_MSG("H264 FU-A packet incompleted: %zu", fuaBuffer.size());
fuaBuffer.truncate(0);
return;
}
@ -941,7 +941,7 @@ namespace RTP{
}
if (pl[1] & 0x40){// last packet
INSANE_MSG("H264 FU-A packet type %u completed: %lu", (unsigned int)(fuaBuffer[4] & 0x1F),
INSANE_MSG("H264 FU-A packet type %u completed: %zu", (unsigned int)(fuaBuffer[4] & 0x1F),
fuaBuffer.size());
uint8_t nalType = (fuaBuffer[4] & 0x1F);
if (nalType == 7 || nalType == 8){

View file

@ -607,10 +607,10 @@ namespace SDP{
}
/// Calculates H265 track metadata from sps and pps data stored in tracks[trackNo]
void State::updateH265Init(size_t tid){
void State::updateH265Init(uint64_t tid){
SDP::Track &RTrk = tracks[tid];
if (!RTrk.hevcInfo.haveRequired()){
MEDIUM_MSG("Aborted meta fill for hevc track %lu: no info nal unit", tid);
MEDIUM_MSG("Aborted meta fill for hevc track %" PRIu64 ": no info nal unit", tid);
return;
}
myMeta->setInit(tid, RTrk.hevcInfo.generateHVCC());
@ -647,7 +647,7 @@ namespace SDP{
}
size_t State::getTrackNoForChannel(uint8_t chan){
for (std::map<size_t, Track>::iterator it = tracks.begin(); it != tracks.end(); ++it){
for (std::map<uint64_t, Track>::iterator it = tracks.begin(); it != tracks.end(); ++it){
if (chan == it->second.channel){return it->first;}
}
return INVALID_TRACK_ID;
@ -671,7 +671,7 @@ namespace SDP{
while (loop){
if (tracks.size()){
for (std::map<size_t, Track>::iterator it = tracks.begin(); it != tracks.end(); ++it){
for (std::map<uint64_t, Track>::iterator it = tracks.begin(); it != tracks.end(); ++it){
if (!it->second.control.size()){
it->second.control = "/track" + JSON::Value(it->first).asString();
INFO_MSG("Control track: %s", it->second.control.c_str());
@ -681,7 +681,7 @@ namespace SDP{
urlString.substr(urlString.size() - it->second.control.size()) == it->second.control) ||
(pw.size() >= it->second.control.size() &&
pw.substr(pw.size() - it->second.control.size()) == it->second.control)){
INFO_MSG("Parsing SETUP against track %lu", it->first);
INFO_MSG("Parsing SETUP against track %" PRIu64, it->first);
if (!it->second.parseTransport(H.GetHeader("Transport"), cH, src, myMeta, it->first)){
return INVALID_TRACK_ID;
}
@ -720,7 +720,7 @@ namespace SDP{
return ((double)M->getRate(tid) / 1000.0);
}
void State::updateInit(const size_t tid, const std::string &initData){
void State::updateInit(const uint64_t tid, const std::string &initData){
myMeta->setInit(tid, initData.data(), initData.size());
}

View file

@ -47,8 +47,8 @@ namespace SDP{
void (*incomingPacketCallback)(const DTSC::Packet &pkt);
void parseSDP(const std::string &sdp);
void parseSDPEx(const std::string &sdp);
void updateH264Init(size_t trackNo);
void updateH265Init(size_t tid);
void updateH264Init(uint64_t trackNo);
void updateH265Init(uint64_t trackNo);
void updateInit(const uint64_t trackNo, const std::string &initData);
size_t getTrackNoForChannel(uint8_t chan);
size_t parseSetup(HTTP::Parser &H, const std::string &host, const std::string &source);
@ -56,8 +56,8 @@ namespace SDP{
public:
DTSC::Meta *myMeta;
std::map<size_t, RTP::toDTSC> tConv; ///< Converters to DTSC
std::map<size_t, Track> tracks; ///< List of selected tracks with SDP-specific session data.
std::map<uint64_t, RTP::toDTSC> tConv; ///< Converters to DTSC
std::map<uint64_t, Track> tracks; ///< List of selected tracks with SDP-specific session data.
};
std::string mediaDescription(const DTSC::Meta *M, size_t tid);

View file

@ -847,7 +847,7 @@ namespace SDP{
M.setType(tid, "video");
M.setRate(tid, answerVideoFormat.getVideoRate());
M.setID(tid, answerVideoFormat.payloadType);
INFO_MSG("Setup video track %zu for payload type %zu", tid, answerVideoFormat.payloadType);
INFO_MSG("Setup video track %zu for payload type %" PRIu64, tid, answerVideoFormat.payloadType);
return true;
}
@ -869,7 +869,7 @@ namespace SDP{
M.setChannels(tid, answerAudioFormat.getAudioNumChannels());
M.setSize(tid, answerAudioFormat.getAudioBitSize());
M.setID(tid, answerAudioFormat.payloadType);
INFO_MSG("Setup audio track %zu for payload time %zu", tid, answerAudioFormat.payloadType);
INFO_MSG("Setup audio track %zu for payload time %" PRIu64, tid, answerAudioFormat.payloadType);
return true;
}
@ -1017,8 +1017,8 @@ namespace SDP{
usedProfile = "42e01f";
}
addLine("a=fmtp:%u profile-level-id=%s;level-asymmetry-allowed=1;packetization-mode=1",
fmtMedia->payloadType, usedProfile.c_str());
addLine("a=fmtp:%u profile-level-id=42e01f;level-asymmetry-allowed=1;packetization-mode=1",
fmtMedia->payloadType);
}else if (fmtMedia->encodingName == "OPUS"){
addLine("a=fmtp:%u minptime=10;useinbandfec=1", fmtMedia->payloadType);
}

View file

@ -331,7 +331,7 @@ void Util::packetSorter::getTrackList(std::set<size_t> &toFill) const{
JSON::Value Util::getStreamConfig(const std::string &streamname){
JSON::Value result;
if (streamname.size() > 100){
FAIL_MSG("Stream opening denied: %s is longer than 100 characters (%lu).", streamname.c_str(),
FAIL_MSG("Stream opening denied: %s is longer than 100 characters (%zu).", streamname.c_str(),
streamname.size());
return result;
}
@ -408,7 +408,7 @@ bool Util::startInput(std::string streamname, std::string filename, bool forkFir
const std::map<std::string, std::string> &overrides, pid_t *spawn_pid){
sanitizeName(streamname);
if (streamname.size() > 100){
FAIL_MSG("Stream opening denied: %s is longer than 100 characters (%lu).", streamname.c_str(),
FAIL_MSG("Stream opening denied: %s is longer than 100 characters (%zu).", streamname.c_str(),
streamname.size());
return false;
}

View file

@ -1369,13 +1369,13 @@ namespace TS{
///\param selectedTracks tracks to include in PMT creation
///\param myMeta
///\returns character pointer to a static 188B TS packet
const char *createPMT(std::set<unsigned long> &selectedTracks, const DTSC::Meta &M, int contCounter){
const char *createPMT(std::set<size_t> &selectedTracks, const DTSC::Meta &M, int contCounter){
static ProgramMappingTable PMT;
PMT.setPID(4096);
PMT.setTableId(2);
// section length met 2 tracks: 0xB017
int sectionLen = 0;
for (std::set<long unsigned int>::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){
for (std::set<size_t>::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){
std::string codec = M.getCodec(*it);
sectionLen += 5;
if (codec == "ID3" || codec == "RAW"){sectionLen += M.getInit(*it).size();}
@ -1394,7 +1394,7 @@ namespace TS{
PMT.setLastSectionNumber(0);
PMT.setContinuityCounter(contCounter);
int vidTrack = -1;
for (std::set<unsigned long>::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){
for (std::set<size_t>::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){
if (M.getType(*it) == "video"){
vidTrack = *it;
break;
@ -1404,7 +1404,7 @@ namespace TS{
PMT.setPCRPID(getUniqTrackID(M, vidTrack));
PMT.setProgramInfoLength(0);
ProgramMappingEntry entry = PMT.getEntry(0);
for (std::set<long unsigned int>::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){
for (std::set<size_t>::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){
std::string codec = M.getCodec(*it);
entry.setElementaryPid(getUniqTrackID(M, *it));
std::string es_info;

View file

@ -255,7 +255,7 @@ namespace TS{
size_t getUniqTrackID(const DTSC::Meta &M, size_t idx);
const char *createPMT(std::set<unsigned long> &selectedTracks, const DTSC::Meta &M, int contCounter = 0);
const char *createPMT(std::set<size_t> &selectedTracks, const DTSC::Meta &M, int contCounter = 0);
const char *createSDT(const std::string &streamName, int contCounter = 0);
}// namespace TS

View file

@ -635,7 +635,7 @@ namespace TS{
offset += pesPayload[offset] + 1;
}
if (realPayloadSize < offset+packSize){
WARN_MSG("Encountered invalid Opus frame (%zu > %zu) - discarding!", offset+packSize, realPayloadSize);
WARN_MSG("Encountered invalid Opus frame (%zu > %" PRIu64 ") - discarding!", offset+packSize, realPayloadSize);
break;
}
out.push_back(DTSC::Packet());
@ -783,7 +783,7 @@ namespace TS{
}
if (!packetReady){
ERROR_MSG("Track %lu: PES without valid packets?", tid);
ERROR_MSG("Track %zu: PES without valid packets?", tid);
return;
}
@ -955,7 +955,7 @@ namespace TS{
switch (it->second){
case H264:{
if (!spsInfo.count(it->first) || !ppsInfo.count(it->first)){
MEDIUM_MSG("Aborted meta fill for h264 track %lu: no SPS/PPS", it->first);
MEDIUM_MSG("Aborted meta fill for h264 track %zu: no SPS/PPS", it->first);
continue;
}
// First generate needed data
@ -984,7 +984,7 @@ namespace TS{
}break;
case H265:{
if (!hevcInfo.count(it->first) || !hevcInfo[it->first].haveRequired()){
MEDIUM_MSG("Aborted meta fill for hevc track %lu: no info nal unit", it->first);
MEDIUM_MSG("Aborted meta fill for hevc track %zu: no info nal unit", it->first);
continue;
}
addNewTrack = true;
@ -1123,7 +1123,7 @@ namespace TS{
entry.advance();
}
}
MEDIUM_MSG("Initialized track %lu as %s %s", idx, codec.c_str(), type.c_str());
MEDIUM_MSG("Initialized track %zu as %s %s", idx, codec.c_str(), type.c_str());
}
}