diff --git a/api/BUILD.gn b/api/BUILD.gn index e537068ab5..074c5a398a 100644 --- a/api/BUILD.gn +++ b/api/BUILD.gn @@ -558,6 +558,11 @@ rtc_source_set("audio_quality_analyzer_api") { ] } +rtc_library("rtp_packet_sender") { + visibility = [ "*" ] + sources = [ "rtp_packet_sender.h" ] +} + rtc_source_set("stats_observer_interface") { visibility = [ "*" ] testonly = true diff --git a/api/rtp_packet_sender.h b/api/rtp_packet_sender.h new file mode 100644 index 0000000000..dc5fc5fb3d --- /dev/null +++ b/api/rtp_packet_sender.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2019 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef API_RTP_PACKET_SENDER_H_ +#define API_RTP_PACKET_SENDER_H_ + +#include +#include + +namespace webrtc { + +class RtpPacketToSend; + +class RtpPacketSender { + public: + virtual ~RtpPacketSender() = default; + + // Insert a set of packets into queue, for eventual transmission. Based on the + // type of packets, they will be prioritized and scheduled relative to other + // packets and the current target send rate. + virtual void EnqueuePackets( + std::vector> packets) = 0; + + // Clear any pending packets with the given SSRC from the queue. + // TODO(crbug.com/1395081): Make pure virtual when downstream code has been + // updated. + virtual void RemovePacketsForSsrc(uint32_t ssrc) {} +}; + +} // namespace webrtc + +#endif // API_RTP_PACKET_SENDER_H_ diff --git a/modules/rtp_rtcp/BUILD.gn b/modules/rtp_rtcp/BUILD.gn index d956a4fd00..b5817106ea 100644 --- a/modules/rtp_rtcp/BUILD.gn +++ b/modules/rtp_rtcp/BUILD.gn @@ -21,7 +21,8 @@ rtc_library("rtp_rtcp_format") { "include/rtcp_statistics.h", "include/rtp_cvo.h", "include/rtp_header_extension_map.h", - "include/rtp_packet_sender.h", + "include/rtp_packet_sender.h", # Kept for compatibility with downstream + # projects "include/rtp_rtcp_defines.h", "source/byte_io.h", "source/rtcp_packet.h", @@ -114,6 +115,7 @@ rtc_library("rtp_rtcp_format") { "../../api:function_view", "../../api:refcountedbase", "../../api:rtp_headers", + "../../api:rtp_packet_sender", # For compatibility with downstream projects "../../api:rtp_parameters", "../../api:scoped_refptr", "../../api/audio_codecs:audio_codecs_api", @@ -281,6 +283,7 @@ rtc_library("rtp_rtcp") { "../../api:function_view", "../../api:rtp_headers", "../../api:rtp_packet_info", + "../../api:rtp_packet_sender", "../../api:rtp_parameters", "../../api:scoped_refptr", "../../api:sequence_checker", @@ -671,6 +674,7 @@ if (rtc_include_tests) { "../../api:mock_transformable_video_frame", "../../api:rtp_headers", "../../api:rtp_packet_info", + "../../api:rtp_packet_sender", "../../api:rtp_parameters", "../../api:scoped_refptr", "../../api:time_controller", diff --git a/modules/rtp_rtcp/include/rtp_packet_sender.h b/modules/rtp_rtcp/include/rtp_packet_sender.h index ebc65298a5..9889d77ada 100644 --- a/modules/rtp_rtcp/include/rtp_packet_sender.h +++ b/modules/rtp_rtcp/include/rtp_packet_sender.h @@ -17,24 +17,7 @@ #include "modules/rtp_rtcp/include/rtp_rtcp_defines.h" #include "modules/rtp_rtcp/source/rtp_packet_to_send.h" -namespace webrtc { - -class RtpPacketSender { - public: - virtual ~RtpPacketSender() = default; - - // Insert a set of packets into queue, for eventual transmission. Based on the - // type of packets, they will be prioritized and scheduled relative to other - // packets and the current target send rate. - virtual void EnqueuePackets( - std::vector> packets) = 0; - - // Clear any pending packets with the given SSRC from the queue. - // TODO(crbug.com/1395081): Make pure virtual when downstream code has been - // updated. - virtual void RemovePacketsForSsrc(uint32_t ssrc) {} -}; - -} // namespace webrtc +// Kept for compatibility with the newer location of the header +#include "api/rtp_packet_sender.h" #endif // MODULES_RTP_RTCP_INCLUDE_RTP_PACKET_SENDER_H_ diff --git a/modules/rtp_rtcp/source/rtp_sender_unittest.cc b/modules/rtp_rtcp/source/rtp_sender_unittest.cc index 3028a88df0..8586f4b960 100644 --- a/modules/rtp_rtcp/source/rtp_sender_unittest.cc +++ b/modules/rtp_rtcp/source/rtp_sender_unittest.cc @@ -15,6 +15,7 @@ #include "absl/strings/string_view.h" #include "api/rtc_event_log/rtc_event.h" +#include "api/rtp_packet_sender.h" #include "api/units/frequency.h" #include "api/units/time_delta.h" #include "api/units/timestamp.h" @@ -23,7 +24,6 @@ #include "logging/rtc_event_log/mock/mock_rtc_event_log.h" #include "modules/rtp_rtcp/include/rtp_cvo.h" #include "modules/rtp_rtcp/include/rtp_header_extension_map.h" -#include "modules/rtp_rtcp/include/rtp_packet_sender.h" #include "modules/rtp_rtcp/include/rtp_rtcp_defines.h" #include "modules/rtp_rtcp/source/packet_sequencer.h" #include "modules/rtp_rtcp/source/rtp_format_video_generic.h" diff --git a/test/peer_scenario/tests/bwe_ramp_up_test.cc b/test/peer_scenario/tests/bwe_ramp_up_test.cc index 36e643ad0b..5b7c763035 100644 --- a/test/peer_scenario/tests/bwe_ramp_up_test.cc +++ b/test/peer_scenario/tests/bwe_ramp_up_test.cc @@ -16,6 +16,7 @@ #include "api/units/time_delta.h" #include "modules/rtp_rtcp/include/rtp_header_extension_map.h" #include "modules/rtp_rtcp/include/rtp_rtcp_defines.h" +#include "modules/rtp_rtcp/source/rtp_header_extensions.h" #include "modules/rtp_rtcp/source/rtp_util.h" #include "pc/media_session.h" #include "pc/test/mock_peer_connection_observers.h" diff --git a/test/peer_scenario/tests/unsignaled_stream_test.cc b/test/peer_scenario/tests/unsignaled_stream_test.cc index dced274e68..d7565c9786 100644 --- a/test/peer_scenario/tests/unsignaled_stream_test.cc +++ b/test/peer_scenario/tests/unsignaled_stream_test.cc @@ -10,11 +10,9 @@ #include "media/base/stream_params.h" #include "modules/rtp_rtcp/source/byte_io.h" +#include "modules/rtp_rtcp/source/rtp_header_extensions.h" #include "modules/rtp_rtcp/source/rtp_util.h" -#include "pc/media_session.h" #include "pc/session_description.h" -#include "test/field_trial.h" -#include "test/gmock.h" #include "test/gtest.h" #include "test/peer_scenario/peer_scenario.h"