Skip to content

Commit e14d122

Browse files
Harald AlvestrandWebRTC LUCI CQ
authored andcommitted
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 <[email protected]> Commit-Queue: Harald Alvestrand <[email protected]> Cr-Commit-Position: refs/heads/main@{#40766}
1 parent 090699a commit e14d122

File tree

3 files changed

+8
-30
lines changed

3 files changed

+8
-30
lines changed

api/call/transport.h

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -45,29 +45,9 @@ struct PacketOptions {
4545

4646
class Transport {
4747
public:
48-
// New style functions. Default implementations are to accomodate
49-
// subclasses that haven't been converted to new style yet.
50-
// TODO(bugs.webrtc.org/14870): Deprecate and remove old functions.
51-
#pragma clang diagnostic push
52-
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
5348
virtual bool SendRtp(rtc::ArrayView<const uint8_t> packet,
54-
const PacketOptions& options) {
55-
return SendRtp(packet.data(), packet.size(), options);
56-
}
57-
virtual bool SendRtcp(rtc::ArrayView<const uint8_t> packet) {
58-
return SendRtcp(packet.data(), packet.size());
59-
}
60-
#pragma clang diagnostic pop
61-
// Old style functions.
62-
[[deprecated("Use ArrayView version")]] virtual bool
63-
SendRtp(const uint8_t* packet, size_t length, const PacketOptions& options) {
64-
return SendRtp(rtc::MakeArrayView(packet, length), options);
65-
}
66-
[[deprecated("Use ArrayView version")]] virtual bool SendRtcp(
67-
const uint8_t* packet,
68-
size_t length) {
69-
return SendRtcp(rtc::MakeArrayView(packet, length));
70-
}
49+
const PacketOptions& options) = 0;
50+
virtual bool SendRtcp(rtc::ArrayView<const uint8_t> packet) = 0;
7151

7252
protected:
7353
virtual ~Transport() {}

examples/androidvoip/jni/android_voip_client.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -427,10 +427,9 @@ void AndroidVoipClient::SendRtpPacket(const std::vector<uint8_t>& packet_copy) {
427427
}
428428
}
429429

430-
bool AndroidVoipClient::SendRtp(const uint8_t* packet,
431-
size_t length,
430+
bool AndroidVoipClient::SendRtp(rtc::ArrayView<const uint8_t> packet,
432431
const webrtc::PacketOptions& options) {
433-
std::vector<uint8_t> packet_copy(packet, packet + length);
432+
std::vector<uint8_t> packet_copy(packet.begin(), packet.end());
434433
voip_thread_->PostTask([this, packet_copy = std::move(packet_copy)] {
435434
SendRtpPacket(packet_copy);
436435
});
@@ -447,8 +446,8 @@ void AndroidVoipClient::SendRtcpPacket(
447446
}
448447
}
449448

450-
bool AndroidVoipClient::SendRtcp(const uint8_t* packet, size_t length) {
451-
std::vector<uint8_t> packet_copy(packet, packet + length);
449+
bool AndroidVoipClient::SendRtcp(rtc::ArrayView<const uint8_t> packet) {
450+
std::vector<uint8_t> packet_copy(packet.begin(), packet.end());
452451
voip_thread_->PostTask([this, packet_copy = std::move(packet_copy)] {
453452
SendRtcpPacket(packet_copy);
454453
});

examples/androidvoip/jni/android_voip_client.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,9 @@ class AndroidVoipClient : public webrtc::Transport,
118118
void Delete(JNIEnv* env);
119119

120120
// Implementation for Transport.
121-
bool SendRtp(const uint8_t* packet,
122-
size_t length,
121+
bool SendRtp(rtc::ArrayView<const uint8_t> packet,
123122
const webrtc::PacketOptions& options) override;
124-
bool SendRtcp(const uint8_t* packet, size_t length) override;
123+
bool SendRtcp(rtc::ArrayView<const uint8_t> packet) override;
125124

126125
// Slots for sockets to connect to.
127126
void OnSignalReadRTPPacket(rtc::AsyncPacketSocket* socket,

0 commit comments

Comments
 (0)