зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 2 changesets (bug 1628630) for build bustages at SdpAttribute.h. CLOSED TREE
Backed out changeset 5c05d978aa32 (bug 1628630) Backed out changeset bbd66b8940bb (bug 1628630)
This commit is contained in:
Родитель
0aaf3525b8
Коммит
094e7f1fa3
|
@ -5002,9 +5002,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "webrtc-sdp"
|
||||
version = "0.3.5"
|
||||
version = "0.3.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "33a041b38913afdc47ea2337fda2bcfdafd2928439422a601bc3bf3cff11a2ee"
|
||||
checksum = "bbedff74854f271e6e4c47d9fcbc8fbc254d6c153034ba9e0492121035c20cfe"
|
||||
dependencies = [
|
||||
"log",
|
||||
"url",
|
||||
|
|
|
@ -680,9 +680,6 @@ std::tuple<SdpRtpmapAttributeList::CodecType, FmtDefaults> strToCodecType(
|
|||
} else if (!nsCRT::strcasecmp(name.c_str(), "telephone-event")) {
|
||||
codec = SdpRtpmapAttributeList::kTelephoneEvent;
|
||||
defaults = {1};
|
||||
} else if (!nsCRT::strcasecmp(name.c_str(), "rtx")) {
|
||||
codec = SdpRtpmapAttributeList::kRtx;
|
||||
defaults = {0};
|
||||
}
|
||||
return std::make_tuple(codec, defaults);
|
||||
}
|
||||
|
@ -780,16 +777,11 @@ void RsdparsaSdpAttributeList::LoadFmtp(RustAttributeList* attributeList) {
|
|||
|
||||
fmtpParameters.reset(
|
||||
new SdpFmtpAttributeList::RedParameters(std::move(redParameters)));
|
||||
} else if (codecName == "RTX") {
|
||||
MOZ_ASSERT(rustFmtpParameters.rtx);
|
||||
rustFmtpParameters.rtx.apply([&](const auto& aRtx) {
|
||||
fmtpParameters.reset(
|
||||
new SdpFmtpAttributeList::RtxParameters(aRtx.apt, aRtx.rtx_time));
|
||||
});
|
||||
} else {
|
||||
// The parameter set is unknown so skip it
|
||||
continue;
|
||||
}
|
||||
|
||||
fmtpList->PushEntry(std::to_string(payloadType), std::move(fmtpParameters));
|
||||
}
|
||||
SetAttribute(fmtpList.release());
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
#define _RUSTSDPINC_H_
|
||||
|
||||
#include "nsError.h"
|
||||
#include "mozilla/Maybe.h"
|
||||
#include "signaling/src/sdp/RsdparsaSdpInc.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
@ -195,11 +193,6 @@ struct RustSdpAttributeImageAttr {
|
|||
RustSdpAttributeImageAttrSetList recv;
|
||||
};
|
||||
|
||||
struct RustRtxFmtpParameters {
|
||||
uint8_t apt;
|
||||
mozilla::Maybe<uint32_t> rtx_time;
|
||||
};
|
||||
|
||||
struct RustSdpAttributeFmtpParameters {
|
||||
// H264
|
||||
uint32_t packetization_mode;
|
||||
|
@ -225,9 +218,6 @@ struct RustSdpAttributeFmtpParameters {
|
|||
// telephone-event
|
||||
StringView dtmf_tones;
|
||||
|
||||
// RTX
|
||||
mozilla::Maybe<RustRtxFmtpParameters> rtx;
|
||||
|
||||
// Red codecs
|
||||
U8Vec* encodings;
|
||||
|
||||
|
|
|
@ -1046,7 +1046,6 @@ static bool ShouldSerializeChannels(SdpRtpmapAttributeList::CodecType type) {
|
|||
case SdpRtpmapAttributeList::kRed:
|
||||
case SdpRtpmapAttributeList::kUlpfec:
|
||||
case SdpRtpmapAttributeList::kTelephoneEvent:
|
||||
case SdpRtpmapAttributeList::kRtx:
|
||||
return false;
|
||||
case SdpRtpmapAttributeList::kOtherCodec:
|
||||
return true;
|
||||
|
|
|
@ -1071,7 +1071,6 @@ class SdpRtpmapAttributeList : public SdpAttribute {
|
|||
kRed,
|
||||
kUlpfec,
|
||||
kTelephoneEvent,
|
||||
kRtx,
|
||||
kOtherCodec
|
||||
};
|
||||
|
||||
|
@ -1154,9 +1153,6 @@ inline std::ostream& operator<<(std::ostream& os,
|
|||
case SdpRtpmapAttributeList::kTelephoneEvent:
|
||||
os << "telephone-event";
|
||||
break;
|
||||
case SdpRtpmapAttributeList::kRtx:
|
||||
os << "rtx";
|
||||
break;
|
||||
default:
|
||||
MOZ_ASSERT(false);
|
||||
os << "?";
|
||||
|
@ -1212,36 +1208,6 @@ class SdpFmtpAttributeList : public SdpAttribute {
|
|||
std::vector<uint8_t> encodings;
|
||||
};
|
||||
|
||||
class RtxParameters : public Parameters {
|
||||
public:
|
||||
uint8_t apt;
|
||||
Maybe<uint32_t> rtx_time;
|
||||
|
||||
RtxParameters(const uint8_t aApt, const Maybe<uint32_t>& aRtxTime)
|
||||
: Parameters(SdpRtpmapAttributeList::kRtx),
|
||||
apt(aApt),
|
||||
rtx_time(aRtxTime) {}
|
||||
|
||||
virtual ~RtxParameters() {}
|
||||
|
||||
virtual Parameters* Clone() const override {
|
||||
return new RtxParameters(*this);
|
||||
}
|
||||
|
||||
virtual void Serialize(std::ostream& os) const override {
|
||||
os << "apt=" << apt;
|
||||
rtx_time.apply([&](const auto& time) { os << ";rtx-time=" << time; });
|
||||
}
|
||||
|
||||
virtual bool CompareEq(const Parameters& aOther) const override {
|
||||
if (aOther.codec_type != codec_type) {
|
||||
return false;
|
||||
}
|
||||
auto other = static_cast<const RtxParameters&>(aOther);
|
||||
return other.apt = apt && other.rtx_time == rtx_time;
|
||||
}
|
||||
};
|
||||
|
||||
class H264Parameters : public Parameters {
|
||||
public:
|
||||
static const uint32_t kDefaultProfileLevelId = 0x420010;
|
||||
|
|
|
@ -7,5 +7,5 @@ authors = ["Paul Ellenbogen <pe5@cs.princeton.edu>",
|
|||
[dependencies]
|
||||
libc = "^0.2.0"
|
||||
log = "0.4"
|
||||
rsdparsa = {package = "webrtc-sdp", version = "0.3.5"}
|
||||
rsdparsa = {package = "webrtc-sdp", version = "0.3.4"}
|
||||
nserror = { path = "../../../../../../xpcom/rust/nserror" }
|
||||
|
|
|
@ -425,9 +425,6 @@ pub struct RustSdpAttributeFmtpParameters {
|
|||
// telephone-event
|
||||
pub dtmf_tones: StringView,
|
||||
|
||||
// RTX
|
||||
pub rtx: Option<RtxFmtpParameters>,
|
||||
|
||||
// Red
|
||||
pub encodings: *const Vec<u8>,
|
||||
|
||||
|
@ -453,7 +450,6 @@ impl<'a> From<&'a SdpAttributeFmtpParameters> for RustSdpAttributeFmtpParameters
|
|||
max_fr: other.max_fr,
|
||||
maxplaybackrate: other.maxplaybackrate,
|
||||
dtmf_tones: StringView::from(other.dtmf_tones.as_str()),
|
||||
rtx: other.rtx,
|
||||
encodings: &other.encodings,
|
||||
unknown_tokens: &other.unknown_tokens,
|
||||
}
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -1,7 +1,4 @@
|
|||
# Changelog
|
||||
## [0.3.5] - 2020-04-07
|
||||
### Fixed
|
||||
- RTX apt can now be zero
|
||||
## [0.3.4] - 2020-03-31
|
||||
### Fixed
|
||||
- Fixed new clippy warnings in stable
|
||||
|
|
|
@ -140,7 +140,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "webrtc-sdp"
|
||||
version = "0.3.5"
|
||||
version = "0.3.4"
|
||||
dependencies = [
|
||||
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
[package]
|
||||
name = "webrtc-sdp"
|
||||
version = "0.3.5"
|
||||
version = "0.3.4"
|
||||
authors = ["Nils Ohlmeier <github@ohlmeier.org>"]
|
||||
description = "This create parses strings in the format of the Session Description Protocol according to RFC4566. It specifically supports the subset of features required to support WebRTC according to the JSEP draft."
|
||||
readme = "README.md"
|
||||
|
|
|
@ -544,23 +544,6 @@ impl fmt::Display for SdpAttributeExtmap {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
#[cfg_attr(feature = "serialize", derive(Serialize))]
|
||||
pub struct RtxFmtpParameters {
|
||||
pub apt: u8,
|
||||
pub rtx_time: Option<u32>,
|
||||
}
|
||||
|
||||
impl fmt::Display for RtxFmtpParameters {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
if let Some(rtx_time) = self.rtx_time {
|
||||
write!(f, "apt={};rtx-time={}", self.apt, rtx_time)
|
||||
} else {
|
||||
write!(f, "apt={}", self.apt)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
#[cfg_attr(feature = "serialize", derive(Serialize))]
|
||||
pub struct SdpAttributeFmtpParameters {
|
||||
|
@ -594,8 +577,9 @@ pub struct SdpAttributeFmtpParameters {
|
|||
// telephone-event
|
||||
pub dtmf_tones: String,
|
||||
|
||||
// RTX
|
||||
pub rtx: Option<RtxFmtpParameters>,
|
||||
// Rtx
|
||||
pub apt: u8,
|
||||
pub rtx_time: u32,
|
||||
|
||||
// Unknown
|
||||
pub unknown_tokens: Vec<String>,
|
||||
|
@ -603,9 +587,6 @@ pub struct SdpAttributeFmtpParameters {
|
|||
|
||||
impl fmt::Display for SdpAttributeFmtpParameters {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
if let Some(ref rtx) = self.rtx {
|
||||
return write!(f, "{}", rtx);
|
||||
}
|
||||
write!(
|
||||
f,
|
||||
"{parameters}{red}{dtmf}{unknown}",
|
||||
|
@ -2001,7 +1982,8 @@ fn parse_fmtp(to_parse: &str) -> Result<SdpAttribute, SdpParserInternalError> {
|
|||
maxplaybackrate: 48000,
|
||||
encodings: Vec::new(),
|
||||
dtmf_tones: "".to_string(),
|
||||
rtx: None,
|
||||
apt: 0,
|
||||
rtx_time: 0,
|
||||
unknown_tokens: Vec::new(),
|
||||
};
|
||||
|
||||
|
@ -2082,21 +2064,8 @@ fn parse_fmtp(to_parse: &str) -> Result<SdpAttribute, SdpParserInternalError> {
|
|||
parameters.useinbandfec = parse_bool(parameter_val, "useinbandfec")?
|
||||
}
|
||||
"CBR" => parameters.cbr = parse_bool(parameter_val, "cbr")?,
|
||||
"APT" => {
|
||||
parameters.rtx = Some(RtxFmtpParameters {
|
||||
apt: parameter_val.parse::<u8>()?,
|
||||
rtx_time: None,
|
||||
})
|
||||
}
|
||||
"RTX-TIME" => {
|
||||
if let Some(ref mut rtx) = parameters.rtx {
|
||||
rtx.rtx_time = Some(parameter_val.parse::<u32>()?)
|
||||
} else {
|
||||
return Err(SdpParserInternalError::Generic(
|
||||
"RTX codec must have an APT field".to_string(),
|
||||
));
|
||||
}
|
||||
}
|
||||
"APT" => parameters.apt = parameter_val.parse::<u8>()?,
|
||||
"RTX-TIME" => parameters.rtx_time = parameter_val.parse::<u32>()?,
|
||||
_ => parameters
|
||||
.unknown_tokens
|
||||
.push((*parameter_token).to_string()),
|
||||
|
@ -3622,8 +3591,8 @@ mod tests {
|
|||
assert!(
|
||||
parse_attribute("fmtp:8 x-google-start-bitrate=800; maxplaybackrate=48000;").is_ok()
|
||||
);
|
||||
check_parse_and_serialize("fmtp:97 apt=96");
|
||||
check_parse_and_serialize("fmtp:97 apt=96;rtx-time=3000");
|
||||
assert!(parse_attribute("fmtp:97 apt=96").is_ok());
|
||||
assert!(parse_attribute("fmtp:97 apt=96;rtx-time=3000").is_ok());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -542,7 +542,8 @@ mod tests {
|
|||
maxplaybackrate: 48000,
|
||||
encodings: Vec::new(),
|
||||
dtmf_tones: "".to_string(),
|
||||
rtx: None,
|
||||
apt: 0,
|
||||
rtx_time: 0,
|
||||
unknown_tokens: Vec::new()
|
||||
}
|
||||
},))
|
||||
|
|
Загрузка…
Ссылка в новой задаче