Move MediaTransportInterface out of the libjingle_peerconnection_api target
And move related files into api/transport/ and api/transport/media/. The moved files are unchanged, except that congestion_control_interface.h and datagram_transport_interface.h no longer include media_transport_interface.h, instead, they forward declare the few MediaTransport* types they reference. Bug: webrtc:8733 Change-Id: I4f4000d0d111f10d15a54c99af27ec26c46ae652 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/152482 Commit-Queue: Niels Moller <nisse@webrtc.org> Reviewed-by: Bjorn Mellem <mellem@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29178}
This commit is contained in:
parent
5f15f86f7c
commit
65f17ca6b4
13
api/BUILD.gn
13
api/BUILD.gn
@ -114,7 +114,6 @@ rtc_static_library("libjingle_peerconnection_api") {
|
||||
"crypto_params.h",
|
||||
"data_channel_interface.cc",
|
||||
"data_channel_interface.h",
|
||||
"data_channel_transport_interface.cc",
|
||||
"data_channel_transport_interface.h",
|
||||
"datagram_transport_interface.h",
|
||||
"dtls_transport_interface.cc",
|
||||
@ -130,9 +129,7 @@ rtc_static_library("libjingle_peerconnection_api") {
|
||||
"media_stream_interface.h",
|
||||
"media_stream_proxy.h",
|
||||
"media_stream_track_proxy.h",
|
||||
"media_transport_config.cc",
|
||||
"media_transport_config.h",
|
||||
"media_transport_interface.cc",
|
||||
"media_transport_interface.h",
|
||||
"notifier.h",
|
||||
"packet_socket_factory.h",
|
||||
@ -175,8 +172,10 @@ rtc_static_library("libjingle_peerconnection_api") {
|
||||
"rtc_event_log",
|
||||
"task_queue",
|
||||
"transport:bitrate_settings",
|
||||
"transport:datagram_transport_interface",
|
||||
"transport:network_control",
|
||||
"transport/media:audio_interfaces",
|
||||
"transport/media:media_transport_interface",
|
||||
"transport/media:video_interfaces",
|
||||
"transport/rtp:rtp_source",
|
||||
"units:data_rate",
|
||||
@ -256,6 +255,7 @@ rtc_source_set("video_quality_test_fixture_api") {
|
||||
"../test:test_common",
|
||||
"../test:video_test_common",
|
||||
"transport:network_control",
|
||||
"transport/media:media_transport_interface",
|
||||
"video_codecs:video_codecs_api",
|
||||
]
|
||||
}
|
||||
@ -350,6 +350,7 @@ rtc_source_set("peer_connection_quality_test_fixture_api") {
|
||||
"rtc_event_log",
|
||||
"task_queue",
|
||||
"transport:network_control",
|
||||
"transport/media:media_transport_interface",
|
||||
"units:time_delta",
|
||||
"video_codecs:video_codecs_api",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
@ -873,8 +874,9 @@ if (rtc_include_tests) {
|
||||
]
|
||||
|
||||
deps = [
|
||||
":libjingle_peerconnection_api",
|
||||
"../rtc_base:checks",
|
||||
"transport:datagram_transport_interface",
|
||||
"transport/media:media_transport_interface",
|
||||
"//third_party/abseil-cpp/absl/algorithm:container",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
]
|
||||
@ -889,9 +891,10 @@ if (rtc_include_tests) {
|
||||
]
|
||||
|
||||
deps = [
|
||||
":libjingle_peerconnection_api",
|
||||
"../rtc_base",
|
||||
"../rtc_base:checks",
|
||||
"transport:datagram_transport_interface",
|
||||
"transport/media:media_transport_interface",
|
||||
"//third_party/abseil-cpp/absl/algorithm:container",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
]
|
||||
|
||||
@ -7,61 +7,11 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
// This is EXPERIMENTAL interface for media and datagram transports.
|
||||
|
||||
#ifndef API_CONGESTION_CONTROL_INTERFACE_H_
|
||||
#define API_CONGESTION_CONTROL_INTERFACE_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "api/media_transport_interface.h"
|
||||
#include "api/units/data_rate.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
// Defines congestion control feedback interface for media and datagram
|
||||
// transports.
|
||||
class CongestionControlInterface {
|
||||
public:
|
||||
virtual ~CongestionControlInterface() = default;
|
||||
|
||||
// Updates allocation limits.
|
||||
virtual void SetAllocatedBitrateLimits(
|
||||
const MediaTransportAllocatedBitrateLimits& limits) = 0;
|
||||
|
||||
// Sets starting rate.
|
||||
virtual void SetTargetBitrateLimits(
|
||||
const MediaTransportTargetRateConstraints& target_rate_constraints) = 0;
|
||||
|
||||
// Intended for receive side. AddRttObserver registers an observer to be
|
||||
// called for each RTT measurement, typically once per ACK. Before media
|
||||
// transport is destructed the observer must be unregistered.
|
||||
//
|
||||
// TODO(sukhanov): Looks like AddRttObserver and RemoveRttObserver were
|
||||
// never implemented for media transport, so keeping noop implementation.
|
||||
virtual void AddRttObserver(MediaTransportRttObserver* observer) {}
|
||||
virtual void RemoveRttObserver(MediaTransportRttObserver* observer) {}
|
||||
|
||||
// Adds a target bitrate observer. Before media transport is destructed
|
||||
// the observer must be unregistered (by calling
|
||||
// RemoveTargetTransferRateObserver).
|
||||
// A newly registered observer will be called back with the latest recorded
|
||||
// target rate, if available.
|
||||
virtual void AddTargetTransferRateObserver(
|
||||
TargetTransferRateObserver* observer) = 0;
|
||||
|
||||
// Removes an existing |observer| from observers. If observer was never
|
||||
// registered, an error is logged and method does nothing.
|
||||
virtual void RemoveTargetTransferRateObserver(
|
||||
TargetTransferRateObserver* observer) = 0;
|
||||
|
||||
// Returns the last known target transfer rate as reported to the above
|
||||
// observers.
|
||||
virtual absl::optional<TargetTransferRate> GetLatestTargetTransferRate() = 0;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
// TODO(bugs.webrtc.org/8733): Delete once users are updated for the new
|
||||
// location.
|
||||
#include "api/transport/congestion_control_interface.h"
|
||||
|
||||
#endif // API_CONGESTION_CONTROL_INTERFACE_H_
|
||||
|
||||
@ -7,119 +7,11 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
// This is an experimental interface and is subject to change without notice.
|
||||
|
||||
#ifndef API_DATA_CHANNEL_TRANSPORT_INTERFACE_H_
|
||||
#define API_DATA_CHANNEL_TRANSPORT_INTERFACE_H_
|
||||
|
||||
#include "absl/types/optional.h"
|
||||
#include "api/rtc_error.h"
|
||||
#include "rtc_base/copy_on_write_buffer.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
// Supported types of application data messages.
|
||||
enum class DataMessageType {
|
||||
// Application data buffer with the binary bit unset.
|
||||
kText,
|
||||
|
||||
// Application data buffer with the binary bit set.
|
||||
kBinary,
|
||||
|
||||
// Transport-agnostic control messages, such as open or open-ack messages.
|
||||
kControl,
|
||||
};
|
||||
|
||||
// Parameters for sending data. The parameters may change from message to
|
||||
// message, even within a single channel. For example, control messages may be
|
||||
// sent reliably and in-order, even if the data channel is configured for
|
||||
// unreliable delivery.
|
||||
struct SendDataParams {
|
||||
SendDataParams();
|
||||
SendDataParams(const SendDataParams&);
|
||||
|
||||
DataMessageType type = DataMessageType::kText;
|
||||
|
||||
// Whether to deliver the message in order with respect to other ordered
|
||||
// messages with the same channel_id.
|
||||
bool ordered = false;
|
||||
|
||||
// If set, the maximum number of times this message may be
|
||||
// retransmitted by the transport before it is dropped.
|
||||
// Setting this value to zero disables retransmission.
|
||||
// Must be non-negative. |max_rtx_count| and |max_rtx_ms| may not be set
|
||||
// simultaneously.
|
||||
absl::optional<int> max_rtx_count;
|
||||
|
||||
// If set, the maximum number of milliseconds for which the transport
|
||||
// may retransmit this message before it is dropped.
|
||||
// Setting this value to zero disables retransmission.
|
||||
// Must be non-negative. |max_rtx_count| and |max_rtx_ms| may not be set
|
||||
// simultaneously.
|
||||
absl::optional<int> max_rtx_ms;
|
||||
};
|
||||
|
||||
// Sink for callbacks related to a data channel.
|
||||
class DataChannelSink {
|
||||
public:
|
||||
virtual ~DataChannelSink() = default;
|
||||
|
||||
// Callback issued when data is received by the transport.
|
||||
virtual void OnDataReceived(int channel_id,
|
||||
DataMessageType type,
|
||||
const rtc::CopyOnWriteBuffer& buffer) = 0;
|
||||
|
||||
// Callback issued when a remote data channel begins the closing procedure.
|
||||
// Messages sent after the closing procedure begins will not be transmitted.
|
||||
virtual void OnChannelClosing(int channel_id) = 0;
|
||||
|
||||
// Callback issued when a (remote or local) data channel completes the closing
|
||||
// procedure. Closing channels become closed after all pending data has been
|
||||
// transmitted.
|
||||
virtual void OnChannelClosed(int channel_id) = 0;
|
||||
|
||||
// Callback issued when the data channel becomes ready to send.
|
||||
// This callback will be issued immediately when the data channel sink is
|
||||
// registered if the transport is ready at that time. This callback may be
|
||||
// invoked again following send errors (eg. due to the transport being
|
||||
// temporarily blocked or unavailable).
|
||||
// TODO(mellem): Make pure virtual when downstream sinks override this.
|
||||
virtual void OnReadyToSend();
|
||||
};
|
||||
|
||||
// Transport for data channels.
|
||||
class DataChannelTransportInterface {
|
||||
public:
|
||||
virtual ~DataChannelTransportInterface() = default;
|
||||
|
||||
// Opens a data |channel_id| for sending. May return an error if the
|
||||
// specified |channel_id| is unusable. Must be called before |SendData|.
|
||||
virtual RTCError OpenChannel(int channel_id);
|
||||
|
||||
// Sends a data buffer to the remote endpoint using the given send parameters.
|
||||
// |buffer| may not be larger than 256 KiB. Returns an error if the send
|
||||
// fails.
|
||||
virtual RTCError SendData(int channel_id,
|
||||
const SendDataParams& params,
|
||||
const rtc::CopyOnWriteBuffer& buffer);
|
||||
|
||||
// Closes |channel_id| gracefully. Returns an error if |channel_id| is not
|
||||
// open. Data sent after the closing procedure begins will not be
|
||||
// transmitted. The channel becomes closed after pending data is transmitted.
|
||||
virtual RTCError CloseChannel(int channel_id);
|
||||
|
||||
// Sets a sink for data messages and channel state callbacks. Before media
|
||||
// transport is destroyed, the sink must be unregistered by setting it to
|
||||
// nullptr.
|
||||
virtual void SetDataSink(DataChannelSink* sink);
|
||||
|
||||
// Returns whether this data channel transport is ready to send.
|
||||
// Note: the default implementation always returns false (as it assumes no one
|
||||
// has implemented the interface). This default implementation is temporary.
|
||||
// TODO(mellem): Change this to pure virtual.
|
||||
virtual bool IsReadyToSend() const;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
// TODO(bugs.webrtc.org/8733): Delete once users are updated for the new
|
||||
// location.
|
||||
#include "api/transport/data_channel_transport_interface.h"
|
||||
|
||||
#endif // API_DATA_CHANNEL_TRANSPORT_INTERFACE_H_
|
||||
|
||||
@ -7,143 +7,11 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
// This is EXPERIMENTAL interface for media and datagram transports.
|
||||
|
||||
#ifndef API_DATAGRAM_TRANSPORT_INTERFACE_H_
|
||||
#define API_DATAGRAM_TRANSPORT_INTERFACE_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "absl/types/optional.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/congestion_control_interface.h"
|
||||
#include "api/data_channel_transport_interface.h"
|
||||
#include "api/media_transport_interface.h"
|
||||
#include "api/rtc_error.h"
|
||||
#include "api/units/data_rate.h"
|
||||
#include "api/units/timestamp.h"
|
||||
|
||||
namespace rtc {
|
||||
class PacketTransportInternal;
|
||||
} // namespace rtc
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
typedef int64_t DatagramId;
|
||||
|
||||
struct DatagramAck {
|
||||
// |datagram_id| is same as passed in
|
||||
// DatagramTransportInterface::SendDatagram.
|
||||
DatagramId datagram_id;
|
||||
|
||||
// The timestamp at which the remote peer received the identified datagram,
|
||||
// according to that peer's clock.
|
||||
Timestamp receive_timestamp = Timestamp::MinusInfinity();
|
||||
};
|
||||
|
||||
// All sink methods are called on network thread.
|
||||
class DatagramSinkInterface {
|
||||
public:
|
||||
virtual ~DatagramSinkInterface() {}
|
||||
|
||||
// Called when new packet is received.
|
||||
virtual void OnDatagramReceived(rtc::ArrayView<const uint8_t> data) = 0;
|
||||
|
||||
// Called when datagram is actually sent (datragram can be delayed due
|
||||
// to congestion control or fusing). |datagram_id| is same as passed in
|
||||
// DatagramTransportInterface::SendDatagram.
|
||||
virtual void OnDatagramSent(DatagramId datagram_id) = 0;
|
||||
|
||||
// Called when datagram is ACKed.
|
||||
// TODO(sukhanov): Make pure virtual.
|
||||
virtual void OnDatagramAcked(const DatagramAck& datagram_ack) {}
|
||||
|
||||
// Called when a datagram is lost.
|
||||
virtual void OnDatagramLost(DatagramId datagram_id) {}
|
||||
};
|
||||
|
||||
// Datagram transport allows to send and receive unreliable packets (datagrams)
|
||||
// and receive feedback from congestion control (via
|
||||
// CongestionControlInterface). The idea is to send RTP packets as datagrams and
|
||||
// have underlying implementation of datagram transport to use QUIC datagram
|
||||
// protocol.
|
||||
class DatagramTransportInterface : public DataChannelTransportInterface {
|
||||
public:
|
||||
virtual ~DatagramTransportInterface() = default;
|
||||
|
||||
// Connect the datagram transport to the ICE transport.
|
||||
// The implementation must be able to ignore incoming packets that don't
|
||||
// belong to it.
|
||||
virtual void Connect(rtc::PacketTransportInternal* packet_transport) = 0;
|
||||
|
||||
// Returns congestion control feedback interface or nullptr if datagram
|
||||
// transport does not implement congestion control.
|
||||
//
|
||||
// Note that right now datagram transport is used without congestion control,
|
||||
// but we plan to use it in the future.
|
||||
virtual CongestionControlInterface* congestion_control() = 0;
|
||||
|
||||
// Sets a state observer callback. Before datagram transport is destroyed, the
|
||||
// callback must be unregistered by setting it to nullptr.
|
||||
// A newly registered callback will be called with the current state.
|
||||
// Datagram transport does not invoke this callback concurrently.
|
||||
virtual void SetTransportStateCallback(
|
||||
MediaTransportStateCallback* callback) = 0;
|
||||
|
||||
// Start asynchronous send of datagram. The status returned by this method
|
||||
// only pertains to the synchronous operations (e.g. serialization /
|
||||
// packetization), not to the asynchronous operation.
|
||||
//
|
||||
// Datagrams larger than GetLargestDatagramSize() will fail and return error.
|
||||
//
|
||||
// Datagrams are sent in FIFO order.
|
||||
//
|
||||
// |datagram_id| is only used in ACK/LOST notifications in
|
||||
// DatagramSinkInterface and does not need to be unique.
|
||||
virtual RTCError SendDatagram(rtc::ArrayView<const uint8_t> data,
|
||||
DatagramId datagram_id) = 0;
|
||||
|
||||
// Returns maximum size of datagram message, does not change.
|
||||
// TODO(sukhanov): Because value may be undefined before connection setup
|
||||
// is complete, consider returning error when called before connection is
|
||||
// established. Currently returns hardcoded const, because integration
|
||||
// prototype may call before connection is established.
|
||||
virtual size_t GetLargestDatagramSize() const = 0;
|
||||
|
||||
// Sets packet sink. Sink must be unset by calling
|
||||
// SetDataTransportSink(nullptr) before the data transport is destroyed or
|
||||
// before new sink is set.
|
||||
virtual void SetDatagramSink(DatagramSinkInterface* sink) = 0;
|
||||
|
||||
// Retrieves callers config (i.e. media transport offer) that should be passed
|
||||
// to the callee, before the call is connected. Such config is opaque to SDP
|
||||
// (sdp just passes it through). The config is a binary blob, so SDP may
|
||||
// choose to use base64 to serialize it (or any other approach that guarantees
|
||||
// that the binary blob goes through). This should only be called for the
|
||||
// caller's perspective.
|
||||
//
|
||||
// TODO(mellem): Delete.
|
||||
virtual absl::optional<std::string> GetTransportParametersOffer() const {
|
||||
return absl::nullopt;
|
||||
}
|
||||
|
||||
// Retrieves transport parameters for this datagram transport. May be called
|
||||
// on either client- or server-perspective transports.
|
||||
//
|
||||
// For servers, the parameters represent what kind of connections and data the
|
||||
// server is prepared to accept. This is generally a superset of acceptable
|
||||
// parameters.
|
||||
//
|
||||
// For clients, the parameters echo the server configuration used to create
|
||||
// the client, possibly removing any fields or parameters which the client
|
||||
// does not understand.
|
||||
//
|
||||
// TODO(mellem): Make pure virtual.
|
||||
virtual std::string GetTransportParameters() const { return ""; }
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
// TODO(bugs.webrtc.org/8733): Delete once users are updated for the new
|
||||
// location.
|
||||
#include "api/transport/datagram_transport_interface.h"
|
||||
|
||||
#endif // API_DATAGRAM_TRANSPORT_INTERFACE_H_
|
||||
|
||||
@ -9,39 +9,8 @@
|
||||
#ifndef API_MEDIA_TRANSPORT_CONFIG_H_
|
||||
#define API_MEDIA_TRANSPORT_CONFIG_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "absl/types/optional.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class MediaTransportInterface;
|
||||
|
||||
// Media transport config is made available to both transport and audio / video
|
||||
// layers, but access to individual interfaces should not be open without
|
||||
// necessity.
|
||||
struct MediaTransportConfig {
|
||||
// Default constructor for no-media transport scenarios.
|
||||
MediaTransportConfig() = default;
|
||||
|
||||
// Constructor for media transport scenarios.
|
||||
// Note that |media_transport| may not be nullptr.
|
||||
explicit MediaTransportConfig(MediaTransportInterface* media_transport);
|
||||
|
||||
// Constructor for datagram transport scenarios.
|
||||
explicit MediaTransportConfig(size_t rtp_max_packet_size);
|
||||
|
||||
std::string DebugString() const;
|
||||
|
||||
// If provided, all media is sent through media_transport.
|
||||
MediaTransportInterface* media_transport = nullptr;
|
||||
|
||||
// If provided, limits RTP packet size (excludes ICE, IP or network overhead).
|
||||
absl::optional<size_t> rtp_max_packet_size;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
// TODO(bugs.webrtc.org/8733): Delete once users are updated for the new
|
||||
// location.
|
||||
#include "api/transport/media/media_transport_config.h"
|
||||
|
||||
#endif // API_MEDIA_TRANSPORT_CONFIG_H_
|
||||
|
||||
@ -7,322 +7,11 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
// This is EXPERIMENTAL interface for media transport.
|
||||
//
|
||||
// The goal is to refactor WebRTC code so that audio and video frames
|
||||
// are sent / received through the media transport interface. This will
|
||||
// enable different media transport implementations, including QUIC-based
|
||||
// media transport.
|
||||
|
||||
#ifndef API_MEDIA_TRANSPORT_INTERFACE_H_
|
||||
#define API_MEDIA_TRANSPORT_INTERFACE_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
// TODO(bugs.webrtc.org/8733): Delete once users are updated for the new
|
||||
// location.
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
|
||||
#include "absl/types/optional.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/data_channel_transport_interface.h"
|
||||
#include "api/rtc_error.h"
|
||||
#include "api/transport/media/audio_transport.h"
|
||||
#include "api/transport/media/video_transport.h"
|
||||
#include "api/transport/network_control.h"
|
||||
#include "api/units/data_rate.h"
|
||||
#include "common_types.h" // NOLINT(build/include)
|
||||
#include "rtc_base/copy_on_write_buffer.h"
|
||||
#include "rtc_base/network_route.h"
|
||||
|
||||
namespace rtc {
|
||||
class PacketTransportInternal;
|
||||
class Thread;
|
||||
} // namespace rtc
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class DatagramTransportInterface;
|
||||
class RtcEventLog;
|
||||
|
||||
class AudioPacketReceivedObserver {
|
||||
public:
|
||||
virtual ~AudioPacketReceivedObserver() = default;
|
||||
|
||||
// Invoked for the first received audio packet on a given channel id.
|
||||
// It will be invoked once for each channel id.
|
||||
virtual void OnFirstAudioPacketReceived(int64_t channel_id) = 0;
|
||||
};
|
||||
|
||||
// Used to configure stream allocations.
|
||||
struct MediaTransportAllocatedBitrateLimits {
|
||||
DataRate min_pacing_rate = DataRate::Zero();
|
||||
DataRate max_padding_bitrate = DataRate::Zero();
|
||||
DataRate max_total_allocated_bitrate = DataRate::Zero();
|
||||
};
|
||||
|
||||
// Used to configure target bitrate constraints.
|
||||
// If the value is provided, the constraint is updated.
|
||||
// If the value is omitted, the value is left unchanged.
|
||||
struct MediaTransportTargetRateConstraints {
|
||||
absl::optional<DataRate> min_bitrate;
|
||||
absl::optional<DataRate> max_bitrate;
|
||||
absl::optional<DataRate> starting_bitrate;
|
||||
};
|
||||
|
||||
// A collection of settings for creation of media transport.
|
||||
struct MediaTransportSettings final {
|
||||
MediaTransportSettings();
|
||||
MediaTransportSettings(const MediaTransportSettings&);
|
||||
MediaTransportSettings& operator=(const MediaTransportSettings&);
|
||||
~MediaTransportSettings();
|
||||
|
||||
// Group calls are not currently supported, in 1:1 call one side must set
|
||||
// is_caller = true and another is_caller = false.
|
||||
bool is_caller;
|
||||
|
||||
// Must be set if a pre-shared key is used for the call.
|
||||
// TODO(bugs.webrtc.org/9944): This should become zero buffer in the distant
|
||||
// future.
|
||||
absl::optional<std::string> pre_shared_key;
|
||||
|
||||
// If present, this is a config passed from the caller to the answerer in the
|
||||
// offer. Each media transport knows how to understand its own parameters.
|
||||
absl::optional<std::string> remote_transport_parameters;
|
||||
|
||||
// If present, provides the event log that media transport should use.
|
||||
// Media transport does not own it. The lifetime of |event_log| will exceed
|
||||
// the lifetime of the instance of MediaTransportInterface instance.
|
||||
RtcEventLog* event_log = nullptr;
|
||||
};
|
||||
|
||||
// Callback to notify about network route changes.
|
||||
class MediaTransportNetworkChangeCallback {
|
||||
public:
|
||||
virtual ~MediaTransportNetworkChangeCallback() = default;
|
||||
|
||||
// Called when the network route is changed, with the new network route.
|
||||
virtual void OnNetworkRouteChanged(
|
||||
const rtc::NetworkRoute& new_network_route) = 0;
|
||||
};
|
||||
|
||||
// State of the media transport. Media transport begins in the pending state.
|
||||
// It transitions to writable when it is ready to send media. It may transition
|
||||
// back to pending if the connection is blocked. It may transition to closed at
|
||||
// any time. Closed is terminal: a transport will never re-open once closed.
|
||||
enum class MediaTransportState {
|
||||
kPending,
|
||||
kWritable,
|
||||
kClosed,
|
||||
};
|
||||
|
||||
// Callback invoked whenever the state of the media transport changes.
|
||||
class MediaTransportStateCallback {
|
||||
public:
|
||||
virtual ~MediaTransportStateCallback() = default;
|
||||
|
||||
// Invoked whenever the state of the media transport changes.
|
||||
virtual void OnStateChanged(MediaTransportState state) = 0;
|
||||
};
|
||||
|
||||
// Callback for RTT measurements on the receive side.
|
||||
// TODO(nisse): Related interfaces: CallStatsObserver and RtcpRttStats. It's
|
||||
// somewhat unclear what type of measurement is needed. It's used to configure
|
||||
// NACK generation and playout buffer. Either raw measurement values or recent
|
||||
// maximum would make sense for this use. Need consolidation of RTT signalling.
|
||||
class MediaTransportRttObserver {
|
||||
public:
|
||||
virtual ~MediaTransportRttObserver() = default;
|
||||
|
||||
// Invoked when a new RTT measurement is available, typically once per ACK.
|
||||
virtual void OnRttUpdated(int64_t rtt_ms) = 0;
|
||||
};
|
||||
|
||||
// Media transport interface for sending / receiving encoded audio/video frames
|
||||
// and receiving bandwidth estimate update from congestion control.
|
||||
class MediaTransportInterface : public DataChannelTransportInterface {
|
||||
public:
|
||||
MediaTransportInterface();
|
||||
virtual ~MediaTransportInterface();
|
||||
|
||||
// Retrieves callers config (i.e. media transport offer) that should be passed
|
||||
// to the callee, before the call is connected. Such config is opaque to SDP
|
||||
// (sdp just passes it through). The config is a binary blob, so SDP may
|
||||
// choose to use base64 to serialize it (or any other approach that guarantees
|
||||
// that the binary blob goes through). This should only be called for the
|
||||
// caller's perspective.
|
||||
//
|
||||
// This may return an unset optional, which means that the given media
|
||||
// transport is not supported / disabled and shouldn't be reported in SDP.
|
||||
//
|
||||
// It may also return an empty string, in which case the media transport is
|
||||
// supported, but without any extra settings.
|
||||
// TODO(psla): Make abstract.
|
||||
virtual absl::optional<std::string> GetTransportParametersOffer() const;
|
||||
|
||||
// Connect the media transport to the ICE transport.
|
||||
// The implementation must be able to ignore incoming packets that don't
|
||||
// belong to it.
|
||||
// TODO(psla): Make abstract.
|
||||
virtual void Connect(rtc::PacketTransportInternal* packet_transport);
|
||||
|
||||
// Start asynchronous send of audio frame. The status returned by this method
|
||||
// only pertains to the synchronous operations (e.g.
|
||||
// serialization/packetization), not to the asynchronous operation.
|
||||
|
||||
virtual RTCError SendAudioFrame(uint64_t channel_id,
|
||||
MediaTransportEncodedAudioFrame frame) = 0;
|
||||
|
||||
// Start asynchronous send of video frame. The status returned by this method
|
||||
// only pertains to the synchronous operations (e.g.
|
||||
// serialization/packetization), not to the asynchronous operation.
|
||||
virtual RTCError SendVideoFrame(
|
||||
uint64_t channel_id,
|
||||
const MediaTransportEncodedVideoFrame& frame) = 0;
|
||||
|
||||
// Used by video sender to be notified on key frame requests.
|
||||
virtual void SetKeyFrameRequestCallback(
|
||||
MediaTransportKeyFrameRequestCallback* callback);
|
||||
|
||||
// Requests a keyframe for the particular channel (stream). The caller should
|
||||
// check that the keyframe is not present in a jitter buffer already (i.e.
|
||||
// don't request a keyframe if there is one that you will get from the jitter
|
||||
// buffer in a moment).
|
||||
virtual RTCError RequestKeyFrame(uint64_t channel_id) = 0;
|
||||
|
||||
// Sets audio sink. Sink must be unset by calling SetReceiveAudioSink(nullptr)
|
||||
// before the media transport is destroyed or before new sink is set.
|
||||
virtual void SetReceiveAudioSink(MediaTransportAudioSinkInterface* sink) = 0;
|
||||
|
||||
// Registers a video sink. Before destruction of media transport, you must
|
||||
// pass a nullptr.
|
||||
virtual void SetReceiveVideoSink(MediaTransportVideoSinkInterface* sink) = 0;
|
||||
|
||||
// Adds a target bitrate observer. Before media transport is destructed
|
||||
// the observer must be unregistered (by calling
|
||||
// RemoveTargetTransferRateObserver).
|
||||
// A newly registered observer will be called back with the latest recorded
|
||||
// target rate, if available.
|
||||
virtual void AddTargetTransferRateObserver(
|
||||
TargetTransferRateObserver* observer);
|
||||
|
||||
// Removes an existing |observer| from observers. If observer was never
|
||||
// registered, an error is logged and method does nothing.
|
||||
virtual void RemoveTargetTransferRateObserver(
|
||||
TargetTransferRateObserver* observer);
|
||||
|
||||
// Sets audio packets observer, which gets informed about incoming audio
|
||||
// packets. Before destruction, the observer must be unregistered by setting
|
||||
// nullptr.
|
||||
//
|
||||
// This method may be temporary, when the multiplexer is implemented (or
|
||||
// multiplexer may use it to demultiplex channel ids).
|
||||
virtual void SetFirstAudioPacketReceivedObserver(
|
||||
AudioPacketReceivedObserver* observer);
|
||||
|
||||
// Intended for receive side. AddRttObserver registers an observer to be
|
||||
// called for each RTT measurement, typically once per ACK. Before media
|
||||
// transport is destructed the observer must be unregistered.
|
||||
virtual void AddRttObserver(MediaTransportRttObserver* observer);
|
||||
virtual void RemoveRttObserver(MediaTransportRttObserver* observer);
|
||||
|
||||
// Returns the last known target transfer rate as reported to the above
|
||||
// observers.
|
||||
virtual absl::optional<TargetTransferRate> GetLatestTargetTransferRate();
|
||||
|
||||
// Gets the audio packet overhead in bytes. Returned overhead does not include
|
||||
// transport overhead (ipv4/6, turn channeldata, tcp/udp, etc.).
|
||||
// If the transport is capable of fusing packets together, this overhead
|
||||
// might not be a very accurate number.
|
||||
// TODO(nisse): Deprecated.
|
||||
virtual size_t GetAudioPacketOverhead() const;
|
||||
|
||||
// Corresponding observers for audio and video overhead. Before destruction,
|
||||
// the observers must be unregistered by setting nullptr.
|
||||
|
||||
// TODO(nisse): Should move to per-stream objects, since packetization
|
||||
// overhead can vary per stream, e.g., depending on negotiated extensions. In
|
||||
// addition, we should move towards reporting total overhead including all
|
||||
// layers. Currently, overhead of the lower layers is reported elsewhere,
|
||||
// e.g., on route change between IPv4 and IPv6.
|
||||
virtual void SetAudioOverheadObserver(OverheadObserver* observer) {}
|
||||
|
||||
// Registers an observer for network change events. If the network route is
|
||||
// already established when the callback is added, |callback| will be called
|
||||
// immediately with the current network route. Before media transport is
|
||||
// destroyed, the callback must be removed.
|
||||
virtual void AddNetworkChangeCallback(
|
||||
MediaTransportNetworkChangeCallback* callback);
|
||||
virtual void RemoveNetworkChangeCallback(
|
||||
MediaTransportNetworkChangeCallback* callback);
|
||||
|
||||
// Sets a state observer callback. Before media transport is destroyed, the
|
||||
// callback must be unregistered by setting it to nullptr.
|
||||
// A newly registered callback will be called with the current state.
|
||||
// Media transport does not invoke this callback concurrently.
|
||||
virtual void SetMediaTransportStateCallback(
|
||||
MediaTransportStateCallback* callback) = 0;
|
||||
|
||||
// Updates allocation limits.
|
||||
// TODO(psla): Make abstract when downstream implementation implement it.
|
||||
virtual void SetAllocatedBitrateLimits(
|
||||
const MediaTransportAllocatedBitrateLimits& limits);
|
||||
|
||||
// Sets starting rate.
|
||||
// TODO(psla): Make abstract when downstream implementation implement it.
|
||||
virtual void SetTargetBitrateLimits(
|
||||
const MediaTransportTargetRateConstraints& target_rate_constraints) {}
|
||||
|
||||
// TODO(sukhanov): RtcEventLogs.
|
||||
};
|
||||
|
||||
// If media transport factory is set in peer connection factory, it will be
|
||||
// used to create media transport for sending/receiving encoded frames and
|
||||
// this transport will be used instead of default RTP/SRTP transport.
|
||||
//
|
||||
// Currently Media Transport negotiation is not supported in SDP.
|
||||
// If application is using media transport, it must negotiate it before
|
||||
// setting media transport factory in peer connection.
|
||||
class MediaTransportFactory {
|
||||
public:
|
||||
virtual ~MediaTransportFactory() = default;
|
||||
|
||||
// Creates media transport.
|
||||
// - Does not take ownership of packet_transport or network_thread.
|
||||
// - Does not support group calls, in 1:1 call one side must set
|
||||
// is_caller = true and another is_caller = false.
|
||||
virtual RTCErrorOr<std::unique_ptr<MediaTransportInterface>>
|
||||
CreateMediaTransport(rtc::PacketTransportInternal* packet_transport,
|
||||
rtc::Thread* network_thread,
|
||||
const MediaTransportSettings& settings);
|
||||
|
||||
// Creates a new Media Transport in a disconnected state. If the media
|
||||
// transport for the caller is created, one can then call
|
||||
// MediaTransportInterface::GetTransportParametersOffer on that new instance.
|
||||
// TODO(psla): Make abstract.
|
||||
virtual RTCErrorOr<std::unique_ptr<webrtc::MediaTransportInterface>>
|
||||
CreateMediaTransport(rtc::Thread* network_thread,
|
||||
const MediaTransportSettings& settings);
|
||||
|
||||
// Creates a new Datagram Transport in a disconnected state. If the datagram
|
||||
// transport for the caller is created, one can then call
|
||||
// DatagramTransportInterface::GetTransportParametersOffer on that new
|
||||
// instance.
|
||||
//
|
||||
// TODO(sukhanov): Consider separating media and datagram transport factories.
|
||||
// TODO(sukhanov): Move factory to a separate .h file.
|
||||
virtual RTCErrorOr<std::unique_ptr<DatagramTransportInterface>>
|
||||
CreateDatagramTransport(rtc::Thread* network_thread,
|
||||
const MediaTransportSettings& settings);
|
||||
|
||||
// Gets a transport name which is supported by the implementation.
|
||||
// Different factories should return different transport names, and at runtime
|
||||
// it will be checked that different names were used.
|
||||
// For example, "rtp" or "generic" may be returned by two different
|
||||
// implementations.
|
||||
// The value returned by this method must never change in the lifetime of the
|
||||
// factory.
|
||||
// TODO(psla): Make abstract.
|
||||
virtual std::string GetTransportName() const;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
#endif // API_MEDIA_TRANSPORT_INTERFACE_H_
|
||||
|
||||
@ -84,7 +84,6 @@
|
||||
#include "api/fec_controller.h"
|
||||
#include "api/jsep.h"
|
||||
#include "api/media_stream_interface.h"
|
||||
#include "api/media_transport_interface.h"
|
||||
#include "api/network_state_predictor.h"
|
||||
#include "api/packet_socket_factory.h"
|
||||
#include "api/rtc_error.h"
|
||||
@ -98,6 +97,7 @@
|
||||
#include "api/stats_types.h"
|
||||
#include "api/task_queue/task_queue_factory.h"
|
||||
#include "api/transport/bitrate_settings.h"
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
#include "api/transport/network_control.h"
|
||||
#include "api/turn_customizer.h"
|
||||
#include "media/base/media_config.h"
|
||||
|
||||
@ -14,7 +14,8 @@
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
|
||||
#include "api/datagram_transport_interface.h"
|
||||
#include "api/transport/datagram_transport_interface.h"
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
||||
@ -18,8 +18,8 @@
|
||||
|
||||
#include "absl/algorithm/container.h"
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/media_transport_interface.h"
|
||||
#include "api/test/fake_datagram_transport.h"
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
||||
@ -17,8 +17,8 @@
|
||||
#include <vector>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/datagram_transport_interface.h"
|
||||
#include "api/media_transport_interface.h"
|
||||
#include "api/transport/datagram_transport_interface.h"
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
#include "rtc_base/async_invoker.h"
|
||||
#include "rtc_base/critical_section.h"
|
||||
#include "rtc_base/thread.h"
|
||||
|
||||
@ -21,7 +21,6 @@
|
||||
#include "api/call/call_factory_interface.h"
|
||||
#include "api/fec_controller.h"
|
||||
#include "api/function_view.h"
|
||||
#include "api/media_transport_interface.h"
|
||||
#include "api/peer_connection_interface.h"
|
||||
#include "api/rtc_event_log/rtc_event_log_factory_interface.h"
|
||||
#include "api/task_queue/task_queue_factory.h"
|
||||
@ -29,6 +28,7 @@
|
||||
#include "api/test/simulated_network.h"
|
||||
#include "api/test/stats_observer_interface.h"
|
||||
#include "api/test/video_quality_analyzer_interface.h"
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
#include "api/transport/network_control.h"
|
||||
#include "api/units/time_delta.h"
|
||||
#include "api/video_codecs/video_decoder_factory.h"
|
||||
|
||||
@ -69,6 +69,25 @@ rtc_source_set("field_trial_based_config") {
|
||||
]
|
||||
}
|
||||
|
||||
rtc_source_set("datagram_transport_interface") {
|
||||
visibility = [ "*" ]
|
||||
sources = [
|
||||
"congestion_control_interface.h",
|
||||
"data_channel_transport_interface.cc",
|
||||
"data_channel_transport_interface.h",
|
||||
"datagram_transport_interface.h",
|
||||
]
|
||||
deps = [
|
||||
":network_control",
|
||||
"..:array_view",
|
||||
"..:rtc_error",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
"../units:data_rate",
|
||||
"../units:timestamp",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
}
|
||||
|
||||
rtc_static_library("goog_cc") {
|
||||
visibility = [ "*" ]
|
||||
sources = [
|
||||
|
||||
75
api/transport/congestion_control_interface.h
Normal file
75
api/transport/congestion_control_interface.h
Normal file
@ -0,0 +1,75 @@
|
||||
/* Copyright 2018 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.
|
||||
*/
|
||||
|
||||
// This is EXPERIMENTAL interface for media and datagram transports.
|
||||
|
||||
#ifndef API_TRANSPORT_CONGESTION_CONTROL_INTERFACE_H_
|
||||
#define API_TRANSPORT_CONGESTION_CONTROL_INTERFACE_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "api/transport/network_control.h"
|
||||
#include "api/units/data_rate.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
// TODO(nisse): Defined together with MediaTransportInterface. But we should use
|
||||
// types that aren't tied to media, so that MediaTransportInterface can depend
|
||||
// on CongestionControlInterface, but not the other way around.
|
||||
// api/transport/network_control.h may be a reasonable place.
|
||||
class MediaTransportRttObserver;
|
||||
struct MediaTransportAllocatedBitrateLimits;
|
||||
struct MediaTransportTargetRateConstraints;
|
||||
|
||||
// Defines congestion control feedback interface for media and datagram
|
||||
// transports.
|
||||
class CongestionControlInterface {
|
||||
public:
|
||||
virtual ~CongestionControlInterface() = default;
|
||||
|
||||
// Updates allocation limits.
|
||||
virtual void SetAllocatedBitrateLimits(
|
||||
const MediaTransportAllocatedBitrateLimits& limits) = 0;
|
||||
|
||||
// Sets starting rate.
|
||||
virtual void SetTargetBitrateLimits(
|
||||
const MediaTransportTargetRateConstraints& target_rate_constraints) = 0;
|
||||
|
||||
// Intended for receive side. AddRttObserver registers an observer to be
|
||||
// called for each RTT measurement, typically once per ACK. Before media
|
||||
// transport is destructed the observer must be unregistered.
|
||||
//
|
||||
// TODO(sukhanov): Looks like AddRttObserver and RemoveRttObserver were
|
||||
// never implemented for media transport, so keeping noop implementation.
|
||||
virtual void AddRttObserver(MediaTransportRttObserver* observer) {}
|
||||
virtual void RemoveRttObserver(MediaTransportRttObserver* observer) {}
|
||||
|
||||
// Adds a target bitrate observer. Before media transport is destructed
|
||||
// the observer must be unregistered (by calling
|
||||
// RemoveTargetTransferRateObserver).
|
||||
// A newly registered observer will be called back with the latest recorded
|
||||
// target rate, if available.
|
||||
virtual void AddTargetTransferRateObserver(
|
||||
TargetTransferRateObserver* observer) = 0;
|
||||
|
||||
// Removes an existing |observer| from observers. If observer was never
|
||||
// registered, an error is logged and method does nothing.
|
||||
virtual void RemoveTargetTransferRateObserver(
|
||||
TargetTransferRateObserver* observer) = 0;
|
||||
|
||||
// Returns the last known target transfer rate as reported to the above
|
||||
// observers.
|
||||
virtual absl::optional<TargetTransferRate> GetLatestTargetTransferRate() = 0;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // API_TRANSPORT_CONGESTION_CONTROL_INTERFACE_H_
|
||||
@ -7,7 +7,7 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "api/data_channel_transport_interface.h"
|
||||
#include "api/transport/data_channel_transport_interface.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
125
api/transport/data_channel_transport_interface.h
Normal file
125
api/transport/data_channel_transport_interface.h
Normal file
@ -0,0 +1,125 @@
|
||||
/* Copyright 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.
|
||||
*/
|
||||
|
||||
// This is an experimental interface and is subject to change without notice.
|
||||
|
||||
#ifndef API_TRANSPORT_DATA_CHANNEL_TRANSPORT_INTERFACE_H_
|
||||
#define API_TRANSPORT_DATA_CHANNEL_TRANSPORT_INTERFACE_H_
|
||||
|
||||
#include "absl/types/optional.h"
|
||||
#include "api/rtc_error.h"
|
||||
#include "rtc_base/copy_on_write_buffer.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
// Supported types of application data messages.
|
||||
enum class DataMessageType {
|
||||
// Application data buffer with the binary bit unset.
|
||||
kText,
|
||||
|
||||
// Application data buffer with the binary bit set.
|
||||
kBinary,
|
||||
|
||||
// Transport-agnostic control messages, such as open or open-ack messages.
|
||||
kControl,
|
||||
};
|
||||
|
||||
// Parameters for sending data. The parameters may change from message to
|
||||
// message, even within a single channel. For example, control messages may be
|
||||
// sent reliably and in-order, even if the data channel is configured for
|
||||
// unreliable delivery.
|
||||
struct SendDataParams {
|
||||
SendDataParams();
|
||||
SendDataParams(const SendDataParams&);
|
||||
|
||||
DataMessageType type = DataMessageType::kText;
|
||||
|
||||
// Whether to deliver the message in order with respect to other ordered
|
||||
// messages with the same channel_id.
|
||||
bool ordered = false;
|
||||
|
||||
// If set, the maximum number of times this message may be
|
||||
// retransmitted by the transport before it is dropped.
|
||||
// Setting this value to zero disables retransmission.
|
||||
// Must be non-negative. |max_rtx_count| and |max_rtx_ms| may not be set
|
||||
// simultaneously.
|
||||
absl::optional<int> max_rtx_count;
|
||||
|
||||
// If set, the maximum number of milliseconds for which the transport
|
||||
// may retransmit this message before it is dropped.
|
||||
// Setting this value to zero disables retransmission.
|
||||
// Must be non-negative. |max_rtx_count| and |max_rtx_ms| may not be set
|
||||
// simultaneously.
|
||||
absl::optional<int> max_rtx_ms;
|
||||
};
|
||||
|
||||
// Sink for callbacks related to a data channel.
|
||||
class DataChannelSink {
|
||||
public:
|
||||
virtual ~DataChannelSink() = default;
|
||||
|
||||
// Callback issued when data is received by the transport.
|
||||
virtual void OnDataReceived(int channel_id,
|
||||
DataMessageType type,
|
||||
const rtc::CopyOnWriteBuffer& buffer) = 0;
|
||||
|
||||
// Callback issued when a remote data channel begins the closing procedure.
|
||||
// Messages sent after the closing procedure begins will not be transmitted.
|
||||
virtual void OnChannelClosing(int channel_id) = 0;
|
||||
|
||||
// Callback issued when a (remote or local) data channel completes the closing
|
||||
// procedure. Closing channels become closed after all pending data has been
|
||||
// transmitted.
|
||||
virtual void OnChannelClosed(int channel_id) = 0;
|
||||
|
||||
// Callback issued when the data channel becomes ready to send.
|
||||
// This callback will be issued immediately when the data channel sink is
|
||||
// registered if the transport is ready at that time. This callback may be
|
||||
// invoked again following send errors (eg. due to the transport being
|
||||
// temporarily blocked or unavailable).
|
||||
// TODO(mellem): Make pure virtual when downstream sinks override this.
|
||||
virtual void OnReadyToSend();
|
||||
};
|
||||
|
||||
// Transport for data channels.
|
||||
class DataChannelTransportInterface {
|
||||
public:
|
||||
virtual ~DataChannelTransportInterface() = default;
|
||||
|
||||
// Opens a data |channel_id| for sending. May return an error if the
|
||||
// specified |channel_id| is unusable. Must be called before |SendData|.
|
||||
virtual RTCError OpenChannel(int channel_id);
|
||||
|
||||
// Sends a data buffer to the remote endpoint using the given send parameters.
|
||||
// |buffer| may not be larger than 256 KiB. Returns an error if the send
|
||||
// fails.
|
||||
virtual RTCError SendData(int channel_id,
|
||||
const SendDataParams& params,
|
||||
const rtc::CopyOnWriteBuffer& buffer);
|
||||
|
||||
// Closes |channel_id| gracefully. Returns an error if |channel_id| is not
|
||||
// open. Data sent after the closing procedure begins will not be
|
||||
// transmitted. The channel becomes closed after pending data is transmitted.
|
||||
virtual RTCError CloseChannel(int channel_id);
|
||||
|
||||
// Sets a sink for data messages and channel state callbacks. Before media
|
||||
// transport is destroyed, the sink must be unregistered by setting it to
|
||||
// nullptr.
|
||||
virtual void SetDataSink(DataChannelSink* sink);
|
||||
|
||||
// Returns whether this data channel transport is ready to send.
|
||||
// Note: the default implementation always returns false (as it assumes no one
|
||||
// has implemented the interface). This default implementation is temporary.
|
||||
// TODO(mellem): Change this to pure virtual.
|
||||
virtual bool IsReadyToSend() const;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // API_TRANSPORT_DATA_CHANNEL_TRANSPORT_INTERFACE_H_
|
||||
150
api/transport/datagram_transport_interface.h
Normal file
150
api/transport/datagram_transport_interface.h
Normal file
@ -0,0 +1,150 @@
|
||||
/* Copyright 2018 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.
|
||||
*/
|
||||
|
||||
// This is EXPERIMENTAL interface for media and datagram transports.
|
||||
|
||||
#ifndef API_TRANSPORT_DATAGRAM_TRANSPORT_INTERFACE_H_
|
||||
#define API_TRANSPORT_DATAGRAM_TRANSPORT_INTERFACE_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "absl/types/optional.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/rtc_error.h"
|
||||
#include "api/transport/congestion_control_interface.h"
|
||||
#include "api/transport/data_channel_transport_interface.h"
|
||||
#include "api/units/data_rate.h"
|
||||
#include "api/units/timestamp.h"
|
||||
|
||||
namespace rtc {
|
||||
class PacketTransportInternal;
|
||||
} // namespace rtc
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class MediaTransportStateCallback;
|
||||
|
||||
typedef int64_t DatagramId;
|
||||
|
||||
struct DatagramAck {
|
||||
// |datagram_id| is same as passed in
|
||||
// DatagramTransportInterface::SendDatagram.
|
||||
DatagramId datagram_id;
|
||||
|
||||
// The timestamp at which the remote peer received the identified datagram,
|
||||
// according to that peer's clock.
|
||||
Timestamp receive_timestamp = Timestamp::MinusInfinity();
|
||||
};
|
||||
|
||||
// All sink methods are called on network thread.
|
||||
class DatagramSinkInterface {
|
||||
public:
|
||||
virtual ~DatagramSinkInterface() {}
|
||||
|
||||
// Called when new packet is received.
|
||||
virtual void OnDatagramReceived(rtc::ArrayView<const uint8_t> data) = 0;
|
||||
|
||||
// Called when datagram is actually sent (datragram can be delayed due
|
||||
// to congestion control or fusing). |datagram_id| is same as passed in
|
||||
// DatagramTransportInterface::SendDatagram.
|
||||
virtual void OnDatagramSent(DatagramId datagram_id) = 0;
|
||||
|
||||
// Called when datagram is ACKed.
|
||||
// TODO(sukhanov): Make pure virtual.
|
||||
virtual void OnDatagramAcked(const DatagramAck& datagram_ack) {}
|
||||
|
||||
// Called when a datagram is lost.
|
||||
virtual void OnDatagramLost(DatagramId datagram_id) {}
|
||||
};
|
||||
|
||||
// Datagram transport allows to send and receive unreliable packets (datagrams)
|
||||
// and receive feedback from congestion control (via
|
||||
// CongestionControlInterface). The idea is to send RTP packets as datagrams and
|
||||
// have underlying implementation of datagram transport to use QUIC datagram
|
||||
// protocol.
|
||||
class DatagramTransportInterface : public DataChannelTransportInterface {
|
||||
public:
|
||||
virtual ~DatagramTransportInterface() = default;
|
||||
|
||||
// Connect the datagram transport to the ICE transport.
|
||||
// The implementation must be able to ignore incoming packets that don't
|
||||
// belong to it.
|
||||
virtual void Connect(rtc::PacketTransportInternal* packet_transport) = 0;
|
||||
|
||||
// Returns congestion control feedback interface or nullptr if datagram
|
||||
// transport does not implement congestion control.
|
||||
//
|
||||
// Note that right now datagram transport is used without congestion control,
|
||||
// but we plan to use it in the future.
|
||||
virtual CongestionControlInterface* congestion_control() = 0;
|
||||
|
||||
// Sets a state observer callback. Before datagram transport is destroyed, the
|
||||
// callback must be unregistered by setting it to nullptr.
|
||||
// A newly registered callback will be called with the current state.
|
||||
// Datagram transport does not invoke this callback concurrently.
|
||||
virtual void SetTransportStateCallback(
|
||||
MediaTransportStateCallback* callback) = 0;
|
||||
|
||||
// Start asynchronous send of datagram. The status returned by this method
|
||||
// only pertains to the synchronous operations (e.g. serialization /
|
||||
// packetization), not to the asynchronous operation.
|
||||
//
|
||||
// Datagrams larger than GetLargestDatagramSize() will fail and return error.
|
||||
//
|
||||
// Datagrams are sent in FIFO order.
|
||||
//
|
||||
// |datagram_id| is only used in ACK/LOST notifications in
|
||||
// DatagramSinkInterface and does not need to be unique.
|
||||
virtual RTCError SendDatagram(rtc::ArrayView<const uint8_t> data,
|
||||
DatagramId datagram_id) = 0;
|
||||
|
||||
// Returns maximum size of datagram message, does not change.
|
||||
// TODO(sukhanov): Because value may be undefined before connection setup
|
||||
// is complete, consider returning error when called before connection is
|
||||
// established. Currently returns hardcoded const, because integration
|
||||
// prototype may call before connection is established.
|
||||
virtual size_t GetLargestDatagramSize() const = 0;
|
||||
|
||||
// Sets packet sink. Sink must be unset by calling
|
||||
// SetDataTransportSink(nullptr) before the data transport is destroyed or
|
||||
// before new sink is set.
|
||||
virtual void SetDatagramSink(DatagramSinkInterface* sink) = 0;
|
||||
|
||||
// Retrieves callers config (i.e. media transport offer) that should be passed
|
||||
// to the callee, before the call is connected. Such config is opaque to SDP
|
||||
// (sdp just passes it through). The config is a binary blob, so SDP may
|
||||
// choose to use base64 to serialize it (or any other approach that guarantees
|
||||
// that the binary blob goes through). This should only be called for the
|
||||
// caller's perspective.
|
||||
//
|
||||
// TODO(mellem): Delete.
|
||||
virtual absl::optional<std::string> GetTransportParametersOffer() const {
|
||||
return absl::nullopt;
|
||||
}
|
||||
|
||||
// Retrieves transport parameters for this datagram transport. May be called
|
||||
// on either client- or server-perspective transports.
|
||||
//
|
||||
// For servers, the parameters represent what kind of connections and data the
|
||||
// server is prepared to accept. This is generally a superset of acceptable
|
||||
// parameters.
|
||||
//
|
||||
// For clients, the parameters echo the server configuration used to create
|
||||
// the client, possibly removing any fields or parameters which the client
|
||||
// does not understand.
|
||||
//
|
||||
// TODO(mellem): Make pure virtual.
|
||||
virtual std::string GetTransportParameters() const { return ""; }
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // API_TRANSPORT_DATAGRAM_TRANSPORT_INTERFACE_H_
|
||||
@ -8,6 +8,31 @@
|
||||
|
||||
import("../../../webrtc.gni")
|
||||
|
||||
rtc_source_set("media_transport_interface") {
|
||||
visibility = [ "*" ]
|
||||
sources = [
|
||||
"media_transport_config.cc",
|
||||
"media_transport_config.h",
|
||||
"media_transport_interface.cc",
|
||||
"media_transport_interface.h",
|
||||
]
|
||||
deps = [
|
||||
":audio_interfaces",
|
||||
":video_interfaces",
|
||||
"..:datagram_transport_interface",
|
||||
"..:network_control",
|
||||
"../..:array_view",
|
||||
"../..:rtc_error",
|
||||
"../../..:webrtc_common",
|
||||
"../../../rtc_base",
|
||||
"../../../rtc_base:checks",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base:stringutils",
|
||||
"../../units:data_rate",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
}
|
||||
|
||||
rtc_source_set("audio_interfaces") {
|
||||
visibility = [ "*" ]
|
||||
sources = [
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "api/media_transport_config.h"
|
||||
#include "api/transport/media/media_transport_config.h"
|
||||
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/strings/string_builder.h"
|
||||
46
api/transport/media/media_transport_config.h
Normal file
46
api/transport/media/media_transport_config.h
Normal file
@ -0,0 +1,46 @@
|
||||
/* Copyright 2018 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_TRANSPORT_MEDIA_MEDIA_TRANSPORT_CONFIG_H_
|
||||
#define API_TRANSPORT_MEDIA_MEDIA_TRANSPORT_CONFIG_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "absl/types/optional.h"
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
// Media transport config is made available to both transport and audio / video
|
||||
// layers, but access to individual interfaces should not be open without
|
||||
// necessity.
|
||||
struct MediaTransportConfig {
|
||||
// Default constructor for no-media transport scenarios.
|
||||
MediaTransportConfig() = default;
|
||||
|
||||
// Constructor for media transport scenarios.
|
||||
// Note that |media_transport| may not be nullptr.
|
||||
explicit MediaTransportConfig(MediaTransportInterface* media_transport);
|
||||
|
||||
// Constructor for datagram transport scenarios.
|
||||
explicit MediaTransportConfig(size_t rtp_max_packet_size);
|
||||
|
||||
std::string DebugString() const;
|
||||
|
||||
// If provided, all media is sent through media_transport.
|
||||
MediaTransportInterface* media_transport = nullptr;
|
||||
|
||||
// If provided, limits RTP packet size (excludes ICE, IP or network overhead).
|
||||
absl::optional<size_t> rtp_max_packet_size;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // API_TRANSPORT_MEDIA_MEDIA_TRANSPORT_CONFIG_H_
|
||||
@ -15,12 +15,12 @@
|
||||
// enable different media transport implementations, including QUIC-based
|
||||
// media transport.
|
||||
|
||||
#include "api/media_transport_interface.h"
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <utility>
|
||||
|
||||
#include "api/datagram_transport_interface.h"
|
||||
#include "api/transport/datagram_transport_interface.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
328
api/transport/media/media_transport_interface.h
Normal file
328
api/transport/media/media_transport_interface.h
Normal file
@ -0,0 +1,328 @@
|
||||
/* Copyright 2018 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.
|
||||
*/
|
||||
|
||||
// This is EXPERIMENTAL interface for media transport.
|
||||
//
|
||||
// The goal is to refactor WebRTC code so that audio and video frames
|
||||
// are sent / received through the media transport interface. This will
|
||||
// enable different media transport implementations, including QUIC-based
|
||||
// media transport.
|
||||
|
||||
#ifndef API_TRANSPORT_MEDIA_MEDIA_TRANSPORT_INTERFACE_H_
|
||||
#define API_TRANSPORT_MEDIA_MEDIA_TRANSPORT_INTERFACE_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "absl/types/optional.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/rtc_error.h"
|
||||
#include "api/transport/data_channel_transport_interface.h"
|
||||
#include "api/transport/media/audio_transport.h"
|
||||
#include "api/transport/media/video_transport.h"
|
||||
#include "api/transport/network_control.h"
|
||||
#include "api/units/data_rate.h"
|
||||
#include "common_types.h" // NOLINT(build/include)
|
||||
#include "rtc_base/copy_on_write_buffer.h"
|
||||
#include "rtc_base/network_route.h"
|
||||
|
||||
namespace rtc {
|
||||
class PacketTransportInternal;
|
||||
class Thread;
|
||||
} // namespace rtc
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class DatagramTransportInterface;
|
||||
class RtcEventLog;
|
||||
|
||||
class AudioPacketReceivedObserver {
|
||||
public:
|
||||
virtual ~AudioPacketReceivedObserver() = default;
|
||||
|
||||
// Invoked for the first received audio packet on a given channel id.
|
||||
// It will be invoked once for each channel id.
|
||||
virtual void OnFirstAudioPacketReceived(int64_t channel_id) = 0;
|
||||
};
|
||||
|
||||
// Used to configure stream allocations.
|
||||
struct MediaTransportAllocatedBitrateLimits {
|
||||
DataRate min_pacing_rate = DataRate::Zero();
|
||||
DataRate max_padding_bitrate = DataRate::Zero();
|
||||
DataRate max_total_allocated_bitrate = DataRate::Zero();
|
||||
};
|
||||
|
||||
// Used to configure target bitrate constraints.
|
||||
// If the value is provided, the constraint is updated.
|
||||
// If the value is omitted, the value is left unchanged.
|
||||
struct MediaTransportTargetRateConstraints {
|
||||
absl::optional<DataRate> min_bitrate;
|
||||
absl::optional<DataRate> max_bitrate;
|
||||
absl::optional<DataRate> starting_bitrate;
|
||||
};
|
||||
|
||||
// A collection of settings for creation of media transport.
|
||||
struct MediaTransportSettings final {
|
||||
MediaTransportSettings();
|
||||
MediaTransportSettings(const MediaTransportSettings&);
|
||||
MediaTransportSettings& operator=(const MediaTransportSettings&);
|
||||
~MediaTransportSettings();
|
||||
|
||||
// Group calls are not currently supported, in 1:1 call one side must set
|
||||
// is_caller = true and another is_caller = false.
|
||||
bool is_caller;
|
||||
|
||||
// Must be set if a pre-shared key is used for the call.
|
||||
// TODO(bugs.webrtc.org/9944): This should become zero buffer in the distant
|
||||
// future.
|
||||
absl::optional<std::string> pre_shared_key;
|
||||
|
||||
// If present, this is a config passed from the caller to the answerer in the
|
||||
// offer. Each media transport knows how to understand its own parameters.
|
||||
absl::optional<std::string> remote_transport_parameters;
|
||||
|
||||
// If present, provides the event log that media transport should use.
|
||||
// Media transport does not own it. The lifetime of |event_log| will exceed
|
||||
// the lifetime of the instance of MediaTransportInterface instance.
|
||||
RtcEventLog* event_log = nullptr;
|
||||
};
|
||||
|
||||
// Callback to notify about network route changes.
|
||||
class MediaTransportNetworkChangeCallback {
|
||||
public:
|
||||
virtual ~MediaTransportNetworkChangeCallback() = default;
|
||||
|
||||
// Called when the network route is changed, with the new network route.
|
||||
virtual void OnNetworkRouteChanged(
|
||||
const rtc::NetworkRoute& new_network_route) = 0;
|
||||
};
|
||||
|
||||
// State of the media transport. Media transport begins in the pending state.
|
||||
// It transitions to writable when it is ready to send media. It may transition
|
||||
// back to pending if the connection is blocked. It may transition to closed at
|
||||
// any time. Closed is terminal: a transport will never re-open once closed.
|
||||
enum class MediaTransportState {
|
||||
kPending,
|
||||
kWritable,
|
||||
kClosed,
|
||||
};
|
||||
|
||||
// Callback invoked whenever the state of the media transport changes.
|
||||
class MediaTransportStateCallback {
|
||||
public:
|
||||
virtual ~MediaTransportStateCallback() = default;
|
||||
|
||||
// Invoked whenever the state of the media transport changes.
|
||||
virtual void OnStateChanged(MediaTransportState state) = 0;
|
||||
};
|
||||
|
||||
// Callback for RTT measurements on the receive side.
|
||||
// TODO(nisse): Related interfaces: CallStatsObserver and RtcpRttStats. It's
|
||||
// somewhat unclear what type of measurement is needed. It's used to configure
|
||||
// NACK generation and playout buffer. Either raw measurement values or recent
|
||||
// maximum would make sense for this use. Need consolidation of RTT signalling.
|
||||
class MediaTransportRttObserver {
|
||||
public:
|
||||
virtual ~MediaTransportRttObserver() = default;
|
||||
|
||||
// Invoked when a new RTT measurement is available, typically once per ACK.
|
||||
virtual void OnRttUpdated(int64_t rtt_ms) = 0;
|
||||
};
|
||||
|
||||
// Media transport interface for sending / receiving encoded audio/video frames
|
||||
// and receiving bandwidth estimate update from congestion control.
|
||||
class MediaTransportInterface : public DataChannelTransportInterface {
|
||||
public:
|
||||
MediaTransportInterface();
|
||||
virtual ~MediaTransportInterface();
|
||||
|
||||
// Retrieves callers config (i.e. media transport offer) that should be passed
|
||||
// to the callee, before the call is connected. Such config is opaque to SDP
|
||||
// (sdp just passes it through). The config is a binary blob, so SDP may
|
||||
// choose to use base64 to serialize it (or any other approach that guarantees
|
||||
// that the binary blob goes through). This should only be called for the
|
||||
// caller's perspective.
|
||||
//
|
||||
// This may return an unset optional, which means that the given media
|
||||
// transport is not supported / disabled and shouldn't be reported in SDP.
|
||||
//
|
||||
// It may also return an empty string, in which case the media transport is
|
||||
// supported, but without any extra settings.
|
||||
// TODO(psla): Make abstract.
|
||||
virtual absl::optional<std::string> GetTransportParametersOffer() const;
|
||||
|
||||
// Connect the media transport to the ICE transport.
|
||||
// The implementation must be able to ignore incoming packets that don't
|
||||
// belong to it.
|
||||
// TODO(psla): Make abstract.
|
||||
virtual void Connect(rtc::PacketTransportInternal* packet_transport);
|
||||
|
||||
// Start asynchronous send of audio frame. The status returned by this method
|
||||
// only pertains to the synchronous operations (e.g.
|
||||
// serialization/packetization), not to the asynchronous operation.
|
||||
|
||||
virtual RTCError SendAudioFrame(uint64_t channel_id,
|
||||
MediaTransportEncodedAudioFrame frame) = 0;
|
||||
|
||||
// Start asynchronous send of video frame. The status returned by this method
|
||||
// only pertains to the synchronous operations (e.g.
|
||||
// serialization/packetization), not to the asynchronous operation.
|
||||
virtual RTCError SendVideoFrame(
|
||||
uint64_t channel_id,
|
||||
const MediaTransportEncodedVideoFrame& frame) = 0;
|
||||
|
||||
// Used by video sender to be notified on key frame requests.
|
||||
virtual void SetKeyFrameRequestCallback(
|
||||
MediaTransportKeyFrameRequestCallback* callback);
|
||||
|
||||
// Requests a keyframe for the particular channel (stream). The caller should
|
||||
// check that the keyframe is not present in a jitter buffer already (i.e.
|
||||
// don't request a keyframe if there is one that you will get from the jitter
|
||||
// buffer in a moment).
|
||||
virtual RTCError RequestKeyFrame(uint64_t channel_id) = 0;
|
||||
|
||||
// Sets audio sink. Sink must be unset by calling SetReceiveAudioSink(nullptr)
|
||||
// before the media transport is destroyed or before new sink is set.
|
||||
virtual void SetReceiveAudioSink(MediaTransportAudioSinkInterface* sink) = 0;
|
||||
|
||||
// Registers a video sink. Before destruction of media transport, you must
|
||||
// pass a nullptr.
|
||||
virtual void SetReceiveVideoSink(MediaTransportVideoSinkInterface* sink) = 0;
|
||||
|
||||
// Adds a target bitrate observer. Before media transport is destructed
|
||||
// the observer must be unregistered (by calling
|
||||
// RemoveTargetTransferRateObserver).
|
||||
// A newly registered observer will be called back with the latest recorded
|
||||
// target rate, if available.
|
||||
virtual void AddTargetTransferRateObserver(
|
||||
TargetTransferRateObserver* observer);
|
||||
|
||||
// Removes an existing |observer| from observers. If observer was never
|
||||
// registered, an error is logged and method does nothing.
|
||||
virtual void RemoveTargetTransferRateObserver(
|
||||
TargetTransferRateObserver* observer);
|
||||
|
||||
// Sets audio packets observer, which gets informed about incoming audio
|
||||
// packets. Before destruction, the observer must be unregistered by setting
|
||||
// nullptr.
|
||||
//
|
||||
// This method may be temporary, when the multiplexer is implemented (or
|
||||
// multiplexer may use it to demultiplex channel ids).
|
||||
virtual void SetFirstAudioPacketReceivedObserver(
|
||||
AudioPacketReceivedObserver* observer);
|
||||
|
||||
// Intended for receive side. AddRttObserver registers an observer to be
|
||||
// called for each RTT measurement, typically once per ACK. Before media
|
||||
// transport is destructed the observer must be unregistered.
|
||||
virtual void AddRttObserver(MediaTransportRttObserver* observer);
|
||||
virtual void RemoveRttObserver(MediaTransportRttObserver* observer);
|
||||
|
||||
// Returns the last known target transfer rate as reported to the above
|
||||
// observers.
|
||||
virtual absl::optional<TargetTransferRate> GetLatestTargetTransferRate();
|
||||
|
||||
// Gets the audio packet overhead in bytes. Returned overhead does not include
|
||||
// transport overhead (ipv4/6, turn channeldata, tcp/udp, etc.).
|
||||
// If the transport is capable of fusing packets together, this overhead
|
||||
// might not be a very accurate number.
|
||||
// TODO(nisse): Deprecated.
|
||||
virtual size_t GetAudioPacketOverhead() const;
|
||||
|
||||
// Corresponding observers for audio and video overhead. Before destruction,
|
||||
// the observers must be unregistered by setting nullptr.
|
||||
|
||||
// TODO(nisse): Should move to per-stream objects, since packetization
|
||||
// overhead can vary per stream, e.g., depending on negotiated extensions. In
|
||||
// addition, we should move towards reporting total overhead including all
|
||||
// layers. Currently, overhead of the lower layers is reported elsewhere,
|
||||
// e.g., on route change between IPv4 and IPv6.
|
||||
virtual void SetAudioOverheadObserver(OverheadObserver* observer) {}
|
||||
|
||||
// Registers an observer for network change events. If the network route is
|
||||
// already established when the callback is added, |callback| will be called
|
||||
// immediately with the current network route. Before media transport is
|
||||
// destroyed, the callback must be removed.
|
||||
virtual void AddNetworkChangeCallback(
|
||||
MediaTransportNetworkChangeCallback* callback);
|
||||
virtual void RemoveNetworkChangeCallback(
|
||||
MediaTransportNetworkChangeCallback* callback);
|
||||
|
||||
// Sets a state observer callback. Before media transport is destroyed, the
|
||||
// callback must be unregistered by setting it to nullptr.
|
||||
// A newly registered callback will be called with the current state.
|
||||
// Media transport does not invoke this callback concurrently.
|
||||
virtual void SetMediaTransportStateCallback(
|
||||
MediaTransportStateCallback* callback) = 0;
|
||||
|
||||
// Updates allocation limits.
|
||||
// TODO(psla): Make abstract when downstream implementation implement it.
|
||||
virtual void SetAllocatedBitrateLimits(
|
||||
const MediaTransportAllocatedBitrateLimits& limits);
|
||||
|
||||
// Sets starting rate.
|
||||
// TODO(psla): Make abstract when downstream implementation implement it.
|
||||
virtual void SetTargetBitrateLimits(
|
||||
const MediaTransportTargetRateConstraints& target_rate_constraints) {}
|
||||
|
||||
// TODO(sukhanov): RtcEventLogs.
|
||||
};
|
||||
|
||||
// If media transport factory is set in peer connection factory, it will be
|
||||
// used to create media transport for sending/receiving encoded frames and
|
||||
// this transport will be used instead of default RTP/SRTP transport.
|
||||
//
|
||||
// Currently Media Transport negotiation is not supported in SDP.
|
||||
// If application is using media transport, it must negotiate it before
|
||||
// setting media transport factory in peer connection.
|
||||
class MediaTransportFactory {
|
||||
public:
|
||||
virtual ~MediaTransportFactory() = default;
|
||||
|
||||
// Creates media transport.
|
||||
// - Does not take ownership of packet_transport or network_thread.
|
||||
// - Does not support group calls, in 1:1 call one side must set
|
||||
// is_caller = true and another is_caller = false.
|
||||
virtual RTCErrorOr<std::unique_ptr<MediaTransportInterface>>
|
||||
CreateMediaTransport(rtc::PacketTransportInternal* packet_transport,
|
||||
rtc::Thread* network_thread,
|
||||
const MediaTransportSettings& settings);
|
||||
|
||||
// Creates a new Media Transport in a disconnected state. If the media
|
||||
// transport for the caller is created, one can then call
|
||||
// MediaTransportInterface::GetTransportParametersOffer on that new instance.
|
||||
// TODO(psla): Make abstract.
|
||||
virtual RTCErrorOr<std::unique_ptr<webrtc::MediaTransportInterface>>
|
||||
CreateMediaTransport(rtc::Thread* network_thread,
|
||||
const MediaTransportSettings& settings);
|
||||
|
||||
// Creates a new Datagram Transport in a disconnected state. If the datagram
|
||||
// transport for the caller is created, one can then call
|
||||
// DatagramTransportInterface::GetTransportParametersOffer on that new
|
||||
// instance.
|
||||
//
|
||||
// TODO(sukhanov): Consider separating media and datagram transport factories.
|
||||
// TODO(sukhanov): Move factory to a separate .h file.
|
||||
virtual RTCErrorOr<std::unique_ptr<DatagramTransportInterface>>
|
||||
CreateDatagramTransport(rtc::Thread* network_thread,
|
||||
const MediaTransportSettings& settings);
|
||||
|
||||
// Gets a transport name which is supported by the implementation.
|
||||
// Different factories should return different transport names, and at runtime
|
||||
// it will be checked that different names were used.
|
||||
// For example, "rtp" or "generic" may be returned by two different
|
||||
// implementations.
|
||||
// The value returned by this method must never change in the lifetime of the
|
||||
// factory.
|
||||
// TODO(psla): Make abstract.
|
||||
virtual std::string GetTransportName() const;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
#endif // API_TRANSPORT_MEDIA_MEDIA_TRANSPORT_INTERFACE_H_
|
||||
@ -54,6 +54,7 @@ rtc_static_library("audio") {
|
||||
"../api/audio_codecs:audio_codecs_api",
|
||||
"../api/rtc_event_log",
|
||||
"../api/task_queue",
|
||||
"../api/transport/media:media_transport_interface",
|
||||
"../api/transport/rtp:rtp_source",
|
||||
"../call:bitrate_allocator",
|
||||
"../call:call_interfaces",
|
||||
@ -139,6 +140,7 @@ if (rtc_include_tests) {
|
||||
"../api/audio_codecs/opus:audio_encoder_opus",
|
||||
"../api/rtc_event_log",
|
||||
"../api/task_queue:default_task_queue_factory",
|
||||
"../api/transport/media:media_transport_interface",
|
||||
"../api/units:time_delta",
|
||||
"../call:mock_bitrate_allocator",
|
||||
"../call:mock_call_interfaces",
|
||||
|
||||
@ -21,8 +21,8 @@
|
||||
#include "api/call/transport.h"
|
||||
#include "api/crypto/frame_encryptor_interface.h"
|
||||
#include "api/function_view.h"
|
||||
#include "api/media_transport_config.h"
|
||||
#include "api/rtc_event_log/rtc_event_log.h"
|
||||
#include "api/transport/media/media_transport_config.h"
|
||||
#include "audio/audio_state.h"
|
||||
#include "audio/channel_send.h"
|
||||
#include "audio/conversion.h"
|
||||
|
||||
@ -22,8 +22,8 @@
|
||||
#include "api/call/audio_sink.h"
|
||||
#include "api/call/transport.h"
|
||||
#include "api/crypto/crypto_options.h"
|
||||
#include "api/media_transport_config.h"
|
||||
#include "api/media_transport_interface.h"
|
||||
#include "api/transport/media/media_transport_config.h"
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
#include "api/transport/rtp/rtp_source.h"
|
||||
#include "call/rtp_packet_sink_interface.h"
|
||||
#include "call/syncable.h"
|
||||
|
||||
@ -19,9 +19,9 @@
|
||||
#include "api/audio_codecs/audio_encoder.h"
|
||||
#include "api/crypto/crypto_options.h"
|
||||
#include "api/function_view.h"
|
||||
#include "api/media_transport_config.h"
|
||||
#include "api/media_transport_interface.h"
|
||||
#include "api/task_queue/task_queue_factory.h"
|
||||
#include "api/transport/media/media_transport_config.h"
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
#include "modules/rtp_rtcp/include/report_block_data.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_sender_audio.h"
|
||||
|
||||
@ -13,11 +13,11 @@
|
||||
#include "api/audio_codecs/audio_encoder_factory_template.h"
|
||||
#include "api/audio_codecs/opus/audio_decoder_opus.h"
|
||||
#include "api/audio_codecs/opus/audio_encoder_opus.h"
|
||||
#include "api/media_transport_config.h"
|
||||
#include "api/rtc_event_log/rtc_event_log.h"
|
||||
#include "api/task_queue/default_task_queue_factory.h"
|
||||
#include "api/test/loopback_media_transport.h"
|
||||
#include "api/test/mock_audio_mixer.h"
|
||||
#include "api/transport/media/media_transport_config.h"
|
||||
#include "audio/audio_receive_stream.h"
|
||||
#include "audio/audio_send_stream.h"
|
||||
#include "call/rtp_transport_controller_send.h"
|
||||
|
||||
@ -33,7 +33,7 @@ rtc_source_set("call_interfaces") {
|
||||
"../api:fec_controller_api",
|
||||
"../api:rtc_error",
|
||||
|
||||
# For api/media_transport_config.h
|
||||
# For api/crypto/crypto_options.h
|
||||
"../api:libjingle_peerconnection_api",
|
||||
"../api:network_state_predictor_api",
|
||||
"../api:rtp_headers",
|
||||
@ -44,6 +44,7 @@ rtc_source_set("call_interfaces") {
|
||||
"../api/audio_codecs:audio_codecs_api",
|
||||
"../api/task_queue",
|
||||
"../api/transport:network_control",
|
||||
"../api/transport/media:media_transport_interface",
|
||||
"../api/transport/rtp:rtp_source",
|
||||
"../modules/audio_device",
|
||||
"../modules/audio_processing",
|
||||
@ -286,6 +287,7 @@ rtc_source_set("video_stream_api") {
|
||||
"../api:rtp_headers",
|
||||
"../api:rtp_parameters",
|
||||
"../api:transport_api",
|
||||
"../api/transport/media:media_transport_interface",
|
||||
"../api/transport/rtp:rtp_source",
|
||||
"../api/video:video_frame",
|
||||
"../api/video:video_rtp_headers",
|
||||
|
||||
@ -21,9 +21,9 @@
|
||||
#include "api/call/transport.h"
|
||||
#include "api/crypto/crypto_options.h"
|
||||
#include "api/crypto/frame_decryptor_interface.h"
|
||||
#include "api/media_transport_config.h"
|
||||
#include "api/rtp_parameters.h"
|
||||
#include "api/scoped_refptr.h"
|
||||
#include "api/transport/media/media_transport_config.h"
|
||||
#include "api/transport/rtp/rtp_source.h"
|
||||
#include "call/rtp_config.h"
|
||||
|
||||
|
||||
@ -23,10 +23,10 @@
|
||||
#include "api/call/transport.h"
|
||||
#include "api/crypto/crypto_options.h"
|
||||
#include "api/crypto/frame_encryptor_interface.h"
|
||||
#include "api/media_transport_config.h"
|
||||
#include "api/media_transport_interface.h"
|
||||
#include "api/rtp_parameters.h"
|
||||
#include "api/scoped_refptr.h"
|
||||
#include "api/transport/media/media_transport_config.h"
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
#include "call/rtp_config.h"
|
||||
#include "modules/audio_processing/include/audio_processing_statistics.h"
|
||||
#include "modules/rtp_rtcp/include/report_block_data.h"
|
||||
|
||||
@ -20,10 +20,10 @@
|
||||
#include "api/call/transport.h"
|
||||
#include "api/crypto/crypto_options.h"
|
||||
#include "api/crypto/frame_decryptor_interface.h"
|
||||
#include "api/media_transport_config.h"
|
||||
#include "api/media_transport_interface.h"
|
||||
#include "api/rtp_headers.h"
|
||||
#include "api/rtp_parameters.h"
|
||||
#include "api/transport/media/media_transport_config.h"
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
#include "api/transport/rtp/rtp_source.h"
|
||||
#include "api/video/video_content_type.h"
|
||||
#include "api/video/video_frame.h"
|
||||
|
||||
@ -20,8 +20,8 @@
|
||||
#include "absl/types/optional.h"
|
||||
#include "api/call/transport.h"
|
||||
#include "api/crypto/crypto_options.h"
|
||||
#include "api/media_transport_interface.h"
|
||||
#include "api/rtp_parameters.h"
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
#include "api/video/video_content_type.h"
|
||||
#include "api/video/video_frame.h"
|
||||
#include "api/video/video_sink_interface.h"
|
||||
|
||||
@ -79,6 +79,7 @@ rtc_static_library("rtc_media_base") {
|
||||
"../api:rtp_parameters",
|
||||
"../api:scoped_refptr",
|
||||
"../api/audio_codecs:audio_codecs_api",
|
||||
"../api/transport/media:media_transport_interface",
|
||||
"../api/transport/rtp:rtp_source",
|
||||
"../api/video:video_bitrate_allocation",
|
||||
"../api/video:video_bitrate_allocator_factory",
|
||||
@ -266,6 +267,8 @@ rtc_static_library("rtc_audio_video") {
|
||||
"../api/audio:audio_mixer_api",
|
||||
"../api/audio_codecs:audio_codecs_api",
|
||||
"../api/task_queue",
|
||||
"../api/transport:datagram_transport_interface",
|
||||
"../api/transport/media:media_transport_interface",
|
||||
"../api/transport/rtp:rtp_source",
|
||||
"../api/video:video_bitrate_allocation",
|
||||
"../api/video:video_bitrate_allocator_factory",
|
||||
@ -530,6 +533,7 @@ if (rtc_include_tests) {
|
||||
"../api/task_queue",
|
||||
"../api/task_queue:default_task_queue_factory",
|
||||
"../api/test/video:function_video_factory",
|
||||
"../api/transport/media:media_transport_interface",
|
||||
"../api/units:time_delta",
|
||||
"../api/video:builtin_video_bitrate_allocator_factory",
|
||||
"../api/video:video_bitrate_allocation",
|
||||
|
||||
@ -22,9 +22,9 @@
|
||||
#include "api/audio_options.h"
|
||||
#include "api/crypto/frame_decryptor_interface.h"
|
||||
#include "api/crypto/frame_encryptor_interface.h"
|
||||
#include "api/media_transport_config.h"
|
||||
#include "api/rtc_error.h"
|
||||
#include "api/rtp_parameters.h"
|
||||
#include "api/transport/media/media_transport_config.h"
|
||||
#include "api/transport/rtp/rtp_source.h"
|
||||
#include "api/video/video_content_type.h"
|
||||
#include "api/video/video_sink_interface.h"
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "api/media_transport_config.h"
|
||||
#include "api/transport/media/media_transport_config.h"
|
||||
#include "media/base/fake_network_interface.h"
|
||||
#include "media/base/media_constants.h"
|
||||
#include "media/base/rtp_utils.h"
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "absl/algorithm/container.h"
|
||||
#include "absl/strings/match.h"
|
||||
#include "api/datagram_transport_interface.h"
|
||||
#include "api/transport/datagram_transport_interface.h"
|
||||
#include "api/video/video_codec_constants.h"
|
||||
#include "api/video/video_codec_type.h"
|
||||
#include "api/video_codecs/sdp_video_format.h"
|
||||
|
||||
@ -19,7 +19,6 @@
|
||||
#include "absl/algorithm/container.h"
|
||||
#include "absl/memory/memory.h"
|
||||
#include "absl/strings/match.h"
|
||||
#include "api/media_transport_config.h"
|
||||
#include "api/rtc_event_log/rtc_event_log.h"
|
||||
#include "api/rtp_parameters.h"
|
||||
#include "api/task_queue/default_task_queue_factory.h"
|
||||
@ -28,6 +27,7 @@
|
||||
#include "api/test/mock_video_bitrate_allocator_factory.h"
|
||||
#include "api/test/mock_video_decoder_factory.h"
|
||||
#include "api/test/mock_video_encoder_factory.h"
|
||||
#include "api/transport/media/media_transport_config.h"
|
||||
#include "api/units/time_delta.h"
|
||||
#include "api/video/builtin_video_bitrate_allocator_factory.h"
|
||||
#include "api/video/i420_buffer.h"
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
#include "absl/strings/match.h"
|
||||
#include "api/audio_codecs/audio_codec_pair_id.h"
|
||||
#include "api/call/audio_sink.h"
|
||||
#include "api/media_transport_interface.h"
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
#include "media/base/audio_source.h"
|
||||
#include "media/base/media_constants.h"
|
||||
#include "media/base/stream_params.h"
|
||||
|
||||
@ -17,11 +17,11 @@
|
||||
#include "absl/strings/match.h"
|
||||
#include "api/audio_codecs/builtin_audio_decoder_factory.h"
|
||||
#include "api/audio_codecs/builtin_audio_encoder_factory.h"
|
||||
#include "api/media_transport_config.h"
|
||||
#include "api/rtc_event_log/rtc_event_log.h"
|
||||
#include "api/rtp_parameters.h"
|
||||
#include "api/scoped_refptr.h"
|
||||
#include "api/task_queue/default_task_queue_factory.h"
|
||||
#include "api/transport/media/media_transport_config.h"
|
||||
#include "call/call.h"
|
||||
#include "media/base/fake_media_engine.h"
|
||||
#include "media/base/fake_network_interface.h"
|
||||
|
||||
@ -88,6 +88,8 @@ rtc_static_library("rtc_pc_base") {
|
||||
"../api:rtp_parameters",
|
||||
"../api:scoped_refptr",
|
||||
"../api/rtc_event_log",
|
||||
"../api/transport:datagram_transport_interface",
|
||||
"../api/transport/media:media_transport_interface",
|
||||
"../api/video:builtin_video_bitrate_allocator_factory",
|
||||
"../api/video:video_frame",
|
||||
"../api/video:video_rtp_headers",
|
||||
@ -227,6 +229,8 @@ rtc_static_library("peerconnection") {
|
||||
"../api:scoped_refptr",
|
||||
"../api/rtc_event_log",
|
||||
"../api/task_queue",
|
||||
"../api/transport:datagram_transport_interface",
|
||||
"../api/transport/media:media_transport_interface",
|
||||
"../api/units:data_rate",
|
||||
"../api/video:builtin_video_bitrate_allocator_factory",
|
||||
"../api/video:video_frame",
|
||||
@ -314,6 +318,7 @@ if (rtc_include_tests) {
|
||||
"../api:rtc_error",
|
||||
"../api:rtp_headers",
|
||||
"../api:rtp_parameters",
|
||||
"../api/transport/media:media_transport_interface",
|
||||
"../api/video:builtin_video_bitrate_allocator_factory",
|
||||
"../call:rtp_interfaces",
|
||||
"../call:rtp_receiver",
|
||||
@ -547,6 +552,7 @@ if (rtc_include_tests) {
|
||||
"../api/rtc_event_log",
|
||||
"../api/rtc_event_log:rtc_event_log_factory",
|
||||
"../api/task_queue:default_task_queue_factory",
|
||||
"../api/transport/media:media_transport_interface",
|
||||
"../api/transport/rtp:rtp_source",
|
||||
"../api/units:time_delta",
|
||||
"../api/video:builtin_video_bitrate_allocator_factory",
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
#include "absl/algorithm/container.h"
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/call/audio_sink.h"
|
||||
#include "api/media_transport_config.h"
|
||||
#include "api/transport/media/media_transport_config.h"
|
||||
#include "media/base/media_constants.h"
|
||||
#include "media/base/rtp_utils.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_packet_received.h"
|
||||
|
||||
@ -20,8 +20,8 @@
|
||||
|
||||
#include "api/call/audio_sink.h"
|
||||
#include "api/jsep.h"
|
||||
#include "api/media_transport_config.h"
|
||||
#include "api/rtp_receiver_interface.h"
|
||||
#include "api/transport/media/media_transport_config.h"
|
||||
#include "api/video/video_sink_interface.h"
|
||||
#include "api/video/video_source_interface.h"
|
||||
#include "call/rtp_packet_sink_interface.h"
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "api/audio_options.h"
|
||||
#include "api/crypto/crypto_options.h"
|
||||
#include "api/media_transport_config.h"
|
||||
#include "api/transport/media/media_transport_config.h"
|
||||
#include "call/call.h"
|
||||
#include "media/base/codec.h"
|
||||
#include "media/base/media_channel.h"
|
||||
|
||||
@ -13,9 +13,9 @@
|
||||
#include <memory>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/media_transport_config.h"
|
||||
#include "api/rtc_error.h"
|
||||
#include "api/test/fake_media_transport.h"
|
||||
#include "api/transport/media/media_transport_config.h"
|
||||
#include "api/video/builtin_video_bitrate_allocator_factory.h"
|
||||
#include "media/base/fake_media_engine.h"
|
||||
#include "media/base/test_utils.h"
|
||||
|
||||
@ -17,8 +17,8 @@
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/audio_options.h"
|
||||
#include "api/media_transport_config.h"
|
||||
#include "api/rtp_parameters.h"
|
||||
#include "api/transport/media/media_transport_config.h"
|
||||
#include "media/base/codec.h"
|
||||
#include "media/base/fake_media_engine.h"
|
||||
#include "media/base/fake_rtp.h"
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "api/crypto/crypto_options.h"
|
||||
#include "api/datagram_transport_interface.h"
|
||||
#include "api/transport/datagram_transport_interface.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_header_extension_map.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_header_extensions.h"
|
||||
#include "p2p/base/ice_transport_internal.h"
|
||||
|
||||
@ -18,9 +18,9 @@
|
||||
|
||||
#include "absl/types/optional.h"
|
||||
#include "api/candidate.h"
|
||||
#include "api/datagram_transport_interface.h"
|
||||
#include "api/jsep.h"
|
||||
#include "api/media_transport_interface.h"
|
||||
#include "api/transport/datagram_transport_interface.h"
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
#include "p2p/base/dtls_transport.h"
|
||||
#include "p2p/base/p2p_constants.h"
|
||||
#include "p2p/base/transport_info.h"
|
||||
|
||||
@ -15,8 +15,8 @@
|
||||
|
||||
#include "absl/algorithm/container.h"
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/datagram_transport_interface.h"
|
||||
#include "api/media_transport_interface.h"
|
||||
#include "api/transport/datagram_transport_interface.h"
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
#include "p2p/base/ice_transport_internal.h"
|
||||
#include "p2p/base/no_op_dtls_transport.h"
|
||||
#include "p2p/base/port.h"
|
||||
|
||||
@ -19,10 +19,10 @@
|
||||
|
||||
#include "api/candidate.h"
|
||||
#include "api/crypto/crypto_options.h"
|
||||
#include "api/media_transport_config.h"
|
||||
#include "api/media_transport_interface.h"
|
||||
#include "api/peer_connection_interface.h"
|
||||
#include "api/rtc_event_log/rtc_event_log.h"
|
||||
#include "api/transport/media/media_transport_config.h"
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
#include "media/sctp/sctp_transport_internal.h"
|
||||
#include "p2p/base/dtls_transport.h"
|
||||
#include "p2p/base/p2p_transport_channel.h"
|
||||
|
||||
@ -14,9 +14,9 @@
|
||||
#include <memory>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/media_transport_interface.h"
|
||||
#include "api/test/fake_media_transport.h"
|
||||
#include "api/test/loopback_media_transport.h"
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
#include "p2p/base/fake_dtls_transport.h"
|
||||
#include "p2p/base/fake_ice_transport.h"
|
||||
#include "p2p/base/no_op_dtls_transport.h"
|
||||
|
||||
@ -18,9 +18,9 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "api/data_channel_transport_interface.h"
|
||||
#include "api/media_transport_interface.h"
|
||||
#include "api/peer_connection_interface.h"
|
||||
#include "api/transport/data_channel_transport_interface.h"
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
#include "api/turn_customizer.h"
|
||||
#include "pc/ice_server_parsing.h"
|
||||
#include "pc/jsep_transport_controller.h"
|
||||
|
||||
@ -17,13 +17,13 @@
|
||||
#include "absl/types/optional.h"
|
||||
#include "api/call/call_factory_interface.h"
|
||||
#include "api/jsep.h"
|
||||
#include "api/media_transport_interface.h"
|
||||
#include "api/media_types.h"
|
||||
#include "api/peer_connection_interface.h"
|
||||
#include "api/peer_connection_proxy.h"
|
||||
#include "api/scoped_refptr.h"
|
||||
#include "api/task_queue/default_task_queue_factory.h"
|
||||
#include "api/test/fake_media_transport.h"
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
#include "media/base/codec.h"
|
||||
#include "media/base/fake_media_engine.h"
|
||||
#include "media/base/media_constants.h"
|
||||
|
||||
@ -18,11 +18,11 @@
|
||||
#include "api/fec_controller.h"
|
||||
#include "api/media_stream_proxy.h"
|
||||
#include "api/media_stream_track_proxy.h"
|
||||
#include "api/media_transport_interface.h"
|
||||
#include "api/network_state_predictor.h"
|
||||
#include "api/peer_connection_factory_proxy.h"
|
||||
#include "api/peer_connection_proxy.h"
|
||||
#include "api/rtc_event_log/rtc_event_log.h"
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
#include "api/turn_customizer.h"
|
||||
#include "api/units/data_rate.h"
|
||||
#include "api/video_track_source_proxy.h"
|
||||
|
||||
@ -16,9 +16,9 @@
|
||||
#include <string>
|
||||
|
||||
#include "api/media_stream_interface.h"
|
||||
#include "api/media_transport_interface.h"
|
||||
#include "api/peer_connection_interface.h"
|
||||
#include "api/scoped_refptr.h"
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
#include "media/sctp/sctp_transport_internal.h"
|
||||
#include "pc/channel_manager.h"
|
||||
#include "rtc_base/rtc_certificate_generator.h"
|
||||
|
||||
@ -929,6 +929,7 @@ if (is_ios || is_mac) {
|
||||
"../api/audio_codecs:builtin_audio_encoder_factory",
|
||||
"../api/rtc_event_log:rtc_event_log_factory",
|
||||
"../api/task_queue:default_task_queue_factory",
|
||||
"../api/transport/media:media_transport_interface",
|
||||
"../api/video:video_frame",
|
||||
"../api/video:video_rtp_headers",
|
||||
"../api/video_codecs:video_codecs_api",
|
||||
@ -1203,6 +1204,7 @@ if (is_ios || is_mac) {
|
||||
"../api/audio_codecs:audio_codecs_api",
|
||||
"../api/audio_codecs:builtin_audio_decoder_factory",
|
||||
"../api/audio_codecs:builtin_audio_encoder_factory",
|
||||
"../api/transport/media:media_transport_interface",
|
||||
"../api/video_codecs:video_codecs_api",
|
||||
"../media:rtc_media_base",
|
||||
"../modules:module_api",
|
||||
|
||||
@ -28,8 +28,8 @@
|
||||
#include <memory>
|
||||
|
||||
#include "api/jsep_ice_candidate.h"
|
||||
#include "api/media_transport_interface.h"
|
||||
#include "api/rtc_event_log_output_file.h"
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/numerics/safe_conversions.h"
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@
|
||||
// TODO(zhihuang): Remove nogncheck once MediaEngineInterface is moved to C++
|
||||
// API layer.
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/media_transport_interface.h"
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
#include "media/engine/webrtc_media_engine.h" // nogncheck
|
||||
|
||||
@implementation RTCPeerConnectionFactory {
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
|
||||
#include "api/audio_codecs/audio_decoder_factory.h"
|
||||
#include "api/audio_codecs/audio_encoder_factory.h"
|
||||
#include "api/media_transport_interface.h"
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
#include "api/video_codecs/video_decoder_factory.h"
|
||||
#include "api/video_codecs/video_encoder_factory.h"
|
||||
#include "modules/audio_device/include/audio_device.h"
|
||||
|
||||
@ -22,7 +22,7 @@ extern "C" {
|
||||
|
||||
#include "api/audio_codecs/builtin_audio_decoder_factory.h"
|
||||
#include "api/audio_codecs/builtin_audio_encoder_factory.h"
|
||||
#include "api/media_transport_interface.h"
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
#include "api/video_codecs/video_decoder_factory.h"
|
||||
#include "api/video_codecs/video_encoder_factory.h"
|
||||
#include "modules/audio_device/include/audio_device.h"
|
||||
|
||||
@ -57,6 +57,7 @@ rtc_source_set("peer_connection_quality_test_params") {
|
||||
"../../../api/rtc_event_log",
|
||||
"../../../api/task_queue",
|
||||
"../../../api/transport:network_control",
|
||||
"../../../api/transport/media:media_transport_interface",
|
||||
"../../../api/video_codecs:video_codecs_api",
|
||||
"../../../rtc_base",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
|
||||
@ -18,10 +18,10 @@
|
||||
#include "api/async_resolver_factory.h"
|
||||
#include "api/call/call_factory_interface.h"
|
||||
#include "api/fec_controller.h"
|
||||
#include "api/media_transport_interface.h"
|
||||
#include "api/rtc_event_log/rtc_event_log_factory_interface.h"
|
||||
#include "api/task_queue/task_queue_factory.h"
|
||||
#include "api/test/peerconnection_quality_test_fixture.h"
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
#include "api/transport/network_control.h"
|
||||
#include "api/video_codecs/video_decoder_factory.h"
|
||||
#include "api/video_codecs/video_encoder_factory.h"
|
||||
|
||||
@ -60,6 +60,7 @@ rtc_static_library("video") {
|
||||
"../api:transport_api",
|
||||
"../api/rtc_event_log",
|
||||
"../api/task_queue",
|
||||
"../api/transport/media:media_transport_interface",
|
||||
"../api/video:encoded_image",
|
||||
"../api/video:video_bitrate_allocation",
|
||||
"../api/video:video_bitrate_allocator",
|
||||
@ -266,6 +267,7 @@ if (rtc_include_tests) {
|
||||
"../api/rtc_event_log:rtc_event_log_factory",
|
||||
"../api/task_queue",
|
||||
"../api/task_queue:default_task_queue_factory",
|
||||
"../api/transport/media:media_transport_interface",
|
||||
"../api/video:builtin_video_bitrate_allocator_factory",
|
||||
"../api/video:video_bitrate_allocator_factory",
|
||||
"../api/video:video_frame",
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "api/media_transport_interface.h"
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
#include "api/video/video_stream_encoder_interface.h"
|
||||
#include "call/rtp_video_sender_interface.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
||||
|
||||
@ -19,9 +19,9 @@
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/fec_controller_override.h"
|
||||
#include "api/media_transport_config.h"
|
||||
#include "api/rtc_event_log_output_file.h"
|
||||
#include "api/task_queue/default_task_queue_factory.h"
|
||||
#include "api/transport/media/media_transport_config.h"
|
||||
#include "api/video/builtin_video_bitrate_allocator_factory.h"
|
||||
#include "api/video_codecs/video_encoder.h"
|
||||
#include "call/fake_network_pipe.h"
|
||||
|
||||
@ -14,8 +14,8 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "api/media_transport_interface.h"
|
||||
#include "api/task_queue/task_queue_factory.h"
|
||||
#include "api/transport/media/media_transport_interface.h"
|
||||
#include "call/rtp_packet_sink_interface.h"
|
||||
#include "call/syncable.h"
|
||||
#include "call/video_receive_stream.h"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user