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

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

Issue 1670153003: Introduce struct MediaConfig, with construction-time settings. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed test nit; use reference. 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
« no previous file with comments | « webrtc/media/engine/nullwebrtcvideoengine.h ('k') | webrtc/media/engine/webrtcvideoengine2.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
(...skipping 16 matching lines...) Expand all
27 #include "webrtc/media/engine/webrtcvideoencoderfactory.h" 27 #include "webrtc/media/engine/webrtcvideoencoderfactory.h"
28 #include "webrtc/transport.h" 28 #include "webrtc/transport.h"
29 #include "webrtc/video_frame.h" 29 #include "webrtc/video_frame.h"
30 #include "webrtc/video_receive_stream.h" 30 #include "webrtc/video_receive_stream.h"
31 #include "webrtc/video_renderer.h" 31 #include "webrtc/video_renderer.h"
32 #include "webrtc/video_send_stream.h" 32 #include "webrtc/video_send_stream.h"
33 33
34 namespace webrtc { 34 namespace webrtc {
35 class VideoDecoder; 35 class VideoDecoder;
36 class VideoEncoder; 36 class VideoEncoder;
37 struct MediaConfig;
37 } 38 }
38 39
39 namespace rtc { 40 namespace rtc {
40 class Thread; 41 class Thread;
41 } // namespace rtc 42 } // namespace rtc
42 43
43 namespace cricket { 44 namespace cricket {
44 45
45 class VideoCapturer; 46 class VideoCapturer;
46 class VideoFrame; 47 class VideoFrame;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // WebRtcVideoEngine2 is used for the new native WebRTC Video API (webrtc:1667). 92 // WebRtcVideoEngine2 is used for the new native WebRTC Video API (webrtc:1667).
92 class WebRtcVideoEngine2 { 93 class WebRtcVideoEngine2 {
93 public: 94 public:
94 WebRtcVideoEngine2(); 95 WebRtcVideoEngine2();
95 ~WebRtcVideoEngine2(); 96 ~WebRtcVideoEngine2();
96 97
97 // Basic video engine implementation. 98 // Basic video engine implementation.
98 void Init(); 99 void Init();
99 100
100 WebRtcVideoChannel2* CreateChannel(webrtc::Call* call, 101 WebRtcVideoChannel2* CreateChannel(webrtc::Call* call,
102 const MediaConfig& config,
101 const VideoOptions& options); 103 const VideoOptions& options);
102 104
103 const std::vector<VideoCodec>& codecs() const; 105 const std::vector<VideoCodec>& codecs() const;
104 RtpCapabilities GetCapabilities() const; 106 RtpCapabilities GetCapabilities() const;
105 107
106 // Set a WebRtcVideoDecoderFactory for external decoding. Video engine does 108 // Set a WebRtcVideoDecoderFactory for external decoding. Video engine does
107 // not take the ownership of |decoder_factory|. The caller needs to make sure 109 // not take the ownership of |decoder_factory|. The caller needs to make sure
108 // that |decoder_factory| outlives the video engine. 110 // that |decoder_factory| outlives the video engine.
109 void SetExternalDecoderFactory(WebRtcVideoDecoderFactory* decoder_factory); 111 void SetExternalDecoderFactory(WebRtcVideoDecoderFactory* decoder_factory);
110 // Set a WebRtcVideoEncoderFactory for external encoding. Video engine does 112 // Set a WebRtcVideoEncoderFactory for external encoding. Video engine does
(...skipping 12 matching lines...) Expand all
123 WebRtcVideoDecoderFactory* external_decoder_factory_; 125 WebRtcVideoDecoderFactory* external_decoder_factory_;
124 WebRtcVideoEncoderFactory* external_encoder_factory_; 126 WebRtcVideoEncoderFactory* external_encoder_factory_;
125 rtc::scoped_ptr<WebRtcVideoEncoderFactory> simulcast_encoder_factory_; 127 rtc::scoped_ptr<WebRtcVideoEncoderFactory> simulcast_encoder_factory_;
126 }; 128 };
127 129
128 class WebRtcVideoChannel2 : public VideoMediaChannel, 130 class WebRtcVideoChannel2 : public VideoMediaChannel,
129 public webrtc::Transport, 131 public webrtc::Transport,
130 public webrtc::LoadObserver { 132 public webrtc::LoadObserver {
131 public: 133 public:
132 WebRtcVideoChannel2(webrtc::Call* call, 134 WebRtcVideoChannel2(webrtc::Call* call,
135 const MediaConfig& config,
133 const VideoOptions& options, 136 const VideoOptions& options,
134 const std::vector<VideoCodec>& recv_codecs, 137 const std::vector<VideoCodec>& recv_codecs,
135 WebRtcVideoEncoderFactory* external_encoder_factory, 138 WebRtcVideoEncoderFactory* external_encoder_factory,
136 WebRtcVideoDecoderFactory* external_decoder_factory); 139 WebRtcVideoDecoderFactory* external_decoder_factory);
137 ~WebRtcVideoChannel2() override; 140 ~WebRtcVideoChannel2() override;
138 141
139 // VideoMediaChannel implementation 142 // VideoMediaChannel implementation
143 rtc::DiffServCodePoint PreferredDscp() const override;
144
140 bool SetSendParameters(const VideoSendParameters& params) override; 145 bool SetSendParameters(const VideoSendParameters& params) override;
141 bool SetRecvParameters(const VideoRecvParameters& params) override; 146 bool SetRecvParameters(const VideoRecvParameters& params) override;
142 bool GetSendCodec(VideoCodec* send_codec) override; 147 bool GetSendCodec(VideoCodec* send_codec) override;
143 bool SetSend(bool send) override; 148 bool SetSend(bool send) override;
144 bool SetVideoSend(uint32_t ssrc, 149 bool SetVideoSend(uint32_t ssrc,
145 bool mute, 150 bool mute,
146 const VideoOptions* options) override; 151 const VideoOptions* options) override;
147 bool AddSendStream(const StreamParams& sp) override; 152 bool AddSendStream(const StreamParams& sp) override;
148 bool RemoveSendStream(uint32_t ssrc) override; 153 bool RemoveSendStream(uint32_t ssrc) override;
149 bool AddRecvStream(const StreamParams& sp) override; 154 bool AddRecvStream(const StreamParams& sp) override;
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 477
473 uint32_t rtcp_receiver_report_ssrc_; 478 uint32_t rtcp_receiver_report_ssrc_;
474 bool sending_; 479 bool sending_;
475 webrtc::Call* const call_; 480 webrtc::Call* const call_;
476 481
477 uint32_t default_send_ssrc_; 482 uint32_t default_send_ssrc_;
478 483
479 DefaultUnsignalledSsrcHandler default_unsignalled_ssrc_handler_; 484 DefaultUnsignalledSsrcHandler default_unsignalled_ssrc_handler_;
480 UnsignalledSsrcHandler* const unsignalled_ssrc_handler_; 485 UnsignalledSsrcHandler* const unsignalled_ssrc_handler_;
481 486
487 const bool signal_cpu_adaptation_;
488 const bool disable_prerenderer_smoothing_;
489
482 // Separate list of set capturers used to signal CPU adaptation. These should 490 // Separate list of set capturers used to signal CPU adaptation. These should
483 // not be locked while calling methods that take other locks to prevent 491 // not be locked while calling methods that take other locks to prevent
484 // lock-order inversions. 492 // lock-order inversions.
485 rtc::CriticalSection capturer_crit_; 493 rtc::CriticalSection capturer_crit_;
486 bool signal_cpu_adaptation_ GUARDED_BY(capturer_crit_);
487 std::map<uint32_t, VideoCapturer*> capturers_ GUARDED_BY(capturer_crit_); 494 std::map<uint32_t, VideoCapturer*> capturers_ GUARDED_BY(capturer_crit_);
488 495
489 rtc::CriticalSection stream_crit_; 496 rtc::CriticalSection stream_crit_;
490 // Using primary-ssrc (first ssrc) as key. 497 // Using primary-ssrc (first ssrc) as key.
491 std::map<uint32_t, WebRtcVideoSendStream*> send_streams_ 498 std::map<uint32_t, WebRtcVideoSendStream*> send_streams_
492 GUARDED_BY(stream_crit_); 499 GUARDED_BY(stream_crit_);
493 std::map<uint32_t, WebRtcVideoReceiveStream*> receive_streams_ 500 std::map<uint32_t, WebRtcVideoReceiveStream*> receive_streams_
494 GUARDED_BY(stream_crit_); 501 GUARDED_BY(stream_crit_);
495 std::set<uint32_t> send_ssrcs_ GUARDED_BY(stream_crit_); 502 std::set<uint32_t> send_ssrcs_ GUARDED_BY(stream_crit_);
496 std::set<uint32_t> receive_ssrcs_ GUARDED_BY(stream_crit_); 503 std::set<uint32_t> receive_ssrcs_ GUARDED_BY(stream_crit_);
497 504
498 rtc::Optional<VideoCodecSettings> send_codec_; 505 rtc::Optional<VideoCodecSettings> send_codec_;
499 std::vector<webrtc::RtpExtension> send_rtp_extensions_; 506 std::vector<webrtc::RtpExtension> send_rtp_extensions_;
500 507
501 WebRtcVideoEncoderFactory* const external_encoder_factory_; 508 WebRtcVideoEncoderFactory* const external_encoder_factory_;
502 WebRtcVideoDecoderFactory* const external_decoder_factory_; 509 WebRtcVideoDecoderFactory* const external_decoder_factory_;
503 std::vector<VideoCodecSettings> recv_codecs_; 510 std::vector<VideoCodecSettings> recv_codecs_;
504 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; 511 std::vector<webrtc::RtpExtension> recv_rtp_extensions_;
505 webrtc::Call::Config::BitrateConfig bitrate_config_; 512 webrtc::Call::Config::BitrateConfig bitrate_config_;
506 VideoOptions options_; 513 VideoOptions options_;
507 // TODO(deadbeef): Don't duplicate information between 514 // TODO(deadbeef): Don't duplicate information between
508 // send_params/recv_params, rtp_extensions, options, etc. 515 // send_params/recv_params, rtp_extensions, options, etc.
509 VideoSendParameters send_params_; 516 VideoSendParameters send_params_;
510 VideoRecvParameters recv_params_; 517 VideoRecvParameters recv_params_;
511 }; 518 };
512 519
513 } // namespace cricket 520 } // namespace cricket
514 521
515 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ 522 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_
OLDNEW
« no previous file with comments | « webrtc/media/engine/nullwebrtcvideoengine.h ('k') | webrtc/media/engine/webrtcvideoengine2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698