Use std::make_unique instead of absl::make_unique.
WebRTC is now using C++14 so there is no need to use the Abseil version of std::make_unique. This CL has been created with the following steps: git grep -l absl::make_unique | sort | uniq > /tmp/make_unique.txt git grep -l absl::WrapUnique | sort | uniq > /tmp/wrap_unique.txt git grep -l "#include <memory>" | sort | uniq > /tmp/memory.txt diff --new-line-format="" --unchanged-line-format="" \ /tmp/make_unique.txt /tmp/wrap_unique.txt | sort | \ uniq > /tmp/only_make_unique.txt diff --new-line-format="" --unchanged-line-format="" \ /tmp/only_make_unique.txt /tmp/memory.txt | \ xargs grep -l "absl/memory" > /tmp/add-memory.txt git grep -l "\babsl::make_unique\b" | \ xargs sed -i "s/\babsl::make_unique\b/std::make_unique/g" git checkout PRESUBMIT.py abseil-in-webrtc.md cat /tmp/add-memory.txt | \ xargs sed -i \ 's/#include "absl\/memory\/memory.h"/#include <memory>/g' git cl format # Manual fix order of the new inserted #include <memory> cat /tmp/only_make_unique | xargs grep -l "#include <memory>" | \ xargs sed -i '/#include "absl\/memory\/memory.h"/d' git ls-files | grep BUILD.gn | \ xargs sed -i '/\/\/third_party\/abseil-cpp\/absl\/memory/d' python tools_webrtc/gn_check_autofix.py \ -m tryserver.webrtc -b linux_rel # Repead the gn_check_autofix step for other platforms git ls-files | grep BUILD.gn | \ xargs sed -i 's/absl\/memory:memory/absl\/memory/g' git cl format Bug: webrtc:10945 Change-Id: I3fe28ea80f4dd3ba3cf28effd151d5e1f19aff89 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153221 Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29209}
This commit is contained in:
committed by
Commit Bot
parent
809198edff
commit
317a1f09ed
@ -20,7 +20,6 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "absl/types/optional.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/video/video_bitrate_allocation.h"
|
||||
@ -379,8 +378,8 @@ class VideoCodecTestFixtureImpl::CpuProcessTime final {
|
||||
};
|
||||
|
||||
VideoCodecTestFixtureImpl::VideoCodecTestFixtureImpl(Config config)
|
||||
: encoder_factory_(absl::make_unique<InternalEncoderFactory>()),
|
||||
decoder_factory_(absl::make_unique<InternalDecoderFactory>()),
|
||||
: encoder_factory_(std::make_unique<InternalEncoderFactory>()),
|
||||
decoder_factory_(std::make_unique<InternalDecoderFactory>()),
|
||||
config_(config) {}
|
||||
|
||||
VideoCodecTestFixtureImpl::VideoCodecTestFixtureImpl(
|
||||
@ -689,7 +688,7 @@ void VideoCodecTestFixtureImpl::SetUpAndInitObjects(
|
||||
|
||||
task_queue->SendTask([this]() {
|
||||
CreateEncoderAndDecoder();
|
||||
processor_ = absl::make_unique<VideoProcessor>(
|
||||
processor_ = std::make_unique<VideoProcessor>(
|
||||
encoder_.get(), &decoders_, source_frame_reader_.get(), config_,
|
||||
&stats_, &encoded_frame_writers_,
|
||||
decoded_frame_writers_.empty() ? nullptr : &decoded_frame_writers_);
|
||||
|
||||
@ -8,9 +8,9 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/test/create_videocodec_test_fixture.h"
|
||||
#include "api/test/video/function_video_encoder_factory.h"
|
||||
#include "api/video_codecs/sdp_video_format.h"
|
||||
@ -94,7 +94,7 @@ TEST(VideoCodecTestLibvpx, HighBitrateVP9) {
|
||||
config.SetCodecSettings(cricket::kVp9CodecName, 1, 1, 1, false, true, false,
|
||||
kCifWidth, kCifHeight);
|
||||
config.num_frames = kNumFramesShort;
|
||||
const auto frame_checker = absl::make_unique<QpFrameChecker>();
|
||||
const auto frame_checker = std::make_unique<QpFrameChecker>();
|
||||
config.encoded_frame_checker = frame_checker.get();
|
||||
auto fixture = CreateVideoCodecTestFixture(config);
|
||||
|
||||
@ -112,7 +112,7 @@ TEST(VideoCodecTestLibvpx, ChangeBitrateVP9) {
|
||||
auto config = CreateConfig();
|
||||
config.SetCodecSettings(cricket::kVp9CodecName, 1, 1, 1, false, true, false,
|
||||
kCifWidth, kCifHeight);
|
||||
const auto frame_checker = absl::make_unique<QpFrameChecker>();
|
||||
const auto frame_checker = std::make_unique<QpFrameChecker>();
|
||||
config.encoded_frame_checker = frame_checker.get();
|
||||
auto fixture = CreateVideoCodecTestFixture(config);
|
||||
|
||||
@ -136,7 +136,7 @@ TEST(VideoCodecTestLibvpx, ChangeFramerateVP9) {
|
||||
auto config = CreateConfig();
|
||||
config.SetCodecSettings(cricket::kVp9CodecName, 1, 1, 1, false, true, false,
|
||||
kCifWidth, kCifHeight);
|
||||
const auto frame_checker = absl::make_unique<QpFrameChecker>();
|
||||
const auto frame_checker = std::make_unique<QpFrameChecker>();
|
||||
config.encoded_frame_checker = frame_checker.get();
|
||||
auto fixture = CreateVideoCodecTestFixture(config);
|
||||
|
||||
@ -163,7 +163,7 @@ TEST(VideoCodecTestLibvpx, DenoiserOnVP9) {
|
||||
config.SetCodecSettings(cricket::kVp9CodecName, 1, 1, 1, true, true, false,
|
||||
kCifWidth, kCifHeight);
|
||||
config.num_frames = kNumFramesShort;
|
||||
const auto frame_checker = absl::make_unique<QpFrameChecker>();
|
||||
const auto frame_checker = std::make_unique<QpFrameChecker>();
|
||||
config.encoded_frame_checker = frame_checker.get();
|
||||
auto fixture = CreateVideoCodecTestFixture(config);
|
||||
|
||||
@ -181,7 +181,7 @@ TEST(VideoCodecTestLibvpx, VeryLowBitrateVP9) {
|
||||
auto config = CreateConfig();
|
||||
config.SetCodecSettings(cricket::kVp9CodecName, 1, 1, 1, false, true, true,
|
||||
kCifWidth, kCifHeight);
|
||||
const auto frame_checker = absl::make_unique<QpFrameChecker>();
|
||||
const auto frame_checker = std::make_unique<QpFrameChecker>();
|
||||
config.encoded_frame_checker = frame_checker.get();
|
||||
auto fixture = CreateVideoCodecTestFixture(config);
|
||||
|
||||
@ -205,7 +205,7 @@ TEST(VideoCodecTestLibvpx, HighBitrateVP8) {
|
||||
config.SetCodecSettings(cricket::kVp8CodecName, 1, 1, 1, true, true, false,
|
||||
kCifWidth, kCifHeight);
|
||||
config.num_frames = kNumFramesShort;
|
||||
const auto frame_checker = absl::make_unique<QpFrameChecker>();
|
||||
const auto frame_checker = std::make_unique<QpFrameChecker>();
|
||||
config.encoded_frame_checker = frame_checker.get();
|
||||
auto fixture = CreateVideoCodecTestFixture(config);
|
||||
|
||||
@ -241,7 +241,7 @@ TEST(VideoCodecTestLibvpx, MAYBE_ChangeBitrateVP8) {
|
||||
auto config = CreateConfig();
|
||||
config.SetCodecSettings(cricket::kVp8CodecName, 1, 1, 1, true, true, false,
|
||||
kCifWidth, kCifHeight);
|
||||
const auto frame_checker = absl::make_unique<QpFrameChecker>();
|
||||
const auto frame_checker = std::make_unique<QpFrameChecker>();
|
||||
config.encoded_frame_checker = frame_checker.get();
|
||||
auto fixture = CreateVideoCodecTestFixture(config);
|
||||
|
||||
@ -275,7 +275,7 @@ TEST(VideoCodecTestLibvpx, MAYBE_ChangeFramerateVP8) {
|
||||
auto config = CreateConfig();
|
||||
config.SetCodecSettings(cricket::kVp8CodecName, 1, 1, 1, true, true, false,
|
||||
kCifWidth, kCifHeight);
|
||||
const auto frame_checker = absl::make_unique<QpFrameChecker>();
|
||||
const auto frame_checker = std::make_unique<QpFrameChecker>();
|
||||
config.encoded_frame_checker = frame_checker.get();
|
||||
auto fixture = CreateVideoCodecTestFixture(config);
|
||||
|
||||
@ -315,7 +315,7 @@ TEST(VideoCodecTestLibvpx, MAYBE_TemporalLayersVP8) {
|
||||
auto config = CreateConfig();
|
||||
config.SetCodecSettings(cricket::kVp8CodecName, 1, 1, 3, true, true, false,
|
||||
kCifWidth, kCifHeight);
|
||||
const auto frame_checker = absl::make_unique<QpFrameChecker>();
|
||||
const auto frame_checker = std::make_unique<QpFrameChecker>();
|
||||
config.encoded_frame_checker = frame_checker.get();
|
||||
auto fixture = CreateVideoCodecTestFixture(config);
|
||||
|
||||
@ -351,7 +351,7 @@ TEST(VideoCodecTestLibvpx, MAYBE_MultiresVP8) {
|
||||
config.num_frames = 100;
|
||||
config.SetCodecSettings(cricket::kVp8CodecName, 3, 1, 3, true, true, false,
|
||||
1280, 720);
|
||||
const auto frame_checker = absl::make_unique<QpFrameChecker>();
|
||||
const auto frame_checker = std::make_unique<QpFrameChecker>();
|
||||
config.encoded_frame_checker = frame_checker.get();
|
||||
auto fixture = CreateVideoCodecTestFixture(config);
|
||||
|
||||
@ -380,13 +380,13 @@ TEST(VideoCodecTestLibvpx, MAYBE_SimulcastVP8) {
|
||||
config.num_frames = 100;
|
||||
config.SetCodecSettings(cricket::kVp8CodecName, 3, 1, 3, true, true, false,
|
||||
1280, 720);
|
||||
const auto frame_checker = absl::make_unique<QpFrameChecker>();
|
||||
const auto frame_checker = std::make_unique<QpFrameChecker>();
|
||||
config.encoded_frame_checker = frame_checker.get();
|
||||
|
||||
InternalEncoderFactory internal_encoder_factory;
|
||||
std::unique_ptr<VideoEncoderFactory> adapted_encoder_factory =
|
||||
absl::make_unique<FunctionVideoEncoderFactory>([&]() {
|
||||
return absl::make_unique<SimulcastEncoderAdapter>(
|
||||
std::make_unique<FunctionVideoEncoderFactory>([&]() {
|
||||
return std::make_unique<SimulcastEncoderAdapter>(
|
||||
&internal_encoder_factory, SdpVideoFormat(cricket::kVp8CodecName));
|
||||
});
|
||||
std::unique_ptr<InternalDecoderFactory> internal_decoder_factory(
|
||||
@ -417,7 +417,7 @@ TEST(VideoCodecTestLibvpx, MAYBE_SvcVP9) {
|
||||
config.num_frames = 100;
|
||||
config.SetCodecSettings(cricket::kVp9CodecName, 1, 3, 3, true, true, false,
|
||||
1280, 720);
|
||||
const auto frame_checker = absl::make_unique<QpFrameChecker>();
|
||||
const auto frame_checker = std::make_unique<QpFrameChecker>();
|
||||
config.encoded_frame_checker = frame_checker.get();
|
||||
auto fixture = CreateVideoCodecTestFixture(config);
|
||||
|
||||
@ -438,7 +438,7 @@ TEST(VideoCodecTestLibvpx, DISABLED_MultiresVP8RdPerf) {
|
||||
config.print_frame_level_stats = true;
|
||||
config.SetCodecSettings(cricket::kVp8CodecName, 3, 1, 3, true, true, false,
|
||||
1280, 720);
|
||||
const auto frame_checker = absl::make_unique<QpFrameChecker>();
|
||||
const auto frame_checker = std::make_unique<QpFrameChecker>();
|
||||
config.encoded_frame_checker = frame_checker.get();
|
||||
auto fixture = CreateVideoCodecTestFixture(config);
|
||||
|
||||
@ -464,7 +464,7 @@ TEST(VideoCodecTestLibvpx, DISABLED_SvcVP9RdPerf) {
|
||||
config.print_frame_level_stats = true;
|
||||
config.SetCodecSettings(cricket::kVp9CodecName, 1, 3, 3, true, true, false,
|
||||
1280, 720);
|
||||
const auto frame_checker = absl::make_unique<QpFrameChecker>();
|
||||
const auto frame_checker = std::make_unique<QpFrameChecker>();
|
||||
config.encoded_frame_checker = frame_checker.get();
|
||||
auto fixture = CreateVideoCodecTestFixture(config);
|
||||
|
||||
|
||||
@ -8,11 +8,11 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/test/create_videocodec_test_fixture.h"
|
||||
#include "media/base/media_constants.h"
|
||||
#include "modules/video_coding/codecs/test/android_codec_factory_helper.h"
|
||||
@ -69,7 +69,7 @@ TEST(VideoCodecTestMediaCodec, ForemanCif500kbpsVp8) {
|
||||
TEST(VideoCodecTestMediaCodec, ForemanCif500kbpsH264CBP) {
|
||||
auto config = CreateConfig();
|
||||
const auto frame_checker =
|
||||
absl::make_unique<VideoCodecTestFixtureImpl::H264KeyframeChecker>();
|
||||
std::make_unique<VideoCodecTestFixtureImpl::H264KeyframeChecker>();
|
||||
config.encoded_frame_checker = frame_checker.get();
|
||||
config.SetCodecSettings(cricket::kH264CodecName, 1, 1, 1, false, false, false,
|
||||
352, 288);
|
||||
@ -93,7 +93,7 @@ TEST(VideoCodecTestMediaCodec, ForemanCif500kbpsH264CBP) {
|
||||
TEST(VideoCodecTestMediaCodec, DISABLED_ForemanCif500kbpsH264CHP) {
|
||||
auto config = CreateConfig();
|
||||
const auto frame_checker =
|
||||
absl::make_unique<VideoCodecTestFixtureImpl::H264KeyframeChecker>();
|
||||
std::make_unique<VideoCodecTestFixtureImpl::H264KeyframeChecker>();
|
||||
|
||||
config.h264_codec_settings.profile = H264::kProfileConstrainedHigh;
|
||||
config.encoded_frame_checker = frame_checker.get();
|
||||
|
||||
@ -8,9 +8,9 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/test/create_videocodec_test_fixture.h"
|
||||
#include "media/base/media_constants.h"
|
||||
#include "modules/video_coding/codecs/test/videocodec_test_fixture_impl.h"
|
||||
@ -39,7 +39,7 @@ VideoCodecTestFixture::Config CreateConfig() {
|
||||
|
||||
TEST(VideoCodecTestOpenH264, ConstantHighBitrate) {
|
||||
auto frame_checker =
|
||||
absl::make_unique<VideoCodecTestFixtureImpl::H264KeyframeChecker>();
|
||||
std::make_unique<VideoCodecTestFixtureImpl::H264KeyframeChecker>();
|
||||
auto config = CreateConfig();
|
||||
config.SetCodecSettings(cricket::kH264CodecName, 1, 1, 1, false, true, false,
|
||||
kCifWidth, kCifHeight);
|
||||
@ -60,7 +60,7 @@ TEST(VideoCodecTestOpenH264, ConstantHighBitrate) {
|
||||
// large frames into multiple slices and limit length of NAL units.
|
||||
TEST(VideoCodecTestOpenH264, SingleNalUnit) {
|
||||
auto frame_checker =
|
||||
absl::make_unique<VideoCodecTestFixtureImpl::H264KeyframeChecker>();
|
||||
std::make_unique<VideoCodecTestFixtureImpl::H264KeyframeChecker>();
|
||||
auto config = CreateConfig();
|
||||
config.h264_codec_settings.packetization_mode =
|
||||
H264PacketizationMode::SingleNalUnit;
|
||||
|
||||
@ -8,9 +8,9 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/test/create_videocodec_test_fixture.h"
|
||||
#include "media/base/media_constants.h"
|
||||
#include "modules/video_coding/codecs/test/objc_codec_factory_helper.h"
|
||||
@ -53,7 +53,7 @@ std::unique_ptr<VideoCodecTestFixture> CreateTestFixtureWithConfig(
|
||||
// longer in use.
|
||||
MAYBE_TEST(VideoCodecTestVideoToolbox, ForemanCif500kbpsH264CBP) {
|
||||
const auto frame_checker =
|
||||
absl::make_unique<VideoCodecTestFixtureImpl::H264KeyframeChecker>();
|
||||
std::make_unique<VideoCodecTestFixtureImpl::H264KeyframeChecker>();
|
||||
auto config = CreateConfig();
|
||||
config.SetCodecSettings(cricket::kH264CodecName, 1, 1, 1, false, false, false,
|
||||
352, 288);
|
||||
@ -69,7 +69,7 @@ MAYBE_TEST(VideoCodecTestVideoToolbox, ForemanCif500kbpsH264CBP) {
|
||||
|
||||
MAYBE_TEST(VideoCodecTestVideoToolbox, ForemanCif500kbpsH264CHP) {
|
||||
const auto frame_checker =
|
||||
absl::make_unique<VideoCodecTestFixtureImpl::H264KeyframeChecker>();
|
||||
std::make_unique<VideoCodecTestFixtureImpl::H264KeyframeChecker>();
|
||||
auto config = CreateConfig();
|
||||
config.h264_codec_settings.profile = H264::kProfileConstrainedHigh;
|
||||
config.SetCodecSettings(cricket::kH264CodecName, 1, 1, 1, false, false, false,
|
||||
|
||||
@ -15,9 +15,9 @@
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/scoped_refptr.h"
|
||||
#include "api/video/builtin_video_bitrate_allocator_factory.h"
|
||||
#include "api/video/i420_buffer.h"
|
||||
@ -220,7 +220,7 @@ VideoProcessor::VideoProcessor(webrtc::VideoEncoder* encoder,
|
||||
|
||||
for (size_t i = 0; i < num_simulcast_or_spatial_layers_; ++i) {
|
||||
decode_callback_.push_back(
|
||||
absl::make_unique<VideoProcessorDecodeCompleteCallback>(this, i));
|
||||
std::make_unique<VideoProcessorDecodeCompleteCallback>(this, i));
|
||||
RTC_CHECK_EQ(
|
||||
decoders_->at(i)->InitDecode(&config_.codec_settings,
|
||||
static_cast<int>(config_.NumberOfCores())),
|
||||
|
||||
@ -19,7 +19,6 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "absl/types/optional.h"
|
||||
#include "api/task_queue/queued_task.h"
|
||||
#include "api/task_queue/task_queue_base.h"
|
||||
@ -98,7 +97,7 @@ class VideoProcessor {
|
||||
|
||||
// Post the callback to the right task queue, if needed.
|
||||
if (!task_queue_->IsCurrent()) {
|
||||
task_queue_->PostTask(absl::make_unique<EncodeCallbackTask>(
|
||||
task_queue_->PostTask(std::make_unique<EncodeCallbackTask>(
|
||||
video_processor_, encoded_image, codec_specific_info));
|
||||
return Result(Result::OK, 0);
|
||||
}
|
||||
|
||||
@ -12,7 +12,6 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/scoped_refptr.h"
|
||||
#include "api/test/mock_video_decoder.h"
|
||||
#include "api/test/mock_video_encoder.h"
|
||||
@ -56,7 +55,7 @@ class VideoProcessorTest : public ::testing::Test {
|
||||
EXPECT_CALL(frame_reader_mock_, FrameLength())
|
||||
.WillRepeatedly(Return(kFrameSize));
|
||||
q_.SendTask([this] {
|
||||
video_processor_ = absl::make_unique<VideoProcessor>(
|
||||
video_processor_ = std::make_unique<VideoProcessor>(
|
||||
&encoder_mock_, &decoders_, &frame_reader_mock_, config_, &stats_,
|
||||
&encoded_frame_writers_, /*decoded_frame_writers=*/nullptr);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user