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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 // frames are then converted from cricket frames to webrtc frames. | 243 // frames are then converted from cricket frames to webrtc frames. |
244 class WebRtcVideoSendStream : public sigslot::has_slots<> { | 244 class WebRtcVideoSendStream : public sigslot::has_slots<> { |
245 public: | 245 public: |
246 WebRtcVideoSendStream( | 246 WebRtcVideoSendStream( |
247 webrtc::Call* call, | 247 webrtc::Call* call, |
248 const StreamParams& sp, | 248 const StreamParams& sp, |
249 const webrtc::VideoSendStream::Config& config, | 249 const webrtc::VideoSendStream::Config& config, |
250 WebRtcVideoEncoderFactory* external_encoder_factory, | 250 WebRtcVideoEncoderFactory* external_encoder_factory, |
251 const VideoOptions& options, | 251 const VideoOptions& options, |
252 int max_bitrate_bps, | 252 int max_bitrate_bps, |
253 const Settable<VideoCodecSettings>& codec_settings, | 253 const rtc::Maybe<VideoCodecSettings>& codec_settings, |
254 const std::vector<webrtc::RtpExtension>& rtp_extensions); | 254 const std::vector<webrtc::RtpExtension>& rtp_extensions); |
255 ~WebRtcVideoSendStream(); | 255 ~WebRtcVideoSendStream(); |
256 | 256 |
257 void SetOptions(const VideoOptions& options); | 257 void SetOptions(const VideoOptions& options); |
258 void SetCodec(const VideoCodecSettings& codec); | 258 void SetCodec(const VideoCodecSettings& codec); |
259 void SetRtpExtensions( | 259 void SetRtpExtensions( |
260 const std::vector<webrtc::RtpExtension>& rtp_extensions); | 260 const std::vector<webrtc::RtpExtension>& rtp_extensions); |
261 | 261 |
262 void InputFrame(VideoCapturer* capturer, const VideoFrame* frame); | 262 void InputFrame(VideoCapturer* capturer, const VideoFrame* frame); |
263 bool SetCapturer(VideoCapturer* capturer); | 263 bool SetCapturer(VideoCapturer* capturer); |
(...skipping 15 matching lines...) Expand all Loading... |
279 private: | 279 private: |
280 // Parameters needed to reconstruct the underlying stream. | 280 // Parameters needed to reconstruct the underlying stream. |
281 // webrtc::VideoSendStream doesn't support setting a lot of options on the | 281 // webrtc::VideoSendStream doesn't support setting a lot of options on the |
282 // fly, so when those need to be changed we tear down and reconstruct with | 282 // fly, so when those need to be changed we tear down and reconstruct with |
283 // similar parameters depending on which options changed etc. | 283 // similar parameters depending on which options changed etc. |
284 struct VideoSendStreamParameters { | 284 struct VideoSendStreamParameters { |
285 VideoSendStreamParameters( | 285 VideoSendStreamParameters( |
286 const webrtc::VideoSendStream::Config& config, | 286 const webrtc::VideoSendStream::Config& config, |
287 const VideoOptions& options, | 287 const VideoOptions& options, |
288 int max_bitrate_bps, | 288 int max_bitrate_bps, |
289 const Settable<VideoCodecSettings>& codec_settings); | 289 const rtc::Maybe<VideoCodecSettings>& codec_settings); |
290 webrtc::VideoSendStream::Config config; | 290 webrtc::VideoSendStream::Config config; |
291 VideoOptions options; | 291 VideoOptions options; |
292 int max_bitrate_bps; | 292 int max_bitrate_bps; |
293 Settable<VideoCodecSettings> codec_settings; | 293 rtc::Maybe<VideoCodecSettings> codec_settings; |
294 // Sent resolutions + bitrates etc. by the underlying VideoSendStream, | 294 // Sent resolutions + bitrates etc. by the underlying VideoSendStream, |
295 // typically changes when setting a new resolution or reconfiguring | 295 // typically changes when setting a new resolution or reconfiguring |
296 // bitrates. | 296 // bitrates. |
297 webrtc::VideoEncoderConfig encoder_config; | 297 webrtc::VideoEncoderConfig encoder_config; |
298 }; | 298 }; |
299 | 299 |
300 struct AllocatedEncoder { | 300 struct AllocatedEncoder { |
301 AllocatedEncoder(webrtc::VideoEncoder* encoder, | 301 AllocatedEncoder(webrtc::VideoEncoder* encoder, |
302 webrtc::VideoCodecType type, | 302 webrtc::VideoCodecType type, |
303 bool external); | 303 bool external); |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 | 505 |
506 rtc::CriticalSection stream_crit_; | 506 rtc::CriticalSection stream_crit_; |
507 // Using primary-ssrc (first ssrc) as key. | 507 // Using primary-ssrc (first ssrc) as key. |
508 std::map<uint32_t, WebRtcVideoSendStream*> send_streams_ | 508 std::map<uint32_t, WebRtcVideoSendStream*> send_streams_ |
509 GUARDED_BY(stream_crit_); | 509 GUARDED_BY(stream_crit_); |
510 std::map<uint32_t, WebRtcVideoReceiveStream*> receive_streams_ | 510 std::map<uint32_t, WebRtcVideoReceiveStream*> receive_streams_ |
511 GUARDED_BY(stream_crit_); | 511 GUARDED_BY(stream_crit_); |
512 std::set<uint32_t> send_ssrcs_ GUARDED_BY(stream_crit_); | 512 std::set<uint32_t> send_ssrcs_ GUARDED_BY(stream_crit_); |
513 std::set<uint32_t> receive_ssrcs_ GUARDED_BY(stream_crit_); | 513 std::set<uint32_t> receive_ssrcs_ GUARDED_BY(stream_crit_); |
514 | 514 |
515 Settable<VideoCodecSettings> send_codec_; | 515 rtc::Maybe<VideoCodecSettings> send_codec_; |
516 std::vector<webrtc::RtpExtension> send_rtp_extensions_; | 516 std::vector<webrtc::RtpExtension> send_rtp_extensions_; |
517 | 517 |
518 WebRtcVideoEncoderFactory* const external_encoder_factory_; | 518 WebRtcVideoEncoderFactory* const external_encoder_factory_; |
519 WebRtcVideoDecoderFactory* const external_decoder_factory_; | 519 WebRtcVideoDecoderFactory* const external_decoder_factory_; |
520 std::vector<VideoCodecSettings> recv_codecs_; | 520 std::vector<VideoCodecSettings> recv_codecs_; |
521 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; | 521 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; |
522 webrtc::Call::Config::BitrateConfig bitrate_config_; | 522 webrtc::Call::Config::BitrateConfig bitrate_config_; |
523 VideoOptions options_; | 523 VideoOptions options_; |
524 }; | 524 }; |
525 | 525 |
526 } // namespace cricket | 526 } // namespace cricket |
527 | 527 |
528 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_H_ | 528 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_H_ |
OLD | NEW |