Bug 1867099 (MOZ) - use non-deprecated rtc::ArrayView versions of SendRtp/SendRtcp from webrtc::Transport

This commit is contained in:
Michael Froman 2023-11-29 15:56:57 -06:00
parent 3a16a1065e
commit 9c1a6793f4
2 changed files with 12 additions and 14 deletions

View File

@ -14,17 +14,15 @@ namespace mozilla {
*/
class NullTransport : public webrtc::Transport {
public:
virtual bool SendRtp(const uint8_t* packet, size_t length,
const webrtc::PacketOptions& options) override {
virtual bool SendRtp(rtc::ArrayView<const uint8_t> packet,
const webrtc::PacketOptions& options) {
(void)packet;
(void)length;
(void)options;
return true;
}
virtual bool SendRtcp(const uint8_t* packet, size_t length) override {
virtual bool SendRtcp(rtc::ArrayView<const uint8_t> packet) {
(void)packet;
(void)length;
return true;
}
#if 0

View File

@ -245,12 +245,12 @@ class WebrtcSendTransport : public webrtc::Transport {
public:
explicit WebrtcSendTransport(MediaSessionConduit* aConduit)
: mConduit(aConduit) {}
bool SendRtp(const uint8_t* aPacket, size_t aLength,
const webrtc::PacketOptions& aOptions) override {
return mConduit->SendRtp(aPacket, aLength, aOptions);
bool SendRtp(rtc::ArrayView<const uint8_t> aPacket,
const webrtc::PacketOptions& aOptions) {
return mConduit->SendRtp(aPacket.data(), aPacket.size(), aOptions);
}
bool SendRtcp(const uint8_t* aPacket, size_t aLength) override {
return mConduit->SendSenderRtcp(aPacket, aLength);
bool SendRtcp(rtc::ArrayView<const uint8_t> aPacket) {
return mConduit->SendSenderRtcp(aPacket.data(), aPacket.size());
}
};
@ -261,12 +261,12 @@ class WebrtcReceiveTransport : public webrtc::Transport {
public:
explicit WebrtcReceiveTransport(MediaSessionConduit* aConduit)
: mConduit(aConduit) {}
bool SendRtp(const uint8_t* aPacket, size_t aLength,
const webrtc::PacketOptions& aOptions) override {
bool SendRtp(rtc::ArrayView<const uint8_t> aPacket,
const webrtc::PacketOptions& aOptions) {
MOZ_CRASH("Unexpected RTP packet");
}
bool SendRtcp(const uint8_t* aPacket, size_t aLength) override {
return mConduit->SendReceiverRtcp(aPacket, aLength);
bool SendRtcp(rtc::ArrayView<const uint8_t> aPacket) {
return mConduit->SendReceiverRtcp(aPacket.data(), aPacket.size());
}
};