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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 bool internal_source); | 76 bool internal_source); |
77 int32_t DeRegisterExternalEncoder(uint8_t pl_type); | 77 int32_t DeRegisterExternalEncoder(uint8_t pl_type); |
78 void SetEncoder(const VideoCodec& video_codec, | 78 void SetEncoder(const VideoCodec& video_codec, |
79 int min_transmit_bitrate_bps, | 79 int min_transmit_bitrate_bps, |
80 size_t max_data_payload_length, | 80 size_t max_data_payload_length, |
81 EncodedImageCallback* sink); | 81 EncodedImageCallback* sink); |
82 | 82 |
83 void EncodeVideoFrame(const VideoFrame& video_frame); | 83 void EncodeVideoFrame(const VideoFrame& video_frame); |
84 void SendKeyFrame(); | 84 void SendKeyFrame(); |
85 | 85 |
86 uint32_t LastObservedBitrateBps() const; | |
87 // Loss protection. Must be called before SetEncoder() to have max packet size | |
88 // updated according to protection. | |
89 // TODO(pbos): Set protection method on construction. | |
90 void SetProtectionMethod(bool nack, bool fec); | |
91 | |
92 // Implements VideoEncoderRateObserver. | 86 // Implements VideoEncoderRateObserver. |
| 87 // TODO(perkj): Refactor VideoEncoderRateObserver. This is only used for |
| 88 // stats. The stats should be set in VideoSendStream instead. |
| 89 // |bitrate_bps| is the target bitrate and |framerate| is the input frame |
| 90 // rate so it has nothing to do with the actual encoder. |
93 void OnSetRates(uint32_t bitrate_bps, int framerate) override; | 91 void OnSetRates(uint32_t bitrate_bps, int framerate) override; |
94 | 92 |
95 // Implements EncodedImageCallback. | 93 // Implements EncodedImageCallback. |
96 int32_t Encoded(const EncodedImage& encoded_image, | 94 int32_t Encoded(const EncodedImage& encoded_image, |
97 const CodecSpecificInfo* codec_specific_info, | 95 const CodecSpecificInfo* codec_specific_info, |
98 const RTPFragmentationHeader* fragmentation) override; | 96 const RTPFragmentationHeader* fragmentation) override; |
99 | 97 |
100 // Implements VideoSendStatisticsCallback. | 98 // Implements VideoSendStatisticsCallback. |
101 void SendStatistics(uint32_t bit_rate, | 99 void SendStatistics(uint32_t bit_rate, |
102 uint32_t frame_rate, | 100 uint32_t frame_rate, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 uint8_t picture_id_sli_ GUARDED_BY(data_cs_); | 145 uint8_t picture_id_sli_ GUARDED_BY(data_cs_); |
148 bool has_received_rpsi_ GUARDED_BY(data_cs_); | 146 bool has_received_rpsi_ GUARDED_BY(data_cs_); |
149 uint64_t picture_id_rpsi_ GUARDED_BY(data_cs_); | 147 uint64_t picture_id_rpsi_ GUARDED_BY(data_cs_); |
150 | 148 |
151 bool video_suspended_ GUARDED_BY(data_cs_); | 149 bool video_suspended_ GUARDED_BY(data_cs_); |
152 }; | 150 }; |
153 | 151 |
154 } // namespace webrtc | 152 } // namespace webrtc |
155 | 153 |
156 #endif // WEBRTC_VIDEO_VIE_ENCODER_H_ | 154 #endif // WEBRTC_VIDEO_VIE_ENCODER_H_ |
OLD | NEW |