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

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

Issue 1655793003: Make cricket::VideoCapturer implement VideoSourceInterface (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixed Android Created 4 years, 10 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 * 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 11 matching lines...) Expand all
22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28 #ifndef TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_H_ 28 #ifndef TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_H_
29 #define TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_H_ 29 #define TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_H_
30 30
31 #include <map> 31 #include <map>
32 #include <set>
32 #include <string> 33 #include <string>
33 #include <vector> 34 #include <vector>
34 35
35 #include "talk/media/base/mediaengine.h" 36 #include "talk/media/base/mediaengine.h"
36 #include "talk/media/webrtc/webrtcvideochannelfactory.h" 37 #include "talk/media/webrtc/webrtcvideochannelfactory.h"
37 #include "talk/media/webrtc/webrtcvideodecoderfactory.h" 38 #include "talk/media/webrtc/webrtcvideodecoderfactory.h"
38 #include "talk/media/webrtc/webrtcvideoencoderfactory.h" 39 #include "talk/media/webrtc/webrtcvideoencoderfactory.h"
39 #include "webrtc/base/criticalsection.h" 40 #include "webrtc/base/criticalsection.h"
40 #include "webrtc/base/scoped_ptr.h" 41 #include "webrtc/base/scoped_ptr.h"
41 #include "webrtc/base/thread_annotations.h" 42 #include "webrtc/base/thread_annotations.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 bool ValidateReceiveSsrcAvailability(const StreamParams& sp) const 241 bool ValidateReceiveSsrcAvailability(const StreamParams& sp) const
241 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_); 242 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_);
242 void DeleteReceiveStream(WebRtcVideoReceiveStream* stream) 243 void DeleteReceiveStream(WebRtcVideoReceiveStream* stream)
243 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_); 244 EXCLUSIVE_LOCKS_REQUIRED(stream_crit_);
244 245
245 static std::string CodecSettingsVectorToString( 246 static std::string CodecSettingsVectorToString(
246 const std::vector<VideoCodecSettings>& codecs); 247 const std::vector<VideoCodecSettings>& codecs);
247 248
248 // Wrapper for the sender part, this is where the capturer is connected and 249 // Wrapper for the sender part, this is where the capturer is connected and
249 // frames are then converted from cricket frames to webrtc frames. 250 // frames are then converted from cricket frames to webrtc frames.
250 class WebRtcVideoSendStream : public sigslot::has_slots<> { 251 class WebRtcVideoSendStream
252 : public rtc::VideoSinkInterface<cricket::VideoFrame> {
251 public: 253 public:
252 WebRtcVideoSendStream( 254 WebRtcVideoSendStream(
253 webrtc::Call* call, 255 webrtc::Call* call,
254 const StreamParams& sp, 256 const StreamParams& sp,
255 const webrtc::VideoSendStream::Config& config, 257 const webrtc::VideoSendStream::Config& config,
256 WebRtcVideoEncoderFactory* external_encoder_factory, 258 WebRtcVideoEncoderFactory* external_encoder_factory,
257 const VideoOptions& options, 259 const VideoOptions& options,
258 int max_bitrate_bps, 260 int max_bitrate_bps,
259 const rtc::Optional<VideoCodecSettings>& codec_settings, 261 const rtc::Optional<VideoCodecSettings>& codec_settings,
260 const std::vector<webrtc::RtpExtension>& rtp_extensions, 262 const std::vector<webrtc::RtpExtension>& rtp_extensions,
261 const VideoSendParameters& send_params); 263 const VideoSendParameters& send_params);
262 ~WebRtcVideoSendStream(); 264 virtual ~WebRtcVideoSendStream();
263 265
264 void SetOptions(const VideoOptions& options); 266 void SetOptions(const VideoOptions& options);
265 // TODO(pbos): Move logic from SetOptions into this method. 267 // TODO(pbos): Move logic from SetOptions into this method.
266 void SetSendParameters(const ChangedSendParameters& send_params); 268 void SetSendParameters(const ChangedSendParameters& send_params);
267 269
268 void InputFrame(VideoCapturer* capturer, const VideoFrame* frame); 270 void OnFrame(const cricket::VideoFrame& frame) override;
269 bool SetCapturer(VideoCapturer* capturer); 271 bool SetCapturer(VideoCapturer* capturer);
270 bool SetVideoFormat(const VideoFormat& format); 272 bool SetVideoFormat(const VideoFormat& format);
271 void MuteStream(bool mute); 273 void MuteStream(bool mute);
272 bool DisconnectCapturer(); 274 bool DisconnectCapturer();
273 275
274 void Start(); 276 void Start();
275 void Stop(); 277 void Stop();
276 278
277 const std::vector<uint32_t>& GetSsrcs() const; 279 const std::vector<uint32_t>& GetSsrcs() const;
278 VideoSenderInfo GetVideoSenderInfo(); 280 VideoSenderInfo GetVideoSenderInfo();
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 369
368 rtc::CriticalSection lock_; 370 rtc::CriticalSection lock_;
369 webrtc::VideoSendStream* stream_ GUARDED_BY(lock_); 371 webrtc::VideoSendStream* stream_ GUARDED_BY(lock_);
370 VideoSendStreamParameters parameters_ GUARDED_BY(lock_); 372 VideoSendStreamParameters parameters_ GUARDED_BY(lock_);
371 bool pending_encoder_reconfiguration_ GUARDED_BY(lock_); 373 bool pending_encoder_reconfiguration_ GUARDED_BY(lock_);
372 VideoEncoderSettings encoder_settings_ GUARDED_BY(lock_); 374 VideoEncoderSettings encoder_settings_ GUARDED_BY(lock_);
373 AllocatedEncoder allocated_encoder_ GUARDED_BY(lock_); 375 AllocatedEncoder allocated_encoder_ GUARDED_BY(lock_);
374 Dimensions last_dimensions_ GUARDED_BY(lock_); 376 Dimensions last_dimensions_ GUARDED_BY(lock_);
375 377
376 VideoCapturer* capturer_ GUARDED_BY(lock_); 378 VideoCapturer* capturer_ GUARDED_BY(lock_);
379 rtc::VideoSinkCapabilities sink_capabilities_ GUARDED_BY(lock_);
377 bool sending_ GUARDED_BY(lock_); 380 bool sending_ GUARDED_BY(lock_);
378 bool muted_ GUARDED_BY(lock_); 381 bool muted_ GUARDED_BY(lock_);
379 VideoFormat format_ GUARDED_BY(lock_); 382 VideoFormat format_ GUARDED_BY(lock_);
380 int old_adapt_changes_ GUARDED_BY(lock_); 383 int old_adapt_changes_ GUARDED_BY(lock_);
381 384
382 // The timestamp of the first frame received 385 // The timestamp of the first frame received
383 // Used to generate the timestamps of subsequent frames 386 // Used to generate the timestamps of subsequent frames
384 int64_t first_frame_timestamp_ms_ GUARDED_BY(lock_); 387 int64_t first_frame_timestamp_ms_ GUARDED_BY(lock_);
385 388
386 // The timestamp of the last frame received 389 // The timestamp of the last frame received
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 VideoOptions options_; 535 VideoOptions options_;
533 // TODO(deadbeef): Don't duplicate information between 536 // TODO(deadbeef): Don't duplicate information between
534 // send_params/recv_params, rtp_extensions, options, etc. 537 // send_params/recv_params, rtp_extensions, options, etc.
535 VideoSendParameters send_params_; 538 VideoSendParameters send_params_;
536 VideoRecvParameters recv_params_; 539 VideoRecvParameters recv_params_;
537 }; 540 };
538 541
539 } // namespace cricket 542 } // namespace cricket
540 543
541 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_H_ 544 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698