Delete enum RtpVideoCodecTypes, replaced with VideoCodecType.

Bug: webrtc:8995
Change-Id: I0b44aa26f2f6a81aec7ca1281b8513d8e03228b8
Reviewed-on: https://webrtc-review.googlesource.com/79561
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23507}
diff --git a/modules/video_coding/decoding_state_unittest.cc b/modules/video_coding/decoding_state_unittest.cc
index 96ba32f..3ed2e89 100644
--- a/modules/video_coding/decoding_state_unittest.cc
+++ b/modules/video_coding/decoding_state_unittest.cc
@@ -36,7 +36,7 @@
   packet.timestamp = 1;
   packet.seqNum = 0xffff;
   packet.frameType = kVideoFrameDelta;
-  packet.video_header.codec = kRtpVideoVp8;
+  packet.video_header.codec = kVideoCodecVP8;
   packet.video_header.codecHeader.VP8.pictureId = 0x007F;
   FrameData frame_data;
   frame_data.rtt_ms = 0;
@@ -211,7 +211,7 @@
   VCMFrameBuffer frame;
   VCMPacket packet;
   packet.frameType = kVideoFrameDelta;
-  packet.video_header.codec = kRtpVideoVp8;
+  packet.video_header.codec = kVideoCodecVP8;
   packet.timestamp = 0;
   packet.seqNum = 0;
   packet.video_header.codecHeader.VP8.tl0PicIdx = 0;
@@ -365,7 +365,7 @@
   VCMPacket packet;
   frame.Reset();
   packet.frameType = kVideoFrameKey;
-  packet.video_header.codec = kRtpVideoVp8;
+  packet.video_header.codec = kVideoCodecVP8;
   packet.timestamp = 0;
   packet.seqNum = 0;
   packet.video_header.codecHeader.VP8.tl0PicIdx = 0;
@@ -418,7 +418,7 @@
   VCMFrameBuffer frame;
   VCMPacket packet;
   packet.frameType = kVideoFrameDelta;
-  packet.video_header.codec = kRtpVideoVp8;
+  packet.video_header.codec = kVideoCodecVP8;
   packet.timestamp = 0;
   packet.seqNum = 0;
   packet.video_header.codecHeader.VP8.tl0PicIdx = 0;
@@ -456,7 +456,7 @@
   uint8_t data[] = "I need a data pointer for this test!";
   packet.sizeBytes = sizeof(data);
   packet.dataPtr = data;
-  packet.video_header.codec = kRtpVideoVp9;
+  packet.video_header.codec = kVideoCodecVP9;
 
   RTPVideoHeaderVP9& vp9_hdr = packet.video_header.codecHeader.VP9;
   vp9_hdr.picture_id = 10;
@@ -499,7 +499,7 @@
   uint8_t data[] = "I need a data pointer for this test!";
   packet.sizeBytes = sizeof(data);
   packet.dataPtr = data;
-  packet.video_header.codec = kRtpVideoVp9;
+  packet.video_header.codec = kVideoCodecVP9;
 
   RTPVideoHeaderVP9& vp9_hdr = packet.video_header.codecHeader.VP9;
   vp9_hdr.picture_id = 10;
@@ -554,7 +554,7 @@
   uint8_t data[] = "I need a data pointer for this test!";
   packet.sizeBytes = sizeof(data);
   packet.dataPtr = data;
-  packet.video_header.codec = kRtpVideoVp9;
+  packet.video_header.codec = kVideoCodecVP9;
 
   RTPVideoHeaderVP9& vp9_hdr = packet.video_header.codecHeader.VP9;
   vp9_hdr.picture_id = 10;
