blob: fd57558fc6e53f3f6c45ba68cae014f393462fa9 [file] [log] [blame]
mflodman@webrtc.org3be58632012-09-06 08:19:401/*
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 */
Mirko Bonadei92ea95e2017-09-15 04:47:3110#ifndef VIDEO_ENCODER_RTCP_FEEDBACK_H_
11#define VIDEO_ENCODER_RTCP_FEEDBACK_H_
mflodman@webrtc.org3be58632012-09-06 08:19:4012
Peter Boström5cb9ce42015-05-05 13:16:3013#include <vector>
mflodman@webrtc.org3be58632012-09-06 08:19:4014
Mirko Bonadei92ea95e2017-09-15 04:47:3115#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
16#include "rtc_base/criticalsection.h"
17#include "system_wrappers/include/clock.h"
Mirko Bonadei71207422017-09-15 11:58:0918#include "typedefs.h" // NOLINT(build/include)
mflodman@webrtc.org3be58632012-09-06 08:19:4019
20namespace webrtc {
21
mflodmancc3d4422017-08-03 15:27:5122class VideoStreamEncoder;
mflodman@webrtc.org3be58632012-09-06 08:19:4023
mflodman15d83572016-10-06 15:35:1124class EncoderRtcpFeedback : public RtcpIntraFrameObserver {
mflodman@webrtc.org3be58632012-09-06 08:19:4025 public:
mflodman15d83572016-10-06 15:35:1126 EncoderRtcpFeedback(Clock* clock,
perkj600246e2016-05-04 18:26:5127 const std::vector<uint32_t>& ssrcs,
mflodmancc3d4422017-08-03 15:27:5128 VideoStreamEncoder* encoder);
Peter Boström45c44f02016-02-19 16:36:0129 void OnReceivedIntraFrameRequest(uint32_t ssrc) override;
mflodman@webrtc.org3be58632012-09-06 08:19:4030
31 private:
perkj600246e2016-05-04 18:26:5132 bool HasSsrc(uint32_t ssrc);
33 size_t GetStreamIndex(uint32_t ssrc);
mflodman@webrtc.org3be58632012-09-06 08:19:4034
perkj600246e2016-05-04 18:26:5135 Clock* const clock_;
36 const std::vector<uint32_t> ssrcs_;
mflodmancc3d4422017-08-03 15:27:5137 VideoStreamEncoder* const video_stream_encoder_;
perkj600246e2016-05-04 18:26:5138
39 rtc::CriticalSection crit_;
danilchapa37de392017-09-09 11:17:2240 std::vector<int64_t> time_last_intra_request_ms_ RTC_GUARDED_BY(crit_);
mflodman@webrtc.org3be58632012-09-06 08:19:4041};
42
43} // namespace webrtc
44
Mirko Bonadei92ea95e2017-09-15 04:47:3145#endif // VIDEO_ENCODER_RTCP_FEEDBACK_H_