Chromium Code Reviews| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 80 void Restart(); | 80 void Restart(); | 
| 81 | 81 | 
| 82 // Codec settings. | 82 // Codec settings. | 
| 83 uint8_t NumberOfCodecs(); | 83 uint8_t NumberOfCodecs(); | 
| 84 int32_t GetCodec(uint8_t list_index, VideoCodec* video_codec); | 84 int32_t GetCodec(uint8_t list_index, VideoCodec* video_codec); | 
| 85 int32_t RegisterExternalEncoder(VideoEncoder* encoder, | 85 int32_t RegisterExternalEncoder(VideoEncoder* encoder, | 
| 86 uint8_t pl_type, | 86 uint8_t pl_type, | 
| 87 bool internal_source); | 87 bool internal_source); | 
| 88 int32_t DeRegisterExternalEncoder(uint8_t pl_type); | 88 int32_t DeRegisterExternalEncoder(uint8_t pl_type); | 
| 89 int32_t SetEncoder(const VideoCodec& video_codec); | 89 int32_t SetEncoder(const VideoCodec& video_codec); | 
| 90 int32_t GetEncoder(VideoCodec* video_codec); | |
| 91 | 90 | 
| 92 // Scale or crop/pad image. | 91 // Scale or crop/pad image. | 
| 93 int32_t ScaleInputImage(bool enable); | 92 int32_t ScaleInputImage(bool enable); | 
| 94 | 93 | 
| 95 // Implementing VideoCaptureCallback. | 94 // Implementing VideoCaptureCallback. | 
| 96 void DeliverFrame(VideoFrame video_frame) override; | 95 void DeliverFrame(VideoFrame video_frame) override; | 
| 97 | 96 | 
| 98 int32_t SendKeyFrame(); | 97 int32_t SendKeyFrame(); | 
| 99 | 98 | 
| 100 uint32_t LastObservedBitrateBps() const; | 99 uint32_t LastObservedBitrateBps() const; | 
| 101 int CodecTargetBitrate(uint32_t* bitrate) const; | 100 int CodecTargetBitrate(uint32_t* bitrate) const; | 
| 102 // Loss protection. | 101 // Loss protection. Must be called before SetEncoder() to have max packet size | 
| 103 int32_t UpdateProtectionMethod(bool nack, bool fec); | 102 // updated according to protection. | 
| 
 
stefan-webrtc
2015/11/10 15:15:26
Add a TODO to move to construction, or in some way
 
pbos-webrtc
2015/11/10 15:18:52
Done.
 
 | |
