OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 bool GetRenderer(uint32_t ssrc, VideoRenderer** renderer); | 196 bool GetRenderer(uint32_t ssrc, VideoRenderer** renderer); |
197 | 197 |
198 private: | 198 private: |
199 bool MuteStream(uint32_t ssrc, bool mute); | 199 bool MuteStream(uint32_t ssrc, bool mute); |
200 class WebRtcVideoReceiveStream; | 200 class WebRtcVideoReceiveStream; |
201 | 201 |
202 bool SetSendCodecs(const std::vector<VideoCodec>& codecs); | 202 bool SetSendCodecs(const std::vector<VideoCodec>& codecs); |
203 bool SetSendRtpHeaderExtensions( | 203 bool SetSendRtpHeaderExtensions( |
204 const std::vector<RtpHeaderExtension>& extensions); | 204 const std::vector<RtpHeaderExtension>& extensions); |
205 bool SetMaxSendBandwidth(int bps); | 205 bool SetMaxSendBandwidth(int bps); |
206 bool SetOptions(const VideoOptions& options); | 206 void SetSharedOptions(const VideoOptions& options); |
| 207 bool SetOptions(uint32_t ssrc, const VideoOptions& options); |
207 bool SetRecvCodecs(const std::vector<VideoCodec>& codecs); | 208 bool SetRecvCodecs(const std::vector<VideoCodec>& codecs); |
208 bool SetRecvRtpHeaderExtensions( | 209 bool SetRecvRtpHeaderExtensions( |
209 const std::vector<RtpHeaderExtension>& extensions); | 210 const std::vector<RtpHeaderExtension>& extensions); |
210 | 211 |
211 void ConfigureReceiverRtp(webrtc::VideoReceiveStream::Config* config, | 212 void ConfigureReceiverRtp(webrtc::VideoReceiveStream::Config* config, |
212 const StreamParams& sp) const; | 213 const StreamParams& sp) const; |
213 bool CodecIsExternallySupported(const std::string& name) const; | 214 bool CodecIsExternallySupported(const std::string& name) const; |
214 bool ValidateSendSsrcAvailability(const StreamParams& sp) const | 215 bool ValidateSendSsrcAvailability(const StreamParams& sp) const |
215 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_); | 216 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_); |
216 bool ValidateReceiveSsrcAvailability(const StreamParams& sp) const | 217 bool ValidateReceiveSsrcAvailability(const StreamParams& sp) const |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 // the stream has been running. | 462 // the stream has been running. |
462 rtc::TimestampWrapAroundHandler timestamp_wraparound_handler_ | 463 rtc::TimestampWrapAroundHandler timestamp_wraparound_handler_ |
463 GUARDED_BY(renderer_lock_); | 464 GUARDED_BY(renderer_lock_); |
464 int64_t first_frame_timestamp_ GUARDED_BY(renderer_lock_); | 465 int64_t first_frame_timestamp_ GUARDED_BY(renderer_lock_); |
465 // Start NTP time is estimated as current remote NTP time (estimated from | 466 // Start NTP time is estimated as current remote NTP time (estimated from |
466 // RTCP) minus the elapsed time, as soon as remote NTP time is available. | 467 // RTCP) minus the elapsed time, as soon as remote NTP time is available. |
467 int64_t estimated_remote_start_ntp_time_ms_ GUARDED_BY(renderer_lock_); | 468 int64_t estimated_remote_start_ntp_time_ms_ GUARDED_BY(renderer_lock_); |
468 }; | 469 }; |
469 | 470 |
470 void Construct(webrtc::Call* call, WebRtcVideoEngine2* engine); | 471 void Construct(webrtc::Call* call, WebRtcVideoEngine2* engine); |
471 void SetDefaultOptions(); | 472 static void SetDefaultOptions(VideoOptions *options); |
472 | 473 |
473 bool SendRtp(const uint8_t* data, | 474 bool SendRtp(const uint8_t* data, |
474 size_t len, | 475 size_t len, |
475 const webrtc::PacketOptions& options) override; | 476 const webrtc::PacketOptions& options) override; |
476 bool SendRtcp(const uint8_t* data, size_t len) override; | 477 bool SendRtcp(const uint8_t* data, size_t len) override; |
477 | 478 |
478 void StartAllSendStreams(); | 479 void StartAllSendStreams(); |
479 void StopAllSendStreams(); | 480 void StopAllSendStreams(); |
480 | 481 |
481 static std::vector<VideoCodecSettings> MapCodecs( | 482 static std::vector<VideoCodecSettings> MapCodecs( |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 std::set<uint32_t> receive_ssrcs_ GUARDED_BY(stream_crit_); | 519 std::set<uint32_t> receive_ssrcs_ GUARDED_BY(stream_crit_); |
519 | 520 |
520 rtc::Optional<VideoCodecSettings> send_codec_; | 521 rtc::Optional<VideoCodecSettings> send_codec_; |
521 std::vector<webrtc::RtpExtension> send_rtp_extensions_; | 522 std::vector<webrtc::RtpExtension> send_rtp_extensions_; |
522 | 523 |
523 WebRtcVideoEncoderFactory* const external_encoder_factory_; | 524 WebRtcVideoEncoderFactory* const external_encoder_factory_; |
524 WebRtcVideoDecoderFactory* const external_decoder_factory_; | 525 WebRtcVideoDecoderFactory* const external_decoder_factory_; |
525 std::vector<VideoCodecSettings> recv_codecs_; | 526 std::vector<VideoCodecSettings> recv_codecs_; |
526 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; | 527 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; |
527 webrtc::Call::Config::BitrateConfig bitrate_config_; | 528 webrtc::Call::Config::BitrateConfig bitrate_config_; |
528 VideoOptions options_; | |
529 // TODO(deadbeef): Don't duplicate information between | 529 // TODO(deadbeef): Don't duplicate information between |
530 // send_params/recv_params, rtp_extensions, options, etc. | 530 // send_params/recv_params, rtp_extensions, options, etc. |
531 VideoSendParameters send_params_; | 531 VideoSendParameters send_params_; |
532 VideoRecvParameters recv_params_; | 532 VideoRecvParameters recv_params_; |
533 }; | 533 }; |
534 | 534 |
535 } // namespace cricket | 535 } // namespace cricket |
536 | 536 |
537 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_H_ | 537 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_H_ |
OLD | NEW |