mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-17 15:47:53 +01:00

- Implement datagram transport adaptor, which wraps datagram transport in DtlsTransportInternal. Datagram adaptor owns both ICE and Datagram Transports. - Implement setup of datagram transport based on RTCConfiguration flag use_datagram_transport. This is very similar to MediaTransport setup with the exception that we create DTLS datagram adaptor. - Propagate maximum datagram size to video encoder via MediaTransportConfig. TODO: Currently this CL can only be tested in downstream projects. Once we add fake datagram transport, we will be able to implement unit tests similar to loopback media transport. Bug: webrtc:9719 Change-Id: I4fa4a5725598dfee5da4f0f374269a7e289d48ed Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/138100 Commit-Queue: Anton Sukhanov <sukhanov@webrtc.org> Reviewed-by: Bjorn Mellem <mellem@webrtc.org> Reviewed-by: Steve Anton <steveanton@webrtc.org> Cr-Commit-Position: refs/heads/master@{#28047}
37 lines
1.3 KiB
C++
37 lines
1.3 KiB
C++
/*
|
|
* Copyright 2017 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.
|
|
*/
|
|
|
|
#include "p2p/base/dtls_transport_internal.h"
|
|
|
|
namespace cricket {
|
|
|
|
DtlsTransportInternal::DtlsTransportInternal() = default;
|
|
|
|
DtlsTransportInternal::~DtlsTransportInternal() = default;
|
|
|
|
webrtc::DtlsTransportState ConvertDtlsTransportState(
|
|
cricket::DtlsTransportState cricket_state) {
|
|
switch (cricket_state) {
|
|
case DtlsTransportState::DTLS_TRANSPORT_NEW:
|
|
return webrtc::DtlsTransportState::kNew;
|
|
case DtlsTransportState::DTLS_TRANSPORT_CONNECTING:
|
|
return webrtc::DtlsTransportState::kConnecting;
|
|
case DtlsTransportState::DTLS_TRANSPORT_CONNECTED:
|
|
return webrtc::DtlsTransportState::kConnected;
|
|
case DtlsTransportState::DTLS_TRANSPORT_CLOSED:
|
|
return webrtc::DtlsTransportState::kClosed;
|
|
case DtlsTransportState::DTLS_TRANSPORT_FAILED:
|
|
return webrtc::DtlsTransportState::kFailed;
|
|
}
|
|
RTC_NOTREACHED();
|
|
return webrtc::DtlsTransportState::kNew;
|
|
}
|
|
|
|
} // namespace cricket
|