Remove screen_share_config from the VideoConfig.

After the migration of the pc framework tests (https://webrtc-review.googlesource.com/c/src/+/174023), having "absl::optional<ScreenShareConfig> screen_share_config" field in VideoConfig became redundant. Replaced it with VideoTrackInterface::ContentHint content_hint field.

Bug: webrtc:11534
Change-Id: Ibf4b1c8daed95ef02111fe952171f11e290905d3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174702
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Andrey Logvin <landrey@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31187}
This commit is contained in:
Andrey Logvin 2020-05-08 08:02:49 +00:00 committed by Commit Bot
parent 553c869c58
commit 435fb9ad06
8 changed files with 39 additions and 34 deletions

View File

@ -362,6 +362,7 @@ rtc_source_set("peer_connection_quality_test_fixture_api") {
":frame_generator_api",
":function_view",
":libjingle_peerconnection_api",
":media_stream_interface",
":network_state_predictor_api",
":packet_socket_factory",
":simulated_network_api",

View File

@ -42,7 +42,7 @@ void ValidateScreenShareConfig(const VideoConfig& video_config,
RTC_CHECK_EQ(video_config.height, kDefaultSlidesHeight);
}
}
if (video_config.screen_share_config->scrolling_params) {
if (screen_share_config.scrolling_params) {
RTC_CHECK_LE(screen_share_config.scrolling_params->duration,
screen_share_config.slide_change_interval);
RTC_CHECK_GE(screen_share_config.scrolling_params->source_width,

View File

@ -23,6 +23,7 @@
#include "api/call/call_factory_interface.h"
#include "api/fec_controller.h"
#include "api/function_view.h"
#include "api/media_stream_interface.h"
#include "api/peer_connection_interface.h"
#include "api/rtc_event_log/rtc_event_log_factory_interface.h"
#include "api/task_queue/task_queue_factory.h"
@ -113,9 +114,6 @@ class PeerConnectionE2EQualityTestFixture {
// must be equal to |kDefaultSlidesWidth| and
// |ScrollingParams::source_height| must be equal to |kDefaultSlidesHeight|.
std::vector<std::string> slides_yuv_file_names;
// If true will set VideoTrackInterface::ContentHint::kText for current
// video track.
bool use_text_content_hint = true;
};
enum VideoGeneratorType { kDefault, kI420A, kI010 };
@ -170,11 +168,9 @@ class PeerConnectionE2EQualityTestFixture {
// Have to be unique among all specified configs for all peers in the call.
// Will be auto generated if omitted.
absl::optional<std::string> stream_label;
// If set, determines whether VideoTrackInterface::ContentHint::kText is set
// for the current video track.
// TODO(landrey) replace by use_text_content_hint boolean field.
absl::optional<ScreenShareConfig> screen_share_config;
// Will be set for current video track. If equals to kText or kDetailed -
// screencast in on.
absl::optional<VideoTrackInterface::ContentHint> content_hint;
// If specified this capturing device will be used to get input video. The
// |capturing_device_index| is the index of required capturing device in OS
// provided list of video devices. On Linux and Windows the list will be

View File

@ -275,6 +275,7 @@ if (rtc_include_tests) {
"../..:video_test_common",
"../../../api:create_frame_generator",
"../../../api:frame_generator_api",
"../../../api:media_stream_interface",
"../../../api:peer_connection_quality_test_fixture_api",
"../../../api/video:video_frame",
"../../../pc:peerconnection",
@ -428,6 +429,7 @@ if (rtc_include_tests) {
"../../../api:create_peer_connection_quality_test_frame_generator",
"../../../api:create_peerconnection_quality_test_fixture",
"../../../api:libjingle_peerconnection_api",
"../../../api:media_stream_interface",
"../../../api:network_emulation_manager_api",
"../../../api:peer_connection_quality_test_fixture_api",
"../../../api:scoped_refptr",

View File

@ -12,6 +12,7 @@
#include <string>
#include <utility>
#include "api/media_stream_interface.h"
#include "api/test/create_frame_generator.h"
#include "test/frame_generator_capturer.h"
#include "test/platform_video_capturer.h"
@ -57,20 +58,21 @@ MediaHelper::MaybeAddVideo(TestPeer* peer) {
video_config, peer->ReleaseVideoGenerator(i),
video_quality_analyzer_injection_helper_->CreateFramePreprocessor(
video_config));
bool is_screencast =
video_config.content_hint == VideoTrackInterface::ContentHint::kText ||
video_config.content_hint ==
VideoTrackInterface::ContentHint::kDetailed;
rtc::scoped_refptr<TestVideoCapturerVideoTrackSource> source =
new rtc::RefCountedObject<TestVideoCapturerVideoTrackSource>(
std::move(capturer),
/*is_screencast=*/video_config.screen_share_config &&
video_config.screen_share_config->use_text_content_hint);
std::move(capturer), is_screencast);
out.push_back(source);
RTC_LOG(INFO) << "Adding video with video_config.stream_label="
<< video_config.stream_label.value();
rtc::scoped_refptr<VideoTrackInterface> track =
peer->pc_factory()->CreateVideoTrack(video_config.stream_label.value(),
source);
if (video_config.screen_share_config &&
video_config.screen_share_config->use_text_content_hint) {
track->set_content_hint(VideoTrackInterface::ContentHint::kText);
if (video_config.content_hint.has_value()) {
track->set_content_hint(video_config.content_hint.value());
}
std::string sync_group = video_config.sync_group
? video_config.sync_group.value()

View File

@ -11,6 +11,7 @@
#include <cstdint>
#include <memory>
#include "api/media_stream_interface.h"
#include "api/test/create_network_emulation_manager.h"
#include "api/test/create_peer_connection_quality_test_frame_generator.h"
#include "api/test/create_peerconnection_quality_test_fixture.h"
@ -169,12 +170,13 @@ TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Smoke) {
VideoConfig screenshare(640, 360, 30);
screenshare.stream_label = "bob-screenshare";
screenshare.screen_share_config =
screenshare.content_hint = VideoTrackInterface::ContentHint::kText;
ScreenShareConfig screen_share_config =
ScreenShareConfig(TimeDelta::Seconds(2));
screenshare.screen_share_config->scrolling_params = ScrollingParams(
screen_share_config.scrolling_params = ScrollingParams(
TimeDelta::Millis(1800), kDefaultSlidesWidth, kDefaultSlidesHeight);
auto screen_share_frame_generator = CreateScreenShareFrameGenerator(
screenshare, *screenshare.screen_share_config);
auto screen_share_frame_generator =
CreateScreenShareFrameGenerator(screenshare, screen_share_config);
bob->AddVideoConfig(std::move(screenshare),
std::move(screen_share_frame_generator));

View File

@ -371,6 +371,7 @@ if (rtc_include_tests) {
"../api:create_peer_connection_quality_test_frame_generator",
"../api:create_peerconnection_quality_test_fixture",
"../api:frame_generator_api",
"../api:media_stream_interface",
"../api:network_emulation_manager_api",
"../api:peer_connection_quality_test_fixture_api",
"../api:simulated_network_api",

View File

@ -12,6 +12,7 @@
#include <utility>
#include <vector>
#include "api/media_stream_interface.h"
#include "api/test/create_network_emulation_manager.h"
#include "api/test/create_peer_connection_quality_test_frame_generator.h"
#include "api/test/create_peerconnection_quality_test_fixture.h"
@ -1119,10 +1120,10 @@ TEST(PCFullStackTest, ScreenshareSlidesVP8_2TL_NoConferenceMode) {
BuiltInNetworkBehaviorConfig()),
[](PeerConfigurer* alice) {
VideoConfig video(1850, 1110, 5);
video.screen_share_config = ScreenShareConfig(TimeDelta::Seconds(10));
video.stream_label = "alice-video";
auto frame_generator =
CreateScreenShareFrameGenerator(video, *video.screen_share_config);
video.content_hint = VideoTrackInterface::ContentHint::kText;
auto frame_generator = CreateScreenShareFrameGenerator(
video, ScreenShareConfig(TimeDelta::Seconds(10)));
alice->AddVideoConfig(std::move(video), std::move(frame_generator));
},
[](PeerConfigurer* bob) {});
@ -1142,10 +1143,10 @@ TEST(PCFullStackTest, ScreenshareSlidesVP8_2TL) {
BuiltInNetworkBehaviorConfig()),
[](PeerConfigurer* alice) {
VideoConfig video(1850, 1110, 5);
video.screen_share_config = ScreenShareConfig(TimeDelta::Seconds(10));
video.stream_label = "alice-video";
auto frame_generator =
CreateScreenShareFrameGenerator(video, *video.screen_share_config);
video.content_hint = VideoTrackInterface::ContentHint::kText;
auto frame_generator = CreateScreenShareFrameGenerator(
video, ScreenShareConfig(TimeDelta::Seconds(10)));
alice->AddVideoConfig(std::move(video), std::move(frame_generator));
},
[](PeerConfigurer* bob) {});
@ -1168,12 +1169,12 @@ TEST(PCFullStackTest, ScreenshareSlidesVP8_2TL_Simulcast_NoConferenceMode) {
BuiltInNetworkBehaviorConfig()),
[](PeerConfigurer* alice) {
VideoConfig video(1850, 1110, 30);
video.screen_share_config = ScreenShareConfig(TimeDelta::Seconds(10));
video.simulcast_config = VideoSimulcastConfig(2, 1);
video.temporal_layers_count = 2;
video.stream_label = "alice-video";
auto frame_generator =
CreateScreenShareFrameGenerator(video, *video.screen_share_config);
video.content_hint = VideoTrackInterface::ContentHint::kText;
auto frame_generator = CreateScreenShareFrameGenerator(
video, ScreenShareConfig(TimeDelta::Seconds(10)));
alice->AddVideoConfig(std::move(video), std::move(frame_generator));
},
[](PeerConfigurer* bob) {});
@ -1193,12 +1194,12 @@ TEST(PCFullStackTest, ScreenshareSlidesVP8_2TL_Simulcast) {
BuiltInNetworkBehaviorConfig()),
[](PeerConfigurer* alice) {
VideoConfig video(1850, 1110, 30);
video.screen_share_config = ScreenShareConfig(TimeDelta::Seconds(10));
video.simulcast_config = VideoSimulcastConfig(2, 1);
video.temporal_layers_count = 2;
video.stream_label = "alice-video";
auto frame_generator =
CreateScreenShareFrameGenerator(video, *video.screen_share_config);
video.content_hint = VideoTrackInterface::ContentHint::kText;
auto frame_generator = CreateScreenShareFrameGenerator(
video, ScreenShareConfig(TimeDelta::Seconds(10)));
alice->AddVideoConfig(std::move(video), std::move(frame_generator));
},
[](PeerConfigurer* bob) {});
@ -1435,10 +1436,10 @@ TEST(PCFullStackTest, ScreenshareSlidesVP9_3SL_High_Fps) {
[](PeerConfigurer* alice) {
VideoConfig video(1850, 1110, 30);
video.stream_label = "alice-video";
video.screen_share_config = ScreenShareConfig(TimeDelta::Seconds(10));
video.simulcast_config = VideoSimulcastConfig(3, 2);
auto frame_generator =
CreateScreenShareFrameGenerator(video, *video.screen_share_config);
video.content_hint = VideoTrackInterface::ContentHint::kText;
auto frame_generator = CreateScreenShareFrameGenerator(
video, ScreenShareConfig(TimeDelta::Seconds(10)));
alice->AddVideoConfig(std::move(video), std::move(frame_generator));
},
[](PeerConfigurer* bob) {});