Minor cleanup in media_session
- Avoid redundant get() when dereferencing smartpointers - Use const ref instead of copy for RtpExtension - Use `.empty()` instead of `.size() == 0` - Remove some unused using declarations Bug: None Change-Id: I0dfdc0dfdf165f153c9ba119c115cd492e9599fb Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/367100 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Björn Terelius <terelius@webrtc.org> Cr-Commit-Position: refs/heads/main@{#43334}
This commit is contained in:
parent
130bdcea7e
commit
fabe3a1173
@ -398,7 +398,7 @@ RTCError CreateContentOffer(
|
||||
// Build the vector of header extensions with directions for this
|
||||
// media_description's options.
|
||||
RtpHeaderExtensions extensions;
|
||||
for (auto extension_with_id : rtp_extensions) {
|
||||
for (const auto& extension_with_id : rtp_extensions) {
|
||||
for (const auto& extension : media_description_options.header_extensions) {
|
||||
if (extension_with_id.uri == extension.uri &&
|
||||
extension_with_id.encrypt == extension.preferred_encrypt) {
|
||||
@ -491,7 +491,7 @@ webrtc::RTCError AssignCodecIdsAndLinkRed(
|
||||
for (cricket::Codec& codec : codecs) {
|
||||
if (codec.type == Codec::Type::kAudio &&
|
||||
absl::EqualsIgnoreCase(codec.name, kRedCodecName)) {
|
||||
if (codec.params.size() == 0) {
|
||||
if (codec.params.empty()) {
|
||||
char buffer[100];
|
||||
rtc::SimpleStringBuilder param(buffer);
|
||||
param << opus_codec << "/" << opus_codec;
|
||||
@ -980,7 +980,7 @@ bool CreateMediaContentAnswer(
|
||||
|
||||
// Filter local extensions by capabilities and direction.
|
||||
RtpHeaderExtensions local_rtp_extensions_to_reply_with;
|
||||
for (auto extension_with_id : local_rtp_extensions) {
|
||||
for (const auto& extension_with_id : local_rtp_extensions) {
|
||||
for (const auto& extension : media_description_options.header_extensions) {
|
||||
if (extension_with_id.uri == extension.uri &&
|
||||
extension_with_id.encrypt == extension.preferred_encrypt) {
|
||||
@ -2186,8 +2186,8 @@ RTCError MediaSessionDescriptionFactory::AddRtpContentForAnswer(
|
||||
<< "' being rejected in answer.";
|
||||
}
|
||||
|
||||
auto error = AddTransportAnswer(media_description_options.mid,
|
||||
*(transport.get()), answer);
|
||||
auto error =
|
||||
AddTransportAnswer(media_description_options.mid, *transport, answer);
|
||||
if (!error.ok()) {
|
||||
return error;
|
||||
}
|
||||
@ -2263,7 +2263,7 @@ RTCError MediaSessionDescriptionFactory::AddDataContentForAnswer(
|
||||
!IsMediaProtocolSupported(MEDIA_TYPE_DATA,
|
||||
data_answer->protocol(), secure);
|
||||
auto error = AddTransportAnswer(media_description_options.mid,
|
||||
*(data_transport.get()), answer);
|
||||
*data_transport, answer);
|
||||
if (!error.ok()) {
|
||||
return error;
|
||||
}
|
||||
@ -2303,7 +2303,7 @@ RTCError MediaSessionDescriptionFactory::AddUnsupportedContentForAnswer(
|
||||
unsupported_answer->set_protocol(offer_unsupported_description->protocol());
|
||||
|
||||
auto error = AddTransportAnswer(media_description_options.mid,
|
||||
*(unsupported_transport.get()), answer);
|
||||
*unsupported_transport, answer);
|
||||
if (!error.ok()) {
|
||||
return error;
|
||||
}
|
||||
|
||||
@ -62,14 +62,11 @@ using ::rtc::UniqueRandomIdGenerator;
|
||||
using ::testing::Bool;
|
||||
using ::testing::Combine;
|
||||
using ::testing::Contains;
|
||||
using ::testing::Each;
|
||||
using ::testing::ElementsAre;
|
||||
using ::testing::ElementsAreArray;
|
||||
using ::testing::Eq;
|
||||
using ::testing::Field;
|
||||
using ::testing::IsEmpty;
|
||||
using ::testing::IsFalse;
|
||||
using ::testing::Ne;
|
||||
using ::testing::Not;
|
||||
using ::testing::Pointwise;
|
||||
using ::testing::SizeIs;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user