Remove deprecated SendRtp and SendRtcp functions
and delete remaining usages. Bug: webrtc:15410 Change-Id: I912bedca80a5a446a3f770211d164a5eb0af02bb Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/320520 Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/main@{#40766}
This commit is contained in:
parent
090699a01b
commit
e14d122a7b
@ -45,29 +45,9 @@ struct PacketOptions {
|
|||||||
|
|
||||||
class Transport {
|
class Transport {
|
||||||
public:
|
public:
|
||||||
// New style functions. Default implementations are to accomodate
|
|
||||||
// subclasses that haven't been converted to new style yet.
|
|
||||||
// TODO(bugs.webrtc.org/14870): Deprecate and remove old functions.
|
|
||||||
#pragma clang diagnostic push
|
|
||||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
|
||||||
virtual bool SendRtp(rtc::ArrayView<const uint8_t> packet,
|
virtual bool SendRtp(rtc::ArrayView<const uint8_t> packet,
|
||||||
const PacketOptions& options) {
|
const PacketOptions& options) = 0;
|
||||||
return SendRtp(packet.data(), packet.size(), options);
|
virtual bool SendRtcp(rtc::ArrayView<const uint8_t> packet) = 0;
|
||||||
}
|
|
||||||
virtual bool SendRtcp(rtc::ArrayView<const uint8_t> packet) {
|
|
||||||
return SendRtcp(packet.data(), packet.size());
|
|
||||||
}
|
|
||||||
#pragma clang diagnostic pop
|
|
||||||
// Old style functions.
|
|
||||||
[[deprecated("Use ArrayView version")]] virtual bool
|
|
||||||
SendRtp(const uint8_t* packet, size_t length, const PacketOptions& options) {
|
|
||||||
return SendRtp(rtc::MakeArrayView(packet, length), options);
|
|
||||||
}
|
|
||||||
[[deprecated("Use ArrayView version")]] virtual bool SendRtcp(
|
|
||||||
const uint8_t* packet,
|
|
||||||
size_t length) {
|
|
||||||
return SendRtcp(rtc::MakeArrayView(packet, length));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~Transport() {}
|
virtual ~Transport() {}
|
||||||
|
|||||||
@ -427,10 +427,9 @@ void AndroidVoipClient::SendRtpPacket(const std::vector<uint8_t>& packet_copy) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AndroidVoipClient::SendRtp(const uint8_t* packet,
|
bool AndroidVoipClient::SendRtp(rtc::ArrayView<const uint8_t> packet,
|
||||||
size_t length,
|
|
||||||
const webrtc::PacketOptions& options) {
|
const webrtc::PacketOptions& options) {
|
||||||
std::vector<uint8_t> packet_copy(packet, packet + length);
|
std::vector<uint8_t> packet_copy(packet.begin(), packet.end());
|
||||||
voip_thread_->PostTask([this, packet_copy = std::move(packet_copy)] {
|
voip_thread_->PostTask([this, packet_copy = std::move(packet_copy)] {
|
||||||
SendRtpPacket(packet_copy);
|
SendRtpPacket(packet_copy);
|
||||||
});
|
});
|
||||||
@ -447,8 +446,8 @@ void AndroidVoipClient::SendRtcpPacket(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AndroidVoipClient::SendRtcp(const uint8_t* packet, size_t length) {
|
bool AndroidVoipClient::SendRtcp(rtc::ArrayView<const uint8_t> packet) {
|
||||||
std::vector<uint8_t> packet_copy(packet, packet + length);
|
std::vector<uint8_t> packet_copy(packet.begin(), packet.end());
|
||||||
voip_thread_->PostTask([this, packet_copy = std::move(packet_copy)] {
|
voip_thread_->PostTask([this, packet_copy = std::move(packet_copy)] {
|
||||||
SendRtcpPacket(packet_copy);
|
SendRtcpPacket(packet_copy);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -118,10 +118,9 @@ class AndroidVoipClient : public webrtc::Transport,
|
|||||||
void Delete(JNIEnv* env);
|
void Delete(JNIEnv* env);
|
||||||
|
|
||||||
// Implementation for Transport.
|
// Implementation for Transport.
|
||||||
bool SendRtp(const uint8_t* packet,
|
bool SendRtp(rtc::ArrayView<const uint8_t> packet,
|
||||||
size_t length,
|
|
||||||
const webrtc::PacketOptions& options) override;
|
const webrtc::PacketOptions& options) override;
|
||||||
bool SendRtcp(const uint8_t* packet, size_t length) override;
|
bool SendRtcp(rtc::ArrayView<const uint8_t> packet) override;
|
||||||
|
|
||||||
// Slots for sockets to connect to.
|
// Slots for sockets to connect to.
|
||||||
void OnSignalReadRTPPacket(rtc::AsyncPacketSocket* socket,
|
void OnSignalReadRTPPacket(rtc::AsyncPacketSocket* socket,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user