Add ability to provide TEXT hint only when requested in PC framework

Bug: webrtc:10138
Change-Id: I1e4d14d7dd02091c656643a77d2d858d5dd606ad
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151913
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29123}
This commit is contained in:
Artem Titov 2019-09-09 13:48:21 +02:00 committed by Commit Bot
parent 9509d95c48
commit b3f1487cbe
2 changed files with 7 additions and 2 deletions

View File

@ -110,6 +110,9 @@ 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 };

View File

@ -691,14 +691,16 @@ PeerConnectionE2EQualityTest::MaybeAddVideo(TestPeer* peer) {
rtc::scoped_refptr<FrameGeneratorCapturerVideoTrackSource> source =
new rtc::RefCountedObject<FrameGeneratorCapturerVideoTrackSource>(
std::move(capturer),
/*is_screencast=*/video_config.screen_share_config.has_value());
/*is_screencast=*/video_config.screen_share_config &&
video_config.screen_share_config->use_text_content_hint);
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) {
if (video_config.screen_share_config &&
video_config.screen_share_config->use_text_content_hint) {
track->set_content_hint(VideoTrackInterface::ContentHint::kText);
}
RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>> sender =