Revert of Add content type information to encoded images and corresponding rtp extension header (patchset #4 id:400001 of https://codereview.webrtc.org/2812913002/ )
Reason for revert:
Breaks android buildbots.
Original issue's description:
> Reland of Add content type information to encoded images and corresponding rtp extension header (patchset #1 id:1 of https://codereview.webrtc.org/2816463002/ )
>
> Reason for revert:
> Reland with appropriate changes to API to not break depending projects.
>
> Original issue's description:
> > Revert of Add content type information to encoded images and corresponding rtp extension header (patchset #31 id:600001 of https://codereview.webrtc.org/2772033002/ )
> >
> > Reason for revert:
> > Breaks dependent projects.
> >
> > Original issue's description:
> > > Add content type information to Encoded Images and add corresponding RTP extension header.
> > > Use it to separate UMA e2e delay metric between screenshare from video.
> > > Content type extension is set based on encoder settings and processed and decoders.
> > >
> > > Also,
> > > Fix full-stack-tests to calculate RTT correctly, so new metric could be tested.
> > >
> > > BUG=webrtc:7420
> > >
> > > Review-Url: https://codereview.webrtc.org/2772033002
> > > Cr-Commit-Position: refs/heads/master@{#17640}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/64e739aeae5629cbbebf2a19e1d3e6b452bb6d0b
> >
> > TBR=tommi@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,nisse@webrtc.org,mflodman@webrtc.org
> > # Skipping CQ checks because original CL landed less than 1 days ago.
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > NOTRY=true
> > BUG=webrtc:7420
> >
> > Review-Url: https://codereview.webrtc.org/2816463002
> > Cr-Commit-Position: refs/heads/master@{#17644}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/57218668083fce36a55efb8c8f1d31785253b8c0
>
> TBR=tommi@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,nisse@webrtc.org,mflodman@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:7420
>
> Review-Url: https://codereview.webrtc.org/2812913002
> Cr-Commit-Position: refs/heads/master@{#17651}
> Committed: https://chromium.googlesource.com/external/webrtc/+/774f6b4b968b46d6bd95c42eec0ce3202b47f0b2
TBR=tommi@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,nisse@webrtc.org,mflodman@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:7420
Review-Url: https://codereview.webrtc.org/2809653004
Cr-Commit-Position: refs/heads/master@{#17653}
diff --git a/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc b/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc
index 315d347..84bfafb 100644
--- a/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc
+++ b/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc
@@ -367,9 +367,6 @@
encoded_image_.ntp_time_ms_ = input_frame.ntp_time_ms();
encoded_image_.capture_time_ms_ = input_frame.render_time_ms();
encoded_image_.rotation_ = input_frame.rotation();
- encoded_image_.content_type_ = (mode_ == kScreensharing)
- ? VideoContentType::SCREENSHARE
- : VideoContentType::UNSPECIFIED;
encoded_image_._frameType = ConvertToVideoFrameType(info.eFrameType);
// Split encoded image up into fragments. This also updates |encoded_image_|.
diff --git a/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc b/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc
index 66db72c..41fd7ff 100644
--- a/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc
+++ b/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc
@@ -878,9 +878,6 @@
encoded_images_[encoder_idx].capture_time_ms_ =
input_image.render_time_ms();
encoded_images_[encoder_idx].rotation_ = input_image.rotation();
- encoded_images_[encoder_idx].content_type_ =
- (codec_.mode == kScreensharing) ? VideoContentType::SCREENSHARE
- : VideoContentType::UNSPECIFIED;
int qp = -1;
vpx_codec_control(&encoders_[encoder_idx], VP8E_GET_LAST_QUANTIZER_64, &qp);
diff --git a/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc b/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc
index 4b0f99e..4d7df86 100644
--- a/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc
+++ b/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc
@@ -706,9 +706,6 @@
encoded_image_._timeStamp = input_image_->timestamp();
encoded_image_.capture_time_ms_ = input_image_->render_time_ms();
encoded_image_.rotation_ = input_image_->rotation();
- encoded_image_.content_type_ = (codec_.mode == kScreensharing)
- ? VideoContentType::SCREENSHARE
- : VideoContentType::UNSPECIFIED;
encoded_image_._encodedHeight = raw_->d_h;
encoded_image_._encodedWidth = raw_->d_w;
int qp = -1;
diff --git a/webrtc/modules/video_coding/encoded_frame.cc b/webrtc/modules/video_coding/encoded_frame.cc
index 1807fa5..fb12c5b 100644
--- a/webrtc/modules/video_coding/encoded_frame.cc
+++ b/webrtc/modules/video_coding/encoded_frame.cc
@@ -87,7 +87,6 @@
_codecSpecificInfo.codecType = kVideoCodecUnknown;
_codec = kVideoCodecUnknown;
rotation_ = kVideoRotation_0;
- content_type_ = VideoContentType::UNSPECIFIED;
_rotation_set = false;
}
diff --git a/webrtc/modules/video_coding/encoded_frame.h b/webrtc/modules/video_coding/encoded_frame.h
index 96f9d00..840cd20 100644
--- a/webrtc/modules/video_coding/encoded_frame.h
+++ b/webrtc/modules/video_coding/encoded_frame.h
@@ -77,12 +77,8 @@
*/
VideoRotation rotation() const { return rotation_; }
/**
- * Get video content type
- */
- VideoContentType contentType() const { return content_type_; }
- /**
- * True if this frame is complete, false otherwise
- */
+ * True if this frame is complete, false otherwise
+ */
bool Complete() const { return _completeFrame; }
/**
* True if there's a frame missing before this frame
diff --git a/webrtc/modules/video_coding/frame_buffer.cc b/webrtc/modules/video_coding/frame_buffer.cc
index 5ea12dc..1439a17 100644
--- a/webrtc/modules/video_coding/frame_buffer.cc
+++ b/webrtc/modules/video_coding/frame_buffer.cc
@@ -163,7 +163,6 @@
RTC_DCHECK(!_rotation_set);
rotation_ = packet.video_header.rotation;
_rotation_set = true;
- content_type_ = packet.video_header.content_type;
}
if (packet.is_first_packet_in_frame) {
diff --git a/webrtc/modules/video_coding/frame_object.cc b/webrtc/modules/video_coding/frame_object.cc
index 9e5ce09..70b0a02 100644
--- a/webrtc/modules/video_coding/frame_object.cc
+++ b/webrtc/modules/video_coding/frame_object.cc
@@ -79,7 +79,6 @@
// (HEVC)).
rotation_ = last_packet->video_header.rotation;
_rotation_set = true;
- content_type_ = last_packet->video_header.content_type;
}
RtpFrameObject::~RtpFrameObject() {
diff --git a/webrtc/modules/video_coding/generic_decoder.cc b/webrtc/modules/video_coding/generic_decoder.cc
index f5d9cfe..2121ab6 100644
--- a/webrtc/modules/video_coding/generic_decoder.cc
+++ b/webrtc/modules/video_coding/generic_decoder.cc
@@ -87,7 +87,7 @@
decodedImage.set_timestamp_us(
frameInfo->renderTimeMs * rtc::kNumMicrosecsPerMillisec);
decodedImage.set_rotation(frameInfo->rotation);
- _receiveCallback->FrameToRender(decodedImage, qp, frameInfo->content_type);
+ _receiveCallback->FrameToRender(decodedImage, qp);
}
int32_t VCMDecodedFrameCallback::ReceivedDecodedReferenceFrame(
@@ -131,8 +131,7 @@
_decoder(decoder),
_codecType(kVideoCodecUnknown),
_isExternal(isExternal),
- _keyFrameDecoded(false),
- _last_keyframe_content_type(VideoContentType::UNSPECIFIED) {}
+ _keyFrameDecoded(false) {}
VCMGenericDecoder::~VCMGenericDecoder() {}
@@ -150,15 +149,6 @@
_frameInfos[_nextFrameInfoIdx].decodeStartTimeMs = nowMs;
_frameInfos[_nextFrameInfoIdx].renderTimeMs = frame.RenderTimeMs();
_frameInfos[_nextFrameInfoIdx].rotation = frame.rotation();
- // Set correctly only for key frames. Thus, use latest key frame
- // content type. If the corresponding key frame was lost, decode will fail
- // and content type will be ignored.
- if (frame.FrameType() == kVideoFrameKey) {
- _frameInfos[_nextFrameInfoIdx].content_type = frame.contentType();
- _last_keyframe_content_type = frame.contentType();
- } else {
- _frameInfos[_nextFrameInfoIdx].content_type = _last_keyframe_content_type;
- }
_callback->Map(frame.TimeStamp(), &_frameInfos[_nextFrameInfoIdx]);
_nextFrameInfoIdx = (_nextFrameInfoIdx + 1) % kDecoderFrameMemoryLength;
diff --git a/webrtc/modules/video_coding/generic_decoder.h b/webrtc/modules/video_coding/generic_decoder.h
index 71b8d81..891ec89 100644
--- a/webrtc/modules/video_coding/generic_decoder.h
+++ b/webrtc/modules/video_coding/generic_decoder.h
@@ -30,7 +30,6 @@
int64_t decodeStartTimeMs;
void* userData;
VideoRotation rotation;
- VideoContentType content_type;
};
class VCMDecodedFrameCallback : public DecodedImageCallback {
@@ -110,7 +109,6 @@
VideoCodecType _codecType;
bool _isExternal;
bool _keyFrameDecoded;
- VideoContentType _last_keyframe_content_type;
};
} // namespace webrtc
diff --git a/webrtc/modules/video_coding/include/mock/mock_vcm_callbacks.h b/webrtc/modules/video_coding/include/mock/mock_vcm_callbacks.h
index 21b154f..8a53c1d 100644
--- a/webrtc/modules/video_coding/include/mock/mock_vcm_callbacks.h
+++ b/webrtc/modules/video_coding/include/mock/mock_vcm_callbacks.h
@@ -33,8 +33,7 @@
MockVCMReceiveCallback() {}
virtual ~MockVCMReceiveCallback() {}
- MOCK_METHOD3(FrameToRender,
- int32_t(VideoFrame&, rtc::Optional<uint8_t>, VideoContentType));
+ MOCK_METHOD2(FrameToRender, int32_t(VideoFrame&, rtc::Optional<uint8_t>));
MOCK_METHOD1(ReceivedDecodedReferenceFrame, int32_t(const uint64_t));
MOCK_METHOD1(OnIncomingPayloadType, void(int));
MOCK_METHOD1(OnDecoderImplementationName, void(const char*));
diff --git a/webrtc/modules/video_coding/include/video_coding_defines.h b/webrtc/modules/video_coding/include/video_coding_defines.h
index 8eaac74..4ed80a6 100644
--- a/webrtc/modules/video_coding/include/video_coding_defines.h
+++ b/webrtc/modules/video_coding/include/video_coding_defines.h
@@ -61,17 +61,8 @@
// rendered.
class VCMReceiveCallback {
public:
- // TODO(ilnik): Once deprecation is complete, change this to pure virtual.
virtual int32_t FrameToRender(VideoFrame& videoFrame, // NOLINT
- rtc::Optional<uint8_t> qp,
- VideoContentType /*content_type*/) {
- return FrameToRender(videoFrame, qp);
- }
- // DEPRECATED. Use the other overloaded version.
- virtual int32_t FrameToRender(VideoFrame& videoFrame, // NOLINT
- rtc::Optional<uint8_t> qp) {
- return -1;
- }
+ rtc::Optional<uint8_t> qp) = 0;
virtual int32_t ReceivedDecodedReferenceFrame(const uint64_t pictureId) {
return -1;
}