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

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

Issue 1972083002: Move logic for calculating needed bitrate overhead used by NACK and FEC to VideoSender. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Removed video_sender_unittest for now. 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) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 #ifndef WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_ 11 #ifndef WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_
12 #define WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_ 12 #define WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_
13 13
14 #include <map> 14 #include <map>
15 #include <memory> 15 #include <memory>
16 #include <vector> 16 #include <vector>
17 17
18 #include "webrtc/call/bitrate_allocator.h" 18 #include "webrtc/call/bitrate_allocator.h"
19 #include "webrtc/base/criticalsection.h" 19 #include "webrtc/base/criticalsection.h"
20 #include "webrtc/call.h" 20 #include "webrtc/call.h"
21 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" 21 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
22 #include "webrtc/modules/video_coding/protection_bitrate_calculator.h"
22 #include "webrtc/video/encoded_frame_callback_adapter.h" 23 #include "webrtc/video/encoded_frame_callback_adapter.h"
23 #include "webrtc/video/encoder_state_feedback.h" 24 #include "webrtc/video/encoder_state_feedback.h"
24 #include "webrtc/video/payload_router.h" 25 #include "webrtc/video/payload_router.h"
25 #include "webrtc/video/send_delay_stats.h" 26 #include "webrtc/video/send_delay_stats.h"
26 #include "webrtc/video/send_statistics_proxy.h" 27 #include "webrtc/video/send_statistics_proxy.h"
27 #include "webrtc/video/video_capture_input.h" 28 #include "webrtc/video/video_capture_input.h"
28 #include "webrtc/video/vie_encoder.h" 29 #include "webrtc/video/vie_encoder.h"
29 #include "webrtc/video_receive_stream.h" 30 #include "webrtc/video_receive_stream.h"
30 #include "webrtc/video_send_stream.h" 31 #include "webrtc/video_send_stream.h"
31 32
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 typedef std::map<uint32_t, RtpState> RtpStateMap; 83 typedef std::map<uint32_t, RtpState> RtpStateMap;
83 RtpStateMap GetRtpStates() const; 84 RtpStateMap GetRtpStates() const;
84 85
85 int GetPaddingNeededBps() const; 86 int GetPaddingNeededBps() const;
86 87
87 // Implements BitrateAllocatorObserver. 88 // Implements BitrateAllocatorObserver.
88 void OnBitrateUpdated(uint32_t bitrate_bps, 89 void OnBitrateUpdated(uint32_t bitrate_bps,
89 uint8_t fraction_loss, 90 uint8_t fraction_loss,
90 int64_t rtt) override; 91 int64_t rtt) override;
91 92
93 protected:
92 // Implements webrtc::VCMProtectionCallback. 94 // Implements webrtc::VCMProtectionCallback.
93 int ProtectionRequest(const FecProtectionParams* delta_params, 95 int ProtectionRequest(const FecProtectionParams* delta_params,
94 const FecProtectionParams* key_params, 96 const FecProtectionParams* key_params,
95 uint32_t* sent_video_rate_bps, 97 uint32_t* sent_video_rate_bps,
96 uint32_t* sent_nack_rate_bps, 98 uint32_t* sent_nack_rate_bps,
97 uint32_t* sent_fec_rate_bps) override; 99 uint32_t* sent_fec_rate_bps) override;
98 100
99 private: 101 private:
100 struct EncoderSettings { 102 struct EncoderSettings {
101 VideoCodec video_codec; 103 VideoCodec video_codec;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 rtc::PlatformThread encoder_thread_; 136 rtc::PlatformThread encoder_thread_;
135 rtc::Event encoder_wakeup_event_; 137 rtc::Event encoder_wakeup_event_;
136 volatile int stop_encoder_thread_; 138 volatile int stop_encoder_thread_;
137 rtc::CriticalSection encoder_settings_crit_; 139 rtc::CriticalSection encoder_settings_crit_;
138 rtc::Optional<EncoderSettings> pending_encoder_settings_ 140 rtc::Optional<EncoderSettings> pending_encoder_settings_
139 GUARDED_BY(encoder_settings_crit_); 141 GUARDED_BY(encoder_settings_crit_);
140 142
141 OveruseFrameDetector overuse_detector_; 143 OveruseFrameDetector overuse_detector_;
142 ViEEncoder vie_encoder_; 144 ViEEncoder vie_encoder_;
143 EncoderStateFeedback encoder_feedback_; 145 EncoderStateFeedback encoder_feedback_;
146 ProtectionBitrateCalculator post_encode_protection_;
144 vcm::VideoSender* const video_sender_; 147 vcm::VideoSender* const video_sender_;
145 148
146 const std::unique_ptr<RtcpBandwidthObserver> bandwidth_observer_; 149 const std::unique_ptr<RtcpBandwidthObserver> bandwidth_observer_;
147 // RtpRtcp modules, declared here as they use other members on construction. 150 // RtpRtcp modules, declared here as they use other members on construction.
148 const std::vector<RtpRtcp*> rtp_rtcp_modules_; 151 const std::vector<RtpRtcp*> rtp_rtcp_modules_;
149 PayloadRouter payload_router_; 152 PayloadRouter payload_router_;
150 VideoCaptureInput input_; 153 VideoCaptureInput input_;
151 }; 154 };
152 } // namespace internal 155 } // namespace internal
153 } // namespace webrtc 156 } // namespace webrtc
154 157
155 #endif // WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_ 158 #endif // WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698