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