Revert^2 "Delete deprecated SetMediaEngineDefaults"

This reverts commit c176175f010a17491a0986a8c2fc67bd48e67315.

Reason for revert: chromium is updated not to depend on the deleted target. (chromium import succeed before the revert)

Original change's description:
> Revert "Delete deprecated SetMediaEngineDefaults"
>
> This reverts commit 1682a7f41135d9529917c0f8e5b6a57fbb47220a.
>
> Reason for revert: Breaks chromium import: https://chromium-review.googlesource.com/c/chromium/src/+/5083877?tab=checks
>
> Original change's description:
> > Delete deprecated SetMediaEngineDefaults
> >
> > Bug: webrtc:15574
> > Change-Id: Ie60973e020ca91ca93ca46159d53d4a89d1757fe
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/326004
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
> > Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> > Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#41304}
>
> Bug: webrtc:15574
> Change-Id: Id09c8e1682831032e84a83187c6905a84e68d736
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/329842
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Auto-Submit: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Owners-Override: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#41312}

Bug: webrtc:15574
Change-Id: Id376c76dbaa069e3cf178b45be7823c1aa9e3789
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/329843
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41314}
diff --git a/media/BUILD.gn b/media/BUILD.gn
index 3f18a79..295a748 100644
--- a/media/BUILD.gn
+++ b/media/BUILD.gn
@@ -576,33 +576,6 @@
   }
 }
 
