diff --git a/.gn b/.gn index 5da4f241b5..82dfd83b7a 100644 --- a/.gn +++ b/.gn @@ -21,6 +21,7 @@ secondary_source = "//build/secondary/" # TODO(kjellander): Keep adding paths to this list as work in webrtc:5589 is done. check_targets = [ "//webrtc/api:audio_mixer_api", + "//webrtc/api:transport_api", "//webrtc/api:rtc_stats_api", "//webrtc/modules/audio_coding:audio_decoder_factory_interface", "//webrtc/modules/audio_coding:audio_format", @@ -37,6 +38,7 @@ check_targets = [ "//webrtc/modules/audio_device/*", "//webrtc/modules/audio_mixer/*", "//webrtc/stats:rtc_stats", + "//webrtc/voice_engine", "//webrtc/voice_engine:level_indicator", ] diff --git a/webrtc/BUILD.gn b/webrtc/BUILD.gn index 76f51e59b0..0bae0aad1e 100644 --- a/webrtc/BUILD.gn +++ b/webrtc/BUILD.gn @@ -231,6 +231,11 @@ if (!build_with_chromium) { "build/no_op_function.cc", "call.h", "config.h", + + # TODO(aleloi): remove transport.h and the transport api + # dependency once clients have updated to the new transport + # location in webrtc/api/call/transport.h See + # http://bugs.webrtc.org/6785. "transport.h", ] @@ -239,6 +244,7 @@ if (!build_with_chromium) { deps = [ ":webrtc_common", "api", + "api:transport_api", "audio", "base", "call", diff --git a/webrtc/api/BUILD.gn b/webrtc/api/BUILD.gn index ead05e4b3a..d827de0378 100644 --- a/webrtc/api/BUILD.gn +++ b/webrtc/api/BUILD.gn @@ -37,6 +37,7 @@ rtc_source_set("call_api") { deps = [ # TODO(kjellander): Add remaining dependencies when webrtc:4243 is done. ":audio_mixer_api", + ":transport_api", "..:webrtc_common", "../base:rtc_base_approved", "../modules/audio_coding:audio_encoder_interface", @@ -362,6 +363,11 @@ rtc_source_set("audio_mixer_api") { ] } +rtc_source_set("transport_api") { + sources = [ + "call/transport.h", + ] +} if (rtc_include_tests) { config("peerconnection_unittests_config") { # The warnings below are enabled by default. Since GN orders compiler flags diff --git a/webrtc/api/call/audio_receive_stream.h b/webrtc/api/call/audio_receive_stream.h index 2fd6760d86..ed9ff3417a 100644 --- a/webrtc/api/call/audio_receive_stream.h +++ b/webrtc/api/call/audio_receive_stream.h @@ -16,12 +16,12 @@ #include #include +#include "webrtc/api/call/transport.h" #include "webrtc/base/optional.h" #include "webrtc/base/scoped_ref_ptr.h" #include "webrtc/modules/audio_coding/codecs/audio_decoder_factory.h" #include "webrtc/common_types.h" #include "webrtc/config.h" -#include "webrtc/transport.h" #include "webrtc/typedefs.h" namespace webrtc { diff --git a/webrtc/api/call/audio_send_stream.h b/webrtc/api/call/audio_send_stream.h index b4ba61549f..487ce98721 100644 --- a/webrtc/api/call/audio_send_stream.h +++ b/webrtc/api/call/audio_send_stream.h @@ -15,10 +15,10 @@ #include #include +#include "webrtc/api/call/transport.h" #include "webrtc/base/optional.h" #include "webrtc/config.h" #include "webrtc/modules/audio_coding/codecs/audio_encoder.h" -#include "webrtc/transport.h" #include "webrtc/typedefs.h" namespace webrtc { diff --git a/webrtc/api/call/transport.h b/webrtc/api/call/transport.h new file mode 100644 index 0000000000..1126f628fe --- /dev/null +++ b/webrtc/api/call/transport.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2013 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 WEBRTC_API_CALL_TRANSPORT_H_ +#define WEBRTC_API_CALL_TRANSPORT_H_ + +#include +#include + +namespace webrtc { + +// TODO(holmer): Look into unifying this with the PacketOptions in +// asyncpacketsocket.h. +struct PacketOptions { + // A 16 bits positive id. Negative ids are invalid and should be interpreted + // as packet_id not being set. + int packet_id = -1; +}; + +class Transport { + public: + virtual bool SendRtp(const uint8_t* packet, + size_t length, + const PacketOptions& options) = 0; + virtual bool SendRtcp(const uint8_t* packet, size_t length) = 0; + + protected: + virtual ~Transport() {} +}; + +} // namespace webrtc + +#endif // WEBRTC_API_CALL_TRANSPORT_H_ diff --git a/webrtc/call/BUILD.gn b/webrtc/call/BUILD.gn index d77dfc6b60..64829e9b9d 100644 --- a/webrtc/call/BUILD.gn +++ b/webrtc/call/BUILD.gn @@ -27,6 +27,7 @@ rtc_static_library("call") { deps = [ "..:webrtc_common", + "../api:transport_api", "../audio", "../base:rtc_task_queue", "../logging:rtc_event_log_impl", diff --git a/webrtc/media/BUILD.gn b/webrtc/media/BUILD.gn index 75f1a31776..93f98a974d 100644 --- a/webrtc/media/BUILD.gn +++ b/webrtc/media/BUILD.gn @@ -226,6 +226,7 @@ rtc_static_library("rtc_media") { ":rtc_media_base", "..:webrtc_common", "../api:call_api", + "../api:transport_api", "../base:rtc_base_approved", "../call", "../modules/audio_mixer:audio_mixer_impl", diff --git a/webrtc/media/engine/webrtcvideoengine2.h b/webrtc/media/engine/webrtcvideoengine2.h index aa116ed318..736d47461a 100644 --- a/webrtc/media/engine/webrtcvideoengine2.h +++ b/webrtc/media/engine/webrtcvideoengine2.h @@ -17,6 +17,7 @@ #include #include +#include "webrtc/api/call/transport.h" #include "webrtc/base/asyncinvoker.h" #include "webrtc/base/criticalsection.h" #include "webrtc/base/networkroute.h" @@ -28,7 +29,6 @@ #include "webrtc/media/base/mediaengine.h" #include "webrtc/media/engine/webrtcvideodecoderfactory.h" #include "webrtc/media/engine/webrtcvideoencoderfactory.h" -#include "webrtc/transport.h" #include "webrtc/video_frame.h" #include "webrtc/video_receive_stream.h" #include "webrtc/video_send_stream.h" diff --git a/webrtc/modules/BUILD.gn b/webrtc/modules/BUILD.gn index bab3b8ee80..3846c6379f 100644 --- a/webrtc/modules/BUILD.gn +++ b/webrtc/modules/BUILD.gn @@ -641,6 +641,7 @@ if (rtc_include_tests) { deps += [ ":audio_network_adaptor_unittests", "..:webrtc_common", + "../api:transport_api", "../base:rtc_base", # TODO(kjellander): Cleanup in bugs.webrtc.org/3806. "../common_audio", "../common_video", diff --git a/webrtc/modules/rtp_rtcp/BUILD.gn b/webrtc/modules/rtp_rtcp/BUILD.gn index aa5403dcd8..50d8b193ed 100644 --- a/webrtc/modules/rtp_rtcp/BUILD.gn +++ b/webrtc/modules/rtp_rtcp/BUILD.gn @@ -174,6 +174,7 @@ rtc_static_library("rtp_rtcp") { deps = [ "../..:webrtc_common", + "../../api:transport_api", "../../common_video", "../../system_wrappers", "../remote_bitrate_estimator", diff --git a/webrtc/modules/rtp_rtcp/source/nack_rtx_unittest.cc b/webrtc/modules/rtp_rtcp/source/nack_rtx_unittest.cc index e52f9d55f7..d772753fa5 100644 --- a/webrtc/modules/rtp_rtcp/source/nack_rtx_unittest.cc +++ b/webrtc/modules/rtp_rtcp/source/nack_rtx_unittest.cc @@ -14,6 +14,7 @@ #include #include +#include "webrtc/api/call/transport.h" #include "webrtc/base/rate_limiter.h" #include "webrtc/common_types.h" #include "webrtc/modules/rtp_rtcp/include/receive_statistics.h" @@ -23,7 +24,6 @@ #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" #include "webrtc/test/gtest.h" -#include "webrtc/transport.h" namespace webrtc { diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_sender.h b/webrtc/modules/rtp_rtcp/source/rtcp_sender.h index de430047b2..f59676685d 100644 --- a/webrtc/modules/rtp_rtcp/source/rtcp_sender.h +++ b/webrtc/modules/rtp_rtcp/source/rtcp_sender.h @@ -18,6 +18,7 @@ #include #include +#include "webrtc/api/call/transport.h" #include "webrtc/base/constructormagic.h" #include "webrtc/base/criticalsection.h" #include "webrtc/base/random.h" @@ -31,7 +32,6 @@ #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/report_block.h" #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmb_item.h" #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" -#include "webrtc/transport.h" #include "webrtc/typedefs.h" namespace webrtc { diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender.h b/webrtc/modules/rtp_rtcp/source/rtp_sender.h index 56a5b6aba5..66db7502e9 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_sender.h +++ b/webrtc/modules/rtp_rtcp/source/rtp_sender.h @@ -16,6 +16,7 @@ #include #include +#include "webrtc/api/call/transport.h" #include "webrtc/base/constructormagic.h" #include "webrtc/base/criticalsection.h" #include "webrtc/base/deprecation.h" @@ -32,7 +33,6 @@ #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h" #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" #include "webrtc/modules/rtp_rtcp/source/ssrc_database.h" -#include "webrtc/transport.h" namespace webrtc { diff --git a/webrtc/modules/rtp_rtcp/test/testAPI/test_api.h b/webrtc/modules/rtp_rtcp/test/testAPI/test_api.h index b0dd4055f3..74548258ac 100644 --- a/webrtc/modules/rtp_rtcp/test/testAPI/test_api.h +++ b/webrtc/modules/rtp_rtcp/test/testAPI/test_api.h @@ -10,6 +10,7 @@ #ifndef WEBRTC_MODULES_RTP_RTCP_TEST_TESTAPI_TEST_API_H_ #define WEBRTC_MODULES_RTP_RTCP_TEST_TESTAPI_TEST_API_H_ +#include "webrtc/api/call/transport.h" #include "webrtc/common_types.h" #include "webrtc/modules/rtp_rtcp/include/receive_statistics.h" #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" @@ -18,7 +19,6 @@ #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" #include "webrtc/test/gtest.h" -#include "webrtc/transport.h" namespace webrtc { diff --git a/webrtc/test/BUILD.gn b/webrtc/test/BUILD.gn index 8b323bf28d..c6f2f4d2e6 100644 --- a/webrtc/test/BUILD.gn +++ b/webrtc/test/BUILD.gn @@ -340,6 +340,7 @@ rtc_source_set("test_common") { ":rtp_test_utils", ":test_support", "..:webrtc_common", + "../api:transport_api", "../audio", "../base:rtc_base_approved", "../call", diff --git a/webrtc/test/direct_transport.h b/webrtc/test/direct_transport.h index e1844763d9..eb552c57c8 100644 --- a/webrtc/test/direct_transport.h +++ b/webrtc/test/direct_transport.h @@ -14,11 +14,11 @@ #include +#include "webrtc/api/call/transport.h" #include "webrtc/base/criticalsection.h" #include "webrtc/base/event.h" #include "webrtc/base/platform_thread.h" #include "webrtc/test/fake_network_pipe.h" -#include "webrtc/transport.h" namespace webrtc { diff --git a/webrtc/test/mock_transport.h b/webrtc/test/mock_transport.h index 37a72b3126..d76dc6e352 100644 --- a/webrtc/test/mock_transport.h +++ b/webrtc/test/mock_transport.h @@ -11,8 +11,8 @@ #ifndef WEBRTC_TEST_MOCK_TRANSPORT_H_ #define WEBRTC_TEST_MOCK_TRANSPORT_H_ +#include "webrtc/api/call/transport.h" #include "webrtc/test/gmock.h" -#include "webrtc/transport.h" namespace webrtc { diff --git a/webrtc/test/null_transport.h b/webrtc/test/null_transport.h index c49883e1dc..41c4759b93 100644 --- a/webrtc/test/null_transport.h +++ b/webrtc/test/null_transport.h @@ -10,7 +10,7 @@ #ifndef WEBRTC_TEST_NULL_TRANSPORT_H_ #define WEBRTC_TEST_NULL_TRANSPORT_H_ -#include "webrtc/transport.h" +#include "webrtc/api/call/transport.h" namespace webrtc { diff --git a/webrtc/transport.h b/webrtc/transport.h index 4e329de93f..c3d11cb476 100644 --- a/webrtc/transport.h +++ b/webrtc/transport.h @@ -7,35 +7,12 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ - #ifndef WEBRTC_TRANSPORT_H_ #define WEBRTC_TRANSPORT_H_ +#include "webrtc/api/call/transport.h" +// The contents header have moved to webrtc/api/call/transport.h. This +// file is deprecated. See http://bugs.webrtc.org/6785. -#include - -#include "webrtc/typedefs.h" - -namespace webrtc { - -// TODO(holmer): Look into unifying this with the PacketOptions in -// asyncpacketsocket.h. -struct PacketOptions { - // A 16 bits positive id. Negative ids are invalid and should be interpreted - // as packet_id not being set. - int packet_id = -1; -}; - -class Transport { - public: - virtual bool SendRtp(const uint8_t* packet, - size_t length, - const PacketOptions& options) = 0; - virtual bool SendRtcp(const uint8_t* packet, size_t length) = 0; - - protected: - virtual ~Transport() {} -}; - -} // namespace webrtc +// TODO(aleloi): delete this file when all dependencies are updated. #endif // WEBRTC_TRANSPORT_H_ diff --git a/webrtc/video/BUILD.gn b/webrtc/video/BUILD.gn index 3074d96e00..aa6730e3f5 100644 --- a/webrtc/video/BUILD.gn +++ b/webrtc/video/BUILD.gn @@ -56,6 +56,7 @@ rtc_static_library("video") { deps = [ "..:webrtc_common", + "../api:transport_api", "../base:rtc_analytics", "../base:rtc_base_approved", "../base:rtc_task_queue", diff --git a/webrtc/video/transport_adapter.h b/webrtc/video/transport_adapter.h index 2ed58aa8ce..3312094be0 100644 --- a/webrtc/video/transport_adapter.h +++ b/webrtc/video/transport_adapter.h @@ -10,9 +10,9 @@ #ifndef WEBRTC_VIDEO_TRANSPORT_ADAPTER_H_ #define WEBRTC_VIDEO_TRANSPORT_ADAPTER_H_ +#include "webrtc/api/call/transport.h" #include "webrtc/common_types.h" #include "webrtc/system_wrappers/include/atomic32.h" -#include "webrtc/transport.h" namespace webrtc { namespace internal { diff --git a/webrtc/video_receive_stream.h b/webrtc/video_receive_stream.h index abeb83b202..3a0c358bb9 100644 --- a/webrtc/video_receive_stream.h +++ b/webrtc/video_receive_stream.h @@ -16,12 +16,12 @@ #include #include +#include "webrtc/api/call/transport.h" #include "webrtc/base/platform_file.h" #include "webrtc/common_types.h" #include "webrtc/common_video/include/frame_callback.h" #include "webrtc/config.h" #include "webrtc/media/base/videosinkinterface.h" -#include "webrtc/transport.h" namespace webrtc { diff --git a/webrtc/video_send_stream.h b/webrtc/video_send_stream.h index 92181a7878..ce16ef3b0c 100644 --- a/webrtc/video_send_stream.h +++ b/webrtc/video_send_stream.h @@ -17,13 +17,13 @@ #include #include +#include "webrtc/api/call/transport.h" #include "webrtc/base/platform_file.h" #include "webrtc/common_types.h" #include "webrtc/common_video/include/frame_callback.h" #include "webrtc/config.h" #include "webrtc/media/base/videosinkinterface.h" #include "webrtc/media/base/videosourceinterface.h" -#include "webrtc/transport.h" namespace webrtc { diff --git a/webrtc/voice_engine/BUILD.gn b/webrtc/voice_engine/BUILD.gn index 919708e241..0cdca05b10 100644 --- a/webrtc/voice_engine/BUILD.gn +++ b/webrtc/voice_engine/BUILD.gn @@ -89,6 +89,7 @@ rtc_static_library("voice_engine") { "..:webrtc_common", "../api:audio_mixer_api", "../api:call_api", + "../api:transport_api", "../base:rtc_base_approved", "../common_audio", "../logging:rtc_event_log_api", @@ -177,6 +178,7 @@ if (rtc_include_tests) { deps = [ "..:webrtc_common", + "../api:transport_api", "../system_wrappers", "//testing/gtest", ] diff --git a/webrtc/voice_engine/include/voe_network.h b/webrtc/voice_engine/include/voe_network.h index c5b0aebd88..e659394f81 100644 --- a/webrtc/voice_engine/include/voe_network.h +++ b/webrtc/voice_engine/include/voe_network.h @@ -34,8 +34,8 @@ #ifndef WEBRTC_VOICE_ENGINE_VOE_NETWORK_H #define WEBRTC_VOICE_ENGINE_VOE_NETWORK_H +#include "webrtc/api/call/transport.h" #include "webrtc/common_types.h" -#include "webrtc/transport.h" namespace webrtc { diff --git a/webrtc/voice_engine/test/channel_transport/udp_transport.h b/webrtc/voice_engine/test/channel_transport/udp_transport.h index f406005b86..4b9e67db85 100644 --- a/webrtc/voice_engine/test/channel_transport/udp_transport.h +++ b/webrtc/voice_engine/test/channel_transport/udp_transport.h @@ -11,8 +11,8 @@ #ifndef WEBRTC_VOICE_ENGINE_TEST_CHANNEL_TRANSPORT_UDP_TRANSPORT_H_ #define WEBRTC_VOICE_ENGINE_TEST_CHANNEL_TRANSPORT_UDP_TRANSPORT_H_ +#include "webrtc/api/call/transport.h" #include "webrtc/common_types.h" -#include "webrtc/transport.h" #include "webrtc/typedefs.h" /*