Replace more instances of rtc::RefCountedObject with make_ref_counted.
This is essentially replacing `new rtc::RefCountedObject` with
`rtc::make_ref_counted` in many files. In a couple of places I
made minor tweaks to make things compile such as adding parenthesis
when they were missing.
Bug: webrtc:12701
Change-Id: I3828dbf3ee0eb0232f3a47067474484ac2f4aed2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215973
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33852}
diff --git a/test/scenario/video_stream.cc b/test/scenario/video_stream.cc
index 5525a9d..709f0b7 100644
--- a/test/scenario/video_stream.cc
+++ b/test/scenario/video_stream.cc
@@ -175,8 +175,8 @@
vp9.automaticResizeOn = conf.single.automatic_scaling;
vp9.denoisingOn = conf.single.denoising;
}
- return new rtc::RefCountedObject<
- VideoEncoderConfig::Vp9EncoderSpecificSettings>(vp9);
+ return rtc::make_ref_counted<VideoEncoderConfig::Vp9EncoderSpecificSettings>(
+ vp9);
}
rtc::scoped_refptr<VideoEncoderConfig::EncoderSpecificSettings>
@@ -192,8 +192,8 @@
vp8_settings.automaticResizeOn = config.encoder.single.automatic_scaling;
vp8_settings.denoisingOn = config.encoder.single.denoising;
}
- return new rtc::RefCountedObject<
- VideoEncoderConfig::Vp8EncoderSpecificSettings>(vp8_settings);
+ return rtc::make_ref_counted<VideoEncoderConfig::Vp8EncoderSpecificSettings>(
+ vp8_settings);
}
rtc::scoped_refptr<VideoEncoderConfig::EncoderSpecificSettings>
@@ -205,8 +205,8 @@
h264_settings.frameDroppingOn = config.encoder.frame_dropping;
h264_settings.keyFrameInterval =
config.encoder.key_frame_interval.value_or(0);
- return new rtc::RefCountedObject<
- VideoEncoderConfig::H264EncoderSpecificSettings>(h264_settings);
+ return rtc::make_ref_counted<VideoEncoderConfig::H264EncoderSpecificSettings>(
+ h264_settings);
}
rtc::scoped_refptr<VideoEncoderConfig::EncoderSpecificSettings>
@@ -248,11 +248,11 @@
bool screenshare = config.encoder.content_type ==
VideoStreamConfig::Encoder::ContentType::kScreen;
encoder_config.video_stream_factory =
- new rtc::RefCountedObject<cricket::EncoderStreamFactory>(
+ rtc::make_ref_counted<cricket::EncoderStreamFactory>(
cricket_codec, kDefaultMaxQp, screenshare, screenshare);
} else {
encoder_config.video_stream_factory =
- new rtc::RefCountedObject<DefaultVideoStreamFactory>();
+ rtc::make_ref_counted<DefaultVideoStreamFactory>();
}
// TODO(srte): Base this on encoder capabilities.