| 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 17 matching lines...) Expand all Loading... |
| 28 #include "webrtc/modules/video_coding/jitter_buffer.h" | 28 #include "webrtc/modules/video_coding/jitter_buffer.h" |
| 29 #include "webrtc/modules/video_coding/media_optimization.h" | 29 #include "webrtc/modules/video_coding/media_optimization.h" |
| 30 #include "webrtc/modules/video_coding/receiver.h" | 30 #include "webrtc/modules/video_coding/receiver.h" |
| 31 #include "webrtc/modules/video_coding/timing.h" | 31 #include "webrtc/modules/video_coding/timing.h" |
| 32 #include "webrtc/modules/video_coding/utility/qp_parser.h" | 32 #include "webrtc/modules/video_coding/utility/qp_parser.h" |
| 33 #include "webrtc/system_wrappers/include/clock.h" | 33 #include "webrtc/system_wrappers/include/clock.h" |
| 34 | 34 |
| 35 namespace webrtc { | 35 namespace webrtc { |
| 36 | 36 |
| 37 class VideoBitrateAllocator; | 37 class VideoBitrateAllocator; |
| 38 class VideoBitrateAllocationObserver; |
| 38 | 39 |
| 39 namespace vcm { | 40 namespace vcm { |
| 40 | 41 |
| 41 class VCMProcessTimer { | 42 class VCMProcessTimer { |
| 42 public: | 43 public: |
| 43 static const int64_t kDefaultProcessIntervalMs = 1000; | 44 static const int64_t kDefaultProcessIntervalMs = 1000; |
| 44 | 45 |
| 45 VCMProcessTimer(int64_t periodMs, Clock* clock) | 46 VCMProcessTimer(int64_t periodMs, Clock* clock) |
| 46 : _clock(clock), | 47 : _clock(clock), |
| 47 _periodMs(periodMs), | 48 _periodMs(periodMs), |
| (...skipping 24 matching lines...) Expand all Loading... |
| 72 uint32_t numberOfCores, | 73 uint32_t numberOfCores, |
| 73 uint32_t maxPayloadSize); | 74 uint32_t maxPayloadSize); |
| 74 | 75 |
| 75 void RegisterExternalEncoder(VideoEncoder* externalEncoder, | 76 void RegisterExternalEncoder(VideoEncoder* externalEncoder, |
| 76 uint8_t payloadType, | 77 uint8_t payloadType, |
| 77 bool internalSource); | 78 bool internalSource); |
| 78 | 79 |
| 79 int Bitrate(unsigned int* bitrate) const; | 80 int Bitrate(unsigned int* bitrate) const; |
| 80 int FrameRate(unsigned int* framerate) const; | 81 int FrameRate(unsigned int* framerate) const; |
| 81 | 82 |
| 82 int32_t SetChannelParameters(uint32_t target_bitrate_bps, | 83 // Update the channel parameters based on new rates and rtt. This will also |
| 83 uint8_t lossRate, | 84 // cause an immediate call to VideoEncoder::SetRateAllocation(). |
| 84 int64_t rtt, | 85 int32_t SetChannelParameters( |
| 85 VideoBitrateAllocator* bitrate_allocator); | 86 uint32_t target_bitrate_bps, |
| 86 // Updates the channel parameters, with a reallocated bitrate based on a | 87 uint8_t loss_rate, |
| 87 // presumably updated codec configuration, but does not update the encoder | 88 int64_t rtt, |
| 88 // itself (it will be updated on the next frame). | 89 VideoBitrateAllocator* bitrate_allocator, |
| 89 void UpdateChannelParemeters(VideoBitrateAllocator* bitrate_allocator); | 90 VideoBitrateAllocationObserver* bitrate_updated_callback); |
| 91 |
| 92 // Updates the channel parameters with a new bitrate allocation, but using the |
| 93 // current targit_bitrate, loss rate and rtt. That is, the distribution or |
| 94 // caps may be updated to a change to a new VideoCodec or allocation mode. |
| 95 // The new parameters will be stored as pending EncoderParameters, and the |
| 96 // encoder will only be updated on the next frame. |
| 97 void UpdateChannelParemeters( |
| 98 VideoBitrateAllocator* bitrate_allocator, |
| 99 VideoBitrateAllocationObserver* bitrate_updated_callback); |
| 90 | 100 |
| 91 // Deprecated: | 101 // Deprecated: |
| 92 // TODO(perkj): Remove once no projects use it. | 102 // TODO(perkj): Remove once no projects use it. |
| 93 int32_t RegisterProtectionCallback(VCMProtectionCallback* protection); | 103 int32_t RegisterProtectionCallback(VCMProtectionCallback* protection); |
| 94 | 104 |
| 95 int32_t AddVideoFrame(const VideoFrame& videoFrame, | 105 int32_t AddVideoFrame(const VideoFrame& videoFrame, |
| 96 const CodecSpecificInfo* codecSpecificInfo); | 106 const CodecSpecificInfo* codecSpecificInfo); |
| 97 | 107 |
| 98 int32_t IntraFrameRequest(size_t stream_index); | 108 int32_t IntraFrameRequest(size_t stream_index); |
| 99 int32_t EnableFrameDropper(bool enable); | 109 int32_t EnableFrameDropper(bool enable); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 VCMProcessTimer _receiveStatsTimer; | 228 VCMProcessTimer _receiveStatsTimer; |
| 219 VCMProcessTimer _retransmissionTimer; | 229 VCMProcessTimer _retransmissionTimer; |
| 220 VCMProcessTimer _keyRequestTimer; | 230 VCMProcessTimer _keyRequestTimer; |
| 221 QpParser qp_parser_; | 231 QpParser qp_parser_; |
| 222 ThreadUnsafeOneTimeEvent first_frame_received_; | 232 ThreadUnsafeOneTimeEvent first_frame_received_; |
| 223 }; | 233 }; |
| 224 | 234 |
| 225 } // namespace vcm | 235 } // namespace vcm |
| 226 } // namespace webrtc | 236 } // namespace webrtc |
| 227 #endif // WEBRTC_MODULES_VIDEO_CODING_VIDEO_CODING_IMPL_H_ | 237 #endif // WEBRTC_MODULES_VIDEO_CODING_VIDEO_CODING_IMPL_H_ |
| OLD | NEW |