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

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

Issue 1338203003: Wire up send-side bandwidth estimation. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed comments, rebase Created 5 years, 3 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
11 #ifndef WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_ 11 #ifndef WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_
12 #define WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_ 12 #define WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_
13 13
14 #include <list> 14 #include <list>
15 #include <map> 15 #include <map>
16 #include <set> 16 #include <set>
17 #include <vector> 17 #include <vector>
18 18
19 #include "webrtc/base/criticalsection.h" 19 #include "webrtc/base/criticalsection.h"
20 #include "webrtc/base/scoped_ptr.h" 20 #include "webrtc/base/scoped_ptr.h"
21 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" 21 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h"
22 #include "webrtc/video_receive_stream.h"
23 #include "webrtc/video_send_stream.h"
22 24
23 namespace webrtc { 25 namespace webrtc {
24 26
25 class BitrateAllocator; 27 class BitrateAllocator;
26 class CallStats; 28 class CallStats;
27 class Config; 29 class Config;
28 class EncoderStateFeedback; 30 class EncoderStateFeedback;
29 class PacedSender; 31 class PacedSender;
30 class PacketRouter; 32 class PacketRouter;
31 class ProcessThread; 33 class ProcessThread;
32 class RemoteBitrateEstimator; 34 class RemoteBitrateEstimator;
35 class RemoteEstimatorProxy;
36 class TransportFeedbackAdapter;
33 class ViEChannel; 37 class ViEChannel;
34 class ViEEncoder; 38 class ViEEncoder;
35 class VieRemb; 39 class VieRemb;
36 class VoEVideoSync; 40 class VoEVideoSync;
37 41
38 typedef std::list<ViEChannel*> ChannelList; 42 typedef std::list<ViEChannel*> ChannelList;
39 43
40 // Channel group contains data common for several channels. All channels in the 44 // Channel group contains data common for several channels. All channels in the
41 // group are assumed to send/receive data to the same end-point. 45 // group are assumed to send/receive data to the same end-point.
42 class ChannelGroup : public BitrateObserver { 46 class ChannelGroup : public BitrateObserver {
43 public: 47 public:
44 explicit ChannelGroup(ProcessThread* process_thread); 48 explicit ChannelGroup(ProcessThread* process_thread);
45 ~ChannelGroup(); 49 ~ChannelGroup();
46 bool CreateSendChannel(int channel_id, 50 bool CreateSendChannel(int channel_id,
47 int engine_id, 51 int engine_id,
48 Transport* transport, 52 Transport* transport,
49 int number_of_cores, 53 int number_of_cores,
50 const std::vector<uint32_t>& ssrcs); 54 const VideoSendStream::Config& config);
51 bool CreateReceiveChannel(int channel_id, 55 bool CreateReceiveChannel(int channel_id,
52 int engine_id, 56 int engine_id,
53 Transport* transport, 57 Transport* transport,
54 int number_of_cores); 58 int number_of_cores,
59 const VideoReceiveStream::Config& config);
55 void DeleteChannel(int channel_id); 60 void DeleteChannel(int channel_id);
56 ViEChannel* GetChannel(int channel_id) const; 61 ViEChannel* GetChannel(int channel_id) const;
57 ViEEncoder* GetEncoder(int channel_id) const; 62 ViEEncoder* GetEncoder(int channel_id) const;
58 void SetSyncInterface(VoEVideoSync* sync_interface); 63 void SetSyncInterface(VoEVideoSync* sync_interface);
59 64
60 void SetChannelRembStatus(bool sender, bool receiver, ViEChannel* channel); 65 void SetChannelRembStatus(bool sender, bool receiver, ViEChannel* channel);
61 66
62 BitrateController* GetBitrateController() const; 67 BitrateController* GetBitrateController() const;
63 CallStats* GetCallStats() const; 68 CallStats* GetCallStats() const;
64 RemoteBitrateEstimator* GetRemoteBitrateEstimator() const; 69 RemoteBitrateEstimator* GetRemoteBitrateEstimator() const;
65 EncoderStateFeedback* GetEncoderStateFeedback() const; 70 EncoderStateFeedback* GetEncoderStateFeedback() const;
66 int64_t GetPacerQueuingDelayMs() const; 71 int64_t GetPacerQueuingDelayMs() const;
67 72
68 // Implements BitrateObserver. 73 // Implements BitrateObserver.
69 void OnNetworkChanged(uint32_t target_bitrate_bps, 74 void OnNetworkChanged(uint32_t target_bitrate_bps,
70 uint8_t fraction_loss, 75 uint8_t fraction_loss,
71 int64_t rtt) override; 76 int64_t rtt) override;
72 77
73 private: 78 private:
74 typedef std::map<int, ViEChannel*> ChannelMap; 79 typedef std::map<int, ViEChannel*> ChannelMap;
75 typedef std::map<int, ViEEncoder*> EncoderMap; 80 typedef std::map<int, ViEEncoder*> EncoderMap;
76 81
77 bool CreateChannel(int channel_id, 82 bool CreateChannel(int channel_id,
78 int engine_id, 83 int engine_id,
79 Transport* transport, 84 Transport* transport,
80 int number_of_cores, 85 int number_of_cores,
81 ViEEncoder* vie_encoder, 86 ViEEncoder* vie_encoder,
82 size_t max_rtp_streams, 87 size_t max_rtp_streams,
83 bool sender); 88 bool sender,
89 RemoteBitrateEstimator* bitrate_estimator,
90 TransportFeedbackObserver* feedback_observer);
84 ViEChannel* PopChannel(int channel_id); 91 ViEChannel* PopChannel(int channel_id);
85 92
86 rtc::scoped_ptr<VieRemb> remb_; 93 rtc::scoped_ptr<VieRemb> remb_;
87 rtc::scoped_ptr<BitrateAllocator> bitrate_allocator_; 94 rtc::scoped_ptr<BitrateAllocator> bitrate_allocator_;
88 rtc::scoped_ptr<CallStats> call_stats_; 95 rtc::scoped_ptr<CallStats> call_stats_;
89 rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_; 96 rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_;
97 rtc::scoped_ptr<RemoteEstimatorProxy> remote_estimator_proxy_;
90 rtc::scoped_ptr<EncoderStateFeedback> encoder_state_feedback_; 98 rtc::scoped_ptr<EncoderStateFeedback> encoder_state_feedback_;
91 rtc::scoped_ptr<PacketRouter> packet_router_; 99 rtc::scoped_ptr<PacketRouter> packet_router_;
92 rtc::scoped_ptr<PacedSender> pacer_; 100 rtc::scoped_ptr<PacedSender> pacer_;
93 ChannelMap channel_map_; 101 ChannelMap channel_map_;
94 // Maps Channel id -> ViEEncoder. 102 // Maps Channel id -> ViEEncoder.
95 mutable rtc::CriticalSection encoder_map_crit_; 103 mutable rtc::CriticalSection encoder_map_crit_;
96 EncoderMap vie_encoder_map_ GUARDED_BY(encoder_map_crit_); 104 EncoderMap vie_encoder_map_ GUARDED_BY(encoder_map_crit_);
97 105
98 // Registered at construct time and assumed to outlive this class. 106 // Registered at construct time and assumed to outlive this class.
99 ProcessThread* const process_thread_; 107 ProcessThread* const process_thread_;
100 rtc::scoped_ptr<ProcessThread> pacer_thread_; 108 rtc::scoped_ptr<ProcessThread> pacer_thread_;
101 109
102 rtc::scoped_ptr<BitrateController> bitrate_controller_; 110 rtc::scoped_ptr<BitrateController> bitrate_controller_;
111 rtc::scoped_ptr<TransportFeedbackAdapter> transport_feedback_adapter_;
103 }; 112 };
104 113
105 } // namespace webrtc 114 } // namespace webrtc
106 115
107 #endif // WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_ 116 #endif // WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698