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

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

Issue 2882433003: Reduce VideoSendStream recreations due to FlexFEC. (Closed)
Patch Set: Created 3 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) 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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 WebRtcVideoSendStream( 243 WebRtcVideoSendStream(
244 webrtc::Call* call, 244 webrtc::Call* call,
245 const StreamParams& sp, 245 const StreamParams& sp,
246 webrtc::VideoSendStream::Config config, 246 webrtc::VideoSendStream::Config config,
247 const VideoOptions& options, 247 const VideoOptions& options,
248 WebRtcVideoEncoderFactory* external_encoder_factory, 248 WebRtcVideoEncoderFactory* external_encoder_factory,
249 bool enable_cpu_overuse_detection, 249 bool enable_cpu_overuse_detection,
250 int max_bitrate_bps, 250 int max_bitrate_bps,
251 const rtc::Optional<VideoCodecSettings>& codec_settings, 251 const rtc::Optional<VideoCodecSettings>& codec_settings,
252 const rtc::Optional<std::vector<webrtc::RtpExtension>>& rtp_extensions, 252 const rtc::Optional<std::vector<webrtc::RtpExtension>>& rtp_extensions,
253 const VideoSendParameters& send_params); 253 const VideoSendParameters& send_params,
254 bool map_flexfec_send);
254 virtual ~WebRtcVideoSendStream(); 255 virtual ~WebRtcVideoSendStream();
255 256
256 void SetSendParameters(const ChangedSendParameters& send_params); 257 void SetSendParameters(const ChangedSendParameters& send_params);
257 bool SetRtpParameters(const webrtc::RtpParameters& parameters); 258 bool SetRtpParameters(const webrtc::RtpParameters& parameters);
258 webrtc::RtpParameters GetRtpParameters() const; 259 webrtc::RtpParameters GetRtpParameters() const;
259 260
260 // Implements rtc::VideoSourceInterface<webrtc::VideoFrame>. 261 // Implements rtc::VideoSourceInterface<webrtc::VideoFrame>.
261 // WebRtcVideoSendStream acts as a source to the webrtc::VideoSendStream 262 // WebRtcVideoSendStream acts as a source to the webrtc::VideoSendStream
262 // in |stream_|. This is done to proxy VideoSinkWants from the encoder to 263 // in |stream_|. This is done to proxy VideoSinkWants from the encoder to
263 // the worker thread. 264 // the worker thread.
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 int64_t estimated_remote_start_ntp_time_ms_ GUARDED_BY(sink_lock_); 446 int64_t estimated_remote_start_ntp_time_ms_ GUARDED_BY(sink_lock_);
446 }; 447 };
447 448
448 void Construct(webrtc::Call* call, WebRtcVideoEngine2* engine); 449 void Construct(webrtc::Call* call, WebRtcVideoEngine2* engine);
449 450
450 bool SendRtp(const uint8_t* data, 451 bool SendRtp(const uint8_t* data,
451 size_t len, 452 size_t len,
452 const webrtc::PacketOptions& options) override; 453 const webrtc::PacketOptions& options) override;
453 bool SendRtcp(const uint8_t* data, size_t len) override; 454 bool SendRtcp(const uint8_t* data, size_t len) override;
454 455
456 // If |map_flexfec| is true, any "flexfec-03" codec payload type will be
perkj_webrtc 2017/05/12 08:37:23 /s types
brandtr 2017/05/12 09:04:33 There should never be multiple FlexFEC payload typ
457 // attached to the VideoCodecSettings of the media codecs.
455 static std::vector<VideoCodecSettings> MapCodecs( 458 static std::vector<VideoCodecSettings> MapCodecs(
456 const std::vector<VideoCodec>& codecs); 459 const std::vector<VideoCodec>& codecs,
460 bool map_flexfec);
457 // Select what video codec will be used for sending, i.e. what codec is used 461 // Select what video codec will be used for sending, i.e. what codec is used
458 // for local encoding, based on supported remote codecs. The first remote 462 // for local encoding, based on supported remote codecs. The first remote
459 // codec that is supported locally will be selected. 463 // codec that is supported locally will be selected.
460 rtc::Optional<VideoCodecSettings> SelectSendVideoCodec( 464 rtc::Optional<VideoCodecSettings> SelectSendVideoCodec(
461 const std::vector<VideoCodecSettings>& remote_mapped_codecs) const; 465 const std::vector<VideoCodecSettings>& remote_mapped_codecs) const;
462 466
463 static bool ReceiveCodecsHaveChanged(std::vector<VideoCodecSettings> before, 467 static bool ReceiveCodecsHaveChanged(std::vector<VideoCodecSettings> before,
464 std::vector<VideoCodecSettings> after); 468 std::vector<VideoCodecSettings> after);
465 469
466 void FillSenderStats(VideoMediaInfo* info, bool log_stats); 470 void FillSenderStats(VideoMediaInfo* info, bool log_stats);
(...skipping 29 matching lines...) Expand all
496 WebRtcVideoDecoderFactory* const external_decoder_factory_; 500 WebRtcVideoDecoderFactory* const external_decoder_factory_;
497 std::vector<VideoCodecSettings> recv_codecs_; 501 std::vector<VideoCodecSettings> recv_codecs_;
498 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; 502 std::vector<webrtc::RtpExtension> recv_rtp_extensions_;
499 webrtc::Call::Config::BitrateConfig bitrate_config_; 503 webrtc::Call::Config::BitrateConfig bitrate_config_;
500 // TODO(deadbeef): Don't duplicate information between 504 // TODO(deadbeef): Don't duplicate information between
501 // send_params/recv_params, rtp_extensions, options, etc. 505 // send_params/recv_params, rtp_extensions, options, etc.
502 VideoSendParameters send_params_; 506 VideoSendParameters send_params_;
503 VideoOptions default_send_options_; 507 VideoOptions default_send_options_;
504 VideoRecvParameters recv_params_; 508 VideoRecvParameters recv_params_;
505 int64_t last_stats_log_ms_; 509 int64_t last_stats_log_ms_;
510
511 const bool map_flexfec_recv_;
512 const bool map_flexfec_send_;
506 }; 513 };
507 514
508 } // namespace cricket 515 } // namespace cricket
509 516
510 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ 517 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/media/engine/webrtcvideoengine2.cc » ('j') | webrtc/media/engine/webrtcvideoengine2.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698