| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 namespace vcm { | 45 namespace vcm { |
| 46 class VideoSender; | 46 class VideoSender; |
| 47 } // namespace vcm | 47 } // namespace vcm |
| 48 | 48 |
| 49 namespace internal { | 49 namespace internal { |
| 50 | 50 |
| 51 class VideoSendStream : public webrtc::VideoSendStream, | 51 class VideoSendStream : public webrtc::VideoSendStream, |
| 52 public webrtc::CpuOveruseObserver, | 52 public webrtc::CpuOveruseObserver, |
| 53 public webrtc::BitrateAllocatorObserver, | 53 public webrtc::BitrateAllocatorObserver, |
| 54 public webrtc::VCMProtectionCallback, | 54 public webrtc::VCMProtectionCallback, |
| 55 protected webrtc::EncodedImageCallback { | 55 public VideoEncoderSink { |
| 56 public: | 56 public: |
| 57 VideoSendStream(int num_cpu_cores, | 57 VideoSendStream(int num_cpu_cores, |
| 58 ProcessThread* module_process_thread, | 58 ProcessThread* module_process_thread, |
| 59 CallStats* call_stats, | 59 CallStats* call_stats, |
| 60 CongestionController* congestion_controller, | 60 CongestionController* congestion_controller, |
| 61 BitrateAllocator* bitrate_allocator, | 61 BitrateAllocator* bitrate_allocator, |
| 62 SendDelayStats* send_delay_stats, | 62 SendDelayStats* send_delay_stats, |
| 63 VieRemb* remb, | 63 VieRemb* remb, |
| 64 RtcEventLog* event_log, | 64 RtcEventLog* event_log, |
| 65 const VideoSendStream::Config& config, | 65 const VideoSendStream::Config& config, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 96 // Implements webrtc::VCMProtectionCallback. | 96 // Implements webrtc::VCMProtectionCallback. |
| 97 int ProtectionRequest(const FecProtectionParams* delta_params, | 97 int ProtectionRequest(const FecProtectionParams* delta_params, |
| 98 const FecProtectionParams* key_params, | 98 const FecProtectionParams* key_params, |
| 99 uint32_t* sent_video_rate_bps, | 99 uint32_t* sent_video_rate_bps, |
| 100 uint32_t* sent_nack_rate_bps, | 100 uint32_t* sent_nack_rate_bps, |
| 101 uint32_t* sent_fec_rate_bps) override; | 101 uint32_t* sent_fec_rate_bps) override; |
| 102 | 102 |
| 103 private: | 103 private: |
| 104 struct EncoderSettings { | 104 struct EncoderSettings { |
| 105 VideoCodec video_codec; | 105 VideoCodec video_codec; |
| 106 int min_transmit_bitrate_bps; | 106 VideoEncoderConfig config; |
| 107 std::vector<VideoStream> streams; | |
| 108 }; | 107 }; |
| 109 | 108 |
| 110 // Implements EncodedImageCallback. The implementation routes encoded frames | 109 // Implements VideoEncoderSink. The implementation routes encoded frames |
| 111 // to the |payload_router_| and |config.pre_encode_callback| if set. | 110 // to the |payload_router_| and |config.pre_encode_callback| if set. |
| 112 // Called on an arbitrary encoder callback thread. | 111 // Called on an arbitrary encoder callback thread. |
| 113 int32_t Encoded(const EncodedImage& encoded_image, | 112 int32_t Encoded(const EncodedImage& encoded_image, |
| 114 const CodecSpecificInfo* codec_specific_info, | 113 const CodecSpecificInfo* codec_specific_info, |
| 115 const RTPFragmentationHeader* fragmentation) override; | 114 const RTPFragmentationHeader* fragmentation) override; |
| 116 | 115 |
| 116 void OnEncoderActivityChanged(bool active) override; |
| 117 |
| 117 static bool EncoderThreadFunction(void* obj); | 118 static bool EncoderThreadFunction(void* obj); |
| 118 void EncoderProcess(); | 119 void EncoderProcess(); |
| 119 | 120 |
| 120 void ConfigureProtection(); | 121 void ConfigureProtection(); |
| 121 void ConfigureSsrcs(); | 122 void ConfigureSsrcs(); |
| 122 | 123 |
| 123 SendStatisticsProxy stats_proxy_; | 124 SendStatisticsProxy stats_proxy_; |
| 124 EncodedFrameCallbackAdapter encoded_frame_proxy_; | 125 EncodedFrameCallbackAdapter encoded_frame_proxy_; |
| 125 const VideoSendStream::Config config_; | 126 const VideoSendStream::Config config_; |
| 126 std::map<uint32_t, RtpState> suspended_ssrcs_; | 127 std::map<uint32_t, RtpState> suspended_ssrcs_; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 152 const std::unique_ptr<RtcpBandwidthObserver> bandwidth_observer_; | 153 const std::unique_ptr<RtcpBandwidthObserver> bandwidth_observer_; |
| 153 // RtpRtcp modules, declared here as they use other members on construction. | 154 // RtpRtcp modules, declared here as they use other members on construction. |
| 154 const std::vector<RtpRtcp*> rtp_rtcp_modules_; | 155 const std::vector<RtpRtcp*> rtp_rtcp_modules_; |
| 155 PayloadRouter payload_router_; | 156 PayloadRouter payload_router_; |
| 156 VideoCaptureInput input_; | 157 VideoCaptureInput input_; |
| 157 }; | 158 }; |
| 158 } // namespace internal | 159 } // namespace internal |
| 159 } // namespace webrtc | 160 } // namespace webrtc |
| 160 | 161 |
| 161 #endif // WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_ | 162 #endif // WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_ |
| OLD | NEW |