/* * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #include "modules/rtp_rtcp/source/ulpfec_receiver.h" #include <memory> #include <utility> #include "api/scoped_refptr.h" #include "modules/rtp_rtcp/source/rtp_packet_received.h" #include "rtc_base/logging.h" #include "rtc_base/time_utils.h" #include "system_wrappers/include/metrics.h" namespace webrtc { UlpfecReceiver::UlpfecReceiver(uint32_t ssrc, int ulpfec_payload_type, RecoveredPacketReceiver* callback, Clock* clock) : … { … } UlpfecReceiver::~UlpfecReceiver() { … } FecPacketCounter UlpfecReceiver::GetPacketCounter() const { … } // 0 1 2 3 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ // |F| block PT | timestamp offset | block length | // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ // // // RFC 2198 RTP Payload for Redundant Audio Data September 1997 // // The bits in the header are specified as follows: // // F: 1 bit First bit in header indicates whether another header block // follows. If 1 further header blocks follow, if 0 this is the // last header block. // If 0 there is only 1 byte RED header // // block PT: 7 bits RTP payload type for this block. // // timestamp offset: 14 bits Unsigned offset of timestamp of this block // relative to timestamp given in RTP header. The use of an unsigned // offset implies that redundant data must be sent after the primary // data, and is hence a time to be subtracted from the current // timestamp to determine the timestamp of the data for which this // block is the redundancy. // // block length: 10 bits Length in bytes of the corresponding data // block excluding header. bool UlpfecReceiver::AddReceivedRedPacket(const RtpPacketReceived& rtp_packet) { … } void UlpfecReceiver::ProcessReceivedFec() { … } } // namespace webrtc