| 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 |
| 25 | namespace webrtc { |
| 26 |
| 27 | class FlexfecReceiveStream : public RtpPacketSinkInterface, |
| 28 | public ReceiveStream { |
| 29 | public: |
| 30 | ~FlexfecReceiveStream() override = default; |
| 31 |
| 32 | struct Stats { |
| 33 | std::string ToString(int64_t time_ms) const; |
| 34 |
| 35 | // TODO(brandtr): Add appropriate stats here. |
| 36 | int flexfec_bitrate_bps; |
| 37 | }; |
| 38 |
| 39 | struct Config { |
| 40 | explicit Config(Transport* rtcp_send_transport); |
| 41 | Config(const Config&); |
| 42 | ~Config(); |
| 43 |
| 44 | std::string ToString() const; |
| 45 |
| 46 | // Returns true if all RTP information is available in order to |
| 47 | // enable receiving FlexFEC. |
| 48 | bool IsCompleteAndEnabled() const; |
| 49 |
| 50 | // Payload type for FlexFEC. |
| 51 | int payload_type = -1; |
| 52 |
| 53 | RtpConfig rtp; |
| 54 |
| 55 | // Vector containing a single element, corresponding to the SSRC of the |
| 56 | // media stream being protected by this FlexFEC stream. The vector MUST have |
| 57 | // size 1. |
| 58 | // |
| 59 | // TODO(brandtr): Update comment above when we support multistream |
| 60 | // protection. |
| 61 | std::vector<uint32_t> protected_media_ssrcs; |
| 62 |
| 63 | // What RTCP mode to use in the reports. |
| 64 | RtcpMode rtcp_mode = RtcpMode::kCompound; |
| 65 |
| 66 | // Transport for outgoing RTCP packets. |
| 67 | Transport* rtcp_send_transport = nullptr; |
| 68 | }; |
| 69 |
| 70 | virtual Stats GetStats() const = 0; |
| 71 | }; |
| 72 |
| 73 | } // namespace webrtc |
| 74 |
| 75 | #endif // CALL_FLEXFEC_RECEIVE_STREAM_H_ |
| 76 |