webrtc/api/media_transport_config.h
Anton Sukhanov 4f08faae82 Introduce MediaTransportConfig
Currently we pass media_transport from PeerConnection to media layers. The goal of this change is to replace media_transport with struct MediaTransportCondif, which will enable adding different transports (i.e. we plan to add DatagramTransport) as well as other media-transport related settings without changing 100s of files.

TODO: In the future we should consider also adding rtp_transport in the same config, but it will require a bit more work, so I did not include it in the same change.


Bug: webrtc:9719
Change-Id: Ie31e1faa3ed9e6beefe30a3da208130509ce00cd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/137181
Commit-Queue: Anton Sukhanov <sukhanov@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Bjorn Mellem <mellem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28016}
2019-05-21 18:58:33 +00:00

42 lines
1.5 KiB
C++

/* 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_MEDIA_TRANSPORT_CONFIG_H_
#define API_MEDIA_TRANSPORT_CONFIG_H_
#include <memory>
#include <string>
#include <utility>
namespace webrtc {
class MediaTransportInterface;
// MediaTransportConfig contains meida transport (if provided) and passed from
// PeerConnection to call obeject and media layers that require access to media
// transport. In the future we can add other transport (for example, datagram
// transport) and related configuration.
struct MediaTransportConfig {
// Default constructor for no-media transport scenarios.
MediaTransportConfig() = default;
// TODO(sukhanov): Consider adding RtpTransport* to MediaTransportConfig,
// because it's almost always passes along with media_transport.
// Does not own media_transport.
explicit MediaTransportConfig(MediaTransportInterface* media_transport)
: media_transport(media_transport) {}
std::string DebugString() const;
// If provided, all media is sent through media_transport.
MediaTransportInterface* media_transport = nullptr;
};
} // namespace webrtc
#endif // API_MEDIA_TRANSPORT_CONFIG_H_