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

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

Issue 1864313003: Move Ownership of RtpModules to VideoSendStream. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebased Created 4 years, 8 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
« no previous file with comments | « webrtc/video/encoder_state_feedback.h ('k') | webrtc/video/payload_router.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 10
11 #include "webrtc/video/encoder_state_feedback.h" 11 #include "webrtc/video/encoder_state_feedback.h"
12 12
13 #include "webrtc/base/checks.h" 13 #include "webrtc/base/checks.h"
14 #include "webrtc/video/vie_encoder.h" 14 #include "webrtc/video/vie_encoder.h"
15 15
16 namespace webrtc { 16 namespace webrtc {
17 17
18 EncoderStateFeedback::EncoderStateFeedback() : vie_encoder_(nullptr) {} 18 EncoderStateFeedback::EncoderStateFeedback() : vie_encoder_(nullptr) {}
19 19
20 void EncoderStateFeedback::Init(const std::vector<uint32_t>& ssrcs, 20 void EncoderStateFeedback::Init(const std::vector<uint32_t>& ssrcs,
21 ViEEncoder* encoder) { 21 ViEEncoder* encoder) {
22 RTC_DCHECK(!ssrcs.empty()); 22 RTC_DCHECK(!ssrcs.empty());
23 rtc::CritScope lock(&crit_); 23 rtc::CritScope lock(&crit_);
24 ssrcs_ = ssrcs; 24 ssrcs_ = ssrcs;
25 vie_encoder_ = encoder; 25 vie_encoder_ = encoder;
26 } 26 }
27 27
28 void EncoderStateFeedback::TearDown() {
29 rtc::CritScope lock(&crit_);
30 RTC_DCHECK(vie_encoder_);
31 ssrcs_.clear();
32 vie_encoder_ = nullptr;
33 }
34
35 bool EncoderStateFeedback::HasSsrc(uint32_t ssrc) { 28 bool EncoderStateFeedback::HasSsrc(uint32_t ssrc) {
36 for (uint32_t registered_ssrc : ssrcs_) { 29 for (uint32_t registered_ssrc : ssrcs_) {
37 if (registered_ssrc == ssrc) 30 if (registered_ssrc == ssrc)
38 return true; 31 return true;
39 } 32 }
40 return false; 33 return false;
41 } 34 }
42 35
43 void EncoderStateFeedback::OnReceivedIntraFrameRequest(uint32_t ssrc) { 36 void EncoderStateFeedback::OnReceivedIntraFrameRequest(uint32_t ssrc) {
44 rtc::CritScope lock(&crit_); 37 rtc::CritScope lock(&crit_);
(...skipping 30 matching lines...) Expand all
75 return; 68 return;
76 rtc::CritScope lock(&crit_); 69 rtc::CritScope lock(&crit_);
77 if (ssrcs_.empty()) // Encoder not yet attached (or detached for teardown). 70 if (ssrcs_.empty()) // Encoder not yet attached (or detached for teardown).
78 return; 71 return;
79 // SSRC shouldn't change to something we haven't already registered with the 72 // SSRC shouldn't change to something we haven't already registered with the
80 // encoder. 73 // encoder.
81 RTC_DCHECK(HasSsrc(new_ssrc)); 74 RTC_DCHECK(HasSsrc(new_ssrc));
82 } 75 }
83 76
84 } // namespace webrtc 77 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/encoder_state_feedback.h ('k') | webrtc/video/payload_router.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698