Provide Environment when creating VideoEncoder in test code

Bug: webrtc:15860
Change-Id: I8c79ff58619716842e02f33e78a0529c631494e6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/342280
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41884}
diff --git a/video/video_quality_test.cc b/video/video_quality_test.cc
index 4e17b4e..551cd34 100644
--- a/video/video_quality_test.cc
+++ b/video/video_quality_test.cc
@@ -312,6 +312,7 @@
 }
 
 std::unique_ptr<VideoEncoder> VideoQualityTest::CreateVideoEncoder(
+    const Environment& env,
     const SdpVideoFormat& format,
     VideoAnalyzer* analyzer) {
   std::unique_ptr<VideoEncoder> encoder;
@@ -321,7 +322,7 @@
   } else if (format.name == "FakeCodec") {
     encoder = webrtc::FakeVideoEncoderFactory::CreateVideoEncoder();
   } else {
-    encoder = encoder_factory_->CreateVideoEncoder(format);
+    encoder = encoder_factory_->Create(env, format);
   }
 
   std::vector<FileWrapper> encoded_frame_dump_files;
@@ -372,12 +373,13 @@
           [this](const Environment& env, const SdpVideoFormat& format) {
             return this->CreateVideoDecoder(env, format);
           }),
-      video_encoder_factory_([this](const SdpVideoFormat& format) {
-        return this->CreateVideoEncoder(format, nullptr);
-      }),
+      video_encoder_factory_(
+          [this](const Environment& env, const SdpVideoFormat& format) {
+            return this->CreateVideoEncoder(env, format, nullptr);
+          }),
       video_encoder_factory_with_analyzer_(
-          [this](const SdpVideoFormat& format) {
-            return this->CreateVideoEncoder(format, analyzer_.get());
+          [this](const Environment& env, const SdpVideoFormat& format) {
+            return this->CreateVideoEncoder(env, format, analyzer_.get());
           }),
       video_bitrate_allocator_factory_(
           CreateBuiltinVideoBitrateAllocatorFactory()),