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 
12 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_PLI_H_
13 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_PLI_H_
14 
15 #include "webrtc/base/basictypes.h"
16 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/psfb.h"
17 
18 namespace webrtc {
19 namespace rtcp {
20 
21 // Picture loss indication (PLI) (RFC 4585).
22 class Pli : public Psfb {
23  public:
24   static const uint8_t kFeedbackMessageType = 1;
25 
Pli()26   Pli() {}
~Pli()27   virtual ~Pli() {}
28 
29   // Parse assumes header is already parsed and validated.
30   bool Parse(const RTCPUtility::RtcpCommonHeader& header,
31              const uint8_t* payload);  // Size of the payload is in the header.
32 
33  protected:
34   bool Create(uint8_t* packet,
35               size_t* index,
36               size_t max_length,
37               RtcpPacket::PacketReadyCallback* callback) const override;
38 
39  private:
BlockLength()40   size_t BlockLength() const override {
41     return kHeaderLength + kCommonFeedbackLength;
42   }
43 
44   RTC_DISALLOW_COPY_AND_ASSIGN(Pli);
45 };
46 
47 }  // namespace rtcp
48 }  // namespace webrtc
49 #endif  // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_PLI_H_
50