Notify jitter buffer about received FEC packets (to avoid sending NACK request for these packets).

Don't copy codec specific header for empty packets in the jitter buffer.

BUG=3135
R=pbos@webrtc.org, stefan@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/37659004

git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@8184 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/video_engine/vie_receiver.cc b/video_engine/vie_receiver.cc
index cdff860..1d2485e 100644
--- a/video_engine/vie_receiver.cc
+++ b/video_engine/vie_receiver.cc
@@ -322,8 +322,11 @@
                                                     const RTPHeader& header) {
   if (rtp_payload_registry_->IsRed(header)) {
     int8_t ulpfec_pt = rtp_payload_registry_->ulpfec_payload_type();
-    if (packet[header.headerLength] == ulpfec_pt)
+    if (packet[header.headerLength] == ulpfec_pt) {
       rtp_receive_statistics_->FecPacketReceived(header, packet_length);
+      // Notify vcm about received FEC packets to avoid NACKing these packets.
+      NotifyReceiverOfFecPacket(header);
+    }
     if (fec_receiver_->AddReceivedRedPacket(
             header, packet, packet_length, ulpfec_pt) != 0) {
       return false;
@@ -360,6 +363,28 @@
   return false;
 }
 
+void ViEReceiver::NotifyReceiverOfFecPacket(const RTPHeader& header) {
+  int8_t last_media_payload_type =
+      rtp_payload_registry_->last_received_media_payload_type();
+  if (last_media_payload_type < 0) {
+    LOG(LS_WARNING) << "Failed to get last media payload type.";
+    return;
+  }
+  // Fake an empty media packet.
+  WebRtcRTPHeader rtp_header = {};
+  rtp_header.header = header;
+  rtp_header.header.payloadType = last_media_payload_type;
+  rtp_header.header.paddingLength = 0;
+  PayloadUnion payload_specific;
+  if (!rtp_payload_registry_->GetPayloadSpecifics(last_media_payload_type,
+                                                  &payload_specific)) {
+    LOG(LS_WARNING) << "Failed to get payload specifics.";
+    return;
+  }
+  rtp_header.type.Video.codec = payload_specific.Video.videoCodecType;
+  OnReceivedPayloadData(NULL, 0, &rtp_header);
+}
+
 int ViEReceiver::InsertRTCPPacket(const uint8_t* rtcp_packet,
                                   size_t rtcp_packet_length) {
   {