
This is a no-op change because rtc::Optional is an alias to absl::optional This CL generated by running script with parameters 'audio call video': #!/bin/bash find $@ -type f \( -name \*.h -o -name \*.cc \) \ -exec sed -i 's|rtc::Optional|absl::optional|g' {} \+ \ -exec sed -i 's|rtc::nullopt|absl::nullopt|g' {} \+ \ -exec sed -i 's|#include "api/optional.h"|#include "absl/types/optional.h"|' {} \+ find $@ -type f -name BUILD.gn \ -exec sed -r -i 's|"(../)*api:optional"|"//third_party/abseil-cpp/absl/types:optional"|' {} \+; git cl format Bug: webrtc:9078 Change-Id: I02c5db956846a88a268a300ba086703a02d62e36 Reviewed-on: https://webrtc-review.googlesource.com/83722 Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23628}
105 lines
3.6 KiB
C++
105 lines
3.6 KiB
C++
/*
|
|
* Copyright (c) 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 CALL_DEGRADED_CALL_H_
|
|
#define CALL_DEGRADED_CALL_H_
|
|
|
|
#include <memory>
|
|
|
|
#include "absl/types/optional.h"
|
|
#include "api/call/transport.h"
|
|
#include "call/call.h"
|
|
#include "call/fake_network_pipe.h"
|
|
#include "modules/utility/include/process_thread.h"
|
|
#include "system_wrappers/include/clock.h"
|
|
|
|
namespace webrtc {
|
|
|
|
class DegradedCall : public Call, private Transport, private PacketReceiver {
|
|
public:
|
|
explicit DegradedCall(std::unique_ptr<Call> call,
|
|
absl::optional<FakeNetworkPipe::Config> send_config,
|
|
absl::optional<FakeNetworkPipe::Config> receive_config);
|
|
~DegradedCall() override;
|
|
|
|
// Implements Call.
|
|
AudioSendStream* CreateAudioSendStream(
|
|
const AudioSendStream::Config& config) override;
|
|
void DestroyAudioSendStream(AudioSendStream* send_stream) override;
|
|
|
|
AudioReceiveStream* CreateAudioReceiveStream(
|
|
const AudioReceiveStream::Config& config) override;
|
|
void DestroyAudioReceiveStream(AudioReceiveStream* receive_stream) override;
|
|
|
|
VideoSendStream* CreateVideoSendStream(
|
|
VideoSendStream::Config config,
|
|
VideoEncoderConfig encoder_config) override;
|
|
VideoSendStream* CreateVideoSendStream(
|
|
VideoSendStream::Config config,
|
|
VideoEncoderConfig encoder_config,
|
|
std::unique_ptr<FecController> fec_controller) override;
|
|
void DestroyVideoSendStream(VideoSendStream* send_stream) override;
|
|
|
|
VideoReceiveStream* CreateVideoReceiveStream(
|
|
VideoReceiveStream::Config configuration) override;
|
|
void DestroyVideoReceiveStream(VideoReceiveStream* receive_stream) override;
|
|
|
|
FlexfecReceiveStream* CreateFlexfecReceiveStream(
|
|
const FlexfecReceiveStream::Config& config) override;
|
|
void DestroyFlexfecReceiveStream(
|
|
FlexfecReceiveStream* receive_stream) override;
|
|
|
|
PacketReceiver* Receiver() override;
|
|
|
|
RtpTransportControllerSendInterface* GetTransportControllerSend() override;
|
|
|
|
Stats GetStats() const override;
|
|
|
|
void SetBitrateAllocationStrategy(
|
|
std::unique_ptr<rtc::BitrateAllocationStrategy>
|
|
bitrate_allocation_strategy) override;
|
|
|
|
void SignalChannelNetworkState(MediaType media, NetworkState state) override;
|
|
|
|
void OnTransportOverheadChanged(MediaType media,
|
|
int transport_overhead_per_packet) override;
|
|
|
|
void OnSentPacket(const rtc::SentPacket& sent_packet) override;
|
|
|
|
protected:
|
|
// Implements Transport.
|
|
bool SendRtp(const uint8_t* packet,
|
|
size_t length,
|
|
const PacketOptions& options) override;
|
|
|
|
bool SendRtcp(const uint8_t* packet, size_t length) override;
|
|
|
|
// Implements PacketReceiver.
|
|
DeliveryStatus DeliverPacket(MediaType media_type,
|
|
rtc::CopyOnWriteBuffer packet,
|
|
const PacketTime& packet_time) override;
|
|
|
|
private:
|
|
Clock* const clock_;
|
|
const std::unique_ptr<Call> call_;
|
|
|
|
const absl::optional<FakeNetworkPipe::Config> send_config_;
|
|
const std::unique_ptr<ProcessThread> send_process_thread_;
|
|
std::unique_ptr<FakeNetworkPipe> send_pipe_;
|
|
size_t num_send_streams_;
|
|
|
|
const absl::optional<FakeNetworkPipe::Config> receive_config_;
|
|
std::unique_ptr<FakeNetworkPipe> receive_pipe_;
|
|
};
|
|
|
|
} // namespace webrtc
|
|
|
|
#endif // CALL_DEGRADED_CALL_H_
|