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