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

Side by Side Diff: webrtc/media/engine/webrtcvideoengine2.h

Issue 2511703002: Wire up FlexFEC in VideoEngine2. (Closed)
Patch Set: Created 4 years, 1 month 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) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 private: 190 private:
191 class WebRtcVideoReceiveStream; 191 class WebRtcVideoReceiveStream;
192 struct VideoCodecSettings { 192 struct VideoCodecSettings {
193 VideoCodecSettings(); 193 VideoCodecSettings();
194 194
195 bool operator==(const VideoCodecSettings& other) const; 195 bool operator==(const VideoCodecSettings& other) const;
196 bool operator!=(const VideoCodecSettings& other) const; 196 bool operator!=(const VideoCodecSettings& other) const;
197 197
198 VideoCodec codec; 198 VideoCodec codec;
199 webrtc::UlpfecConfig ulpfec; 199 webrtc::UlpfecConfig ulpfec;
200 webrtc::FlexfecConfig flexfec;
200 int rtx_payload_type; 201 int rtx_payload_type;
201 }; 202 };
202 203
203 struct ChangedSendParameters { 204 struct ChangedSendParameters {
204 // These optionals are unset if not changed. 205 // These optionals are unset if not changed.
205 rtc::Optional<VideoCodecSettings> codec; 206 rtc::Optional<VideoCodecSettings> codec;
206 rtc::Optional<std::vector<webrtc::RtpExtension>> rtp_header_extensions; 207 rtc::Optional<std::vector<webrtc::RtpExtension>> rtp_header_extensions;
207 rtc::Optional<int> max_bandwidth_bps; 208 rtc::Optional<int> max_bandwidth_bps;
208 rtc::Optional<bool> conference_mode; 209 rtc::Optional<bool> conference_mode;
209 rtc::Optional<webrtc::RtcpMode> rtcp_mode; 210 rtc::Optional<webrtc::RtcpMode> rtcp_mode;
210 }; 211 };
211 212
212 struct ChangedRecvParameters { 213 struct ChangedRecvParameters {
213 // These optionals are unset if not changed. 214 // These optionals are unset if not changed.
214 rtc::Optional<std::vector<VideoCodecSettings>> codec_settings; 215 rtc::Optional<std::vector<VideoCodecSettings>> codec_settings;
215 rtc::Optional<std::vector<webrtc::RtpExtension>> rtp_header_extensions; 216 rtc::Optional<std::vector<webrtc::RtpExtension>> rtp_header_extensions;
216 }; 217 };
217 218
218 bool GetChangedSendParameters(const VideoSendParameters& params, 219 bool GetChangedSendParameters(const VideoSendParameters& params,
219 ChangedSendParameters* changed_params) const; 220 ChangedSendParameters* changed_params) const;
220 bool GetChangedRecvParameters(const VideoRecvParameters& params, 221 bool GetChangedRecvParameters(const VideoRecvParameters& params,
221 ChangedRecvParameters* changed_params) const; 222 ChangedRecvParameters* changed_params) const;
222 223
223 void SetMaxSendBandwidth(int bps); 224 void SetMaxSendBandwidth(int bps);
224 225
225 void ConfigureReceiverRtp(webrtc::VideoReceiveStream::Config* config, 226 void ConfigureReceiverRtp(webrtc::VideoReceiveStream::Config* config,
227 webrtc::FlexfecConfig* flexfec_config,
226 const StreamParams& sp) const; 228 const StreamParams& sp) const;
227 bool ValidateSendSsrcAvailability(const StreamParams& sp) const 229 bool ValidateSendSsrcAvailability(const StreamParams& sp) const
228 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_); 230 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_);
229 bool ValidateReceiveSsrcAvailability(const StreamParams& sp) const 231 bool ValidateReceiveSsrcAvailability(const StreamParams& sp) const
230 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_); 232 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_);
231 void DeleteReceiveStream(WebRtcVideoReceiveStream* stream) 233 void DeleteReceiveStream(WebRtcVideoReceiveStream* stream)
232 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_); 234 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_);
233 235
234 static std::string CodecSettingsVectorToString( 236 static std::string CodecSettingsVectorToString(
235 const std::vector<VideoCodecSettings>& codecs); 237 const std::vector<VideoCodecSettings>& codecs);
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 // reconstruct the underlying VideoReceiveStream. 381 // reconstruct the underlying VideoReceiveStream.
380 class WebRtcVideoReceiveStream 382 class WebRtcVideoReceiveStream
381 : public rtc::VideoSinkInterface<webrtc::VideoFrame> { 383 : public rtc::VideoSinkInterface<webrtc::VideoFrame> {
382 public: 384 public:
383 WebRtcVideoReceiveStream( 385 WebRtcVideoReceiveStream(
384 webrtc::Call* call, 386 webrtc::Call* call,
385 const StreamParams& sp, 387 const StreamParams& sp,
386 webrtc::VideoReceiveStream::Config config, 388 webrtc::VideoReceiveStream::Config config,
387 WebRtcVideoDecoderFactory* external_decoder_factory, 389 WebRtcVideoDecoderFactory* external_decoder_factory,
388 bool default_stream, 390 bool default_stream,
389 const std::vector<VideoCodecSettings>& recv_codecs); 391 const std::vector<VideoCodecSettings>& recv_codecs,
392 webrtc::FlexfecConfig flexfec_config);
390 ~WebRtcVideoReceiveStream(); 393 ~WebRtcVideoReceiveStream();
391 394
392 const std::vector<uint32_t>& GetSsrcs() const; 395 const std::vector<uint32_t>& GetSsrcs() const;
393 rtc::Optional<uint32_t> GetFirstPrimarySsrc() const; 396 rtc::Optional<uint32_t> GetFirstPrimarySsrc() const;
394 397
395 void SetLocalSsrc(uint32_t local_ssrc); 398 void SetLocalSsrc(uint32_t local_ssrc);
396 // TODO(deadbeef): Move these feedback parameters into the recv parameters. 399 // TODO(deadbeef): Move these feedback parameters into the recv parameters.
397 void SetFeedbackParameters(bool nack_enabled, 400 void SetFeedbackParameters(bool nack_enabled,
398 bool remb_enabled, 401 bool remb_enabled,
399 bool transport_cc_enabled, 402 bool transport_cc_enabled,
(...skipping 29 matching lines...) Expand all
429 void ClearDecoders(std::vector<AllocatedDecoder>* allocated_decoders); 432 void ClearDecoders(std::vector<AllocatedDecoder>* allocated_decoders);
430 433
431 std::string GetCodecNameFromPayloadType(int payload_type); 434 std::string GetCodecNameFromPayloadType(int payload_type);
432 435
433 webrtc::Call* const call_; 436 webrtc::Call* const call_;
434 StreamParams stream_params_; 437 StreamParams stream_params_;
435 438
436 webrtc::VideoReceiveStream* stream_; 439 webrtc::VideoReceiveStream* stream_;
437 const bool default_stream_; 440 const bool default_stream_;
438 webrtc::VideoReceiveStream::Config config_; 441 webrtc::VideoReceiveStream::Config config_;
442 webrtc::FlexfecConfig flexfec_config_;
443 webrtc::FlexfecReceiveStream* flexfec_stream_;
439 444
440 WebRtcVideoDecoderFactory* const external_decoder_factory_; 445 WebRtcVideoDecoderFactory* const external_decoder_factory_;
441 std::vector<AllocatedDecoder> allocated_decoders_; 446 std::vector<AllocatedDecoder> allocated_decoders_;
442 447
443 rtc::CriticalSection sink_lock_; 448 rtc::CriticalSection sink_lock_;
444 rtc::VideoSinkInterface<webrtc::VideoFrame>* sink_ GUARDED_BY(sink_lock_); 449 rtc::VideoSinkInterface<webrtc::VideoFrame>* sink_ GUARDED_BY(sink_lock_);
445 // Expands remote RTP timestamps to int64_t to be able to estimate how long 450 // Expands remote RTP timestamps to int64_t to be able to estimate how long
446 // the stream has been running. 451 // the stream has been running.
447 rtc::TimestampWrapAroundHandler timestamp_wraparound_handler_ 452 rtc::TimestampWrapAroundHandler timestamp_wraparound_handler_
448 GUARDED_BY(sink_lock_); 453 GUARDED_BY(sink_lock_);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 // send_params/recv_params, rtp_extensions, options, etc. 513 // send_params/recv_params, rtp_extensions, options, etc.
509 VideoSendParameters send_params_; 514 VideoSendParameters send_params_;
510 VideoOptions default_send_options_; 515 VideoOptions default_send_options_;
511 VideoRecvParameters recv_params_; 516 VideoRecvParameters recv_params_;
512 int64_t last_stats_log_ms_; 517 int64_t last_stats_log_ms_;
513 }; 518 };
514 519
515 } // namespace cricket 520 } // namespace cricket
516 521
517 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ 522 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698