From 01a89904c05359b335bbbe686c216a0a092f904d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A1ri=20Tristan=20Helgason?= Date: Mon, 27 Aug 2018 13:26:52 +0200 Subject: [PATCH] Remove deprecated type alias for RtpVideoCodecTypes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit First phase of this removal landed with cl https://webrtc-review.googlesource.com/79561 Bug: webrtc:8995 Change-Id: I9dc152e2f1bac17e2959af7e18106760ca5435c8 Reviewed-on: https://webrtc-review.googlesource.com/95720 Commit-Queue: Kári Helgason Reviewed-by: Karl Wiberg Reviewed-by: Niels Moller Cr-Commit-Position: refs/heads/master@{#24447} --- common_types.h | 7 ------- modules/include/module_common_types.h | 3 --- modules/rtp_rtcp/source/rtp_format.cc | 7 ++----- modules/rtp_rtcp/source/rtp_payload_registry.cc | 13 +------------ 4 files changed, 3 insertions(+), 27 deletions(-) diff --git a/common_types.h b/common_types.h index beb6bcaf50..8617c9ee93 100644 --- a/common_types.h +++ b/common_types.h @@ -342,13 +342,6 @@ enum VideoCodecType { kVideoCodecMultiplex, // DEPRECATED. Do not use. kVideoCodecUnknown, - - // TODO(nisse): Deprecated aliases, for code expecting RtpVideoCodecTypes. - kRtpVideoNone = kVideoCodecGeneric, - kRtpVideoGeneric = kVideoCodecGeneric, - kRtpVideoVp8 = kVideoCodecVP8, - kRtpVideoVp9 = kVideoCodecVP9, - kRtpVideoH264 = kVideoCodecH264, }; // Translates from name of codec to codec type and vice versa. diff --git a/modules/include/module_common_types.h b/modules/include/module_common_types.h index 4175c411d5..8ee2369e15 100644 --- a/modules/include/module_common_types.h +++ b/modules/include/module_common_types.h @@ -32,9 +32,6 @@ namespace webrtc { -// TODO(nisse): Deprecated, use webrtc::VideoCodecType instead. -using RtpVideoCodecTypes = VideoCodecType; - struct WebRtcRTPHeader { RTPVideoHeader& video_header() { return video; } const RTPVideoHeader& video_header() const { return video; } diff --git a/modules/rtp_rtcp/source/rtp_format.cc b/modules/rtp_rtcp/source/rtp_format.cc index 1078a66810..293181e780 100644 --- a/modules/rtp_rtcp/source/rtp_format.cc +++ b/modules/rtp_rtcp/source/rtp_format.cc @@ -23,7 +23,7 @@ RtpPacketizer* RtpPacketizer::Create(VideoCodecType type, size_t last_packet_reduction_len, const RTPVideoHeader* rtp_video_header, FrameType frame_type) { - RTC_CHECK(type == kVideoCodecGeneric || rtp_video_header); + RTC_CHECK(rtp_video_header); switch (type) { case kVideoCodecH264: { const auto& h264 = @@ -40,13 +40,10 @@ RtpPacketizer* RtpPacketizer::Create(VideoCodecType type, return new RtpPacketizerVp9(vp9, max_payload_len, last_packet_reduction_len); } - case kVideoCodecGeneric: - RTC_CHECK(rtp_video_header); + default: return new RtpPacketizerGeneric(*rtp_video_header, frame_type, max_payload_len, last_packet_reduction_len); - default: - RTC_NOTREACHED(); } return nullptr; } diff --git a/modules/rtp_rtcp/source/rtp_payload_registry.cc b/modules/rtp_rtcp/source/rtp_payload_registry.cc index 74a7788261..4bbb03a08b 100644 --- a/modules/rtp_rtcp/source/rtp_payload_registry.cc +++ b/modules/rtp_rtcp/source/rtp_payload_registry.cc @@ -47,20 +47,9 @@ RtpUtility::Payload CreatePayloadType(const SdpAudioFormat& audio_format) { PayloadUnion(AudioPayload{audio_format, 0})}; } -RtpVideoCodecTypes ConvertToRtpVideoCodecType(VideoCodecType type) { - switch (type) { - case kVideoCodecVP8: - case kVideoCodecVP9: - case kVideoCodecH264: - return type; - default: - return kVideoCodecGeneric; - } -} - RtpUtility::Payload CreatePayloadType(const VideoCodec& video_codec) { VideoPayload p; - p.videoCodecType = ConvertToRtpVideoCodecType(video_codec.codecType); + p.videoCodecType = video_codec.codecType; if (video_codec.codecType == kVideoCodecH264) p.h264_profile = video_codec.H264().profile; return {CodecTypeToPayloadString(video_codec.codecType), PayloadUnion(p)};