blob: 79c6cc06875ea558ff27fa003db024e5974801bf [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"
21
22namespace webrtc {
23
24class FlexfecReceiveStreamImpl : public FlexfecReceiveStream {
25 public:
26 FlexfecReceiveStreamImpl(const Config& config,
27 RecoveredPacketReceiver* recovered_packet_callback);
28 ~FlexfecReceiveStreamImpl() override;
29
30 bool AddAndProcessReceivedPacket(const uint8_t* packet, size_t length);
31
32 // Implements FlexfecReceiveStream.
33 void Start() override;
34 void Stop() override;
35 Stats GetStats() const override;
36
37 private:
38 rtc::CriticalSection crit_;
39 bool started_ GUARDED_BY(crit_);
40
41 const Config config_;
42 const std::unique_ptr<FlexfecReceiver> receiver_;
43};
44
45} // namespace webrtc
46
47#endif // WEBRTC_CALL_FLEXFEC_RECEIVE_STREAM_IMPL_H_