2018-02-02 16:24:16 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright 2018 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.
|
|
|
|
|
*/
|
|
|
|
|
|
2019-09-17 17:06:18 +02:00
|
|
|
#include <memory>
|
2024-08-29 13:00:40 +00:00
|
|
|
#include <optional>
|
2023-04-25 09:56:49 +02:00
|
|
|
|
2024-02-22 13:09:46 +01:00
|
|
|
#include "api/environment/environment.h"
|
2018-10-26 15:57:48 +02:00
|
|
|
#include "api/test/video/function_video_encoder_factory.h"
|
2018-12-12 11:17:43 +01:00
|
|
|
#include "api/video/color_space.h"
|
|
|
|
|
#include "api/video/video_rotation.h"
|
2018-12-14 10:14:07 +01:00
|
|
|
#include "common_video/test/utilities.h"
|
2023-05-31 12:44:32 +00:00
|
|
|
#include "media/base/codec.h"
|
|
|
|
|
#include "media/base/media_constants.h"
|
2019-01-11 09:11:00 -08:00
|
|
|
#include "media/engine/internal_decoder_factory.h"
|
|
|
|
|
#include "media/engine/internal_encoder_factory.h"
|
2018-02-02 16:24:16 +01:00
|
|
|
#include "modules/video_coding/codecs/h264/include/h264.h"
|
|
|
|
|
#include "modules/video_coding/codecs/vp8/include/vp8.h"
|
|
|
|
|
#include "modules/video_coding/codecs/vp9/include/vp9.h"
|
|
|
|
|
#include "test/call_test.h"
|
|
|
|
|
#include "test/encoder_settings.h"
|
|
|
|
|
#include "test/field_trial.h"
|
|
|
|
|
#include "test/gtest.h"
|
2023-04-25 09:56:49 +02:00
|
|
|
#include "test/video_test_constants.h"
|
2018-02-02 16:24:16 +01:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
Reland "Delete test/constants.h"
This reverts commit 4f36b7a478c2763463c7a9ea970548ec68bc3ea6.
Reason for revert: Failing tests fixed.
Original change's description:
> Revert "Delete test/constants.h"
>
> This reverts commit 389b1672a32f2dd49af6c6ed40e8ddf394b986de.
>
> Reason for revert: Causes failure (and empty result list) in CallPerfTest.PadsToMinTransmitBitrate
>
> Original change's description:
> > Delete test/constants.h
> >
> > It's not possible to use constants.h for all RTP extensions
> > after the number of extensions exceeds 14, which is the maximum
> > number of one-byte RTP extensions. This is because some extensions
> > would have to be assigned a number greater than 14, even if the
> > test only involves 14 extensions or less.
> >
> > For uniformity's sake, this CL also edits some files to use an
> > enum as the files involved in this CL, rather than free-floating
> > const-ints.
> >
> > Bug: webrtc:10288
> > Change-Id: Ib5e58ad72c4d3756f4c4f6521f140ec59617f3f5
> > Reviewed-on: https://webrtc-review.googlesource.com/c/123048
> > Commit-Queue: Elad Alon <eladalon@webrtc.org>
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Reviewed-by: Erik Språng <sprang@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#26728}
>
> TBR=danilchap@webrtc.org,kwiberg@webrtc.org,eladalon@webrtc.org,sprang@webrtc.org
>
> Bug: webrtc:10288, chromium:933127
> Change-Id: If1de0bd8992137c52bf0b877b3cb0a2bafc809d4
> Reviewed-on: https://webrtc-review.googlesource.com/c/123381
> Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
> Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26744}
TBR=danilchap@webrtc.org,oprypin@webrtc.org,kwiberg@webrtc.org,eladalon@webrtc.org,sprang@webrtc.org
Change-Id: I65e391325d3a6df6db3c0739185e2002e70fb954
Bug: webrtc:10288, chromium:933127
Reviewed-on: https://webrtc-review.googlesource.com/c/123384
Reviewed-by: Elad Alon <eladalon@webrtc.org>
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26750}
2019-02-18 23:45:57 +01:00
|
|
|
namespace {
|
|
|
|
|
enum : int { // The first valid value is 1.
|
|
|
|
|
kColorSpaceExtensionId = 1,
|
|
|
|
|
kVideoRotationExtensionId,
|
|
|
|
|
};
|
|
|
|
|
} // namespace
|
2018-02-02 16:24:16 +01:00
|
|
|
|
2020-06-03 14:11:26 +02:00
|
|
|
class CodecEndToEndTest : public test::CallTest {
|
2018-02-02 16:24:16 +01:00
|
|
|
public:
|
2020-06-03 14:11:26 +02:00
|
|
|
CodecEndToEndTest() {
|
Reland "Delete test/constants.h"
This reverts commit 4f36b7a478c2763463c7a9ea970548ec68bc3ea6.
Reason for revert: Failing tests fixed.
Original change's description:
> Revert "Delete test/constants.h"
>
> This reverts commit 389b1672a32f2dd49af6c6ed40e8ddf394b986de.
>
> Reason for revert: Causes failure (and empty result list) in CallPerfTest.PadsToMinTransmitBitrate
>
> Original change's description:
> > Delete test/constants.h
> >
> > It's not possible to use constants.h for all RTP extensions
> > after the number of extensions exceeds 14, which is the maximum
> > number of one-byte RTP extensions. This is because some extensions
> > would have to be assigned a number greater than 14, even if the
> > test only involves 14 extensions or less.
> >
> > For uniformity's sake, this CL also edits some files to use an
> > enum as the files involved in this CL, rather than free-floating
> > const-ints.
> >
> > Bug: webrtc:10288
> > Change-Id: Ib5e58ad72c4d3756f4c4f6521f140ec59617f3f5
> > Reviewed-on: https://webrtc-review.googlesource.com/c/123048
> > Commit-Queue: Elad Alon <eladalon@webrtc.org>
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Reviewed-by: Erik Språng <sprang@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#26728}
>
> TBR=danilchap@webrtc.org,kwiberg@webrtc.org,eladalon@webrtc.org,sprang@webrtc.org
>
> Bug: webrtc:10288, chromium:933127
> Change-Id: If1de0bd8992137c52bf0b877b3cb0a2bafc809d4
> Reviewed-on: https://webrtc-review.googlesource.com/c/123381
> Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
> Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26744}
TBR=danilchap@webrtc.org,oprypin@webrtc.org,kwiberg@webrtc.org,eladalon@webrtc.org,sprang@webrtc.org
Change-Id: I65e391325d3a6df6db3c0739185e2002e70fb954
Bug: webrtc:10288, chromium:933127
Reviewed-on: https://webrtc-review.googlesource.com/c/123384
Reviewed-by: Elad Alon <eladalon@webrtc.org>
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26750}
2019-02-18 23:45:57 +01:00
|
|
|
RegisterRtpExtension(
|
|
|
|
|
RtpExtension(RtpExtension::kColorSpaceUri, kColorSpaceExtensionId));
|
|
|
|
|
RegisterRtpExtension(RtpExtension(RtpExtension::kVideoRotationUri,
|
|
|
|
|
kVideoRotationExtensionId));
|
|
|
|
|
}
|
2018-02-02 16:24:16 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class CodecObserver : public test::EndToEndTest,
|
|
|
|
|
public rtc::VideoSinkInterface<VideoFrame> {
|
|
|
|
|
public:
|
|
|
|
|
CodecObserver(int no_frames_to_wait_for,
|
|
|
|
|
VideoRotation rotation_to_test,
|
2024-08-29 13:00:40 +00:00
|
|
|
std::optional<ColorSpace> color_space_to_test,
|
2018-02-02 16:24:16 +01:00
|
|
|
const std::string& payload_name,
|
2018-04-19 09:04:13 +02:00
|
|
|
VideoEncoderFactory* encoder_factory,
|
2018-09-28 09:07:24 +02:00
|
|
|
VideoDecoderFactory* decoder_factory)
|
2023-04-25 09:56:49 +02:00
|
|
|
: EndToEndTest(4 * test::VideoTestConstants::kDefaultTimeout),
|
2018-02-02 16:24:16 +01:00
|
|
|
// TODO(hta): This timeout (120 seconds) is excessive.
|
|
|
|
|
// https://bugs.webrtc.org/6830
|
|
|
|
|
no_frames_to_wait_for_(no_frames_to_wait_for),
|
|
|
|
|
expected_rotation_(rotation_to_test),
|
2018-12-12 11:17:43 +01:00
|
|
|
expected_color_space_(color_space_to_test),
|
2018-02-02 16:24:16 +01:00
|
|
|
payload_name_(payload_name),
|
2018-04-19 09:04:13 +02:00
|
|
|
encoder_factory_(encoder_factory),
|
2018-09-28 09:07:24 +02:00
|
|
|
decoder_factory_(decoder_factory),
|
2018-02-02 16:24:16 +01:00
|
|
|
frame_counter_(0) {}
|
|
|
|
|
|
|
|
|
|
void PerformTest() override {
|
|
|
|
|
EXPECT_TRUE(Wait())
|
|
|
|
|
<< "Timed out while waiting for enough frames to be decoded.";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ModifyVideoConfigs(
|
|
|
|
|
VideoSendStream::Config* send_config,
|
2022-05-20 15:21:20 +02:00
|
|
|
std::vector<VideoReceiveStreamInterface::Config>* receive_configs,
|
2018-02-02 16:24:16 +01:00
|
|
|
VideoEncoderConfig* encoder_config) override {
|
Reland "Reland "Move rtp-specific config out of EncoderSettings.""
This reverts commit 6c2c13af06b32778b86950681758a7970d1c5d9e.
Reason for revert: Intend to investigate and fix perf problems.
Original change's description:
> Revert "Reland "Move rtp-specific config out of EncoderSettings.""
>
> This reverts commit 04dd1768625eb2241d1fb97fd0137897e703e266.
>
> Reason for revert: Regression in ramp up perf tests.
>
> Original change's description:
> > Reland "Move rtp-specific config out of EncoderSettings."
> >
> > This is a reland of bc900cb1d1810fcf678fe41cf1e3966daa39c88c
> >
> > Original change's description:
> > > Move rtp-specific config out of EncoderSettings.
> > >
> > > In VideoSendStream::Config, move payload_name and payload_type from
> > > EncoderSettings to Rtp.
> > >
> > > EncoderSettings now contains configuration for VideoStreamEncoder only,
> > > and should perhaps be renamed in a follow up cl. It's no longer
> > > passed as an argument to VideoCodecInitializer::SetupCodec.
> > >
> > > The latter then needs a different way to know the codec type,
> > > which is provided by a new codec_type member in VideoEncoderConfig.
> > >
> > > Bug: webrtc:8830
> > > Change-Id: Ifcc691aef1ee6a95e43c0452c5e630d92a511cd6
> > > Reviewed-on: https://webrtc-review.googlesource.com/62062
> > > Commit-Queue: Niels Moller <nisse@webrtc.org>
> > > Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#22532}
> >
> > Bug: webrtc:8830
> > Change-Id: If88ef7d57cdaa4fae3c7b2a97ea5a6e1b833e019
> > Reviewed-on: https://webrtc-review.googlesource.com/63721
> > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Niels Moller <nisse@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22595}
>
> TBR=brandtr@webrtc.org,magjed@webrtc.org,nisse@webrtc.org,stefan@webrtc.org
>
> Bug: webrtc:8830,chromium:827080
> Change-Id: Iaaf146de91ec5c0d741b8efdf143f7e173084fef
> Reviewed-on: https://webrtc-review.googlesource.com/65520
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22677}
TBR=brandtr@webrtc.org,magjed@webrtc.org,nisse@webrtc.org,stefan@webrtc.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: webrtc:8830, chromium:827080
Change-Id: I9b62987bf5daced90dfeb3ebb6739c80117c487f
Reviewed-on: https://webrtc-review.googlesource.com/66862
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22751}
2018-04-05 15:36:51 +02:00
|
|
|
encoder_config->codec_type = PayloadStringToCodecType(payload_name_);
|
2018-04-19 09:04:13 +02:00
|
|
|
send_config->encoder_settings.encoder_factory = encoder_factory_;
|
Reland "Reland "Move rtp-specific config out of EncoderSettings.""
This reverts commit 6c2c13af06b32778b86950681758a7970d1c5d9e.
Reason for revert: Intend to investigate and fix perf problems.
Original change's description:
> Revert "Reland "Move rtp-specific config out of EncoderSettings.""
>
> This reverts commit 04dd1768625eb2241d1fb97fd0137897e703e266.
>
> Reason for revert: Regression in ramp up perf tests.
>
> Original change's description:
> > Reland "Move rtp-specific config out of EncoderSettings."
> >
> > This is a reland of bc900cb1d1810fcf678fe41cf1e3966daa39c88c
> >
> > Original change's description:
> > > Move rtp-specific config out of EncoderSettings.
> > >
> > > In VideoSendStream::Config, move payload_name and payload_type from
> > > EncoderSettings to Rtp.
> > >
> > > EncoderSettings now contains configuration for VideoStreamEncoder only,
> > > and should perhaps be renamed in a follow up cl. It's no longer
> > > passed as an argument to VideoCodecInitializer::SetupCodec.
> > >
> > > The latter then needs a different way to know the codec type,
> > > which is provided by a new codec_type member in VideoEncoderConfig.
> > >
> > > Bug: webrtc:8830
> > > Change-Id: Ifcc691aef1ee6a95e43c0452c5e630d92a511cd6
> > > Reviewed-on: https://webrtc-review.googlesource.com/62062
> > > Commit-Queue: Niels Moller <nisse@webrtc.org>
> > > Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#22532}
> >
> > Bug: webrtc:8830
> > Change-Id: If88ef7d57cdaa4fae3c7b2a97ea5a6e1b833e019
> > Reviewed-on: https://webrtc-review.googlesource.com/63721
> > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Niels Moller <nisse@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22595}
>
> TBR=brandtr@webrtc.org,magjed@webrtc.org,nisse@webrtc.org,stefan@webrtc.org
>
> Bug: webrtc:8830,chromium:827080
> Change-Id: Iaaf146de91ec5c0d741b8efdf143f7e173084fef
> Reviewed-on: https://webrtc-review.googlesource.com/65520
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22677}
TBR=brandtr@webrtc.org,magjed@webrtc.org,nisse@webrtc.org,stefan@webrtc.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: webrtc:8830, chromium:827080
Change-Id: I9b62987bf5daced90dfeb3ebb6739c80117c487f
Reviewed-on: https://webrtc-review.googlesource.com/66862
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22751}
2018-04-05 15:36:51 +02:00
|
|
|
send_config->rtp.payload_name = payload_name_;
|
2023-04-25 09:56:49 +02:00
|
|
|
send_config->rtp.payload_type =
|
|
|
|
|
test::VideoTestConstants::kVideoSendPayloadType;
|
2018-02-02 16:24:16 +01:00
|
|
|
|
|
|
|
|
(*receive_configs)[0].renderer = this;
|
|
|
|
|
(*receive_configs)[0].decoders.resize(1);
|
|
|
|
|
(*receive_configs)[0].decoders[0].payload_type =
|
Reland "Reland "Move rtp-specific config out of EncoderSettings.""
This reverts commit 6c2c13af06b32778b86950681758a7970d1c5d9e.
Reason for revert: Intend to investigate and fix perf problems.
Original change's description:
> Revert "Reland "Move rtp-specific config out of EncoderSettings.""
>
> This reverts commit 04dd1768625eb2241d1fb97fd0137897e703e266.
>
> Reason for revert: Regression in ramp up perf tests.
>
> Original change's description:
> > Reland "Move rtp-specific config out of EncoderSettings."
> >
> > This is a reland of bc900cb1d1810fcf678fe41cf1e3966daa39c88c
> >
> > Original change's description:
> > > Move rtp-specific config out of EncoderSettings.
> > >
> > > In VideoSendStream::Config, move payload_name and payload_type from
> > > EncoderSettings to Rtp.
> > >
> > > EncoderSettings now contains configuration for VideoStreamEncoder only,
> > > and should perhaps be renamed in a follow up cl. It's no longer
> > > passed as an argument to VideoCodecInitializer::SetupCodec.
> > >
> > > The latter then needs a different way to know the codec type,
> > > which is provided by a new codec_type member in VideoEncoderConfig.
> > >
> > > Bug: webrtc:8830
> > > Change-Id: Ifcc691aef1ee6a95e43c0452c5e630d92a511cd6
> > > Reviewed-on: https://webrtc-review.googlesource.com/62062
> > > Commit-Queue: Niels Moller <nisse@webrtc.org>
> > > Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#22532}
> >
> > Bug: webrtc:8830
> > Change-Id: If88ef7d57cdaa4fae3c7b2a97ea5a6e1b833e019
> > Reviewed-on: https://webrtc-review.googlesource.com/63721
> > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Niels Moller <nisse@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22595}
>
> TBR=brandtr@webrtc.org,magjed@webrtc.org,nisse@webrtc.org,stefan@webrtc.org
>
> Bug: webrtc:8830,chromium:827080
> Change-Id: Iaaf146de91ec5c0d741b8efdf143f7e173084fef
> Reviewed-on: https://webrtc-review.googlesource.com/65520
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22677}
TBR=brandtr@webrtc.org,magjed@webrtc.org,nisse@webrtc.org,stefan@webrtc.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: webrtc:8830, chromium:827080
Change-Id: I9b62987bf5daced90dfeb3ebb6739c80117c487f
Reviewed-on: https://webrtc-review.googlesource.com/66862
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22751}
2018-04-05 15:36:51 +02:00
|
|
|
send_config->rtp.payload_type;
|
2018-09-11 15:56:04 +02:00
|
|
|
(*receive_configs)[0].decoders[0].video_format =
|
|
|
|
|
SdpVideoFormat(send_config->rtp.payload_name);
|
2020-08-03 15:55:10 +00:00
|
|
|
(*receive_configs)[0].decoder_factory = decoder_factory_;
|
2018-02-02 16:24:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OnFrame(const VideoFrame& video_frame) override {
|
|
|
|
|
EXPECT_EQ(expected_rotation_, video_frame.rotation());
|
2018-12-12 11:17:43 +01:00
|
|
|
// Test only if explicit color space has been specified since otherwise the
|
|
|
|
|
// color space is codec dependent.
|
|
|
|
|
if (expected_color_space_) {
|
|
|
|
|
EXPECT_EQ(expected_color_space_,
|
|
|
|
|
video_frame.color_space()
|
2024-08-29 13:00:40 +00:00
|
|
|
? std::make_optional(*video_frame.color_space())
|
|
|
|
|
: std::nullopt);
|
2018-12-12 11:17:43 +01:00
|
|
|
}
|
2018-02-02 16:24:16 +01:00
|
|
|
if (++frame_counter_ == no_frames_to_wait_for_)
|
|
|
|
|
observation_complete_.Set();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OnFrameGeneratorCapturerCreated(
|
|
|
|
|
test::FrameGeneratorCapturer* frame_generator_capturer) override {
|
|
|
|
|
frame_generator_capturer->SetFakeRotation(expected_rotation_);
|
2018-12-12 11:17:43 +01:00
|
|
|
frame_generator_capturer->SetFakeColorSpace(expected_color_space_);
|
2018-02-02 16:24:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
int no_frames_to_wait_for_;
|
|
|
|
|
VideoRotation expected_rotation_;
|
2024-08-29 13:00:40 +00:00
|
|
|
std::optional<ColorSpace> expected_color_space_;
|
2018-02-02 16:24:16 +01:00
|
|
|
std::string payload_name_;
|
2018-04-19 09:04:13 +02:00
|
|
|
VideoEncoderFactory* encoder_factory_;
|
2018-09-28 09:07:24 +02:00
|
|
|
VideoDecoderFactory* decoder_factory_;
|
2018-02-02 16:24:16 +01:00
|
|
|
int frame_counter_;
|
|
|
|
|
};
|
|
|
|
|
|
2020-06-03 14:11:26 +02:00
|
|
|
TEST_F(CodecEndToEndTest, SendsAndReceivesVP8) {
|
2018-04-19 09:04:13 +02:00
|
|
|
test::FunctionVideoEncoderFactory encoder_factory(
|
2024-03-22 13:33:59 +01:00
|
|
|
[](const Environment& env, const SdpVideoFormat& format) {
|
|
|
|
|
return CreateVp8Encoder(env);
|
|
|
|
|
});
|
2018-09-28 09:07:24 +02:00
|
|
|
test::FunctionVideoDecoderFactory decoder_factory(
|
2024-02-22 13:09:46 +01:00
|
|
|
[](const Environment& env, const SdpVideoFormat& format) {
|
|
|
|
|
return CreateVp8Decoder(env);
|
|
|
|
|
});
|
2024-08-29 13:00:40 +00:00
|
|
|
CodecObserver test(5, kVideoRotation_0, std::nullopt, "VP8", &encoder_factory,
|
|
|
|
|
&decoder_factory);
|
2018-02-02 16:24:16 +01:00
|
|
|
RunBaseTest(&test);
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-03 14:11:26 +02:00
|
|
|
TEST_F(CodecEndToEndTest, SendsAndReceivesVP8Rotation90) {
|
2018-04-19 09:04:13 +02:00
|
|
|
test::FunctionVideoEncoderFactory encoder_factory(
|
2024-03-22 13:33:59 +01:00
|
|
|
[](const Environment& env, const SdpVideoFormat& format) {
|
|
|
|
|
return CreateVp8Encoder(env);
|
|
|
|
|
});
|
2018-09-28 09:07:24 +02:00
|
|
|
test::FunctionVideoDecoderFactory decoder_factory(
|
2024-02-22 13:09:46 +01:00
|
|
|
[](const Environment& env, const SdpVideoFormat& format) {
|
|
|
|
|
return CreateVp8Decoder(env);
|
|
|
|
|
});
|
2024-08-29 13:00:40 +00:00
|
|
|
CodecObserver test(5, kVideoRotation_90, std::nullopt, "VP8",
|
2018-12-12 11:17:43 +01:00
|
|
|
&encoder_factory, &decoder_factory);
|
2018-02-02 16:24:16 +01:00
|
|
|
RunBaseTest(&test);
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-16 14:38:03 +01:00
|
|
|
#if defined(RTC_ENABLE_VP9)
|
2020-06-03 14:11:26 +02:00
|
|
|
TEST_F(CodecEndToEndTest, SendsAndReceivesVP9) {
|
2018-04-19 09:04:13 +02:00
|
|
|
test::FunctionVideoEncoderFactory encoder_factory(
|
2024-03-22 13:33:59 +01:00
|
|
|
[](const Environment& env, const SdpVideoFormat& format) {
|
|
|
|
|
return CreateVp9Encoder(env);
|
|
|
|
|
});
|
2018-09-28 09:07:24 +02:00
|
|
|
test::FunctionVideoDecoderFactory decoder_factory(
|
|
|
|
|
[]() { return VP9Decoder::Create(); });
|
2024-08-29 13:00:40 +00:00
|
|
|
CodecObserver test(500, kVideoRotation_0, std::nullopt, "VP9",
|
2018-12-12 11:17:43 +01:00
|
|
|
&encoder_factory, &decoder_factory);
|
2018-02-02 16:24:16 +01:00
|
|
|
RunBaseTest(&test);
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-03 14:11:26 +02:00
|
|
|
TEST_F(CodecEndToEndTest, SendsAndReceivesVP9VideoRotation90) {
|
2018-04-19 09:04:13 +02:00
|
|
|
test::FunctionVideoEncoderFactory encoder_factory(
|
2024-03-22 13:33:59 +01:00
|
|
|
[](const Environment& env, const SdpVideoFormat& format) {
|
|
|
|
|
return CreateVp9Encoder(env);
|
|
|
|
|
});
|
2018-09-28 09:07:24 +02:00
|
|
|
test::FunctionVideoDecoderFactory decoder_factory(
|
|
|
|
|
[]() { return VP9Decoder::Create(); });
|
2024-08-29 13:00:40 +00:00
|
|
|
CodecObserver test(5, kVideoRotation_90, std::nullopt, "VP9",
|
2018-12-12 11:17:43 +01:00
|
|
|
&encoder_factory, &decoder_factory);
|
|
|
|
|
RunBaseTest(&test);
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-03 14:11:26 +02:00
|
|
|
TEST_F(CodecEndToEndTest, SendsAndReceivesVP9ExplicitColorSpace) {
|
2018-12-12 11:17:43 +01:00
|
|
|
test::FunctionVideoEncoderFactory encoder_factory(
|
2024-03-22 13:33:59 +01:00
|
|
|
[](const Environment& env, const SdpVideoFormat& format) {
|
|
|
|
|
return CreateVp9Encoder(env);
|
|
|
|
|
});
|
2018-12-12 11:17:43 +01:00
|
|
|
test::FunctionVideoDecoderFactory decoder_factory(
|
|
|
|
|
[]() { return VP9Decoder::Create(); });
|
|
|
|
|
CodecObserver test(5, kVideoRotation_90,
|
|
|
|
|
CreateTestColorSpace(/*with_hdr_metadata=*/false), "VP9",
|
|
|
|
|
&encoder_factory, &decoder_factory);
|
|
|
|
|
RunBaseTest(&test);
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-03 14:11:26 +02:00
|
|
|
TEST_F(CodecEndToEndTest,
|
2018-12-12 11:17:43 +01:00
|
|
|
SendsAndReceivesVP9ExplicitColorSpaceWithHdrMetadata) {
|
|
|
|
|
test::FunctionVideoEncoderFactory encoder_factory(
|
2024-03-22 13:33:59 +01:00
|
|
|
[](const Environment& env, const SdpVideoFormat& format) {
|
|
|
|
|
return CreateVp9Encoder(env);
|
|
|
|
|
});
|
2018-12-12 11:17:43 +01:00
|
|
|
test::FunctionVideoDecoderFactory decoder_factory(
|
|
|
|
|
[]() { return VP9Decoder::Create(); });
|
|
|
|
|
CodecObserver test(5, kVideoRotation_90,
|
|
|
|
|
CreateTestColorSpace(/*with_hdr_metadata=*/true), "VP9",
|
|
|
|
|
&encoder_factory, &decoder_factory);
|
2018-02-02 16:24:16 +01:00
|
|
|
RunBaseTest(&test);
|
|
|
|
|
}
|
2018-02-12 13:36:41 -08:00
|
|
|
|
2018-11-16 14:38:03 +01:00
|
|
|
#endif // defined(RTC_ENABLE_VP9)
|
2018-02-02 16:24:16 +01:00
|
|
|
|
|
|
|
|
#if defined(WEBRTC_USE_H264)
|
2018-09-04 09:07:31 +00:00
|
|
|
class EndToEndTestH264 : public test::CallTest,
|
2019-04-09 15:11:12 +02:00
|
|
|
public ::testing::WithParamInterface<std::string> {
|
2018-09-04 09:07:31 +00:00
|
|
|
public:
|
2022-08-22 09:06:06 +00:00
|
|
|
EndToEndTestH264() : field_trial_(GetParam()) {
|
Reland "Delete test/constants.h"
This reverts commit 4f36b7a478c2763463c7a9ea970548ec68bc3ea6.
Reason for revert: Failing tests fixed.
Original change's description:
> Revert "Delete test/constants.h"
>
> This reverts commit 389b1672a32f2dd49af6c6ed40e8ddf394b986de.
>
> Reason for revert: Causes failure (and empty result list) in CallPerfTest.PadsToMinTransmitBitrate
>
> Original change's description:
> > Delete test/constants.h
> >
> > It's not possible to use constants.h for all RTP extensions
> > after the number of extensions exceeds 14, which is the maximum
> > number of one-byte RTP extensions. This is because some extensions
> > would have to be assigned a number greater than 14, even if the
> > test only involves 14 extensions or less.
> >
> > For uniformity's sake, this CL also edits some files to use an
> > enum as the files involved in this CL, rather than free-floating
> > const-ints.
> >
> > Bug: webrtc:10288
> > Change-Id: Ib5e58ad72c4d3756f4c4f6521f140ec59617f3f5
> > Reviewed-on: https://webrtc-review.googlesource.com/c/123048
> > Commit-Queue: Elad Alon <eladalon@webrtc.org>
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Reviewed-by: Erik Språng <sprang@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#26728}
>
> TBR=danilchap@webrtc.org,kwiberg@webrtc.org,eladalon@webrtc.org,sprang@webrtc.org
>
> Bug: webrtc:10288, chromium:933127
> Change-Id: If1de0bd8992137c52bf0b877b3cb0a2bafc809d4
> Reviewed-on: https://webrtc-review.googlesource.com/c/123381
> Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
> Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26744}
TBR=danilchap@webrtc.org,oprypin@webrtc.org,kwiberg@webrtc.org,eladalon@webrtc.org,sprang@webrtc.org
Change-Id: I65e391325d3a6df6db3c0739185e2002e70fb954
Bug: webrtc:10288, chromium:933127
Reviewed-on: https://webrtc-review.googlesource.com/c/123384
Reviewed-by: Elad Alon <eladalon@webrtc.org>
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26750}
2019-02-18 23:45:57 +01:00
|
|
|
RegisterRtpExtension(RtpExtension(RtpExtension::kVideoRotationUri,
|
|
|
|
|
kVideoRotationExtensionId));
|
|
|
|
|
}
|
2022-08-22 09:06:06 +00:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
test::ScopedFieldTrials field_trial_;
|
2018-09-04 09:07:31 +00:00
|
|
|
};
|
|
|
|
|
|
2022-08-22 09:06:06 +00:00
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
|
|
|
|
SpsPpsIdrIsKeyframe,
|
|
|
|
|
EndToEndTestH264,
|
|
|
|
|
::testing::Values("WebRTC-SpsPpsIdrIsH264Keyframe/Disabled/",
|
|
|
|
|
"WebRTC-SpsPpsIdrIsH264Keyframe/Enabled/"));
|
|
|
|
|
|
|
|
|
|
TEST_P(EndToEndTestH264, SendsAndReceivesH264) {
|
2018-04-19 09:04:13 +02:00
|
|
|
test::FunctionVideoEncoderFactory encoder_factory(
|
2024-03-22 13:33:59 +01:00
|
|
|
[](const Environment& env, const SdpVideoFormat& format) {
|
|
|
|
|
return CreateH264Encoder(env);
|
|
|
|
|
});
|
2018-09-28 09:07:24 +02:00
|
|
|
test::FunctionVideoDecoderFactory decoder_factory(
|
|
|
|
|
[]() { return H264Decoder::Create(); });
|
2024-08-29 13:00:40 +00:00
|
|
|
CodecObserver test(500, kVideoRotation_0, std::nullopt, "H264",
|
2018-12-12 11:17:43 +01:00
|
|
|
&encoder_factory, &decoder_factory);
|
2018-02-02 16:24:16 +01:00
|
|
|
RunBaseTest(&test);
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-22 09:06:06 +00:00
|
|
|
TEST_P(EndToEndTestH264, SendsAndReceivesH264VideoRotation90) {
|
2018-04-19 09:04:13 +02:00
|
|
|
test::FunctionVideoEncoderFactory encoder_factory(
|
2024-03-22 13:33:59 +01:00
|
|
|
[](const Environment& env, const SdpVideoFormat& format) {
|
|
|
|
|
return CreateH264Encoder(env);
|
|
|
|
|
});
|
2018-09-28 09:07:24 +02:00
|
|
|
test::FunctionVideoDecoderFactory decoder_factory(
|
|
|
|
|
[]() { return H264Decoder::Create(); });
|
2024-08-29 13:00:40 +00:00
|
|
|
CodecObserver test(5, kVideoRotation_90, std::nullopt, "H264",
|
2018-12-12 11:17:43 +01:00
|
|
|
&encoder_factory, &decoder_factory);
|
2018-02-02 16:24:16 +01:00
|
|
|
RunBaseTest(&test);
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-22 09:06:06 +00:00
|
|
|
TEST_P(EndToEndTestH264, SendsAndReceivesH264PacketizationMode0) {
|
2024-03-22 13:33:59 +01:00
|
|
|
SdpVideoFormat codec(cricket::kH264CodecName);
|
|
|
|
|
codec.parameters[cricket::kH264FmtpPacketizationMode] = "0";
|
2018-04-19 09:04:13 +02:00
|
|
|
test::FunctionVideoEncoderFactory encoder_factory(
|
2024-03-22 13:33:59 +01:00
|
|
|
[codec](const Environment& env, const SdpVideoFormat& format) {
|
|
|
|
|
return CreateH264Encoder(env, H264EncoderSettings::Parse(codec));
|
|
|
|
|
});
|
2018-09-28 09:07:24 +02:00
|
|
|
test::FunctionVideoDecoderFactory decoder_factory(
|
|
|
|
|
[]() { return H264Decoder::Create(); });
|
2024-08-29 13:00:40 +00:00
|
|
|
CodecObserver test(500, kVideoRotation_0, std::nullopt, "H264",
|
2018-12-12 11:17:43 +01:00
|
|
|
&encoder_factory, &decoder_factory);
|
2018-02-02 16:24:16 +01:00
|
|
|
RunBaseTest(&test);
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-22 09:06:06 +00:00
|
|
|
TEST_P(EndToEndTestH264, SendsAndReceivesH264PacketizationMode1) {
|
2024-03-22 13:33:59 +01:00
|
|
|
SdpVideoFormat codec(cricket::kH264CodecName);
|
|
|
|
|
codec.parameters[cricket::kH264FmtpPacketizationMode] = "1";
|
2018-04-19 09:04:13 +02:00
|
|
|
test::FunctionVideoEncoderFactory encoder_factory(
|
2024-03-22 13:33:59 +01:00
|
|
|
[codec](const Environment& env, const SdpVideoFormat& format) {
|
|
|
|
|
return CreateH264Encoder(env, H264EncoderSettings::Parse(codec));
|
|
|
|
|
});
|
2018-09-28 09:07:24 +02:00
|
|
|
test::FunctionVideoDecoderFactory decoder_factory(
|
|
|
|
|
[]() { return H264Decoder::Create(); });
|
2024-08-29 13:00:40 +00:00
|
|
|
CodecObserver test(500, kVideoRotation_0, std::nullopt, "H264",
|
2018-12-12 11:17:43 +01:00
|
|
|
&encoder_factory, &decoder_factory);
|
2018-02-02 16:24:16 +01:00
|
|
|
RunBaseTest(&test);
|
|
|
|
|
}
|
|
|
|
|
#endif // defined(WEBRTC_USE_H264)
|
|
|
|
|
|
|
|
|
|
} // namespace webrtc
|