2016-10-20 04:54:48 -07:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2016 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.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#ifndef CALL_FLEXFEC_RECEIVE_STREAM_H_
|
|
|
|
|
#define CALL_FLEXFEC_RECEIVE_STREAM_H_
|
2016-10-20 04:54:48 -07:00
|
|
|
|
2017-01-02 08:42:32 -08:00
|
|
|
#include <stdint.h>
|
2019-07-05 19:08:33 +02:00
|
|
|
|
2016-10-20 04:54:48 -07:00
|
|
|
#include <string>
|
2016-12-19 01:13:46 -08:00
|
|
|
#include <vector>
|
2016-10-20 04:54:48 -07:00
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "api/call/transport.h"
|
2017-12-15 14:40:10 +01:00
|
|
|
#include "api/rtp_headers.h"
|
2021-06-14 10:54:20 +02:00
|
|
|
#include "call/receive_stream.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "call/rtp_packet_sink_interface.h"
|
2023-06-21 13:53:41 +02:00
|
|
|
#include "modules/rtp_rtcp/include/receive_statistics.h"
|
2016-10-20 04:54:48 -07:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
|
2021-06-14 10:54:20 +02:00
|
|
|
class FlexfecReceiveStream : public RtpPacketSinkInterface,
|
2022-05-18 09:18:37 +02:00
|
|
|
public ReceiveStreamInterface {
|
2016-10-20 04:54:48 -07:00
|
|
|
public:
|
2017-08-02 07:39:07 -07:00
|
|
|
~FlexfecReceiveStream() override = default;
|
2017-07-25 06:40:06 -07:00
|
|
|
|
2016-12-19 01:13:46 -08:00
|
|
|
struct Config {
|
2018-04-09 14:24:52 +02:00
|
|
|
explicit Config(Transport* rtcp_send_transport);
|
2018-08-28 16:30:18 +02:00
|
|
|
Config(const Config&);
|
2018-04-09 14:24:52 +02:00
|
|
|
~Config();
|
2017-01-13 07:41:19 -08:00
|
|
|
|
2016-12-19 01:13:46 -08:00
|
|
|
std::string ToString() const;
|
2016-10-20 04:54:48 -07:00
|
|
|
|
2017-01-13 07:41:19 -08:00
|
|
|
// Returns true if all RTP information is available in order to
|
|
|
|
|
// enable receiving FlexFEC.
|
|
|
|
|
bool IsCompleteAndEnabled() const;
|
|
|
|
|
|
2016-12-19 01:13:46 -08:00
|
|
|
// Payload type for FlexFEC.
|
|
|
|
|
int payload_type = -1;
|
2016-10-20 04:54:48 -07:00
|
|
|
|
2022-05-09 18:54:02 +00:00
|
|
|
ReceiveStreamRtpConfig rtp;
|
2016-12-19 01:13:46 -08:00
|
|
|
|
|
|
|
|
// Vector containing a single element, corresponding to the SSRC of the
|
|
|
|
|
// media stream being protected by this FlexFEC stream. The vector MUST have
|
|
|
|
|
// size 1.
|
|
|
|
|
//
|
|
|
|
|
// TODO(brandtr): Update comment above when we support multistream
|
|
|
|
|
// protection.
|
|
|
|
|
std::vector<uint32_t> protected_media_ssrcs;
|
|
|
|
|
|
|
|
|
|
// What RTCP mode to use in the reports.
|
|
|
|
|
RtcpMode rtcp_mode = RtcpMode::kCompound;
|
|
|
|
|
|
|
|
|
|
// Transport for outgoing RTCP packets.
|
|
|
|
|
Transport* rtcp_send_transport = nullptr;
|
|
|
|
|
};
|
2022-07-14 18:33:42 +02:00
|
|
|
|
|
|
|
|
// TODO(tommi): FlexfecReceiveStream inherits from ReceiveStreamInterface,
|
|
|
|
|
// not VideoReceiveStreamInterface where there's also a SetRtcpMode method.
|
|
|
|
|
// Perhaps this should be in ReceiveStreamInterface and apply to audio streams
|
|
|
|
|
// as well (although there's no logic that would use it at present).
|
|
|
|
|
virtual void SetRtcpMode(RtcpMode mode) = 0;
|
2022-07-28 09:24:52 +02:00
|
|
|
|
|
|
|
|
// Called to change the payload type after initialization.
|
|
|
|
|
virtual void SetPayloadType(int payload_type) = 0;
|
|
|
|
|
virtual int payload_type() const = 0;
|
2023-06-21 13:53:41 +02:00
|
|
|
|
|
|
|
|
virtual const ReceiveStatistics* GetStats() const = 0;
|
2016-12-19 01:13:46 -08:00
|
|
|
};
|
2016-10-20 04:54:48 -07:00
|
|
|
|
|
|
|
|
} // namespace webrtc
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#endif // CALL_FLEXFEC_RECEIVE_STREAM_H_
|