| OLD | NEW |
| 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 I420FrameCallback; | 31 class I420FrameCallback; |
| 30 class PacedSender; | 32 class PacedSender; |
| 31 class PacketRouter; | 33 class PacketRouter; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 45 // group are assumed to send/receive data to the same end-point. | 47 // group are assumed to send/receive data to the same end-point. |
| 46 class ChannelGroup : public BitrateObserver { | 48 class ChannelGroup : public BitrateObserver { |
| 47 public: | 49 public: |
| 48 explicit ChannelGroup(ProcessThread* process_thread); | 50 explicit ChannelGroup(ProcessThread* process_thread); |
| 49 ~ChannelGroup(); | 51 ~ChannelGroup(); |
| 50 bool CreateSendChannel(int channel_id, | 52 bool CreateSendChannel(int channel_id, |
| 51 Transport* transport, | 53 Transport* transport, |
| 52 SendStatisticsProxy* stats_proxy, | 54 SendStatisticsProxy* stats_proxy, |
| 53 I420FrameCallback* pre_encode_callback, | 55 I420FrameCallback* pre_encode_callback, |
| 54 int number_of_cores, | 56 int number_of_cores, |
| 55 const std::vector<uint32_t>& ssrcs); | 57 const VideoSendStream::Config& config); |
| 56 bool CreateReceiveChannel(int channel_id, | 58 bool CreateReceiveChannel(int channel_id, |
| 57 Transport* transport, | 59 Transport* transport, |
| 58 int number_of_cores); | 60 int number_of_cores, |
| 61 const VideoReceiveStream::Config& config); |
| 59 void DeleteChannel(int channel_id); | 62 void DeleteChannel(int channel_id); |
| 60 ViEChannel* GetChannel(int channel_id) const; | 63 ViEChannel* GetChannel(int channel_id) const; |
| 61 ViEEncoder* GetEncoder(int channel_id) const; | 64 ViEEncoder* GetEncoder(int channel_id) const; |
| 62 void SetSyncInterface(VoEVideoSync* sync_interface); | 65 void SetSyncInterface(VoEVideoSync* sync_interface); |
| 63 | 66 |
| 64 void SetChannelRembStatus(bool sender, bool receiver, ViEChannel* channel); | 67 void SetChannelRembStatus(bool sender, bool receiver, ViEChannel* channel); |
| 65 | 68 |
| 66 BitrateController* GetBitrateController() const; | 69 BitrateController* GetBitrateController() const; |
| 67 CallStats* GetCallStats() const; | 70 CallStats* GetCallStats() const; |
| 68 RemoteBitrateEstimator* GetRemoteBitrateEstimator() const; | 71 RemoteBitrateEstimator* GetRemoteBitrateEstimator() const; |
| 69 EncoderStateFeedback* GetEncoderStateFeedback() const; | 72 EncoderStateFeedback* GetEncoderStateFeedback() const; |
| 70 int64_t GetPacerQueuingDelayMs() const; | 73 int64_t GetPacerQueuingDelayMs() const; |
| 71 | 74 |
| 72 // Implements BitrateObserver. | 75 // Implements BitrateObserver. |
| 73 void OnNetworkChanged(uint32_t target_bitrate_bps, | 76 void OnNetworkChanged(uint32_t target_bitrate_bps, |
| 74 uint8_t fraction_loss, | 77 uint8_t fraction_loss, |
| 75 int64_t rtt) override; | 78 int64_t rtt) override; |
| 76 | 79 |
| 77 private: | 80 private: |
| 78 typedef std::map<int, ViEChannel*> ChannelMap; | 81 typedef std::map<int, ViEChannel*> ChannelMap; |
| 79 typedef std::map<int, ViEEncoder*> EncoderMap; | 82 typedef std::map<int, ViEEncoder*> EncoderMap; |
| 80 | 83 |
| 81 bool CreateChannel(int channel_id, | 84 bool CreateChannel(int channel_id, |
| 82 Transport* transport, | 85 Transport* transport, |
| 83 int number_of_cores, | 86 int number_of_cores, |
| 84 ViEEncoder* vie_encoder, | 87 ViEEncoder* vie_encoder, |
| 85 size_t max_rtp_streams, | 88 size_t max_rtp_streams, |
| 86 bool sender); | 89 bool sender, |
| 90 RemoteBitrateEstimator* bitrate_estimator, |
| 91 TransportFeedbackObserver* feedback_observer); |
| 87 ViEChannel* PopChannel(int channel_id); | 92 ViEChannel* PopChannel(int channel_id); |
| 88 | 93 |
| 89 rtc::scoped_ptr<VieRemb> remb_; | 94 rtc::scoped_ptr<VieRemb> remb_; |
| 90 rtc::scoped_ptr<BitrateAllocator> bitrate_allocator_; | 95 rtc::scoped_ptr<BitrateAllocator> bitrate_allocator_; |
| 91 rtc::scoped_ptr<CallStats> call_stats_; | 96 rtc::scoped_ptr<CallStats> call_stats_; |
| 92 rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_; | |
| 93 rtc::scoped_ptr<EncoderStateFeedback> encoder_state_feedback_; | |
| 94 rtc::scoped_ptr<PacketRouter> packet_router_; | 97 rtc::scoped_ptr<PacketRouter> packet_router_; |
| 95 rtc::scoped_ptr<PacedSender> pacer_; | 98 rtc::scoped_ptr<PacedSender> pacer_; |
| 99 rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_; |
| 100 rtc::scoped_ptr<RemoteEstimatorProxy> remote_estimator_proxy_; |
| 101 rtc::scoped_ptr<EncoderStateFeedback> encoder_state_feedback_; |
| 96 ChannelMap channel_map_; | 102 ChannelMap channel_map_; |
| 97 // Maps Channel id -> ViEEncoder. | 103 // Maps Channel id -> ViEEncoder. |
| 98 mutable rtc::CriticalSection encoder_map_crit_; | 104 mutable rtc::CriticalSection encoder_map_crit_; |
| 99 EncoderMap vie_encoder_map_ GUARDED_BY(encoder_map_crit_); | 105 EncoderMap vie_encoder_map_ GUARDED_BY(encoder_map_crit_); |
| 100 | 106 |
| 101 // Registered at construct time and assumed to outlive this class. | 107 // Registered at construct time and assumed to outlive this class. |
| 102 ProcessThread* const process_thread_; | 108 ProcessThread* const process_thread_; |
| 103 rtc::scoped_ptr<ProcessThread> pacer_thread_; | 109 rtc::scoped_ptr<ProcessThread> pacer_thread_; |
| 104 | 110 |
| 105 rtc::scoped_ptr<BitrateController> bitrate_controller_; | 111 rtc::scoped_ptr<BitrateController> bitrate_controller_; |
| 112 rtc::scoped_ptr<TransportFeedbackAdapter> transport_feedback_adapter_; |
| 106 }; | 113 }; |
| 107 | 114 |
| 108 } // namespace webrtc | 115 } // namespace webrtc |
| 109 | 116 |
| 110 #endif // WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_ | 117 #endif // WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_ |
| OLD | NEW |