blob: 4afdcf4c9e87434c79e98e7e3734f94898628fd5 [file] [log] [blame]
mflodman@webrtc.org3be58632012-09-06 08:19:40 +00001/*
2 * Copyright (c) 2012 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 */
mflodman15d83572016-10-06 08:35:11 -070010#ifndef WEBRTC_VIDEO_ENCODER_RTCP_FEEDBACK_H_
11#define WEBRTC_VIDEO_ENCODER_RTCP_FEEDBACK_H_
mflodman@webrtc.org3be58632012-09-06 08:19:40 +000012
Peter Boström5cb9ce42015-05-05 15:16:30 +020013#include <vector>
mflodman@webrtc.org3be58632012-09-06 08:19:40 +000014
Tommi97888bd2016-01-21 23:24:59 +010015#include "webrtc/base/criticalsection.h"
Peter Boström45c44f02016-02-19 17:36:01 +010016#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
perkj600246e2016-05-04 11:26:51 -070017#include "webrtc/system_wrappers/include/clock.h"
pbos@webrtc.orgf5d4cb12013-05-17 13:44:48 +000018#include "webrtc/typedefs.h"
mflodman@webrtc.org3be58632012-09-06 08:19:40 +000019
20namespace webrtc {
21
mflodman@webrtc.org3be58632012-09-06 08:19:40 +000022class ViEEncoder;
23
mflodman15d83572016-10-06 08:35:11 -070024class EncoderRtcpFeedback : public RtcpIntraFrameObserver {
mflodman@webrtc.org3be58632012-09-06 08:19:40 +000025 public:
mflodman15d83572016-10-06 08:35:11 -070026 EncoderRtcpFeedback(Clock* clock,
perkj600246e2016-05-04 11:26:51 -070027 const std::vector<uint32_t>& ssrcs,
28 ViEEncoder* encoder);
Peter Boström45c44f02016-02-19 17:36:01 +010029 void OnReceivedIntraFrameRequest(uint32_t ssrc) override;
30 void OnReceivedSLI(uint32_t ssrc, uint8_t picture_id) override;
31 void OnReceivedRPSI(uint32_t ssrc, uint64_t picture_id) override;
mflodman@webrtc.org3be58632012-09-06 08:19:40 +000032
33 private:
perkj600246e2016-05-04 11:26:51 -070034 bool HasSsrc(uint32_t ssrc);
35 size_t GetStreamIndex(uint32_t ssrc);
mflodman@webrtc.org3be58632012-09-06 08:19:40 +000036
perkj600246e2016-05-04 11:26:51 -070037 Clock* const clock_;
38 const std::vector<uint32_t> ssrcs_;
39 ViEEncoder* const vie_encoder_;
40
41 rtc::CriticalSection crit_;
42 std::vector<int64_t> time_last_intra_request_ms_ GUARDED_BY(crit_);
mflodman@webrtc.org3be58632012-09-06 08:19:40 +000043};
44
45} // namespace webrtc
46
mflodman15d83572016-10-06 08:35:11 -070047#endif // WEBRTC_VIDEO_ENCODER_RTCP_FEEDBACK_H_