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

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: More GN fixes... 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
« no previous file with comments | « webrtc/video/video_send_stream.cc ('k') | webrtc/video_engine/vie_channel_group.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) 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 Transport* transport, 51 Transport* transport,
48 int number_of_cores, 52 int number_of_cores,
49 const std::vector<uint32_t>& ssrcs); 53 const VideoSendStream::Config& config);
50 bool CreateReceiveChannel(int channel_id, 54 bool CreateReceiveChannel(int channel_id,
51 Transport* transport, 55 Transport* transport,
52 int number_of_cores); 56 int number_of_cores,
57 const VideoReceiveStream::Config& config);
53 void DeleteChannel(int channel_id); 58 void DeleteChannel(int channel_id);
54 ViEChannel* GetChannel(int channel_id) const; 59 ViEChannel* GetChannel(int channel_id) const;
55 ViEEncoder* GetEncoder(int channel_id) const; 60 ViEEncoder* GetEncoder(int channel_id) const;
56 void SetSyncInterface(VoEVideoSync* sync_interface); 61 void SetSyncInterface(VoEVideoSync* sync_interface);
57 62
58 void SetChannelRembStatus(bool sender, bool receiver, ViEChannel* channel); 63 void SetChannelRembStatus(bool sender, bool receiver, ViEChannel* channel);
59 64
60 BitrateController* GetBitrateController() const; 65 BitrateController* GetBitrateController() const;
61 CallStats* GetCallStats() const; 66 CallStats* GetCallStats() const;
62 RemoteBitrateEstimator* GetRemoteBitrateEstimator() const; 67 RemoteBitrateEstimator* GetRemoteBitrateEstimator() const;
63 EncoderStateFeedback* GetEncoderStateFeedback() const; 68 EncoderStateFeedback* GetEncoderStateFeedback() const;
64 int64_t GetPacerQueuingDelayMs() const; 69 int64_t GetPacerQueuingDelayMs() const;
65 70
66 // Implements BitrateObserver. 71 // Implements BitrateObserver.
67 void OnNetworkChanged(uint32_t target_bitrate_bps, 72 void OnNetworkChanged(uint32_t target_bitrate_bps,
68 uint8_t fraction_loss, 73 uint8_t fraction_loss,
69 int64_t rtt) override; 74 int64_t rtt) override;
70 75
71 private: 76 private:
72 typedef std::map<int, ViEChannel*> ChannelMap; 77 typedef std::map<int, ViEChannel*> ChannelMap;
73 typedef std::map<int, ViEEncoder*> EncoderMap; 78 typedef std::map<int, ViEEncoder*> EncoderMap;
74 79
75 bool CreateChannel(int channel_id, 80 bool CreateChannel(int channel_id,
76 Transport* transport, 81 Transport* transport,
77 int number_of_cores, 82 int number_of_cores,
78 ViEEncoder* vie_encoder, 83 ViEEncoder* vie_encoder,
79 size_t max_rtp_streams, 84 size_t max_rtp_streams,
80 bool sender); 85 bool sender,
86 RemoteBitrateEstimator* bitrate_estimator,
87 TransportFeedbackObserver* feedback_observer);
81 ViEChannel* PopChannel(int channel_id); 88 ViEChannel* PopChannel(int channel_id);
82 89
83 rtc::scoped_ptr<VieRemb> remb_; 90 rtc::scoped_ptr<VieRemb> remb_;
84 rtc::scoped_ptr<BitrateAllocator> bitrate_allocator_; 91 rtc::scoped_ptr<BitrateAllocator> bitrate_allocator_;
85 rtc::scoped_ptr<CallStats> call_stats_; 92 rtc::scoped_ptr<CallStats> call_stats_;
86 rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_;
87 rtc::scoped_ptr<EncoderStateFeedback> encoder_state_feedback_;
88 rtc::scoped_ptr<PacketRouter> packet_router_; 93 rtc::scoped_ptr<PacketRouter> packet_router_;
89 rtc::scoped_ptr<PacedSender> pacer_; 94 rtc::scoped_ptr<PacedSender> pacer_;
95 rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_;
96 rtc::scoped_ptr<RemoteEstimatorProxy> remote_estimator_proxy_;
97 rtc::scoped_ptr<EncoderStateFeedback> encoder_state_feedback_;
90 ChannelMap channel_map_; 98 ChannelMap channel_map_;
91 // Maps Channel id -> ViEEncoder. 99 // Maps Channel id -> ViEEncoder.
92 mutable rtc::CriticalSection encoder_map_crit_; 100 mutable rtc::CriticalSection encoder_map_crit_;
93 EncoderMap vie_encoder_map_ GUARDED_BY(encoder_map_crit_); 101 EncoderMap vie_encoder_map_ GUARDED_BY(encoder_map_crit_);
94 102
95 // Registered at construct time and assumed to outlive this class. 103 // Registered at construct time and assumed to outlive this class.
96 ProcessThread* const process_thread_; 104 ProcessThread* const process_thread_;
97 rtc::scoped_ptr<ProcessThread> pacer_thread_; 105 rtc::scoped_ptr<ProcessThread> pacer_thread_;
98 106
99 rtc::scoped_ptr<BitrateController> bitrate_controller_; 107 rtc::scoped_ptr<BitrateController> bitrate_controller_;
108 rtc::scoped_ptr<TransportFeedbackAdapter> transport_feedback_adapter_;
100 }; 109 };
101 110
102 } // namespace webrtc 111 } // namespace webrtc
103 112
104 #endif // WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_ 113 #endif // WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_
OLDNEW
« no previous file with comments | « webrtc/video/video_send_stream.cc ('k') | webrtc/video_engine/vie_channel_group.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698