blob: 7267dc0e45a5ebf55eeaa2e8dc3cf000c33336aa [file] [log] [blame]
brandtr7250b392016-12-19 01:13:46 -08001/*
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
11#ifndef WEBRTC_CALL_FLEXFEC_RECEIVE_STREAM_IMPL_H_
12#define WEBRTC_CALL_FLEXFEC_RECEIVE_STREAM_IMPL_H_
13
14#include <memory>
15#include <string>
16
17#include "webrtc/base/basictypes.h"
18#include "webrtc/base/criticalsection.h"
19#include "webrtc/call/flexfec_receive_stream.h"
20#include "webrtc/modules/rtp_rtcp/include/flexfec_receiver.h"
brandtrab2ffa32016-12-20 03:33:58 -080021#include "webrtc/modules/rtp_rtcp/source/rtp_packet_received.h"
brandtr7250b392016-12-19 01:13:46 -080022
23namespace webrtc {
24
25class FlexfecReceiveStreamImpl : public FlexfecReceiveStream {
26 public:
27 FlexfecReceiveStreamImpl(const Config& config,
brandtrab2ffa32016-12-20 03:33:58 -080028 RecoveredPacketReceiver* recovered_packet_receiver);
brandtr7250b392016-12-19 01:13:46 -080029 ~FlexfecReceiveStreamImpl() override;
30
brandtrab2ffa32016-12-20 03:33:58 -080031 const Config& GetConfig() const { return config_; }
32
33 bool AddAndProcessReceivedPacket(RtpPacketReceived packet);
brandtr7250b392016-12-19 01:13:46 -080034
35 // Implements FlexfecReceiveStream.
36 void Start() override;
37 void Stop() override;
38 Stats GetStats() const override;
39
40 private:
41 rtc::CriticalSection crit_;
42 bool started_ GUARDED_BY(crit_);
43
44 const Config config_;
45 const std::unique_ptr<FlexfecReceiver> receiver_;
46};
47
48} // namespace webrtc
49
50#endif // WEBRTC_CALL_FLEXFEC_RECEIVE_STREAM_IMPL_H_