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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 void SetNetworkTransmissionState(bool is_transmitting); | 75 void SetNetworkTransmissionState(bool is_transmitting); |
76 | 76 |
77 // Returns the id of the owning channel. | 77 // Returns the id of the owning channel. |
78 int Owner() const; | 78 int Owner() const; |
79 | 79 |
80 // Drops incoming packets before they get to the encoder. | 80 // Drops incoming packets before they get to the encoder. |
81 void Pause(); | 81 void Pause(); |
82 void Restart(); | 82 void Restart(); |
83 | 83 |
84 // Codec settings. | 84 // Codec settings. |
85 int32_t RegisterExternalEncoder(VideoEncoder* encoder, | 85 void SetEncoder(const VideoCodec& video_codec); |
86 uint8_t pl_type, | |
87 bool internal_source); | |
88 int32_t DeRegisterExternalEncoder(uint8_t pl_type); | |
89 int32_t SetEncoder(const VideoCodec& video_codec); | |
90 | 86 |
91 // Implementing VideoCaptureCallback. | 87 // Implementing VideoCaptureCallback. |
92 void DeliverFrame(VideoFrame video_frame) override; | 88 void DeliverFrame(VideoFrame video_frame) override; |
93 | 89 |
94 void SendKeyFrame(); | 90 void SendKeyFrame(); |
95 | 91 |
96 uint32_t LastObservedBitrateBps() const; | 92 uint32_t LastObservedBitrateBps() const; |
97 int CodecTargetBitrate(uint32_t* bitrate) const; | 93 int CodecTargetBitrate(uint32_t* bitrate) const; |
98 // Loss protection. Must be called before SetEncoder() to have max packet size | 94 // Loss protection. Must be called before SetEncoder() to have max packet size |
99 // updated according to protection. | 95 // updated according to protection. |
(...skipping 22 matching lines...) Expand all Loading... |
122 void OnReceivedIntraFrameRequest(uint32_t ssrc) override; | 118 void OnReceivedIntraFrameRequest(uint32_t ssrc) override; |
123 void OnReceivedSLI(uint32_t ssrc, uint8_t picture_id) override; | 119 void OnReceivedSLI(uint32_t ssrc, uint8_t picture_id) override; |
124 void OnReceivedRPSI(uint32_t ssrc, uint64_t picture_id) override; | 120 void OnReceivedRPSI(uint32_t ssrc, uint64_t picture_id) override; |
125 void OnLocalSsrcChanged(uint32_t old_ssrc, uint32_t new_ssrc) override; | 121 void OnLocalSsrcChanged(uint32_t old_ssrc, uint32_t new_ssrc) override; |
126 | 122 |
127 // Sets SSRCs for all streams. | 123 // Sets SSRCs for all streams. |
128 void SetSsrcs(const std::vector<uint32_t>& ssrcs); | 124 void SetSsrcs(const std::vector<uint32_t>& ssrcs); |
129 | 125 |
130 void SetMinTransmitBitrate(int min_transmit_bitrate_kbps); | 126 void SetMinTransmitBitrate(int min_transmit_bitrate_kbps); |
131 | 127 |
132 // Lets the sender suspend video when the rate drops below | |
133 // |threshold_bps|, and turns back on when the rate goes back up above | |
134 // |threshold_bps| + |window_bps|. | |
135 void SuspendBelowMinBitrate(); | |
136 | |
137 // New-style callbacks, used by VideoSendStream. | 128 // New-style callbacks, used by VideoSendStream. |
138 void RegisterPostEncodeImageCallback( | 129 void RegisterPostEncodeImageCallback( |
139 EncodedImageCallback* post_encode_callback); | 130 EncodedImageCallback* post_encode_callback); |
140 | 131 |
141 int GetPaddingNeededBps() const; | 132 int GetPaddingNeededBps() const; |
| 133 VideoCodingModule* vcm() const; |
142 | 134 |
143 protected: | 135 protected: |
144 // Called by BitrateObserver. | 136 // Called by BitrateObserver. |
145 void OnNetworkChanged(uint32_t bitrate_bps, | 137 void OnNetworkChanged(uint32_t bitrate_bps, |
146 uint8_t fraction_lost, | 138 uint8_t fraction_lost, |
147 int64_t round_trip_time_ms); | 139 int64_t round_trip_time_ms); |
148 | 140 |
149 private: | 141 private: |
150 bool EncoderPaused() const EXCLUSIVE_LOCKS_REQUIRED(data_cs_); | 142 bool EncoderPaused() const EXCLUSIVE_LOCKS_REQUIRED(data_cs_); |
151 void TraceFrameDropStart() EXCLUSIVE_LOCKS_REQUIRED(data_cs_); | 143 void TraceFrameDropStart() EXCLUSIVE_LOCKS_REQUIRED(data_cs_); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 bool has_received_rpsi_ GUARDED_BY(data_cs_); | 179 bool has_received_rpsi_ GUARDED_BY(data_cs_); |
188 uint64_t picture_id_rpsi_ GUARDED_BY(data_cs_); | 180 uint64_t picture_id_rpsi_ GUARDED_BY(data_cs_); |
189 std::map<uint32_t, int> ssrc_streams_ GUARDED_BY(data_cs_); | 181 std::map<uint32_t, int> ssrc_streams_ GUARDED_BY(data_cs_); |
190 | 182 |
191 bool video_suspended_ GUARDED_BY(data_cs_); | 183 bool video_suspended_ GUARDED_BY(data_cs_); |
192 }; | 184 }; |
193 | 185 |
194 } // namespace webrtc | 186 } // namespace webrtc |
195 | 187 |
196 #endif // WEBRTC_VIDEO_VIE_ENCODER_H_ | 188 #endif // WEBRTC_VIDEO_VIE_ENCODER_H_ |
OLD | NEW |