voip_network.h (1608B)
1 /* 2 * Copyright (c) 2020 The WebRTC project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #ifndef API_VOIP_VOIP_NETWORK_H_ 12 #define API_VOIP_VOIP_NETWORK_H_ 13 14 #include <cstdint> 15 16 #include "api/array_view.h" 17 #include "api/voip/voip_base.h" 18 19 namespace webrtc { 20 21 // VoipNetwork interface provides any network related interfaces such as 22 // processing received RTP/RTCP packet from remote endpoint. This interface 23 // requires a ChannelId created via VoipBase interface. 24 class VoipNetwork { 25 public: 26 // The data received from the network including RTP header is passed here. 27 // Returns following VoipResult; 28 // kOk - received RTP packet is processed. 29 // kInvalidArgument - `channel_id` is invalid. 30 virtual VoipResult ReceivedRTPPacket(ChannelId channel_id, 31 ArrayView<const uint8_t> rtp_packet) = 0; 32 33 // The data received from the network including RTCP header is passed here. 34 // Returns following VoipResult; 35 // kOk - received RTCP packet is processed. 36 // kInvalidArgument - `channel_id` is invalid. 37 virtual VoipResult ReceivedRTCPPacket( 38 ChannelId channel_id, 39 ArrayView<const uint8_t> rtcp_packet) = 0; 40 41 protected: 42 virtual ~VoipNetwork() = default; 43 }; 44 45 } // namespace webrtc 46 47 #endif // API_VOIP_VOIP_NETWORK_H_