OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 24 matching lines...) Expand all Loading... | |
35 class ProcessThread; | 35 class ProcessThread; |
36 class RtpRtcp; | 36 class RtpRtcp; |
37 class ViEChannel; | 37 class ViEChannel; |
38 class ViEEncoder; | 38 class ViEEncoder; |
39 class VieRemb; | 39 class VieRemb; |
40 | 40 |
41 namespace internal { | 41 namespace internal { |
42 | 42 |
43 class VideoSendStream : public webrtc::VideoSendStream, | 43 class VideoSendStream : public webrtc::VideoSendStream, |
44 public webrtc::CpuOveruseObserver, | 44 public webrtc::CpuOveruseObserver, |
45 public webrtc::BitrateAllocatorObserver { | 45 public webrtc::BitrateAllocatorObserver, |
46 public webrtc::VCMProtectionCallback { | |
46 public: | 47 public: |
47 VideoSendStream(int num_cpu_cores, | 48 VideoSendStream(int num_cpu_cores, |
48 ProcessThread* module_process_thread, | 49 ProcessThread* module_process_thread, |
49 CallStats* call_stats, | 50 CallStats* call_stats, |
50 CongestionController* congestion_controller, | 51 CongestionController* congestion_controller, |
51 BitrateAllocator* bitrate_allocator, | 52 BitrateAllocator* bitrate_allocator, |
52 VieRemb* remb, | 53 VieRemb* remb, |
53 const VideoSendStream::Config& config, | 54 const VideoSendStream::Config& config, |
54 const VideoEncoderConfig& encoder_config, | 55 const VideoEncoderConfig& encoder_config, |
55 const std::map<uint32_t, RtpState>& suspended_ssrcs); | 56 const std::map<uint32_t, RtpState>& suspended_ssrcs); |
(...skipping 18 matching lines...) Expand all Loading... | |
74 typedef std::map<uint32_t, RtpState> RtpStateMap; | 75 typedef std::map<uint32_t, RtpState> RtpStateMap; |
75 RtpStateMap GetRtpStates() const; | 76 RtpStateMap GetRtpStates() const; |
76 | 77 |
77 int GetPaddingNeededBps() const; | 78 int GetPaddingNeededBps() const; |
78 | 79 |
79 // Implements BitrateAllocatorObserver. | 80 // Implements BitrateAllocatorObserver. |
80 void OnBitrateUpdated(uint32_t bitrate_bps, | 81 void OnBitrateUpdated(uint32_t bitrate_bps, |
81 uint8_t fraction_loss, | 82 uint8_t fraction_loss, |
82 int64_t rtt) override; | 83 int64_t rtt) override; |
83 | 84 |
85 // implements webrtc::VCMProtectionCallback. | |
pbos-webrtc
2016/04/07 16:02:08
Implements
perkj_webrtc
2016/04/08 10:59:04
Done.
| |
86 int ProtectionRequest(const FecProtectionParams* delta_params, | |
87 const FecProtectionParams* key_params, | |
88 uint32_t* sent_video_rate_bps, | |
89 uint32_t* sent_nack_rate_bps, | |
90 uint32_t* sent_fec_rate_bps) override; | |
91 | |
84 private: | 92 private: |
85 static bool EncoderThreadFunction(void* obj); | 93 static bool EncoderThreadFunction(void* obj); |
86 void EncoderProcess(); | 94 void EncoderProcess(); |
87 | 95 |
88 void ConfigureSsrcs(); | 96 void ConfigureSsrcs(); |
89 | 97 |
90 SendStatisticsProxy stats_proxy_; | 98 SendStatisticsProxy stats_proxy_; |
91 EncodedFrameCallbackAdapter encoded_frame_proxy_; | 99 EncodedFrameCallbackAdapter encoded_frame_proxy_; |
92 const VideoSendStream::Config config_; | 100 const VideoSendStream::Config config_; |
93 std::map<uint32_t, RtpState> suspended_ssrcs_; | 101 std::map<uint32_t, RtpState> suspended_ssrcs_; |
94 | 102 |
95 ProcessThread* const module_process_thread_; | 103 ProcessThread* const module_process_thread_; |
96 CallStats* const call_stats_; | 104 CallStats* const call_stats_; |
97 CongestionController* const congestion_controller_; | 105 CongestionController* const congestion_controller_; |
98 BitrateAllocator* const bitrate_allocator_; | 106 BitrateAllocator* const bitrate_allocator_; |
99 VieRemb* const remb_; | 107 VieRemb* const remb_; |
100 | 108 |
101 rtc::PlatformThread encoder_thread_; | 109 rtc::PlatformThread encoder_thread_; |
102 rtc::Event encoder_wakeup_event_; | 110 rtc::Event encoder_wakeup_event_; |
103 volatile int stop_encoder_thread_; | 111 volatile int stop_encoder_thread_; |
104 | 112 |
105 OveruseFrameDetector overuse_detector_; | 113 OveruseFrameDetector overuse_detector_; |
106 PayloadRouter payload_router_; | |
107 EncoderStateFeedback encoder_feedback_; | 114 EncoderStateFeedback encoder_feedback_; |
108 ViEChannel vie_channel_; | |
109 ViEReceiver* const vie_receiver_; | |
110 ViEEncoder vie_encoder_; | 115 ViEEncoder vie_encoder_; |
111 VideoCodingModule* const vcm_; | 116 VideoCodingModule* const vcm_; |
112 // TODO(pbos): Move RtpRtcp ownership to VideoSendStream. | 117 |
113 // RtpRtcp modules, currently owned by ViEChannel but ownership should | 118 // RtpRtcp modules, declared here as they use other members on construction. |
pbos-webrtc
2016/04/07 16:02:08
remove double space.
perkj_webrtc
2016/04/08 10:59:04
Done.
| |
114 // eventually move here. | |
115 const std::vector<RtpRtcp*> rtp_rtcp_modules_; | 119 const std::vector<RtpRtcp*> rtp_rtcp_modules_; |
120 PayloadRouter payload_router_; | |
116 VideoCaptureInput input_; | 121 VideoCaptureInput input_; |
117 }; | 122 }; |
118 } // namespace internal | 123 } // namespace internal |
119 } // namespace webrtc | 124 } // namespace webrtc |
120 | 125 |
121 #endif // WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_ | 126 #endif // WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_ |
OLD | NEW |