mirror of
https://github.com/mii443/libdatachannel.git
synced 2025-08-22 23:25:33 +00:00
Re-Formatting to use spaces
This commit is contained in:
@ -183,8 +183,8 @@ public:
|
||||
public:
|
||||
void addRTPMap(const RTPMap &map);
|
||||
|
||||
void removeSSRC(uint32_t oldSSRC);
|
||||
};
|
||||
void removeSSRC(uint32_t oldSSRC);
|
||||
};
|
||||
|
||||
class RTC_CPP_EXPORT Audio : public Media {
|
||||
public:
|
||||
@ -193,16 +193,16 @@ public:
|
||||
void addAudioCodec(int payloadType, const string &codec, const std::optional<std::string>& profile=
|
||||
"minptime=10; maxaveragebitrate=96000; stereo=1; sprop-stereo=1; useinbandfec=1");
|
||||
void addOpusCodec(int payloadType);
|
||||
};
|
||||
};
|
||||
|
||||
class RTC_CPP_EXPORT Video : public Media {
|
||||
public:
|
||||
Video(string mid = "video", Direction dir = Direction::SendOnly);
|
||||
|
||||
// Use Constrained Baseline profile Level 4.2 (necessary for Firefox)
|
||||
// https://developer.mozilla.org/en-US/docs/Web/Media/Formats/WebRTC_codecs#Supported_video_codecs
|
||||
// TODO: Should be 42E0 but 42C0 appears to be more compatible. Investigate this.
|
||||
void addVideoCodec(int payloadType, const string &codec, const std::optional<std::string>&
|
||||
// Use Constrained Baseline profile Level 4.2 (necessary for Firefox)
|
||||
// https://developer.mozilla.org/en-US/docs/Web/Media/Formats/WebRTC_codecs#Supported_video_codecs
|
||||
// TODO: Should be 42E0 but 42C0 appears to be more compatible. Investigate this.
|
||||
void addVideoCodec(int payloadType, const string &codec, const std::optional<std::string>&
|
||||
profile="profile-level-id=42e01f;packetization-mode=1;level-asymmetry-allowed=1");
|
||||
|
||||
void addH264Codec(int payloadType);
|
||||
|
@ -520,26 +520,26 @@ Description::Entry::removeAttribute(std::vector<string>::iterator it) {
|
||||
}
|
||||
|
||||
void Description::Media::addSSRC(uint32_t ssrc, std::optional<std::string> name, std::optional<std::string> msid) {
|
||||
if (name)
|
||||
mAttributes.emplace_back("ssrc:" + std::to_string(ssrc) + " cname:" + *name);
|
||||
else
|
||||
mAttributes.emplace_back("ssrc:" + std::to_string(ssrc));
|
||||
if (name)
|
||||
mAttributes.emplace_back("ssrc:" + std::to_string(ssrc) + " cname:" + *name);
|
||||
else
|
||||
mAttributes.emplace_back("ssrc:" + std::to_string(ssrc));
|
||||
|
||||
if (msid)
|
||||
mAttributes.emplace_back("ssrc:" + std::to_string(ssrc) + " msid:" + *msid + " " + *msid);
|
||||
if (msid)
|
||||
mAttributes.emplace_back("ssrc:" + std::to_string(ssrc) + " msid:" + *msid + " " + *msid);
|
||||
|
||||
mSsrcs.emplace_back(ssrc);
|
||||
}
|
||||
|
||||
void Description::Media::replaceSSRC(uint32_t oldSSRC, uint32_t ssrc, std::optional<std::string> name, std::optional<std::string> msid) {
|
||||
auto it = mAttributes.begin();
|
||||
while (it != mAttributes.end()) {
|
||||
if (it->find("ssrc:" + std::to_string(oldSSRC)) == 0) {
|
||||
it = mAttributes.erase(it);
|
||||
} else
|
||||
it++;
|
||||
}
|
||||
addSSRC(ssrc, std::move(name), std::move(msid));
|
||||
auto it = mAttributes.begin();
|
||||
while (it != mAttributes.end()) {
|
||||
if (it->find("ssrc:" + std::to_string(oldSSRC)) == 0) {
|
||||
it = mAttributes.erase(it);
|
||||
} else
|
||||
it++;
|
||||
}
|
||||
addSSRC(ssrc, std::move(name), std::move(msid));
|
||||
}
|
||||
|
||||
void Description::Media::removeSSRC(uint32_t oldSSRC) {
|
||||
@ -735,7 +735,6 @@ void Description::Audio::addAudioCodec(int payloadType, const string &codec, con
|
||||
}
|
||||
|
||||
void Description::Media::addRTXCodec(unsigned int payloadType, unsigned int originalPayloadType, unsigned int clockRate) {
|
||||
// TODO This 48000/2 should be parameterized
|
||||
RTPMap map(std::to_string(payloadType) + " RTX/" + std::to_string(clockRate));
|
||||
map.fmtps.emplace_back("apt=" + std::to_string(originalPayloadType));
|
||||
addRTPMap(map);
|
||||
|
Reference in New Issue
Block a user