提交 a1d9bb95 authored 作者: José Luis Millán's avatar José Luis Millán

Style

上级 7632afac
...@@ -10,8 +10,8 @@ namespace RTC ...@@ -10,8 +10,8 @@ namespace RTC
{ {
namespace Codecs namespace Codecs
{ {
bool isKnown(const RTC::RtpCodecMimeType& mimeType); bool IsKnown(const RTC::RtpCodecMimeType& mimeType);
bool isKeyFrame(const RTC::RtpCodecMimeType& mimeType, const RTC::RtpPacket* packet); bool IsKeyFrame(const RTC::RtpCodecMimeType& mimeType, const RTC::RtpPacket* packet);
} // namespace Codecs } // namespace Codecs
} // namespace RTC } // namespace RTC
......
...@@ -10,7 +10,7 @@ namespace RTC ...@@ -10,7 +10,7 @@ namespace RTC
class VP8 class VP8
{ {
public: public:
static bool isKeyFrame(const uint8_t* data, size_t len); static bool IsKeyFrame(const uint8_t* data, size_t len);
}; };
} // namespace Codecs } // namespace Codecs
} // namespace RTC } // namespace RTC
......
...@@ -9,7 +9,7 @@ namespace RTC ...@@ -9,7 +9,7 @@ namespace RTC
{ {
namespace Codecs namespace Codecs
{ {
bool isKnown(const RTC::RtpCodecMimeType& mimeType) bool IsKnown(const RTC::RtpCodecMimeType& mimeType)
{ {
MS_TRACE(); MS_TRACE();
...@@ -25,11 +25,11 @@ namespace RTC ...@@ -25,11 +25,11 @@ namespace RTC
} }
} }
bool isKeyFrame(const RTC::RtpCodecMimeType& mimeType, const RTC::RtpPacket* packet) bool IsKeyFrame(const RTC::RtpCodecMimeType& mimeType, const RTC::RtpPacket* packet)
{ {
MS_TRACE(); MS_TRACE();
if (!isKnown(mimeType)) if (!IsKnown(mimeType))
return false; return false;
auto data = packet->GetPayload(); auto data = packet->GetPayload();
...@@ -38,7 +38,7 @@ namespace RTC ...@@ -38,7 +38,7 @@ namespace RTC
switch (mimeType.subtype) switch (mimeType.subtype)
{ {
case RTC::RtpCodecMimeType::Subtype::VP8: case RTC::RtpCodecMimeType::Subtype::VP8:
return VP8::isKeyFrame(data, len); return VP8::IsKeyFrame(data, len);
default: default:
MS_DEBUG_TAG( MS_DEBUG_TAG(
......
...@@ -9,7 +9,7 @@ namespace RTC ...@@ -9,7 +9,7 @@ namespace RTC
{ {
namespace Codecs namespace Codecs
{ {
bool VP8::isKeyFrame(const uint8_t* data, size_t len) bool VP8::IsKeyFrame(const uint8_t* data, size_t len)
{ {
if (len < 1) if (len < 1)
return false; return false;
......
...@@ -175,10 +175,8 @@ namespace RTC ...@@ -175,10 +175,8 @@ namespace RTC
MS_DEBUG_DEV("Consumer resumed [consumerId:%" PRIu32 "]", this->consumerId); MS_DEBUG_DEV("Consumer resumed [consumerId:%" PRIu32 "]", this->consumerId);
if (IsEnabled() && !this->sourcePaused) if (IsEnabled() && !this->sourcePaused)
{
RequestFullFrame(); RequestFullFrame();
} }
}
void Consumer::SourcePause() void Consumer::SourcePause()
{ {
...@@ -239,7 +237,6 @@ namespace RTC ...@@ -239,7 +237,6 @@ namespace RTC
MS_DEBUG_TAG( MS_DEBUG_TAG(
rtp, "profile added [profile:%s]", RTC::RtpEncodingParameters::profile2String[profile].c_str()); rtp, "profile added [profile:%s]", RTC::RtpEncodingParameters::profile2String[profile].c_str());
;
RecalculateTargetProfile(); RecalculateTargetProfile();
} }
...@@ -260,7 +257,6 @@ namespace RTC ...@@ -260,7 +257,6 @@ namespace RTC
rtp, rtp,
"profile removed [profile:%s]", "profile removed [profile:%s]",
RTC::RtpEncodingParameters::profile2String[profile].c_str()); RTC::RtpEncodingParameters::profile2String[profile].c_str());
;
RecalculateTargetProfile(); RecalculateTargetProfile();
} }
...@@ -278,7 +274,6 @@ namespace RTC ...@@ -278,7 +274,6 @@ namespace RTC
rtp, rtp,
"preferred profile set [profile:%s]", "preferred profile set [profile:%s]",
RTC::RtpEncodingParameters::profile2String[profile].c_str()); RTC::RtpEncodingParameters::profile2String[profile].c_str());
;
RecalculateTargetProfile(); RecalculateTargetProfile();
} }
...@@ -339,8 +334,8 @@ namespace RTC ...@@ -339,8 +334,8 @@ namespace RTC
{ {
bool isKeyFrame = false; bool isKeyFrame = false;
if (Codecs::isKnown(this->rtpStream->GetMymeType()) && if (Codecs::IsKnown(this->rtpStream->GetMymeType()) &&
Codecs::isKeyFrame(this->rtpStream->GetMymeType(), packet)) Codecs::IsKeyFrame(this->rtpStream->GetMymeType(), packet))
{ {
isKeyFrame = true; isKeyFrame = true;
...@@ -348,7 +343,7 @@ namespace RTC ...@@ -348,7 +343,7 @@ namespace RTC
RTC::RtpEncodingParameters::profile2String[profile].c_str()); RTC::RtpEncodingParameters::profile2String[profile].c_str());
} }
if (!Codecs::isKnown(this->rtpStream->GetMymeType()) || isKeyFrame ) if (!Codecs::IsKnown(this->rtpStream->GetMymeType()) || isKeyFrame )
{ {
SetEffectiveProfile(this->targetProfile); SetEffectiveProfile(this->targetProfile);
...@@ -357,9 +352,6 @@ namespace RTC ...@@ -357,9 +352,6 @@ namespace RTC
// Resynchronize the stream. // Resynchronize the stream.
this->syncRequired = true; this->syncRequired = true;
// Calculate the new target profile.
RecalculateTargetProfile();
} }
} }
...@@ -696,13 +688,10 @@ namespace RTC ...@@ -696,13 +688,10 @@ namespace RTC
rtp, rtp,
"target profile set [profile:%s]", "target profile set [profile:%s]",
RTC::RtpEncodingParameters::profile2String[this->targetProfile].c_str()); RTC::RtpEncodingParameters::profile2String[this->targetProfile].c_str());
;
if (IsEnabled() && !IsPaused()) if (IsEnabled() && !IsPaused())
{
RequestFullFrame(); RequestFullFrame();
} }
}
void Consumer::SetEffectiveProfile(RTC::RtpEncodingParameters::Profile profile) void Consumer::SetEffectiveProfile(RTC::RtpEncodingParameters::Profile profile)
{ {
...@@ -718,7 +707,6 @@ namespace RTC ...@@ -718,7 +707,6 @@ namespace RTC
rtp, rtp,
"effective profile set [profile:%s]", "effective profile set [profile:%s]",
RTC::RtpEncodingParameters::profile2String[this->effectiveProfile].c_str()); RTC::RtpEncodingParameters::profile2String[this->effectiveProfile].c_str());
;
// Notify. // Notify.
eventData[JsonStringProfile] = RTC::RtpEncodingParameters::profile2String[this->effectiveProfile]; eventData[JsonStringProfile] = RTC::RtpEncodingParameters::profile2String[this->effectiveProfile];
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论