1*d9f75844SAndroid Build Coastguard Worker /* 2*d9f75844SAndroid Build Coastguard Worker * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 3*d9f75844SAndroid Build Coastguard Worker * 4*d9f75844SAndroid Build Coastguard Worker * Use of this source code is governed by a BSD-style license 5*d9f75844SAndroid Build Coastguard Worker * that can be found in the LICENSE file in the root of the source 6*d9f75844SAndroid Build Coastguard Worker * tree. An additional intellectual property rights grant can be found 7*d9f75844SAndroid Build Coastguard Worker * in the file PATENTS. All contributing project authors may 8*d9f75844SAndroid Build Coastguard Worker * be found in the AUTHORS file in the root of the source tree. 9*d9f75844SAndroid Build Coastguard Worker */ 10*d9f75844SAndroid Build Coastguard Worker 11*d9f75844SAndroid Build Coastguard Worker #ifndef CALL_FLEXFEC_RECEIVE_STREAM_H_ 12*d9f75844SAndroid Build Coastguard Worker #define CALL_FLEXFEC_RECEIVE_STREAM_H_ 13*d9f75844SAndroid Build Coastguard Worker 14*d9f75844SAndroid Build Coastguard Worker #include <stdint.h> 15*d9f75844SAndroid Build Coastguard Worker 16*d9f75844SAndroid Build Coastguard Worker #include <string> 17*d9f75844SAndroid Build Coastguard Worker #include <vector> 18*d9f75844SAndroid Build Coastguard Worker 19*d9f75844SAndroid Build Coastguard Worker #include "api/call/transport.h" 20*d9f75844SAndroid Build Coastguard Worker #include "api/rtp_headers.h" 21*d9f75844SAndroid Build Coastguard Worker #include "api/rtp_parameters.h" 22*d9f75844SAndroid Build Coastguard Worker #include "call/receive_stream.h" 23*d9f75844SAndroid Build Coastguard Worker #include "call/rtp_packet_sink_interface.h" 24*d9f75844SAndroid Build Coastguard Worker 25*d9f75844SAndroid Build Coastguard Worker namespace webrtc { 26*d9f75844SAndroid Build Coastguard Worker 27*d9f75844SAndroid Build Coastguard Worker class FlexfecReceiveStream : public RtpPacketSinkInterface, 28*d9f75844SAndroid Build Coastguard Worker public ReceiveStreamInterface { 29*d9f75844SAndroid Build Coastguard Worker public: 30*d9f75844SAndroid Build Coastguard Worker ~FlexfecReceiveStream() override = default; 31*d9f75844SAndroid Build Coastguard Worker 32*d9f75844SAndroid Build Coastguard Worker struct Config { 33*d9f75844SAndroid Build Coastguard Worker explicit Config(Transport* rtcp_send_transport); 34*d9f75844SAndroid Build Coastguard Worker Config(const Config&); 35*d9f75844SAndroid Build Coastguard Worker ~Config(); 36*d9f75844SAndroid Build Coastguard Worker 37*d9f75844SAndroid Build Coastguard Worker std::string ToString() const; 38*d9f75844SAndroid Build Coastguard Worker 39*d9f75844SAndroid Build Coastguard Worker // Returns true if all RTP information is available in order to 40*d9f75844SAndroid Build Coastguard Worker // enable receiving FlexFEC. 41*d9f75844SAndroid Build Coastguard Worker bool IsCompleteAndEnabled() const; 42*d9f75844SAndroid Build Coastguard Worker 43*d9f75844SAndroid Build Coastguard Worker // Payload type for FlexFEC. 44*d9f75844SAndroid Build Coastguard Worker int payload_type = -1; 45*d9f75844SAndroid Build Coastguard Worker 46*d9f75844SAndroid Build Coastguard Worker ReceiveStreamRtpConfig rtp; 47*d9f75844SAndroid Build Coastguard Worker 48*d9f75844SAndroid Build Coastguard Worker // Vector containing a single element, corresponding to the SSRC of the 49*d9f75844SAndroid Build Coastguard Worker // media stream being protected by this FlexFEC stream. The vector MUST have 50*d9f75844SAndroid Build Coastguard Worker // size 1. 51*d9f75844SAndroid Build Coastguard Worker // 52*d9f75844SAndroid Build Coastguard Worker // TODO(brandtr): Update comment above when we support multistream 53*d9f75844SAndroid Build Coastguard Worker // protection. 54*d9f75844SAndroid Build Coastguard Worker std::vector<uint32_t> protected_media_ssrcs; 55*d9f75844SAndroid Build Coastguard Worker 56*d9f75844SAndroid Build Coastguard Worker // What RTCP mode to use in the reports. 57*d9f75844SAndroid Build Coastguard Worker RtcpMode rtcp_mode = RtcpMode::kCompound; 58*d9f75844SAndroid Build Coastguard Worker 59*d9f75844SAndroid Build Coastguard Worker // Transport for outgoing RTCP packets. 60*d9f75844SAndroid Build Coastguard Worker Transport* rtcp_send_transport = nullptr; 61*d9f75844SAndroid Build Coastguard Worker }; 62*d9f75844SAndroid Build Coastguard Worker 63*d9f75844SAndroid Build Coastguard Worker // TODO(tommi): FlexfecReceiveStream inherits from ReceiveStreamInterface, 64*d9f75844SAndroid Build Coastguard Worker // not VideoReceiveStreamInterface where there's also a SetRtcpMode method. 65*d9f75844SAndroid Build Coastguard Worker // Perhaps this should be in ReceiveStreamInterface and apply to audio streams 66*d9f75844SAndroid Build Coastguard Worker // as well (although there's no logic that would use it at present). 67*d9f75844SAndroid Build Coastguard Worker virtual void SetRtcpMode(RtcpMode mode) = 0; 68*d9f75844SAndroid Build Coastguard Worker 69*d9f75844SAndroid Build Coastguard Worker // Called to change the payload type after initialization. 70*d9f75844SAndroid Build Coastguard Worker virtual void SetPayloadType(int payload_type) = 0; 71*d9f75844SAndroid Build Coastguard Worker virtual int payload_type() const = 0; 72*d9f75844SAndroid Build Coastguard Worker }; 73*d9f75844SAndroid Build Coastguard Worker 74*d9f75844SAndroid Build Coastguard Worker } // namespace webrtc 75*d9f75844SAndroid Build Coastguard Worker 76*d9f75844SAndroid Build Coastguard Worker #endif // CALL_FLEXFEC_RECEIVE_STREAM_H_ 77