blob: b623254b1bef030bbda1266a6eca053cd98cab8b [file] [log] [blame]
Amit Hilbuchdd9390c2018-11-13 16:26:05 -08001/*
2 * Copyright 2018 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
Steve Anton10542f22019-01-11 09:11:00 -080011#ifndef PC_CHANNEL_INTERFACE_H_
12#define PC_CHANNEL_INTERFACE_H_
Amit Hilbuchdd9390c2018-11-13 16:26:05 -080013
14#include <string>
15
16#include "api/jsep.h"
Steve Anton10542f22019-01-11 09:11:00 -080017#include "api/media_types.h"
18#include "media/base/media_channel.h"
19#include "pc/rtp_transport_internal.h"
Amit Hilbuchdd9390c2018-11-13 16:26:05 -080020
21namespace cricket {
22
23class MediaContentDescription;
24
25// ChannelInterface contains methods common to voice, video and data channels.
26// As more methods are added to BaseChannel, they should be included in the
27// interface as well.
28class ChannelInterface {
29 public:
30 virtual cricket::MediaType media_type() const = 0;
31
32 virtual MediaChannel* media_channel() const = 0;
33
34 // TODO(deadbeef): This is redundant; remove this.
35 virtual const std::string& transport_name() const = 0;
36
37 virtual const std::string& content_name() const = 0;
38
39 virtual bool enabled() const = 0;
40
41 // Enables or disables this channel
42 virtual bool Enable(bool enable) = 0;
43
44 // Used for latency measurements.
45 virtual sigslot::signal1<ChannelInterface*>& SignalFirstPacketReceived() = 0;
46
47 // Channel control
48 virtual bool SetLocalContent(const MediaContentDescription* content,
49 webrtc::SdpType type,
50 std::string* error_desc) = 0;
51 virtual bool SetRemoteContent(const MediaContentDescription* content,
52 webrtc::SdpType type,
53 std::string* error_desc) = 0;
54
55 // Set an RTP level transport.
56 // Some examples:
57 // * An RtpTransport without encryption.
58 // * An SrtpTransport for SDES.
59 // * A DtlsSrtpTransport for DTLS-SRTP.
60 virtual bool SetRtpTransport(webrtc::RtpTransportInternal* rtp_transport) = 0;
61
62 protected:
63 virtual ~ChannelInterface() = default;
64};
65
66} // namespace cricket
67
Steve Anton10542f22019-01-11 09:11:00 -080068#endif // PC_CHANNEL_INTERFACE_H_