Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Side by Side Diff: webrtc/video/encoder_state_feedback.h

Issue 1936503002: Removed SSRC knowledge from ViEEncoder. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@move_payload_router2
Patch Set: Fix unittest. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10
11 // TODO(mflodman) ViEEncoder has a time check to not send key frames too often,
12 // move the logic to this class.
13
14 #ifndef WEBRTC_VIDEO_ENCODER_STATE_FEEDBACK_H_ 10 #ifndef WEBRTC_VIDEO_ENCODER_STATE_FEEDBACK_H_
15 #define WEBRTC_VIDEO_ENCODER_STATE_FEEDBACK_H_ 11 #define WEBRTC_VIDEO_ENCODER_STATE_FEEDBACK_H_
16 12
17 #include <vector> 13 #include <vector>
18 14
19 #include "webrtc/base/criticalsection.h" 15 #include "webrtc/base/criticalsection.h"
20 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" 16 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
17 #include "webrtc/system_wrappers/include/clock.h"
21 #include "webrtc/typedefs.h" 18 #include "webrtc/typedefs.h"
22 19
23 namespace webrtc { 20 namespace webrtc {
24 21
25 class ViEEncoder; 22 class ViEEncoder;
26 23
27 class EncoderStateFeedback : public RtcpIntraFrameObserver { 24 class EncoderStateFeedback : public RtcpIntraFrameObserver {
28 public: 25 public:
29 EncoderStateFeedback(); 26 explicit EncoderStateFeedback(Clock* clock);
30 27
31 // Adds an encoder to receive feedback for a set of SSRCs. 28 // Adds an encoder to receive feedback for a set of SSRCs.
32 void Init(const std::vector<uint32_t>& ssrc, ViEEncoder* encoder); 29 void Init(const std::vector<uint32_t>& ssrc, ViEEncoder* encoder);
33 30
34 void OnReceivedIntraFrameRequest(uint32_t ssrc) override; 31 void OnReceivedIntraFrameRequest(uint32_t ssrc) override;
35 void OnReceivedSLI(uint32_t ssrc, uint8_t picture_id) override; 32 void OnReceivedSLI(uint32_t ssrc, uint8_t picture_id) override;
36 void OnReceivedRPSI(uint32_t ssrc, uint64_t picture_id) override; 33 void OnReceivedRPSI(uint32_t ssrc, uint64_t picture_id) override;
37 void OnLocalSsrcChanged(uint32_t old_ssrc, uint32_t new_ssrc) override; 34 void OnLocalSsrcChanged(uint32_t old_ssrc, uint32_t new_ssrc) override;
38 35
39 private: 36 private:
40 bool HasSsrc(uint32_t ssrc) EXCLUSIVE_LOCKS_REQUIRED(crit_); 37 bool HasSsrc(uint32_t ssrc) EXCLUSIVE_LOCKS_REQUIRED(crit_);
38 size_t GetStreamIndex(uint32_t ssrc) EXCLUSIVE_LOCKS_REQUIRED(crit_);
39
40 Clock* const clock_;
41 rtc::CriticalSection crit_; 41 rtc::CriticalSection crit_;
42 42
43 std::vector<uint32_t> ssrcs_ GUARDED_BY(crit_); 43 std::vector<uint32_t> ssrcs_ GUARDED_BY(crit_);
44 std::vector<int64_t> time_last_intra_request_ms_ GUARDED_BY(crit_);
44 ViEEncoder* vie_encoder_ GUARDED_BY(crit_); 45 ViEEncoder* vie_encoder_ GUARDED_BY(crit_);
45 }; 46 };
46 47
47 } // namespace webrtc 48 } // namespace webrtc
48 49
49 #endif // WEBRTC_VIDEO_ENCODER_STATE_FEEDBACK_H_ 50 #endif // WEBRTC_VIDEO_ENCODER_STATE_FEEDBACK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698