| OLD | NEW |
| 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 |
| 11 #ifndef WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ | 11 #ifndef WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ |
| 12 #define WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ | 12 #define WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ |
| 13 | 13 |
| 14 #include <map> | 14 #include <map> |
| 15 #include <memory> | 15 #include <memory> |
| 16 #include <set> | 16 #include <set> |
| 17 #include <string> | 17 #include <string> |
| 18 #include <vector> | 18 #include <vector> |
| 19 | 19 |
| 20 #include "webrtc/api/call/transport.h" | 20 #include "webrtc/api/call/transport.h" |
| 21 #include "webrtc/api/video/video_frame.h" | 21 #include "webrtc/api/video/video_frame.h" |
| 22 #include "webrtc/base/asyncinvoker.h" | 22 #include "webrtc/base/asyncinvoker.h" |
| 23 #include "webrtc/base/criticalsection.h" | 23 #include "webrtc/base/criticalsection.h" |
| 24 #include "webrtc/base/networkroute.h" | 24 #include "webrtc/base/networkroute.h" |
| 25 #include "webrtc/base/thread_annotations.h" | 25 #include "webrtc/base/thread_annotations.h" |
| 26 #include "webrtc/base/thread_checker.h" | 26 #include "webrtc/base/thread_checker.h" |
| 27 #include "webrtc/media/base/videosinkinterface.h" | 27 #include "webrtc/media/base/videosinkinterface.h" |
| 28 #include "webrtc/media/base/videosourceinterface.h" | 28 #include "webrtc/media/base/videosourceinterface.h" |
| 29 #include "webrtc/call/call.h" | 29 #include "webrtc/call/call.h" |
| 30 #include "webrtc/call/flexfec_receive_stream.h" |
| 30 #include "webrtc/media/base/mediaengine.h" | 31 #include "webrtc/media/base/mediaengine.h" |
| 31 #include "webrtc/media/engine/webrtcvideodecoderfactory.h" | 32 #include "webrtc/media/engine/webrtcvideodecoderfactory.h" |
| 32 #include "webrtc/media/engine/webrtcvideoencoderfactory.h" | 33 #include "webrtc/media/engine/webrtcvideoencoderfactory.h" |
| 33 #include "webrtc/video_receive_stream.h" | 34 #include "webrtc/video_receive_stream.h" |
| 34 #include "webrtc/video_send_stream.h" | 35 #include "webrtc/video_send_stream.h" |
| 35 | 36 |
| 36 namespace webrtc { | 37 namespace webrtc { |
| 37 class VideoDecoder; | 38 class VideoDecoder; |
| 38 class VideoEncoder; | 39 class VideoEncoder; |
| 39 struct MediaConfig; | 40 struct MediaConfig; |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 rtc::Optional<std::vector<webrtc::RtpExtension>> rtp_header_extensions; | 212 rtc::Optional<std::vector<webrtc::RtpExtension>> rtp_header_extensions; |
| 212 }; | 213 }; |
| 213 | 214 |
| 214 bool GetChangedSendParameters(const VideoSendParameters& params, | 215 bool GetChangedSendParameters(const VideoSendParameters& params, |
| 215 ChangedSendParameters* changed_params) const; | 216 ChangedSendParameters* changed_params) const; |
| 216 bool GetChangedRecvParameters(const VideoRecvParameters& params, | 217 bool GetChangedRecvParameters(const VideoRecvParameters& params, |
| 217 ChangedRecvParameters* changed_params) const; | 218 ChangedRecvParameters* changed_params) const; |
| 218 | 219 |
| 219 void SetMaxSendBandwidth(int bps); | 220 void SetMaxSendBandwidth(int bps); |
| 220 | 221 |
| 221 void ConfigureReceiverRtp(webrtc::VideoReceiveStream::Config* config, | 222 void ConfigureReceiverRtp( |
| 222 webrtc::FlexfecConfig* flexfec_config, | 223 webrtc::VideoReceiveStream::Config* config, |
| 223 const StreamParams& sp) const; | 224 webrtc::FlexfecReceiveStream::Config* flexfec_config, |
| 225 const StreamParams& sp) const; |
| 224 bool ValidateSendSsrcAvailability(const StreamParams& sp) const | 226 bool ValidateSendSsrcAvailability(const StreamParams& sp) const |
| 225 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_); | 227 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_); |
| 226 bool ValidateReceiveSsrcAvailability(const StreamParams& sp) const | 228 bool ValidateReceiveSsrcAvailability(const StreamParams& sp) const |
| 227 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_); | 229 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_); |
| 228 void DeleteReceiveStream(WebRtcVideoReceiveStream* stream) | 230 void DeleteReceiveStream(WebRtcVideoReceiveStream* stream) |
| 229 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_); | 231 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_); |
| 230 | 232 |
| 231 static std::string CodecSettingsVectorToString( | 233 static std::string CodecSettingsVectorToString( |
| 232 const std::vector<VideoCodecSettings>& codecs); | 234 const std::vector<VideoCodecSettings>& codecs); |
| 233 | 235 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 class WebRtcVideoReceiveStream | 379 class WebRtcVideoReceiveStream |
| 378 : public rtc::VideoSinkInterface<webrtc::VideoFrame> { | 380 : public rtc::VideoSinkInterface<webrtc::VideoFrame> { |
| 379 public: | 381 public: |
| 380 WebRtcVideoReceiveStream( | 382 WebRtcVideoReceiveStream( |
| 381 webrtc::Call* call, | 383 webrtc::Call* call, |
| 382 const StreamParams& sp, | 384 const StreamParams& sp, |
| 383 webrtc::VideoReceiveStream::Config config, | 385 webrtc::VideoReceiveStream::Config config, |
| 384 WebRtcVideoDecoderFactory* external_decoder_factory, | 386 WebRtcVideoDecoderFactory* external_decoder_factory, |
| 385 bool default_stream, | 387 bool default_stream, |
| 386 const std::vector<VideoCodecSettings>& recv_codecs, | 388 const std::vector<VideoCodecSettings>& recv_codecs, |
| 387 const webrtc::FlexfecConfig& flexfec_config); | 389 const webrtc::FlexfecReceiveStream::Config& flexfec_config); |
| 388 ~WebRtcVideoReceiveStream(); | 390 ~WebRtcVideoReceiveStream(); |
| 389 | 391 |
| 390 const std::vector<uint32_t>& GetSsrcs() const; | 392 const std::vector<uint32_t>& GetSsrcs() const; |
| 391 rtc::Optional<uint32_t> GetFirstPrimarySsrc() const; | 393 rtc::Optional<uint32_t> GetFirstPrimarySsrc() const; |
| 392 | 394 |
| 393 void SetLocalSsrc(uint32_t local_ssrc); | 395 void SetLocalSsrc(uint32_t local_ssrc); |
| 394 // TODO(deadbeef): Move these feedback parameters into the recv parameters. | 396 // TODO(deadbeef): Move these feedback parameters into the recv parameters. |
| 395 void SetFeedbackParameters(bool nack_enabled, | 397 void SetFeedbackParameters(bool nack_enabled, |
| 396 bool remb_enabled, | 398 bool remb_enabled, |
| 397 bool transport_cc_enabled, | 399 bool transport_cc_enabled, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 | 432 |
| 431 webrtc::Call* const call_; | 433 webrtc::Call* const call_; |
| 432 StreamParams stream_params_; | 434 StreamParams stream_params_; |
| 433 | 435 |
| 434 // Both |stream_| and |flexfec_stream_| are managed by |this|. They are | 436 // Both |stream_| and |flexfec_stream_| are managed by |this|. They are |
| 435 // destroyed by calling call_->DestroyVideoReceiveStream and | 437 // destroyed by calling call_->DestroyVideoReceiveStream and |
| 436 // call_->DestroyFlexfecReceiveStream, respectively. | 438 // call_->DestroyFlexfecReceiveStream, respectively. |
| 437 webrtc::VideoReceiveStream* stream_; | 439 webrtc::VideoReceiveStream* stream_; |
| 438 const bool default_stream_; | 440 const bool default_stream_; |
| 439 webrtc::VideoReceiveStream::Config config_; | 441 webrtc::VideoReceiveStream::Config config_; |
| 440 webrtc::FlexfecConfig flexfec_config_; | 442 webrtc::FlexfecReceiveStream::Config flexfec_config_; |
| 441 webrtc::FlexfecReceiveStream* flexfec_stream_; | 443 webrtc::FlexfecReceiveStream* flexfec_stream_; |
| 442 | 444 |
| 443 WebRtcVideoDecoderFactory* const external_decoder_factory_; | 445 WebRtcVideoDecoderFactory* const external_decoder_factory_; |
| 444 std::vector<AllocatedDecoder> allocated_decoders_; | 446 std::vector<AllocatedDecoder> allocated_decoders_; |
| 445 | 447 |
| 446 rtc::CriticalSection sink_lock_; | 448 rtc::CriticalSection sink_lock_; |
| 447 rtc::VideoSinkInterface<webrtc::VideoFrame>* sink_ GUARDED_BY(sink_lock_); | 449 rtc::VideoSinkInterface<webrtc::VideoFrame>* sink_ GUARDED_BY(sink_lock_); |
| 448 // 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 |
| 449 // the stream has been running. | 451 // the stream has been running. |
| 450 rtc::TimestampWrapAroundHandler timestamp_wraparound_handler_ | 452 rtc::TimestampWrapAroundHandler timestamp_wraparound_handler_ |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 // send_params/recv_params, rtp_extensions, options, etc. | 513 // send_params/recv_params, rtp_extensions, options, etc. |
| 512 VideoSendParameters send_params_; | 514 VideoSendParameters send_params_; |
| 513 VideoOptions default_send_options_; | 515 VideoOptions default_send_options_; |
| 514 VideoRecvParameters recv_params_; | 516 VideoRecvParameters recv_params_; |
| 515 int64_t last_stats_log_ms_; | 517 int64_t last_stats_log_ms_; |
| 516 }; | 518 }; |
| 517 | 519 |
| 518 } // namespace cricket | 520 } // namespace cricket |
| 519 | 521 |
| 520 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ | 522 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ |
| OLD | NEW |