| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 | 160 |
| 161 // VideoMediaChannel implementation | 161 // VideoMediaChannel implementation |
| 162 bool SetSendParameters(const VideoSendParameters& params) override; | 162 bool SetSendParameters(const VideoSendParameters& params) override; |
| 163 bool SetRecvParameters(const VideoRecvParameters& params) override; | 163 bool SetRecvParameters(const VideoRecvParameters& params) override; |
| 164 bool GetSendCodec(VideoCodec* send_codec) override; | 164 bool GetSendCodec(VideoCodec* send_codec) override; |
| 165 bool SetSendStreamFormat(uint32_t ssrc, const VideoFormat& format) override; | 165 bool SetSendStreamFormat(uint32_t ssrc, const VideoFormat& format) override; |
| 166 bool SetSend(bool send) override; | 166 bool SetSend(bool send) override; |
| 167 bool SetVideoSend(uint32_t ssrc, | 167 bool SetVideoSend(uint32_t ssrc, |
| 168 bool mute, | 168 bool mute, |
| 169 const VideoOptions* options) override; | 169 const VideoOptions* options) override; |
| 170 rtc::VideoSinkInterface<cricket::VideoFrame>* GetSink(uint32_t ssrc) override; |
| 170 bool AddSendStream(const StreamParams& sp) override; | 171 bool AddSendStream(const StreamParams& sp) override; |
| 171 bool RemoveSendStream(uint32_t ssrc) override; | 172 bool RemoveSendStream(uint32_t ssrc) override; |
| 172 bool AddRecvStream(const StreamParams& sp) override; | 173 bool AddRecvStream(const StreamParams& sp) override; |
| 173 bool AddRecvStream(const StreamParams& sp, bool default_stream); | 174 bool AddRecvStream(const StreamParams& sp, bool default_stream); |
| 174 bool RemoveRecvStream(uint32_t ssrc) override; | 175 bool RemoveRecvStream(uint32_t ssrc) override; |
| 175 bool SetRenderer(uint32_t ssrc, VideoRenderer* renderer) override; | 176 bool SetRenderer(uint32_t ssrc, VideoRenderer* renderer) override; |
| 176 bool GetStats(VideoMediaInfo* info) override; | 177 bool GetStats(VideoMediaInfo* info) override; |
| 177 bool SetCapturer(uint32_t ssrc, VideoCapturer* capturer) override; | 178 bool SetCapturer(uint32_t ssrc, VideoCapturer* capturer) override; |
| 178 bool SendIntraFrame() override; | 179 bool SendIntraFrame() override; |
| 179 bool RequestIntraFrame() override; | 180 bool RequestIntraFrame() override; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 VideoCodec codec; | 227 VideoCodec codec; |
| 227 webrtc::FecConfig fec; | 228 webrtc::FecConfig fec; |
| 228 int rtx_payload_type; | 229 int rtx_payload_type; |
| 229 }; | 230 }; |
| 230 | 231 |
| 231 static std::string CodecSettingsVectorToString( | 232 static std::string CodecSettingsVectorToString( |
| 232 const std::vector<VideoCodecSettings>& codecs); | 233 const std::vector<VideoCodecSettings>& codecs); |
| 233 | 234 |
| 234 // Wrapper for the sender part, this is where the capturer is connected and | 235 // Wrapper for the sender part, this is where the capturer is connected and |
| 235 // frames are then converted from cricket frames to webrtc frames. | 236 // frames are then converted from cricket frames to webrtc frames. |
| 236 class WebRtcVideoSendStream : public sigslot::has_slots<> { | 237 class WebRtcVideoSendStream : |
| 238 public rtc::VideoSinkInterface<cricket::VideoFrame> { |
| 237 public: | 239 public: |
| 238 WebRtcVideoSendStream( | 240 WebRtcVideoSendStream( |
| 239 webrtc::Call* call, | 241 webrtc::Call* call, |
| 240 const StreamParams& sp, | 242 const StreamParams& sp, |
| 241 const webrtc::VideoSendStream::Config& config, | 243 const webrtc::VideoSendStream::Config& config, |
| 242 WebRtcVideoEncoderFactory* external_encoder_factory, | 244 WebRtcVideoEncoderFactory* external_encoder_factory, |
| 243 const VideoOptions& options, | 245 const VideoOptions& options, |
| 244 int max_bitrate_bps, | 246 int max_bitrate_bps, |
| 245 const rtc::Optional<VideoCodecSettings>& codec_settings, | 247 const rtc::Optional<VideoCodecSettings>& codec_settings, |
| 246 const std::vector<webrtc::RtpExtension>& rtp_extensions, | 248 const std::vector<webrtc::RtpExtension>& rtp_extensions, |
| 247 const VideoSendParameters& send_params); | 249 const VideoSendParameters& send_params); |
| 248 ~WebRtcVideoSendStream(); | 250 virtual ~WebRtcVideoSendStream(); |
| 249 | 251 |
| 250 void SetOptions(const VideoOptions& options); | 252 void SetOptions(const VideoOptions& options); |
| 251 void SetCodec(const VideoCodecSettings& codec); | 253 void SetCodec(const VideoCodecSettings& codec); |
| 252 void SetRtpExtensions( | 254 void SetRtpExtensions( |
| 253 const std::vector<webrtc::RtpExtension>& rtp_extensions); | 255 const std::vector<webrtc::RtpExtension>& rtp_extensions); |
| 254 // TODO(deadbeef): Move logic from SetCodec/SetRtpExtensions/etc. | 256 // TODO(deadbeef): Move logic from SetCodec/SetRtpExtensions/etc. |
| 255 // into this method. Currently this method only sets the RTCP mode. | 257 // into this method. Currently this method only sets the RTCP mode. |
| 256 void SetSendParameters(const VideoSendParameters& send_params); | 258 void SetSendParameters(const VideoSendParameters& send_params); |
| 257 | 259 |
| 258 void InputFrame(VideoCapturer* capturer, const VideoFrame* frame); | 260 void OnFrame(const cricket::VideoFrame& frame) override; |
| 259 bool SetCapturer(VideoCapturer* capturer); | 261 bool SetCapturer(VideoCapturer* capturer); |
| 260 bool SetVideoFormat(const VideoFormat& format); | 262 bool SetVideoFormat(const VideoFormat& format); |
| 261 void MuteStream(bool mute); | 263 void MuteStream(bool mute); |
| 262 bool DisconnectCapturer(); | 264 bool DisconnectCapturer(); |
| 263 | 265 |
| 264 void SetApplyRotation(bool apply_rotation); | 266 void SetApplyRotation(bool apply_rotation); |
| 265 | 267 |
| 266 void Start(); | 268 void Start(); |
| 267 void Stop(); | 269 void Stop(); |
| 268 | 270 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 GUARDED_BY(lock_); | 361 GUARDED_BY(lock_); |
| 360 | 362 |
| 361 rtc::CriticalSection lock_; | 363 rtc::CriticalSection lock_; |
| 362 webrtc::VideoSendStream* stream_ GUARDED_BY(lock_); | 364 webrtc::VideoSendStream* stream_ GUARDED_BY(lock_); |
| 363 VideoSendStreamParameters parameters_ GUARDED_BY(lock_); | 365 VideoSendStreamParameters parameters_ GUARDED_BY(lock_); |
| 364 VideoEncoderSettings encoder_settings_ GUARDED_BY(lock_); | 366 VideoEncoderSettings encoder_settings_ GUARDED_BY(lock_); |
| 365 AllocatedEncoder allocated_encoder_ GUARDED_BY(lock_); | 367 AllocatedEncoder allocated_encoder_ GUARDED_BY(lock_); |
| 366 Dimensions last_dimensions_ GUARDED_BY(lock_); | 368 Dimensions last_dimensions_ GUARDED_BY(lock_); |
| 367 | 369 |
| 368 VideoCapturer* capturer_ GUARDED_BY(lock_); | 370 VideoCapturer* capturer_ GUARDED_BY(lock_); |
| 371 // TODO(nisse): Keeping this flag here, caching |
| 372 // capturer_->IsScreencast(), is a temporary hack. The plan is to |
| 373 // move the screencast flag into VideoOptions. |
| 374 bool is_screencast_; |
| 369 bool sending_ GUARDED_BY(lock_); | 375 bool sending_ GUARDED_BY(lock_); |
| 370 bool muted_ GUARDED_BY(lock_); | 376 bool muted_ GUARDED_BY(lock_); |
| 371 VideoFormat format_ GUARDED_BY(lock_); | 377 VideoFormat format_ GUARDED_BY(lock_); |
| 372 int old_adapt_changes_ GUARDED_BY(lock_); | 378 int old_adapt_changes_ GUARDED_BY(lock_); |
| 373 | 379 |
| 374 // The timestamp of the first frame received | 380 // The timestamp of the first frame received |
| 375 // Used to generate the timestamps of subsequent frames | 381 // Used to generate the timestamps of subsequent frames |
| 376 int64_t first_frame_timestamp_ms_ GUARDED_BY(lock_); | 382 int64_t first_frame_timestamp_ms_ GUARDED_BY(lock_); |
| 377 | 383 |
| 378 // The timestamp of the last frame received | 384 // The timestamp of the last frame received |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 VideoOptions options_; | 532 VideoOptions options_; |
| 527 // TODO(deadbeef): Don't duplicate information between | 533 // TODO(deadbeef): Don't duplicate information between |
| 528 // send_params/recv_params, rtp_extensions, options, etc. | 534 // send_params/recv_params, rtp_extensions, options, etc. |
| 529 VideoSendParameters send_params_; | 535 VideoSendParameters send_params_; |
| 530 VideoRecvParameters recv_params_; | 536 VideoRecvParameters recv_params_; |
| 531 }; | 537 }; |
| 532 | 538 |
| 533 } // namespace cricket | 539 } // namespace cricket |
| 534 | 540 |
| 535 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_H_ | 541 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_H_ |
| OLD | NEW |