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

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

Issue 1993113003: Refactor how padding is calculated. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Self review 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
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 namespace vcm { 43 namespace vcm {
44 class VideoSender; 44 class VideoSender;
45 } // namespace vcm 45 } // namespace vcm
46 46
47 namespace internal { 47 namespace internal {
48 48
49 class VideoSendStream : public webrtc::VideoSendStream, 49 class VideoSendStream : public webrtc::VideoSendStream,
50 public webrtc::CpuOveruseObserver, 50 public webrtc::CpuOveruseObserver,
51 public webrtc::BitrateAllocatorObserver, 51 public webrtc::BitrateAllocatorObserver,
52 public webrtc::VCMProtectionCallback, 52 public webrtc::VCMProtectionCallback,
53 protected webrtc::EncodedImageCallback { 53 public VideoEncoderSink {
54 public: 54 public:
55 VideoSendStream(int num_cpu_cores, 55 VideoSendStream(int num_cpu_cores,
56 ProcessThread* module_process_thread, 56 ProcessThread* module_process_thread,
57 CallStats* call_stats, 57 CallStats* call_stats,
58 CongestionController* congestion_controller, 58 CongestionController* congestion_controller,
59 BitrateAllocator* bitrate_allocator, 59 BitrateAllocator* bitrate_allocator,
60 SendDelayStats* send_delay_stats, 60 SendDelayStats* send_delay_stats,
61 VieRemb* remb, 61 VieRemb* remb,
62 const VideoSendStream::Config& config, 62 const VideoSendStream::Config& config,
63 const VideoEncoderConfig& encoder_config, 63 const VideoEncoderConfig& encoder_config,
(...skipping 28 matching lines...) Expand all
92 // Implements webrtc::VCMProtectionCallback. 92 // Implements webrtc::VCMProtectionCallback.
93 int ProtectionRequest(const FecProtectionParams* delta_params, 93 int ProtectionRequest(const FecProtectionParams* delta_params,
94 const FecProtectionParams* key_params, 94 const FecProtectionParams* key_params,
95 uint32_t* sent_video_rate_bps, 95 uint32_t* sent_video_rate_bps,
96 uint32_t* sent_nack_rate_bps, 96 uint32_t* sent_nack_rate_bps,
97 uint32_t* sent_fec_rate_bps) override; 97 uint32_t* sent_fec_rate_bps) override;
98 98
99 private: 99 private:
100 struct EncoderSettings { 100 struct EncoderSettings {
101 VideoCodec video_codec; 101 VideoCodec video_codec;
102 int min_transmit_bitrate_bps; 102 VideoEncoderConfig config;
103 std::vector<VideoStream> streams;
104 }; 103 };
105 104
106 // Implements EncodedImageCallback. The implementation routes encoded frames 105 // Implements VideoEncoderSink. The implementation routes encoded frames
107 // to the |payload_router_| and |config.pre_encode_callback| if set. 106 // to the |payload_router_| and |config.pre_encode_callback| if set.
108 // Called on an arbitrary encoder callback thread. 107 // Called on an arbitrary encoder callback thread.
109 int32_t Encoded(const EncodedImage& encoded_image, 108 int32_t Encoded(const EncodedImage& encoded_image,
110 const CodecSpecificInfo* codec_specific_info, 109 const CodecSpecificInfo* codec_specific_info,
111 const RTPFragmentationHeader* fragmentation) override; 110 const RTPFragmentationHeader* fragmentation) override;
112 111
112 void OnEncoderActivityChanged(bool active) override;
113
113 static bool EncoderThreadFunction(void* obj); 114 static bool EncoderThreadFunction(void* obj);
114 void EncoderProcess(); 115 void EncoderProcess();
115 116
116 void ConfigureProtection(); 117 void ConfigureProtection();
117 void ConfigureSsrcs(); 118 void ConfigureSsrcs();
118 119
119 SendStatisticsProxy stats_proxy_; 120 SendStatisticsProxy stats_proxy_;
120 EncodedFrameCallbackAdapter encoded_frame_proxy_; 121 EncodedFrameCallbackAdapter encoded_frame_proxy_;
121 const VideoSendStream::Config config_; 122 const VideoSendStream::Config config_;
122 std::map<uint32_t, RtpState> suspended_ssrcs_; 123 std::map<uint32_t, RtpState> suspended_ssrcs_;
(...skipping 23 matching lines...) Expand all
146 const std::unique_ptr<RtcpBandwidthObserver> bandwidth_observer_; 147 const std::unique_ptr<RtcpBandwidthObserver> bandwidth_observer_;
147 // RtpRtcp modules, declared here as they use other members on construction. 148 // RtpRtcp modules, declared here as they use other members on construction.
148 const std::vector<RtpRtcp*> rtp_rtcp_modules_; 149 const std::vector<RtpRtcp*> rtp_rtcp_modules_;
149 PayloadRouter payload_router_; 150 PayloadRouter payload_router_;
150 VideoCaptureInput input_; 151 VideoCaptureInput input_;
151 }; 152 };
152 } // namespace internal 153 } // namespace internal
153 } // namespace webrtc 154 } // namespace webrtc
154 155
155 #endif // WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_ 156 #endif // WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698