LCOV - code coverage report
Current view: top level - media/webrtc/trunk/webrtc/modules/rtp_rtcp/source/rtcp_packet - pli.cc (source / functions) Hit Total Coverage
Test: output.info Lines: 0 17 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 2 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :  *  Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
       3             :  *
       4             :  *  Use of this source code is governed by a BSD-style license
       5             :  *  that can be found in the LICENSE file in the root of the source
       6             :  *  tree. An additional intellectual property rights grant can be found
       7             :  *  in the file PATENTS.  All contributing project authors may
       8             :  *  be found in the AUTHORS file in the root of the source tree.
       9             :  */
      10             : 
      11             : #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/pli.h"
      12             : 
      13             : #include "webrtc/base/checks.h"
      14             : #include "webrtc/base/logging.h"
      15             : #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/common_header.h"
      16             : 
      17             : namespace webrtc {
      18             : namespace rtcp {
      19             : constexpr uint8_t Pli::kFeedbackMessageType;
      20             : // RFC 4585: Feedback format.
      21             : //
      22             : // Common packet format:
      23             : //
      24             : //   0                   1                   2                   3
      25             : //   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
      26             : //  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      27             : //  |V=2|P|   FMT   |       PT      |          length               |
      28             : //  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      29             : //  |                  SSRC of packet sender                        |
      30             : //  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      31             : //  |                  SSRC of media source                         |
      32             : //  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      33             : //  :            Feedback Control Information (FCI)                 :
      34             : //  :                                                               :
      35             : 
      36             : //
      37             : // Picture loss indication (PLI) (RFC 4585).
      38             : // FCI: no feedback control information.
      39           0 : bool Pli::Parse(const CommonHeader& packet) {
      40           0 :   RTC_DCHECK_EQ(packet.type(), kPacketType);
      41           0 :   RTC_DCHECK_EQ(packet.fmt(), kFeedbackMessageType);
      42             : 
      43           0 :   if (packet.payload_size_bytes() < kCommonFeedbackLength) {
      44           0 :     LOG(LS_WARNING) << "Packet is too small to be a valid PLI packet";
      45           0 :     return false;
      46             :   }
      47             : 
      48           0 :   ParseCommonFeedback(packet.payload());
      49           0 :   return true;
      50             : }
      51             : 
      52           0 : bool Pli::Create(uint8_t* packet,
      53             :                  size_t* index,
      54             :                  size_t max_length,
      55             :                  RtcpPacket::PacketReadyCallback* callback) const {
      56           0 :   while (*index + BlockLength() > max_length) {
      57           0 :     if (!OnBufferFull(packet, index, callback))
      58           0 :       return false;
      59             :   }
      60             : 
      61           0 :   CreateHeader(kFeedbackMessageType, kPacketType, HeaderLength(), packet,
      62           0 :                index);
      63           0 :   CreateCommonFeedback(packet + *index);
      64           0 :   *index += kCommonFeedbackLength;
      65           0 :   return true;
      66             : }
      67             : 
      68             : }  // namespace rtcp
      69             : }  // namespace webrtc

Generated by: LCOV version 1.13