Properly mark RtpRtcp deprecated

The clang pragma have been added to ensure we can still test the code
until usage is gone, and that we can still have the one implementation
compiling without itself tripping on the deprecation errors.

Users of the code will have deprecation warnings or error as intended.

Bug: webrtc:14617
Change-Id: I21dae57c669557d4d218c235c811174a477be080
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/281221
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38514}
This commit is contained in:
Florent Castelli 2022-10-31 18:47:06 +01:00 committed by WebRTC LUCI CQ
parent 7d3e5a03eb
commit a30f8829ff
4 changed files with 14 additions and 6 deletions

View File

@ -18,8 +18,7 @@
namespace webrtc {
// DEPRECATED. Do not use.
class RtpRtcp : public RtpRtcpInterface {
class ABSL_DEPRECATED("") RtpRtcp : public RtpRtcpInterface {
public:
// Instantiates a deprecated version of the RtpRtcp module.
static std::unique_ptr<RtpRtcp> ABSL_DEPRECATED("")

View File

@ -43,8 +43,12 @@ class Clock;
struct PacedPacketInfo;
struct RTPVideoHeader;
// DEPRECATED.
class ModuleRtpRtcpImpl : public RtpRtcp, public RTCPReceiver::ModuleRtpRtcp {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
class ABSL_DEPRECATED("") ModuleRtpRtcpImpl
: public RtpRtcp,
public RTCPReceiver::ModuleRtpRtcp {
#pragma clang diagnostic pop
public:
explicit ModuleRtpRtcpImpl(
const RtpRtcpInterface::Configuration& configuration);

View File

@ -44,6 +44,9 @@ const uint8_t kPayloadType = 100;
const int kWidth = 320;
const int kHeight = 100;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
class RtcpRttStatsTestImpl : public RtcpRttStats {
public:
RtcpRttStatsTestImpl() : rtt_ms_(0) {}
@ -697,4 +700,6 @@ TEST_F(RtpRtcpImplTest, SenderReportStatsPacketByteCounters) {
Field(&SenderReportStats::bytes_sent, Gt(0u)))));
}
#pragma clang diagnostic pop
} // namespace webrtc

View File

@ -154,8 +154,8 @@ class RtpSenderEgressTest : public ::testing::TestWithParam<TestConfig> {
return std::make_unique<RtpSenderEgress>(DefaultConfig(), &packet_history_);
}
RtpRtcp::Configuration DefaultConfig() {
RtpRtcp::Configuration config;
RtpRtcpInterface::Configuration DefaultConfig() {
RtpRtcpInterface::Configuration config;
config.clock = clock_;
config.outgoing_transport = &transport_;
config.local_media_ssrc = kSsrc;