Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(348)

Unified Diff: webrtc/video/vie_encoder.cc

Issue 2772033002: Add content type information to encoded images and corresponding rtp extension header (Closed)
Patch Set: Set EncodedImage content_type from vie_encoder Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/video/vie_encoder.cc
diff --git a/webrtc/video/vie_encoder.cc b/webrtc/video/vie_encoder.cc
index c30752b6dfb048e96d40a5f2e2e25853fe4b529e..f8a906f815c75060cfd7d7e5557f47e74ae435a9 100644
--- a/webrtc/video/vie_encoder.cc
+++ b/webrtc/video/vie_encoder.cc
@@ -256,7 +256,8 @@ ViEEncoder::ViEEncoder(uint32_t number_of_cores,
SendStatisticsProxy* stats_proxy,
const VideoSendStream::Config::EncoderSettings& settings,
rtc::VideoSinkInterface<VideoFrame>* pre_encode_callback,
- EncodedFrameObserver* encoder_timing)
+ EncodedFrameObserver* encoder_timing,
+ VideoEncoderConfig::ContentType content_type)
: shutdown_event_(true /* manual_reset */, false),
number_of_cores_(number_of_cores),
initial_rampup_(0),
@@ -265,6 +266,7 @@ ViEEncoder::ViEEncoder(uint32_t number_of_cores,
settings_(settings),
codec_type_(PayloadNameToCodecType(settings.payload_name)
.value_or(VideoCodecType::kVideoCodecUnknown)),
+ content_type_(content_type),
video_sender_(Clock::GetRealTimeClock(), this, this),
overuse_detector_(GetCpuOveruseOptions(settings.full_overuse_time),
this,
@@ -408,8 +410,8 @@ void ViEEncoder::ConfigureEncoderOnTaskQueue(VideoEncoderConfig config,
if (last_frame_info_) {
ReconfigureEncoder();
} else if (settings_.internal_source) {
- last_frame_info_ = rtc::Optional<VideoFrameInfo>(
- VideoFrameInfo(176, 144, kVideoRotation_0, false));
+ last_frame_info_ = rtc::Optional<VideoFrameInfo>(VideoFrameInfo(
+ 176, 144, kVideoRotation_0, kVideoContent_Default, false));
ReconfigureEncoder();
}
}
@@ -483,7 +485,8 @@ void ViEEncoder::ConfigureQualityScaler() {
void ViEEncoder::OnFrame(const VideoFrame& video_frame) {
RTC_DCHECK_RUNS_SERIALIZED(&incoming_frame_race_checker_);
VideoFrame incoming_frame = video_frame;
-
+ if (content_type_ == VideoEncoderConfig::ContentType::kScreen)
+ incoming_frame.set_content_type(kVideoContent_Screenshare);
// Local time in webrtc time base.
int64_t current_time_us = clock_->TimeInMicroseconds();
int64_t current_time_ms = current_time_us / rtc::kNumMicrosecsPerMillisec;
@@ -567,9 +570,9 @@ void ViEEncoder::EncodeVideoFrame(const VideoFrame& video_frame,
video_frame.rotation() != last_frame_info_->rotation ||
video_frame.is_texture() != last_frame_info_->is_texture) {
pending_encoder_reconfiguration_ = true;
- last_frame_info_ = rtc::Optional<VideoFrameInfo>(
- VideoFrameInfo(video_frame.width(), video_frame.height(),
- video_frame.rotation(), video_frame.is_texture()));
+ last_frame_info_ = rtc::Optional<VideoFrameInfo>(VideoFrameInfo(
+ video_frame.width(), video_frame.height(), video_frame.rotation(),
+ video_frame.content_type(), video_frame.is_texture()));
LOG(LS_INFO) << "Video frame parameters changed: dimensions="
<< last_frame_info_->width << "x" << last_frame_info_->height
<< ", rotation=" << last_frame_info_->rotation

Powered by Google App Engine
This is Rietveld 408576698