flexfec_receive_stream.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  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. #ifndef CALL_FLEXFEC_RECEIVE_STREAM_H_
  11. #define CALL_FLEXFEC_RECEIVE_STREAM_H_
  12. #include <stdint.h>
  13. #include <string>
  14. #include <vector>
  15. #include "api/call/transport.h"
  16. #include "api/rtp_headers.h"
  17. #include "api/rtp_parameters.h"
  18. #include "call/rtp_packet_sink_interface.h"
  19. namespace webrtc {
  20. class FlexfecReceiveStream : public RtpPacketSinkInterface {
  21. public:
  22. ~FlexfecReceiveStream() override = default;
  23. struct Stats {
  24. std::string ToString(int64_t time_ms) const;
  25. // TODO(brandtr): Add appropriate stats here.
  26. int flexfec_bitrate_bps;
  27. };
  28. struct Config {
  29. explicit Config(Transport* rtcp_send_transport);
  30. Config(const Config&);
  31. ~Config();
  32. std::string ToString() const;
  33. // Returns true if all RTP information is available in order to
  34. // enable receiving FlexFEC.
  35. bool IsCompleteAndEnabled() const;
  36. // Payload type for FlexFEC.
  37. int payload_type = -1;
  38. // SSRC for FlexFEC stream to be received.
  39. uint32_t remote_ssrc = 0;
  40. // Vector containing a single element, corresponding to the SSRC of the
  41. // media stream being protected by this FlexFEC stream. The vector MUST have
  42. // size 1.
  43. //
  44. // TODO(brandtr): Update comment above when we support multistream
  45. // protection.
  46. std::vector<uint32_t> protected_media_ssrcs;
  47. // SSRC for RTCP reports to be sent.
  48. uint32_t local_ssrc = 0;
  49. // What RTCP mode to use in the reports.
  50. RtcpMode rtcp_mode = RtcpMode::kCompound;
  51. // Transport for outgoing RTCP packets.
  52. Transport* rtcp_send_transport = nullptr;
  53. // |transport_cc| is true whenever the send-side BWE RTCP feedback message
  54. // has been negotiated. This is a prerequisite for enabling send-side BWE.
  55. bool transport_cc = false;
  56. // RTP header extensions that have been negotiated for this track.
  57. std::vector<RtpExtension> rtp_header_extensions;
  58. };
  59. virtual Stats GetStats() const = 0;
  60. virtual const Config& GetConfig() const = 0;
  61. };
  62. } // namespace webrtc
  63. #endif // CALL_FLEXFEC_RECEIVE_STREAM_H_