| 104 bool nack_enabled() const { return nack_enabled_; } | 103 void SetProtectionMethod(bool nack, bool fec); | 
| 105 | 104 | 
| 106 // Buffering mode. | 105 // Buffering mode. | 
| 107 void SetSenderBufferingMode(int target_delay_ms); | 106 void SetSenderBufferingMode(int target_delay_ms); | 
| 108 | 107 | 
| 109 // Implements VideoEncoderRateObserver. | 108 // Implements VideoEncoderRateObserver. | 
| 110 void OnSetRates(uint32_t bitrate_bps, int framerate) override; | 109 void OnSetRates(uint32_t bitrate_bps, int framerate) override; | 
| 111 | 110 | 
| 112 // Implements VCMPacketizationCallback. | 111 // Implements VCMPacketizationCallback. | 
| 113 int32_t SendData(uint8_t payload_type, | 112 int32_t SendData(uint8_t payload_type, | 
| 114 const EncodedImage& encoded_image, | 113 const EncodedImage& encoded_image, | 
| 115 const RTPFragmentationHeader& fragmentation_header, | 114 const RTPFragmentationHeader& fragmentation_header, | 
| 116 const RTPVideoHeader* rtp_video_hdr) override; | 115 const RTPVideoHeader* rtp_video_hdr) override; | 
| 117 | 116 | 
| 118 // Implements VideoSendStatisticsCallback. | 117 // Implements VideoSendStatisticsCallback. | 
| 119 int32_t SendStatistics(const uint32_t bit_rate, | 118 int32_t SendStatistics(const uint32_t bit_rate, | 
| 120 const uint32_t frame_rate) override; | 119 const uint32_t frame_rate) override; | 
| 121 | 120 | 
| 122 // Implements RtcpIntraFrameObserver. | 121 // Implements RtcpIntraFrameObserver. | 
| 123 void OnReceivedIntraFrameRequest(uint32_t ssrc) override; | 122 void OnReceivedIntraFrameRequest(uint32_t ssrc) override; | 
| 124 void OnReceivedSLI(uint32_t ssrc, uint8_t picture_id) override; | 123 void OnReceivedSLI(uint32_t ssrc, uint8_t picture_id) override; | 
| 125 void OnReceivedRPSI(uint32_t ssrc, uint64_t picture_id) override; | 124 void OnReceivedRPSI(uint32_t ssrc, uint64_t picture_id) override; | 
| 126 void OnLocalSsrcChanged(uint32_t old_ssrc, uint32_t new_ssrc) override; | 125 void OnLocalSsrcChanged(uint32_t old_ssrc, uint32_t new_ssrc) override; | 
| 127 | 126 | 
| 128 // Sets SSRCs for all streams. | 127 // Sets SSRCs for all streams. | 
| 129 bool SetSsrcs(const std::vector<uint32_t>& ssrcs); | 128 void SetSsrcs(const std::vector<uint32_t>& ssrcs); | 
| 130 | 129 | 
| 131 void SetMinTransmitBitrate(int min_transmit_bitrate_kbps); | 130 void SetMinTransmitBitrate(int min_transmit_bitrate_kbps); | 
| 132 | 131 | 
| 133 // Lets the sender suspend video when the rate drops below | 132 // Lets the sender suspend video when the rate drops below | 
| 134 // |threshold_bps|, and turns back on when the rate goes back up above | 133 // |threshold_bps|, and turns back on when the rate goes back up above | 
| 135 // |threshold_bps| + |window_bps|. | 134 // |threshold_bps| + |window_bps|. | 
| 136 void SuspendBelowMinBitrate(); | 135 void SuspendBelowMinBitrate(); | 
| 137 | 136 | 
| 138 // New-style callbacks, used by VideoSendStream. | 137 // New-style callbacks, used by VideoSendStream. | 
| 139 void RegisterPostEncodeImageCallback( | 138 void RegisterPostEncodeImageCallback( | 
| (...skipping 24 matching lines...) Expand all Loading... | |
| 164 | 163 | 
| 165 SendStatisticsProxy* const stats_proxy_; | 164 SendStatisticsProxy* const stats_proxy_; | 
| 166 I420FrameCallback* const pre_encode_callback_; | 165 I420FrameCallback* const pre_encode_callback_; | 
| 167 PacedSender* const pacer_; | 166 PacedSender* const pacer_; | 
| 168 BitrateAllocator* const bitrate_allocator_; | 167 BitrateAllocator* const bitrate_allocator_; | 
| 169 | 168 | 
| 170 // The time we last received an input frame or encoded frame. This is used to | 169 // The time we last received an input frame or encoded frame. This is used to | 
| 171 // track when video is stopped long enough that we also want to stop sending | 170 // track when video is stopped long enough that we also want to stop sending | 
| 172 // padding. | 171 // padding. | 
| 173 int64_t time_of_last_frame_activity_ms_ GUARDED_BY(data_cs_); | 172 int64_t time_of_last_frame_activity_ms_ GUARDED_BY(data_cs_); | 
| 174 bool simulcast_enabled_ GUARDED_BY(data_cs_); | 173 VideoCodec encoder_config_ GUARDED_BY(data_cs_); | 
| 175 int min_transmit_bitrate_kbps_ GUARDED_BY(data_cs_); | 174 int min_transmit_bitrate_kbps_ GUARDED_BY(data_cs_); | 
| 176 uint32_t last_observed_bitrate_bps_ GUARDED_BY(data_cs_); | 175 uint32_t last_observed_bitrate_bps_ GUARDED_BY(data_cs_); | 
| 177 int target_delay_ms_ GUARDED_BY(data_cs_); | 176 int target_delay_ms_ GUARDED_BY(data_cs_); | 
| 178 bool network_is_transmitting_ GUARDED_BY(data_cs_); | 177 bool network_is_transmitting_ GUARDED_BY(data_cs_); | 
| 179 bool encoder_paused_ GUARDED_BY(data_cs_); | 178 bool encoder_paused_ GUARDED_BY(data_cs_); | 
| 180 bool encoder_paused_and_dropped_frame_ GUARDED_BY(data_cs_); | 179 bool encoder_paused_and_dropped_frame_ GUARDED_BY(data_cs_); | 
| 181 std::map<unsigned int, int64_t> time_last_intra_request_ms_ | 180 std::map<unsigned int, int64_t> time_last_intra_request_ms_ | 
| 182 GUARDED_BY(data_cs_); | 181 GUARDED_BY(data_cs_); | 
| 183 | 182 | 
| 184 bool fec_enabled_; | |
| 185 bool nack_enabled_; | |
| 186 | |
| 187 ProcessThread* module_process_thread_; | 183 ProcessThread* module_process_thread_; | 
| 188 | 184 | 
| 189 bool has_received_sli_ GUARDED_BY(data_cs_); | 185 bool has_received_sli_ GUARDED_BY(data_cs_); | 
| 190 uint8_t picture_id_sli_ GUARDED_BY(data_cs_); | 186 uint8_t picture_id_sli_ GUARDED_BY(data_cs_); | 
| 191 bool has_received_rpsi_ GUARDED_BY(data_cs_); | 187 bool has_received_rpsi_ GUARDED_BY(data_cs_); | 
| 192 uint64_t picture_id_rpsi_ GUARDED_BY(data_cs_); | 188 uint64_t picture_id_rpsi_ GUARDED_BY(data_cs_); | 
| 193 std::map<uint32_t, int> ssrc_streams_ GUARDED_BY(data_cs_); | 189 std::map<uint32_t, int> ssrc_streams_ GUARDED_BY(data_cs_); | 
| 194 | 190 | 
| 195 bool video_suspended_ GUARDED_BY(data_cs_); | 191 bool video_suspended_ GUARDED_BY(data_cs_); | 
| 196 }; | 192 }; | 
| 197 | 193 | 
| 198 } // namespace webrtc | 194 } // namespace webrtc | 
| 199 | 195 | 
| 200 #endif // WEBRTC_VIDEO_ENGINE_VIE_ENCODER_H_ | 196 #endif // WEBRTC_VIDEO_ENGINE_VIE_ENCODER_H_ | 
| OLD | NEW |