Format /media folder

Formatting done via:

git ls-files | grep -E '^media\/.*\.(h|cc|mm)' | xargs clang-format -i

No-Iwyu: Includes didn't change and it isn't related to formatting
Bug: webrtc:42225392
Change-Id: I7c79f10d8ac2c2e3a9f796d2ca3c542b9826683c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/373701
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43685}
This commit is contained in:
Boris Tsirkin 2025-01-07 23:37:21 -08:00 committed by WebRTC LUCI CQ
parent d4937d3336
commit 256d828aac
6 changed files with 31 additions and 40 deletions

View File

@ -35,10 +35,6 @@
#include "rtc_base/strings/string_builder.h" #include "rtc_base/strings/string_builder.h"
namespace cricket { namespace cricket {
namespace {
} // namespace
FeedbackParams::FeedbackParams() = default; FeedbackParams::FeedbackParams() = default;
FeedbackParams::~FeedbackParams() = default; FeedbackParams::~FeedbackParams() = default;

View File

@ -148,7 +148,6 @@ TEST(CodecTest, TestVideoCodecEqualsWithDifferentPacketization) {
EXPECT_EQ(c2, c2); EXPECT_EQ(c2, c2);
} }
TEST(CodecTest, TestSetParamGetParamAndRemoveParam) { TEST(CodecTest, TestSetParamGetParamAndRemoveParam) {
Codec codec = cricket::CreateAudioCodec(0, "foo", 22222, 2); Codec codec = cricket::CreateAudioCodec(0, "foo", 22222, 2);
codec.SetParam("a", "1"); codec.SetParam("a", "1");

View File

@ -201,29 +201,29 @@ bool MediaChannelUtil::TransportForMediaChannels::SendRtcp(
bool MediaChannelUtil::TransportForMediaChannels::SendRtp( bool MediaChannelUtil::TransportForMediaChannels::SendRtp(
rtc::ArrayView<const uint8_t> packet, rtc::ArrayView<const uint8_t> packet,
const webrtc::PacketOptions& options) { const webrtc::PacketOptions& options) {
auto send = auto send = [this, packet_id = options.packet_id,
[this, packet_id = options.packet_id, included_in_feedback = options.included_in_feedback,
included_in_feedback = options.included_in_feedback, included_in_allocation = options.included_in_allocation,
included_in_allocation = options.included_in_allocation, batchable = options.batchable,
batchable = options.batchable, last_packet_in_batch = options.last_packet_in_batch,
last_packet_in_batch = options.last_packet_in_batch, is_media = options.is_media, ect_1 = options.send_as_ect1,
is_media = options.is_media, ect_1 = options.send_as_ect1, packet =
packet = rtc::CopyOnWriteBuffer(packet, kMaxRtpPacketLen)]() mutable { rtc::CopyOnWriteBuffer(packet, kMaxRtpPacketLen)]() mutable {
rtc::PacketOptions rtc_options; rtc::PacketOptions rtc_options;
rtc_options.packet_id = packet_id; rtc_options.packet_id = packet_id;
if (DscpEnabled()) { if (DscpEnabled()) {
rtc_options.dscp = PreferredDscp(); rtc_options.dscp = PreferredDscp();
} }
rtc_options.info_signaled_after_sent.included_in_feedback = rtc_options.info_signaled_after_sent.included_in_feedback =
included_in_feedback; included_in_feedback;
rtc_options.info_signaled_after_sent.included_in_allocation = rtc_options.info_signaled_after_sent.included_in_allocation =
included_in_allocation; included_in_allocation;
rtc_options.info_signaled_after_sent.is_media = is_media; rtc_options.info_signaled_after_sent.is_media = is_media;
rtc_options.ecn_1 = ect_1; rtc_options.ecn_1 = ect_1;
rtc_options.batchable = batchable; rtc_options.batchable = batchable;
rtc_options.last_packet_in_batch = last_packet_in_batch; rtc_options.last_packet_in_batch = last_packet_in_batch;
DoSendPacket(&packet, false, rtc_options); DoSendPacket(&packet, false, rtc_options);
}; };
// TODO(bugs.webrtc.org/11993): ModuleRtpRtcpImpl2 and related classes (e.g. // TODO(bugs.webrtc.org/11993): ModuleRtpRtcpImpl2 and related classes (e.g.
// RTCPSender) aren't aware of the network thread and may trigger calls to // RTCPSender) aren't aware of the network thread and may trigger calls to

View File

@ -230,9 +230,8 @@ bool VideoAdapter::AdaptFrameResolution(int in_width,
*cropped_height = *cropped_height =
std::min(in_height, static_cast<int>(in_width / requested_aspect)); std::min(in_height, static_cast<int>(in_width / requested_aspect));
} }
const Fraction scale = const Fraction scale = FindScale(*cropped_width, *cropped_height,
FindScale(*cropped_width, *cropped_height, target_pixel_count, target_pixel_count, max_pixel_count);
max_pixel_count);
// Adjust cropping slightly to get correctly aligned output size and a perfect // Adjust cropping slightly to get correctly aligned output size and a perfect
// scale factor. // scale factor.
*cropped_width = roundUp(*cropped_width, *cropped_width = roundUp(*cropped_width,

View File

@ -62,8 +62,7 @@ bool FakeWebRtcVideoDecoder::Configure(const Settings& /* settings */) {
return true; return true;
} }
int32_t FakeWebRtcVideoDecoder::Decode(const webrtc::EncodedImage&, int32_t FakeWebRtcVideoDecoder::Decode(const webrtc::EncodedImage&, int64_t) {
int64_t) {
num_frames_received_++; num_frames_received_++;
return WEBRTC_VIDEO_CODEC_OK; return WEBRTC_VIDEO_CODEC_OK;
} }

View File

@ -833,7 +833,6 @@ webrtc::AudioState* WebRtcVoiceEngine::audio_state() {
return audio_state_.get(); return audio_state_.get();
} }
// --------------------------------- WebRtcVoiceSendChannel ------------------ // --------------------------------- WebRtcVoiceSendChannel ------------------
class WebRtcVoiceSendChannel::WebRtcAudioSendStream : public AudioSource::Sink { class WebRtcVoiceSendChannel::WebRtcAudioSendStream : public AudioSource::Sink {
@ -1931,7 +1930,7 @@ webrtc::RTCError WebRtcVoiceSendChannel::SetRtpSendParameters(
if (parameters.encodings[0].codec && send_codec && if (parameters.encodings[0].codec && send_codec &&
!send_codec->MatchesRtpCodec(*parameters.encodings[0].codec)) { !send_codec->MatchesRtpCodec(*parameters.encodings[0].codec)) {
RTC_LOG(LS_VERBOSE) << "Trying to change codec to " RTC_LOG(LS_VERBOSE) << "Trying to change codec to "
<< parameters.encodings[0].codec->name; << parameters.encodings[0].codec->name;
auto matched_codec = auto matched_codec =
absl::c_find_if(send_codecs_, [&](auto negotiated_codec) { absl::c_find_if(send_codecs_, [&](auto negotiated_codec) {
return negotiated_codec.MatchesRtpCodec( return negotiated_codec.MatchesRtpCodec(
@ -2729,11 +2728,10 @@ bool WebRtcVoiceReceiveChannel::GetStats(VoiceMediaReceiveInfo* info,
void WebRtcVoiceReceiveChannel::FillReceiveCodecStats( void WebRtcVoiceReceiveChannel::FillReceiveCodecStats(
VoiceMediaReceiveInfo* voice_media_info) { VoiceMediaReceiveInfo* voice_media_info) {
for (const auto& receiver : voice_media_info->receivers) { for (const auto& receiver : voice_media_info->receivers) {
auto codec = auto codec = absl::c_find_if(recv_codecs_, [&receiver](const Codec& c) {
absl::c_find_if(recv_codecs_, [&receiver](const Codec& c) { return receiver.codec_payload_type &&
return receiver.codec_payload_type && *receiver.codec_payload_type == c.id;
*receiver.codec_payload_type == c.id; });
});
if (codec != recv_codecs_.end()) { if (codec != recv_codecs_.end()) {
voice_media_info->receive_codecs.insert( voice_media_info->receive_codecs.insert(
std::make_pair(codec->id, codec->ToCodecParameters())); std::make_pair(codec->id, codec->ToCodecParameters()));