-# Heavy but optional helper for unittests and webrtc users who prefer to use
-# defaults factories or do not worry about extra dependencies and binary size.
-rtc_library("rtc_media_engine_defaults") {
-  visibility = [ "*" ]
-  allow_poison = [
-    "audio_codecs",
-    "environment_construction",
-    "software_video_codecs",
-  ]
-  sources = [
-    "engine/webrtc_media_engine_defaults.cc",
-    "engine/webrtc_media_engine_defaults.h",
-  ]
-  deps = [
-    ":rtc_audio_video",
-    "../api/audio_codecs:builtin_audio_decoder_factory",
-    "../api/audio_codecs:builtin_audio_encoder_factory",
-    "../api/task_queue:default_task_queue_factory",
-    "../api/video:builtin_video_bitrate_allocator_factory",
-    "../api/video_codecs:builtin_video_decoder_factory",
-    "../api/video_codecs:builtin_video_encoder_factory",
-    "../modules/audio_processing:api",
-    "../rtc_base:checks",
-    "../rtc_base/system:rtc_export",
-  ]
-}
-
 rtc_source_set("rtc_data_sctp_transport_internal") {
   sources = [ "sctp/sctp_transport_internal.h" ]
   deps = [
@@ -805,7 +778,6 @@
         ":rtc_internal_video_codecs",
         ":rtc_media",
         ":rtc_media_base",
-        ":rtc_media_engine_defaults",
         ":rtc_media_tests_utils",
         ":rtc_sdp_video_format_utils",
         ":rtc_simulcast_encoder_adapter",
diff --git a/media/engine/webrtc_media_engine_defaults.cc b/media/engine/webrtc_media_engine_defaults.cc
deleted file mode 100644
index fed6466..0000000
--- a/media/engine/webrtc_media_engine_defaults.cc
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- *  Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-#include "media/engine/webrtc_media_engine_defaults.h"
-
-#include "api/audio_codecs/builtin_audio_decoder_factory.h"
-#include "api/audio_codecs/builtin_audio_encoder_factory.h"
-#include "api/task_queue/default_task_queue_factory.h"
-#include "api/video/builtin_video_bitrate_allocator_factory.h"
-#include "api/video_codecs/builtin_video_decoder_factory.h"
-#include "api/video_codecs/builtin_video_encoder_factory.h"
-#include "modules/audio_processing/include/audio_processing.h"
-#include "rtc_base/checks.h"
-
-namespace webrtc {
-
-void DeprecatedSetMediaEngineDefaults(cricket::MediaEngineDependencies* deps) {
-  RTC_DCHECK(deps);
-  if (deps->task_queue_factory == nullptr) {
-    static TaskQueueFactory* const task_queue_factory =
-        CreateDefaultTaskQueueFactory().release();
-    deps->task_queue_factory = task_queue_factory;
-  }
-  if (deps->audio_encoder_factory == nullptr)
-    deps->audio_encoder_factory = CreateBuiltinAudioEncoderFactory();
-  if (deps->audio_decoder_factory == nullptr)
-    deps->audio_decoder_factory = CreateBuiltinAudioDecoderFactory();
-  if (deps->audio_processing == nullptr)
-    deps->audio_processing = AudioProcessingBuilder().Create();
-
-  if (deps->video_encoder_factory == nullptr)
-    deps->video_encoder_factory = CreateBuiltinVideoEncoderFactory();
-  if (deps->video_decoder_factory == nullptr)
-    deps->video_decoder_factory = CreateBuiltinVideoDecoderFactory();
-}
-
-}  // namespace webrtc
diff --git a/media/engine/webrtc_media_engine_defaults.h b/media/engine/webrtc_media_engine_defaults.h
deleted file mode 100644
index a0ed059..0000000
--- a/media/engine/webrtc_media_engine_defaults.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *  Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-#ifndef MEDIA_ENGINE_WEBRTC_MEDIA_ENGINE_DEFAULTS_H_
-#define MEDIA_ENGINE_WEBRTC_MEDIA_ENGINE_DEFAULTS_H_
-
-#include "media/engine/webrtc_media_engine.h"
-#include "rtc_base/system/rtc_export.h"
-
-namespace webrtc {
-
-// Sets required but null dependencies with default factories.
-// Deprecated in favor of EnableMediaWithDefaults.
-RTC_EXPORT void DeprecatedSetMediaEngineDefaults(
-    cricket::MediaEngineDependencies* deps);
-[[deprecated("bugs.webrc.org/15574")]] inline void SetMediaEngineDefaults(
-    cricket::MediaEngineDependencies* deps) {
-  DeprecatedSetMediaEngineDefaults(deps);
-}
-
-}  // namespace webrtc
-
-#endif  // MEDIA_ENGINE_WEBRTC_MEDIA_ENGINE_DEFAULTS_H_
diff --git a/media/engine/webrtc_media_engine_unittest.cc b/media/engine/webrtc_media_engine_unittest.cc
index b89c98fe..40cad75 100644
--- a/media/engine/webrtc_media_engine_unittest.cc
+++ b/media/engine/webrtc_media_engine_unittest.cc
@@ -14,7 +14,6 @@
 #include <string>
 #include <utility>
 
-#include "media/engine/webrtc_media_engine_defaults.h"
 #include "test/gtest.h"
 #include "test/scoped_key_value_config.h"
 
@@ -322,20 +321,4 @@
   EXPECT_EQ(RtpExtension::kTimestampOffsetUri, filtered[0].uri);
 }
 
-// Deprecated as part of the bugs.webrtc.org/15574 effort.
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-TEST(WebRtcMediaEngineTest, Create) {
-  MediaEngineDependencies deps;
-  webrtc::DeprecatedSetMediaEngineDefaults(&deps);
-  webrtc::test::ScopedKeyValueConfig trials;
-  deps.trials = &trials;
-
-  std::unique_ptr<MediaEngineInterface> engine =
-      CreateMediaEngine(std::move(deps));
-
-  EXPECT_TRUE(engine);
-}
-#pragma clang diagnostic pop
-
 }  // namespace cricket
diff --git a/pc/BUILD.gn b/pc/BUILD.gn
index e4cff6a..e9549cd 100644
--- a/pc/BUILD.gn
+++ b/pc/BUILD.gn
@@ -2479,7 +2479,6 @@
       "../media:rid_description",
       "../media:rtc_data_sctp_transport_internal",
       "../media:rtc_media_config",
-      "../media:rtc_media_engine_defaults",
       "../media:stream_params",
       "../modules/audio_device:audio_device_api",
       "../modules/audio_processing:audio_processing_statistics",