diff --git a/modules/video_coding/encoded_frame.cc b/modules/video_coding/encoded_frame.cc
index e390557..2f7a2c7 100644
--- a/modules/video_coding/encoded_frame.cc
+++ b/modules/video_coding/encoded_frame.cc
@@ -92,7 +92,7 @@
 void VCMEncodedFrame::CopyCodecSpecific(const RTPVideoHeader* header) {
   if (header) {
     switch (header->codec) {
-      case kRtpVideoVp8: {
+      case kVideoCodecVP8: {
         if (_codecSpecificInfo.codecType != kVideoCodecVP8) {
           // This is the first packet for this frame.
           _codecSpecificInfo.codecSpecific.VP8.pictureId = -1;
@@ -119,7 +119,7 @@
         }
         break;
       }
-      case kRtpVideoVp9: {
+      case kVideoCodecVP9: {
         if (_codecSpecificInfo.codecType != kVideoCodecVP9) {
           // This is the first packet for this frame.
           _codecSpecificInfo.codecSpecific.VP9.picture_id = -1;
@@ -186,12 +186,11 @@
         }
         break;
       }
-      case kRtpVideoH264: {
+      case kVideoCodecH264: {
         _codecSpecificInfo.codecType = kVideoCodecH264;
         break;
       }
-      case kRtpVideoNone:
-      case kRtpVideoGeneric: {
+      default: {
         _codecSpecificInfo.codecType = kVideoCodecUnknown;
         break;
       }
diff --git a/modules/video_coding/jitter_buffer_unittest.cc b/modules/video_coding/jitter_buffer_unittest.cc
index 06faf21..a1447c0 100644
--- a/modules/video_coding/jitter_buffer_unittest.cc
+++ b/modules/video_coding/jitter_buffer_unittest.cc
@@ -49,7 +49,7 @@
     packet_.markerBit = true;
     packet_.frameType = kVideoFrameKey;
     packet_.codec = kVideoCodecVP9;
-    packet_.video_header.codec = kRtpVideoVp9;
+    packet_.video_header.codec = kVideoCodecVP9;
     packet_.video_header.codecHeader.VP9.flexible_mode = false;
     packet_.video_header.codecHeader.VP9.gof_idx = 0;
     packet_.video_header.codecHeader.VP9.temporal_idx = kNoTemporalIdx;
@@ -243,6 +243,7 @@
     rtpHeader.header.timestamp = timestamp_;
     rtpHeader.header.markerBit = true;
     rtpHeader.frameType = kVideoFrameDelta;
+    rtpHeader.type.Video.codec = kVideoCodecUnknown;
     packet_.reset(new VCMPacket(data_, size_, rtpHeader));
   }
 
@@ -800,6 +801,7 @@
   rtpHeader.header.sequenceNumber = seq_num_ + 2;
   rtpHeader.header.timestamp = timestamp_ + (33 * 90);
   rtpHeader.header.markerBit = false;
+  rtpHeader.type.Video.codec = kVideoCodecUnknown;
   VCMPacket empty_packet(data_, 0, rtpHeader);
   EXPECT_EQ(kOldPacket,
             jitter_buffer_->InsertPacket(empty_packet, &retransmitted));
@@ -920,7 +922,7 @@
 
   bool re = false;
   packet_->codec = kVideoCodecVP9;
-  packet_->video_header.codec = kRtpVideoVp9;
+  packet_->video_header.codec = kVideoCodecVP9;
   packet_->is_first_packet_in_frame = true;
   packet_->markerBit = true;
   packet_->video_header.codecHeader.VP9.flexible_mode = false;
@@ -973,7 +975,7 @@
 
   bool re = false;
   packet_->codec = kVideoCodecVP9;
-  packet_->video_header.codec = kRtpVideoVp9;
+  packet_->video_header.codec = kVideoCodecVP9;
   packet_->is_first_packet_in_frame = true;
   packet_->markerBit = true;
   packet_->video_header.codecHeader.VP9.flexible_mode = false;
@@ -1049,7 +1051,7 @@
 
   bool re = false;
   packet_->codec = kVideoCodecVP9;
-  packet_->video_header.codec = kRtpVideoVp9;
+  packet_->video_header.codec = kVideoCodecVP9;
   packet_->video_header.codecHeader.VP9.flexible_mode = false;
   packet_->video_header.codecHeader.VP9.beginning_of_frame = true;
   packet_->video_header.codecHeader.VP9.end_of_frame = true;
@@ -1158,7 +1160,7 @@
   packet_->is_first_packet_in_frame = true;
   packet_->markerBit = true;
   packet_->codec = kVideoCodecH264;
-  packet_->video_header.codec = kRtpVideoH264;
+  packet_->video_header.codec = kVideoCodecH264;
   packet_->video_header.codecHeader.H264.nalu_type = H264::NaluType::kIdr;
   packet_->video_header.codecHeader.H264.nalus[0].type = H264::NaluType::kIdr;
   packet_->video_header.codecHeader.H264.nalus[0].sps_id = -1;
@@ -1178,7 +1180,7 @@
   packet_->is_first_packet_in_frame = true;
   packet_->markerBit = false;
   packet_->codec = kVideoCodecH264;
-  packet_->video_header.codec = kRtpVideoH264;
+  packet_->video_header.codec = kVideoCodecH264;
   packet_->video_header.codecHeader.H264.nalu_type = H264::NaluType::kStapA;
   packet_->video_header.codecHeader.H264.nalus[0].type = H264::NaluType::kSps;
   packet_->video_header.codecHeader.H264.nalus[0].sps_id = 0;
@@ -1197,7 +1199,7 @@
   packet_->is_first_packet_in_frame = false;
   packet_->markerBit = true;
   packet_->codec = kVideoCodecH264;
-  packet_->video_header.codec = kRtpVideoH264;
+  packet_->video_header.codec = kVideoCodecH264;
   packet_->video_header.codecHeader.H264.nalu_type = H264::NaluType::kIdr;
   packet_->video_header.codecHeader.H264.nalus[0].type = H264::NaluType::kIdr;
   packet_->video_header.codecHeader.H264.nalus[0].sps_id = -1;
@@ -1219,7 +1221,7 @@
   packet_->is_first_packet_in_frame = true;
   packet_->markerBit = true;
   packet_->codec = kVideoCodecH264;
-  packet_->video_header.codec = kRtpVideoH264;
+  packet_->video_header.codec = kVideoCodecH264;
   packet_->video_header.codecHeader.H264.nalu_type = H264::NaluType::kSlice;
   packet_->video_header.codecHeader.H264.nalus[0].type = H264::NaluType::kSlice;
   packet_->video_header.codecHeader.H264.nalus[0].sps_id = -1;
@@ -2163,6 +2165,7 @@
   timestamp_ += 33 * 90;
   WebRtcRTPHeader rtpHeader;
   memset(&rtpHeader, 0, sizeof(rtpHeader));
+  rtpHeader.type.Video.codec = kVideoCodecUnknown;
   VCMPacket emptypacket(data_, 0, rtpHeader);
   emptypacket.seqNum = seq_num_;
   emptypacket.timestamp = timestamp_;
diff --git a/modules/video_coding/packet.cc b/modules/video_coding/packet.cc
index f176194..7db566a 100644
--- a/modules/video_coding/packet.cc
+++ b/modules/video_coding/packet.cc
@@ -89,8 +89,9 @@
 }
 
 void VCMPacket::CopyCodecSpecifics(const RTPVideoHeader& videoHeader) {
+  codec = videoHeader.codec;
   switch (videoHeader.codec) {
-    case kRtpVideoVp8:
+    case kVideoCodecVP8:
       // Handle all packets within a frame as depending on the previous packet
       // TODO(holmer): This should be changed to make fragments independent
       // when the VP8 RTP receiver supports fragments.
@@ -103,9 +104,8 @@
       else
         completeNALU = kNaluIncomplete;
 
-      codec = kVideoCodecVP8;
       return;
-    case kRtpVideoVp9:
+    case kVideoCodecVP9:
       if (is_first_packet_in_frame && markerBit)
         completeNALU = kNaluComplete;
       else if (is_first_packet_in_frame)
@@ -115,9 +115,8 @@
       else
         completeNALU = kNaluIncomplete;
 
-      codec = kVideoCodecVP9;
       return;
-    case kRtpVideoH264:
+    case kVideoCodecH264:
       is_first_packet_in_frame = videoHeader.is_first_packet_in_frame;
       if (is_first_packet_in_frame)
         insertStartCode = true;
@@ -131,12 +130,10 @@
       } else {
         completeNALU = kNaluIncomplete;
       }
-      codec = kVideoCodecH264;
       return;
-    case kRtpVideoGeneric:
-      codec = kVideoCodecGeneric;
+    case kVideoCodecGeneric:
       return;
-    case kRtpVideoNone:
+    default:
       codec = kVideoCodecUnknown;
       return;
   }
diff --git a/modules/video_coding/session_info.cc b/modules/video_coding/session_info.cc
index 74d7bfa..bf4adcc 100644
--- a/modules/video_coding/session_info.cc
+++ b/modules/video_coding/session_info.cc
@@ -60,9 +60,9 @@
 int VCMSessionInfo::PictureId() const {
   if (packets_.empty())
     return kNoPictureId;
-  if (packets_.front().video_header.codec == kRtpVideoVp8) {
+  if (packets_.front().video_header.codec == kVideoCodecVP8) {
     return packets_.front().video_header.codecHeader.VP8.pictureId;
-  } else if (packets_.front().video_header.codec == kRtpVideoVp9) {
+  } else if (packets_.front().video_header.codec == kVideoCodecVP9) {
     return packets_.front().video_header.codecHeader.VP9.picture_id;
   } else {
     return kNoPictureId;
@@ -72,9 +72,9 @@
 int VCMSessionInfo::TemporalId() const {
   if (packets_.empty())
     return kNoTemporalIdx;
-  if (packets_.front().video_header.codec == kRtpVideoVp8) {
+  if (packets_.front().video_header.codec == kVideoCodecVP8) {
     return packets_.front().video_header.codecHeader.VP8.temporalIdx;
-  } else if (packets_.front().video_header.codec == kRtpVideoVp9) {
+  } else if (packets_.front().video_header.codec == kVideoCodecVP9) {
     return packets_.front().video_header.codecHeader.VP9.temporal_idx;
   } else {
     return kNoTemporalIdx;
@@ -84,9 +84,9 @@
 bool VCMSessionInfo::LayerSync() const {
   if (packets_.empty())
     return false;
-  if (packets_.front().video_header.codec == kRtpVideoVp8) {
+  if (packets_.front().video_header.codec == kVideoCodecVP8) {
     return packets_.front().video_header.codecHeader.VP8.layerSync;
-  } else if (packets_.front().video_header.codec == kRtpVideoVp9) {
+  } else if (packets_.front().video_header.codec == kVideoCodecVP9) {
     return packets_.front().video_header.codecHeader.VP9.temporal_up_switch;
   } else {
     return false;
@@ -96,9 +96,9 @@
 int VCMSessionInfo::Tl0PicId() const {
   if (packets_.empty())
     return kNoTl0PicIdx;
-  if (packets_.front().video_header.codec == kRtpVideoVp8) {
+  if (packets_.front().video_header.codec == kVideoCodecVP8) {
     return packets_.front().video_header.codecHeader.VP8.tl0PicIdx;
-  } else if (packets_.front().video_header.codec == kRtpVideoVp9) {
+  } else if (packets_.front().video_header.codec == kVideoCodecVP9) {
     return packets_.front().video_header.codecHeader.VP9.tl0_pic_idx;
   } else {
     return kNoTl0PicIdx;
@@ -106,13 +106,14 @@
 }
 
 bool VCMSessionInfo::NonReference() const {
-  if (packets_.empty() || packets_.front().video_header.codec != kRtpVideoVp8)
+  if (packets_.empty() || packets_.front().video_header.codec != kVideoCodecVP8)
     return false;
   return packets_.front().video_header.codecHeader.VP8.nonReference;
 }
 
 std::vector<NaluInfo> VCMSessionInfo::GetNaluInfos() const {
-  if (packets_.empty() || packets_.front().video_header.codec != kRtpVideoH264)
+  if (packets_.empty() ||
+      packets_.front().video_header.codec != kVideoCodecH264)
     return std::vector<NaluInfo>();
   std::vector<NaluInfo> nalu_infos;
   for (const VCMPacket& packet : packets_) {
@@ -125,7 +126,8 @@
 }
 
 void VCMSessionInfo::SetGofInfo(const GofInfoVP9& gof_info, size_t idx) {
-  if (packets_.empty() || packets_.front().video_header.codec != kRtpVideoVp9 ||
+  if (packets_.empty() ||
+      packets_.front().video_header.codec != kVideoCodecVP9 ||
       packets_.front().video_header.codecHeader.VP9.flexible_mode) {
     return;
   }
@@ -185,7 +187,7 @@
   // header supplied by the H264 depacketizer.
   const size_t kH264NALHeaderLengthInBytes = 1;
   const size_t kLengthFieldLength = 2;
-  if (packet.video_header.codec == kRtpVideoH264 &&
+  if (packet.video_header.codec == kVideoCodecH264 &&
       packet.video_header.codecHeader.H264.packetization_type == kH264StapA) {
     size_t required_length = 0;
     const uint8_t* nalu_ptr = packet_buffer + kH264NALHeaderLengthInBytes;
diff --git a/modules/video_coding/utility/simulcast_rate_allocator_unittest.cc b/modules/video_coding/utility/simulcast_rate_allocator_unittest.cc
index aa9b320..446fa7e 100644
--- a/modules/video_coding/utility/simulcast_rate_allocator_unittest.cc
+++ b/modules/video_coding/utility/simulcast_rate_allocator_unittest.cc
@@ -48,6 +48,7 @@
  public:
   SimulcastRateAllocatorTest() {
     memset(&codec_, 0, sizeof(VideoCodec));
+    codec_.codecType = kVideoCodecVP8;
     codec_.minBitrate = kMinBitrateKbps;
     codec_.targetBitrate = kTargetBitrateKbps;
     codec_.maxBitrate = kMaxBitrateKbps;
diff --git a/modules/video_coding/video_receiver_unittest.cc b/modules/video_coding/video_receiver_unittest.cc
index 9e01feb..feca48e 100644
--- a/modules/video_coding/video_receiver_unittest.cc
+++ b/modules/video_coding/video_receiver_unittest.cc
@@ -106,7 +106,7 @@
   header.header.payloadType = kUnusedPayloadType;
   header.header.ssrc = 1;
   header.header.headerLength = 12;
-  header.type.Video.codec = kRtpVideoVp8;
+  header.type.Video.codec = kVideoCodecVP8;
   for (int i = 0; i < 10; ++i) {
     EXPECT_CALL(packet_request_callback_, ResendPackets(_, _)).Times(0);
     InsertAndVerifyPaddingFrame(payload, &header);
@@ -130,7 +130,7 @@
   header.header.payloadType = kUnusedPayloadType;
   header.header.ssrc = 1;
   header.header.headerLength = 12;
-  header.type.Video.codec = kRtpVideoVp8;
+  header.type.Video.codec = kVideoCodecVP8;
   // Insert one video frame to get one frame decoded.
   header.frameType = kVideoFrameKey;
   header.type.Video.is_first_packet_in_frame = true;
@@ -182,7 +182,7 @@
   header.header.payloadType = kUnusedPayloadType;
   header.header.ssrc = 1;
   header.header.headerLength = 12;
-  header.type.Video.codec = kRtpVideoVp8;
+  header.type.Video.codec = kVideoCodecVP8;
   header.type.Video.codecHeader.VP8.pictureId = -1;
   header.type.Video.codecHeader.VP8.tl0PicIdx = -1;
   for (int i = 0; i < 3; ++i) {