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

Side by Side Diff: webrtc/video_engine/vie_channel_group.h

Issue 1394243006: Move ownership of send ViEChannels and ViEEncoder to VideoSendStream. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Based on pbos, stefan feedback. Created 5 years, 2 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 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 SendStatisticsProxy* stats_proxy, 54 SendStatisticsProxy* stats_proxy,
55 I420FrameCallback* pre_encode_callback, 55 I420FrameCallback* pre_encode_callback,
56 int number_of_cores, 56 int number_of_cores,
57 const VideoSendStream::Config& config); 57 const VideoSendStream::Config& config);
58 bool CreateReceiveChannel(int channel_id, 58 bool CreateReceiveChannel(int channel_id,
59 Transport* transport, 59 Transport* transport,
60 int number_of_cores, 60 int number_of_cores,
61 const VideoReceiveStream::Config& config); 61 const VideoReceiveStream::Config& config);
62 void DeleteChannel(int channel_id); 62 void DeleteChannel(int channel_id);
63 ViEChannel* GetChannel(int channel_id) const; 63 ViEChannel* GetChannel(int channel_id) const;
64 ViEEncoder* GetEncoder(int channel_id) const; 64 void AddEncoder(const std::vector<uint32_t>& ssrcs, ViEEncoder* encoder);
65 void RemoveEncoder(ViEEncoder* encoder);
65 void SetSyncInterface(VoEVideoSync* sync_interface); 66 void SetSyncInterface(VoEVideoSync* sync_interface);
66 void SetBweBitrates(int min_bitrate_bps, 67 void SetBweBitrates(int min_bitrate_bps,
67 int start_bitrate_bps, 68 int start_bitrate_bps,
68 int max_bitrate_bps); 69 int max_bitrate_bps);
69 70
70 void SetChannelRembStatus(bool sender, bool receiver, ViEChannel* channel); 71 void SetChannelRembStatus(bool sender, bool receiver, ViEChannel* channel);
71 72
72 BitrateController* GetBitrateController() const; 73 BitrateController* GetBitrateController() const;
74 RemoteBitrateEstimator* GetRemoteBitrateEstimator() const;
73 CallStats* GetCallStats() const; 75 CallStats* GetCallStats() const;
74 RemoteBitrateEstimator* GetRemoteBitrateEstimator() const;
75 EncoderStateFeedback* GetEncoderStateFeedback() const;
76 int64_t GetPacerQueuingDelayMs() const; 76 int64_t GetPacerQueuingDelayMs() const;
77 PacedSender* pacer() const { return pacer_.get(); }
78 PacketRouter* packet_router() const { return packet_router_.get(); }
79 BitrateAllocator* bitrate_allocator() const {
80 return bitrate_allocator_.get(); }
81 TransportFeedbackObserver* GetTransportFeedbackObserver();
82 RtcpIntraFrameObserver* GetRtcpIntraFrameObserver() const;
77 83
78 // Implements BitrateObserver. 84 // Implements BitrateObserver.
79 void OnNetworkChanged(uint32_t target_bitrate_bps, 85 void OnNetworkChanged(uint32_t target_bitrate_bps,
80 uint8_t fraction_loss, 86 uint8_t fraction_loss,
81 int64_t rtt) override; 87 int64_t rtt) override;
82 88
83 private: 89 private:
84 typedef std::map<int, ViEChannel*> ChannelMap; 90 typedef std::map<int, ViEChannel*> ChannelMap;
85 typedef std::map<int, ViEEncoder*> EncoderMap;
86 91
87 bool CreateChannel(int channel_id, 92 bool CreateChannel(int channel_id,
88 Transport* transport, 93 Transport* transport,
89 int number_of_cores, 94 int number_of_cores,
90 ViEEncoder* vie_encoder,
91 size_t max_rtp_streams, 95 size_t max_rtp_streams,
92 bool sender, 96 bool sender,
93 RemoteBitrateEstimator* bitrate_estimator, 97 RemoteBitrateEstimator* bitrate_estimator,
94 TransportFeedbackObserver* feedback_observer); 98 TransportFeedbackObserver* feedback_observer);
95 ViEChannel* PopChannel(int channel_id); 99 ViEChannel* PopChannel(int channel_id);
96 100
97 rtc::scoped_ptr<VieRemb> remb_; 101 rtc::scoped_ptr<VieRemb> remb_;
98 rtc::scoped_ptr<BitrateAllocator> bitrate_allocator_; 102 rtc::scoped_ptr<BitrateAllocator> bitrate_allocator_;
99 rtc::scoped_ptr<CallStats> call_stats_; 103 rtc::scoped_ptr<CallStats> call_stats_;
100 rtc::scoped_ptr<PacketRouter> packet_router_; 104 rtc::scoped_ptr<PacketRouter> packet_router_;
101 rtc::scoped_ptr<PacedSender> pacer_; 105 rtc::scoped_ptr<PacedSender> pacer_;
102 rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_; 106 rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_;
103 rtc::scoped_ptr<RemoteEstimatorProxy> remote_estimator_proxy_; 107 rtc::scoped_ptr<RemoteEstimatorProxy> remote_estimator_proxy_;
104 rtc::scoped_ptr<EncoderStateFeedback> encoder_state_feedback_; 108 rtc::scoped_ptr<EncoderStateFeedback> encoder_state_feedback_;
105 ChannelMap channel_map_; 109 ChannelMap channel_map_;
106 // Maps Channel id -> ViEEncoder. 110
107 mutable rtc::CriticalSection encoder_map_crit_; 111 mutable rtc::CriticalSection encoder_crit_;
108 EncoderMap vie_encoder_map_ GUARDED_BY(encoder_map_crit_); 112 std::vector<ViEEncoder*> encoders_ GUARDED_BY(encoder_crit_);
109 113
110 // Registered at construct time and assumed to outlive this class. 114 // Registered at construct time and assumed to outlive this class.
111 ProcessThread* const process_thread_; 115 ProcessThread* const process_thread_;
112 rtc::scoped_ptr<ProcessThread> pacer_thread_; 116 rtc::scoped_ptr<ProcessThread> pacer_thread_;
113 117
114 rtc::scoped_ptr<BitrateController> bitrate_controller_; 118 rtc::scoped_ptr<BitrateController> bitrate_controller_;
115 rtc::scoped_ptr<TransportFeedbackAdapter> transport_feedback_adapter_; 119 rtc::scoped_ptr<TransportFeedbackAdapter> transport_feedback_adapter_;
116 int min_bitrate_bps_; 120 int min_bitrate_bps_;
117 }; 121 };
118 122
119 } // namespace webrtc 123 } // namespace webrtc
120 124
121 #endif // WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_ 125 #endif // WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698