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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // decisions on that thread with regards to the current codec. | 79 // decisions on that thread with regards to the current codec. |
80 int32_t SendCodecBlocking(VideoCodec* currentSendCodec) const; | 80 int32_t SendCodecBlocking(VideoCodec* currentSendCodec) const; |
81 | 81 |
82 // Same as SendCodecBlocking. Try to use GetSendCodec() instead. | 82 // Same as SendCodecBlocking. Try to use GetSendCodec() instead. |
83 VideoCodecType SendCodecBlocking() const; | 83 VideoCodecType SendCodecBlocking() const; |
84 | 84 |
85 int32_t RegisterExternalEncoder(VideoEncoder* externalEncoder, | 85 int32_t RegisterExternalEncoder(VideoEncoder* externalEncoder, |
86 uint8_t payloadType, | 86 uint8_t payloadType, |
87 bool internalSource); | 87 bool internalSource); |
88 | 88 |
89 int32_t CodecConfigParameters(uint8_t* buffer, int32_t size) const; | |
90 int Bitrate(unsigned int* bitrate) const; | 89 int Bitrate(unsigned int* bitrate) const; |
91 int FrameRate(unsigned int* framerate) const; | 90 int FrameRate(unsigned int* framerate) const; |
92 | 91 |
93 int32_t SetChannelParameters(uint32_t target_bitrate, // bits/s. | 92 int32_t SetChannelParameters(uint32_t target_bitrate, // bits/s. |
94 uint8_t lossRate, | 93 uint8_t lossRate, |
95 int64_t rtt); | 94 int64_t rtt); |
96 | 95 |
97 int32_t RegisterTransportCallback(VCMPacketizationCallback* transport); | 96 int32_t RegisterTransportCallback(VCMPacketizationCallback* transport); |
98 int32_t RegisterSendStatisticsCallback(VCMSendStatisticsCallback* sendStats); | 97 int32_t RegisterSendStatisticsCallback(VCMSendStatisticsCallback* sendStats); |
99 int32_t RegisterProtectionCallback(VCMProtectionCallback* protection); | 98 int32_t RegisterProtectionCallback(VCMProtectionCallback* protection); |
100 void SetVideoProtection(VCMVideoProtection videoProtection); | 99 void SetVideoProtection(VCMVideoProtection videoProtection); |
101 | 100 |
102 int32_t AddVideoFrame(const VideoFrame& videoFrame, | 101 int32_t AddVideoFrame(const VideoFrame& videoFrame, |
103 const VideoContentMetrics* _contentMetrics, | 102 const VideoContentMetrics* _contentMetrics, |
104 const CodecSpecificInfo* codecSpecificInfo); | 103 const CodecSpecificInfo* codecSpecificInfo); |
105 | 104 |
106 int32_t IntraFrameRequest(int stream_index); | 105 int32_t IntraFrameRequest(int stream_index); |
107 int32_t EnableFrameDropper(bool enable); | 106 int32_t EnableFrameDropper(bool enable); |
108 | 107 |
109 void SuspendBelowMinBitrate(); | 108 void SuspendBelowMinBitrate(); |
110 bool VideoSuspended() const; | 109 bool VideoSuspended() const; |
111 | 110 |
112 int64_t TimeUntilNextProcess(); | 111 int64_t TimeUntilNextProcess(); |
113 int32_t Process(); | 112 int32_t Process(); |
114 | 113 |
115 private: | 114 private: |
116 struct EncoderParameters { | |
117 uint32_t target_bitrate; | |
118 uint8_t loss_rate; | |
119 int64_t rtt; | |
120 uint32_t input_frame_rate; | |
121 bool updated; | |
122 }; | |
123 | |
124 void SetEncoderParameters(EncoderParameters params) | 115 void SetEncoderParameters(EncoderParameters params) |
125 EXCLUSIVE_LOCKS_REQUIRED(send_crit_); | 116 EXCLUSIVE_LOCKS_REQUIRED(send_crit_); |
126 | 117 |
127 Clock* const clock_; | 118 Clock* const clock_; |
128 | 119 |
129 rtc::scoped_ptr<CriticalSectionWrapper> process_crit_sect_; | 120 rtc::scoped_ptr<CriticalSectionWrapper> process_crit_sect_; |
130 mutable rtc::CriticalSection send_crit_; | 121 mutable rtc::CriticalSection send_crit_; |
131 VCMGenericEncoder* _encoder; | 122 VCMGenericEncoder* _encoder; |
132 VCMEncodedFrameCallback _encodedFrameCallback; | 123 VCMEncodedFrameCallback _encodedFrameCallback; |
133 std::vector<FrameType> _nextFrameTypes; | 124 std::vector<FrameType> _nextFrameTypes; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 VCMCodecDataBase _codecDataBase GUARDED_BY(_receiveCritSect); | 228 VCMCodecDataBase _codecDataBase GUARDED_BY(_receiveCritSect); |
238 VCMProcessTimer _receiveStatsTimer; | 229 VCMProcessTimer _receiveStatsTimer; |
239 VCMProcessTimer _retransmissionTimer; | 230 VCMProcessTimer _retransmissionTimer; |
240 VCMProcessTimer _keyRequestTimer; | 231 VCMProcessTimer _keyRequestTimer; |
241 QpParser qp_parser_; | 232 QpParser qp_parser_; |
242 }; | 233 }; |
243 | 234 |
244 } // namespace vcm | 235 } // namespace vcm |
245 } // namespace webrtc | 236 } // namespace webrtc |
246 #endif // WEBRTC_MODULES_VIDEO_CODING_VIDEO_CODING_IMPL_H_ | 237 #endif // WEBRTC_MODULES_VIDEO_CODING_VIDEO_CODING_IMPL_H_ |
OLD | NEW |