Add application extension field to RtpPacketReceived.
Bug: webrtc:8439 Change-Id: I372e90c81a68351d343554fb77ce6ef77d538e62 Reviewed-on: https://webrtc-review.googlesource.com/14820 Commit-Queue: Dino Radaković <dinor@webrtc.org> Reviewed-by: Niels Moller <nisse@webrtc.org> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/master@{#20410}
This commit is contained in:
committed by
Commit Bot
parent
f7a3558f3e
commit
21360eb01e
@ -17,6 +17,12 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
RtpPacketReceived::RtpPacketReceived() = default;
|
||||
RtpPacketReceived::RtpPacketReceived(const ExtensionManager* extensions)
|
||||
: RtpPacket(extensions) {}
|
||||
|
||||
RtpPacketReceived::~RtpPacketReceived() {}
|
||||
|
||||
void RtpPacketReceived::GetHeader(RTPHeader* header) const {
|
||||
header->markerBit = Marker();
|
||||
header->payloadType = PayloadType();
|
||||
|
||||
@ -10,6 +10,8 @@
|
||||
#ifndef MODULES_RTP_RTCP_SOURCE_RTP_PACKET_RECEIVED_H_
|
||||
#define MODULES_RTP_RTCP_SOURCE_RTP_PACKET_RECEIVED_H_
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "common_types.h" // NOLINT(build/include)
|
||||
#include "modules/rtp_rtcp/source/rtp_packet.h"
|
||||
#include "system_wrappers/include/ntp_time.h"
|
||||
@ -18,9 +20,10 @@ namespace webrtc {
|
||||
// Class to hold rtp packet with metadata for receiver side.
|
||||
class RtpPacketReceived : public RtpPacket {
|
||||
public:
|
||||
RtpPacketReceived() = default;
|
||||
explicit RtpPacketReceived(const ExtensionManager* extensions)
|
||||
: RtpPacket(extensions) {}
|
||||
RtpPacketReceived();
|
||||
explicit RtpPacketReceived(const ExtensionManager* extensions);
|
||||
|
||||
~RtpPacketReceived();
|
||||
|
||||
// TODO(danilchap): Remove this function when all code update to use RtpPacket
|
||||
// directly. Function is there just for easier backward compatibilty.
|
||||
@ -44,11 +47,21 @@ class RtpPacketReceived : public RtpPacket {
|
||||
payload_type_frequency_ = value;
|
||||
}
|
||||
|
||||
// Additional data bound to the RTP packet for use in application code,
|
||||
// outside of WebRTC.
|
||||
rtc::ArrayView<const uint8_t> application_data() const {
|
||||
return application_data_;
|
||||
}
|
||||
void set_application_data(rtc::ArrayView<const uint8_t> data) {
|
||||
application_data_.assign(data.begin(), data.end());
|
||||
}
|
||||
|
||||
private:
|
||||
NtpTime capture_time_;
|
||||
int64_t arrival_time_ms_ = 0;
|
||||
int payload_type_frequency_ = 0;
|
||||
bool recovered_ = false;
|
||||
std::vector<uint8_t> application_data_;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
Reference in New Issue
Block a user