forked from open-webrtc-toolkit/owt-deps-webrtc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Set generic frame descriptor extension for HEVC * Enable more rtcp feedbacks for loss/reference indication
- Loading branch information
Showing
6 changed files
with
133 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* | ||
* Copyright (c) 2020 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/rtcp_packet/rpsi.h" | ||
|
||
#include "modules/rtp_rtcp/source/rtcp_packet/common_header.h" | ||
#include "rtc_base/checks.h" | ||
#include "rtc_base/logging.h" | ||
|
||
namespace webrtc { | ||
namespace rtcp { | ||
constexpr uint8_t Rpsi::kFeedbackMessageType; | ||
// RFC 4585: Feedback format. | ||
// | ||
// Common packet format: | ||
// | ||
// 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 | ||
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
// |V=2|P| FMT | PT | length | | ||
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
// | SSRC of packet sender | | ||
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
// | SSRC of media source | | ||
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
// : Feedback Control Information (FCI) : | ||
// : : | ||
|
||
Rpsi::Rpsi() = default; | ||
|
||
Rpsi::Rpsi(const Rpsi& Rpsi) = default; | ||
|
||
Rpsi::~Rpsi() = default; | ||
|
||
// | ||
// Reference picture selection indication(RPSI) (RFC 4585). | ||
// FCI: no feedback control information. | ||
bool Rpsi::Parse(const CommonHeader& packet) { | ||
RTC_DCHECK_EQ(packet.type(), kPacketType); | ||
RTC_DCHECK_EQ(packet.fmt(), kFeedbackMessageType); | ||
|
||
if (packet.payload_size_bytes() < kCommonFeedbackLength) { | ||
RTC_LOG(LS_WARNING) << "Packet is too small to be a valid Rpsi packet"; | ||
return false; | ||
} | ||
|
||
ParseCommonFeedback(packet.payload()); | ||
return true; | ||
} | ||
|
||
size_t Rpsi::BlockLength() const { | ||
return kHeaderLength + kCommonFeedbackLength; | ||
} | ||
|
||
bool Rpsi::Create(uint8_t* packet, | ||
size_t* index, | ||
size_t max_length, | ||
PacketReadyCallback callback) const { | ||
while (*index + BlockLength() > max_length) { | ||
if (!OnBufferFull(packet, index, callback)) | ||
return false; | ||
} | ||
|
||
CreateHeader(kFeedbackMessageType, kPacketType, HeaderLength(), packet, | ||
index); | ||
CreateCommonFeedback(packet + *index); | ||
*index += kCommonFeedbackLength; | ||
return true; | ||
} | ||
|
||
} // namespace rtcp | ||
} // namespace webrtc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (c) 2020 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. | ||
*/ | ||
#ifndef MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_RPSI_H_ | ||
#define MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_RPSI_H_ | ||
|
||
#include "modules/rtp_rtcp/source/rtcp_packet/psfb.h" | ||
|
||
namespace webrtc { | ||
namespace rtcp { | ||
class CommonHeader; | ||
// Reference picture selection indication (RPSI) (RFC 4585). | ||
// Will add detailed format fields after finalizing payload. | ||
class Rpsi : public Psfb { | ||
public: | ||
static constexpr uint8_t kFeedbackMessageType = 1; | ||
|
||
Rpsi(); | ||
Rpsi(const Rpsi& rpsi); | ||
~Rpsi() override; | ||
|
||
bool Parse(const CommonHeader& packet); | ||
|
||
size_t BlockLength() const override; | ||
|
||
bool Create(uint8_t* packet, | ||
size_t* index, | ||
size_t max_length, | ||
PacketReadyCallback callback) const override; | ||
}; | ||
|
||
} // namespace rtcp | ||
} // namespace webrtc | ||
#endif // MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_RPSI_H_ |