提交 541651b3 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

s/mime/mimeType/g

上级 05086ce7
...@@ -2,16 +2,12 @@ ...@@ -2,16 +2,12 @@
* Instead of using `static_cast<size_t>(number)` use `size_t{ number }`. NOTE: Investigate it. * Instead of using `static_cast<size_t>(number)` use `size_t{ number }`. NOTE: Investigate it.
* In `RtpStreamSend::StorePacket()` we should remove old packets (as `NackGenerator` does).
* Remove `producer.on('rtprawpacket')` and, instead, create a special `RtpConsumer` or something like that. * Remove `producer.on('rtprawpacket')` and, instead, create a special `RtpConsumer` or something like that.
* Set a proper value for Producer::FullFrameRequestBlockTimeout (currently 1 second). * Set a proper value for Producer::FullFrameRequestBlockTimeout (currently 1 second).
* Check `appData` everywhere. * Check `appData` everywhere.
* Remove DEPTH stuff.
* Rethink the auto close of the worker `Transport` when receiving a DTLS CLOSE ALERT (or when it's just TCP and the connection fails...). Yes/no? BTW it's generating some issues because the JS closes the Producer/Transport and gets `request failed [id:84026423, reason:"Consumer/Transport does not exist"]` (because it was already closed due to DTLS ALERT). * Rethink the auto close of the worker `Transport` when receiving a DTLS CLOSE ALERT (or when it's just TCP and the connection fails...). Yes/no? BTW it's generating some issues because the JS closes the Producer/Transport and gets `request failed [id:84026423, reason:"Consumer/Transport does not exist"]` (because it was already closed due to DTLS ALERT).
* Implement `mandatoryCodecPayloadTypes`. * Implement `mandatoryCodecPayloadTypes`.
......
...@@ -18,8 +18,7 @@ namespace RTC ...@@ -18,8 +18,7 @@ namespace RTC
{ {
ALL = 0, ALL = 0,
AUDIO, AUDIO,
VIDEO, VIDEO
DEPTH
}; };
public: public:
...@@ -169,7 +168,7 @@ namespace RTC ...@@ -169,7 +168,7 @@ namespace RTC
void CheckCodec(); void CheckCodec();
public: public:
RtpCodecMimeType mime; RtpCodecMimeType mimeType;
uint8_t payloadType{ 0 }; uint8_t payloadType{ 0 };
uint32_t clockRate{ 0 }; uint32_t clockRate{ 0 };
uint32_t maxptime{ 0 }; uint32_t maxptime{ 0 };
......
...@@ -26,7 +26,7 @@ namespace RTC ...@@ -26,7 +26,7 @@ namespace RTC
uint32_t ssrc{ 0 }; uint32_t ssrc{ 0 };
uint8_t payloadType{ 0 }; uint8_t payloadType{ 0 };
RTC::RtpCodecMimeType mime; RTC::RtpCodecMimeType mimeType;
uint32_t clockRate{ 0 }; uint32_t clockRate{ 0 };
bool useNack{ false }; bool useNack{ false };
bool usePli{ false }; bool usePli{ false };
...@@ -96,7 +96,7 @@ namespace RTC ...@@ -96,7 +96,7 @@ namespace RTC
inline const RTC::RtpCodecMimeType& RtpStream::GetMimeType() const inline const RTC::RtpCodecMimeType& RtpStream::GetMimeType() const
{ {
return this->params.mime; return this->params.mimeType;
} }
inline bool RtpStream::IsHealthy() inline bool RtpStream::IsHealthy()
......
...@@ -608,7 +608,7 @@ namespace RTC ...@@ -608,7 +608,7 @@ namespace RTC
params.ssrc = ssrc; params.ssrc = ssrc;
params.payloadType = codec.payloadType; params.payloadType = codec.payloadType;
params.mime = codec.mime; params.mimeType = codec.mimeType;
params.clockRate = codec.clockRate; params.clockRate = codec.clockRate;
params.useNack = useNack; params.useNack = useNack;
params.usePli = usePli; params.usePli = usePli;
......
...@@ -582,7 +582,7 @@ namespace RTC ...@@ -582,7 +582,7 @@ namespace RTC
params.ssrc = ssrc; params.ssrc = ssrc;
params.payloadType = codec.payloadType; params.payloadType = codec.payloadType;
params.mime = codec.mime; params.mimeType = codec.mimeType;
params.clockRate = codec.clockRate; params.clockRate = codec.clockRate;
params.useNack = useNack; params.useNack = useNack;
params.usePli = usePli; params.usePli = usePli;
......
...@@ -15,15 +15,13 @@ namespace RTC ...@@ -15,15 +15,13 @@ namespace RTC
{ {
{ "", Media::Kind::ALL }, { "", Media::Kind::ALL },
{ "audio", Media::Kind::AUDIO }, { "audio", Media::Kind::AUDIO },
{ "video", Media::Kind::VIDEO }, { "video", Media::Kind::VIDEO }
{ "depth", Media::Kind::DEPTH }
}; };
std::map<Media::Kind, Json::StaticString> Media::kind2Json = std::map<Media::Kind, Json::StaticString> Media::kind2Json =
{ {
{ Media::Kind::ALL, Json::StaticString("") }, { Media::Kind::ALL, Json::StaticString("") },
{ Media::Kind::AUDIO, Json::StaticString("audio") }, { Media::Kind::AUDIO, Json::StaticString("audio") },
{ Media::Kind::VIDEO, Json::StaticString("video") }, { Media::Kind::VIDEO, Json::StaticString("video") }
{ Media::Kind::DEPTH, Json::StaticString("depth") }
}; };
// clang-format on // clang-format on
......
...@@ -33,7 +33,7 @@ namespace RTC ...@@ -33,7 +33,7 @@ namespace RTC
// Set MIME field. // Set MIME field.
// NOTE: This may throw. // NOTE: This may throw.
this->mime.SetMimeType(mimeType); this->mimeType.SetMimeType(mimeType);
if (!data[JsonStringPayloadType].isUInt()) if (!data[JsonStringPayloadType].isUInt())
MS_THROW_ERROR("missing RtpCodecParameters.payloadType"); MS_THROW_ERROR("missing RtpCodecParameters.payloadType");
...@@ -97,10 +97,10 @@ namespace RTC ...@@ -97,10 +97,10 @@ namespace RTC
Json::Value json(Json::objectValue); Json::Value json(Json::objectValue);
// Add mimeType. // Add mimeType.
json[JsonStringMimeType] = this->mime.ToString(); json[JsonStringMimeType] = this->mimeType.ToString();
// Add name. // Add name.
json[JsonStringName] = this->mime.GetName(); json[JsonStringName] = this->mimeType.GetName();
// Add payloadType. // Add payloadType.
json[JsonStringPayloadType] = Json::UInt{ this->payloadType }; json[JsonStringPayloadType] = Json::UInt{ this->payloadType };
...@@ -141,7 +141,7 @@ namespace RTC ...@@ -141,7 +141,7 @@ namespace RTC
static std::string jsonStringApt{ "apt" }; static std::string jsonStringApt{ "apt" };
// Check per MIME parameters and set default values. // Check per MIME parameters and set default values.
switch (this->mime.subtype) switch (this->mimeType.subtype)
{ {
case RTC::RtpCodecMimeType::Subtype::RTX: case RTC::RtpCodecMimeType::Subtype::RTX:
{ {
......
...@@ -185,7 +185,7 @@ namespace RTC ...@@ -185,7 +185,7 @@ namespace RTC
{ {
auto& codec = *it; auto& codec = *it;
if (codec.mime.IsFeatureCodec() && codec.parameters.GetInteger(AssociatedPayloadType) == payloadType) if (codec.mimeType.IsFeatureCodec() && codec.parameters.GetInteger(AssociatedPayloadType) == payloadType)
{ {
return codec; return codec;
} }
...@@ -209,7 +209,7 @@ namespace RTC ...@@ -209,7 +209,7 @@ namespace RTC
else else
payloadTypes.insert(codec.payloadType); payloadTypes.insert(codec.payloadType);
switch (codec.mime.subtype) switch (codec.mimeType.subtype)
{ {
// A RTX codec must have 'apt' parameter pointing to a non RTX codec. // A RTX codec must have 'apt' parameter pointing to a non RTX codec.
case RTC::RtpCodecMimeType::Subtype::RTX: case RTC::RtpCodecMimeType::Subtype::RTX:
...@@ -224,11 +224,11 @@ namespace RTC ...@@ -224,11 +224,11 @@ namespace RTC
if (static_cast<int32_t>(codec.payloadType) == apt) if (static_cast<int32_t>(codec.payloadType) == apt)
{ {
if (codec.mime.subtype == RTC::RtpCodecMimeType::Subtype::RTX) if (codec.mimeType.subtype == RTC::RtpCodecMimeType::Subtype::RTX)
MS_THROW_ERROR("apt in RTX codec points to a RTX codec"); MS_THROW_ERROR("apt in RTX codec points to a RTX codec");
else if (codec.mime.subtype == RTC::RtpCodecMimeType::Subtype::ULPFEC) else if (codec.mimeType.subtype == RTC::RtpCodecMimeType::Subtype::ULPFEC)
MS_THROW_ERROR("apt in RTX codec points to a ULPFEC codec"); MS_THROW_ERROR("apt in RTX codec points to a ULPFEC codec");
else if (codec.mime.subtype == RTC::RtpCodecMimeType::Subtype::FLEXFEC) else if (codec.mimeType.subtype == RTC::RtpCodecMimeType::Subtype::FLEXFEC)
MS_THROW_ERROR("apt in RTX codec points to a FLEXFEC codec"); MS_THROW_ERROR("apt in RTX codec points to a FLEXFEC codec");
else else
break; break;
...@@ -257,7 +257,7 @@ namespace RTC ...@@ -257,7 +257,7 @@ namespace RTC
auto& codec = *it; auto& codec = *it;
// Must be a media codec. // Must be a media codec.
if (codec.mime.IsMediaCodec()) if (codec.mimeType.IsMediaCodec())
{ {
firstMediaPayloadType = codec.payloadType; firstMediaPayloadType = codec.payloadType;
...@@ -288,7 +288,7 @@ namespace RTC ...@@ -288,7 +288,7 @@ namespace RTC
if (codec.payloadType == encoding.codecPayloadType) if (codec.payloadType == encoding.codecPayloadType)
{ {
// Must be a media codec. // Must be a media codec.
if (codec.mime.IsMediaCodec()) if (codec.mimeType.IsMediaCodec())
break; break;
MS_THROW_ERROR("invalid encoding.codecPayloadType"); MS_THROW_ERROR("invalid encoding.codecPayloadType");
......
...@@ -194,7 +194,7 @@ namespace RTC ...@@ -194,7 +194,7 @@ namespace RTC
static const Json::StaticString JsonStringSsrc{ "ssrc" }; static const Json::StaticString JsonStringSsrc{ "ssrc" };
static const Json::StaticString JsonStringPayloadType{ "payloadType" }; static const Json::StaticString JsonStringPayloadType{ "payloadType" };
static const Json::StaticString JsonStringMime{ "mime" }; static const Json::StaticString JsonStringMimeType{ "mimeType" };
static const Json::StaticString JsonStringClockRate{ "clockRate" }; static const Json::StaticString JsonStringClockRate{ "clockRate" };
static const Json::StaticString JsonStringUseNack{ "useNack" }; static const Json::StaticString JsonStringUseNack{ "useNack" };
static const Json::StaticString JsonStringUsePli{ "usePli" }; static const Json::StaticString JsonStringUsePli{ "usePli" };
...@@ -203,7 +203,7 @@ namespace RTC ...@@ -203,7 +203,7 @@ namespace RTC
json[JsonStringSsrc] = Json::UInt{ this->ssrc }; json[JsonStringSsrc] = Json::UInt{ this->ssrc };
json[JsonStringPayloadType] = Json::UInt{ this->payloadType }; json[JsonStringPayloadType] = Json::UInt{ this->payloadType };
json[JsonStringMime] = this->mime.ToString(); json[JsonStringMimeType] = this->mimeType.ToString();
json[JsonStringClockRate] = Json::UInt{ this->clockRate }; json[JsonStringClockRate] = Json::UInt{ this->clockRate };
json[JsonStringUseNack] = this->useNack; json[JsonStringUseNack] = this->useNack;
json[JsonStringUsePli] = this->usePli; json[JsonStringUsePli] = this->usePli;
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论