| 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 int32_t SetChannelParameters( |
| 83 uint8_t lossRate, | 84 uint32_t target_bitrate_bps, |
| 84 int64_t rtt, | 85 uint8_t lossRate, |
| 85 VideoBitrateAllocator* bitrate_allocator); | 86 int64_t rtt, |
| 87 VideoBitrateAllocator* bitrate_allocator, |
| 88 VideoBitrateAllocationObserver* bitrate_updated_callback); |
| 86 // Updates the channel parameters, with a reallocated bitrate based on a | 89 // Updates the channel parameters, with a reallocated bitrate based on a |
| 87 // presumably updated codec configuration, but does not update the encoder | 90 // presumably updated codec configuration, but does not update the encoder |
| 88 // itself (it will be updated on the next frame). | 91 // itself (it will be updated on the next frame). |
| 89 void UpdateChannelParemeters(VideoBitrateAllocator* bitrate_allocator); | 92 void UpdateChannelParemeters( |
| 93 VideoBitrateAllocator* bitrate_allocator, |
| 94 VideoBitrateAllocationObserver* bitrate_updated_callback); |
| 90 | 95 |
| 91 // Deprecated: | 96 // Deprecated: |
| 92 // TODO(perkj): Remove once no projects use it. | 97 // TODO(perkj): Remove once no projects use it. |
| 93 int32_t RegisterProtectionCallback(VCMProtectionCallback* protection); | 98 int32_t RegisterProtectionCallback(VCMProtectionCallback* protection); |
| 94 | 99 |
| 95 int32_t AddVideoFrame(const VideoFrame& videoFrame, | 100 int32_t AddVideoFrame(const VideoFrame& videoFrame, |
| 96 const CodecSpecificInfo* codecSpecificInfo); | 101 const CodecSpecificInfo* codecSpecificInfo); |
| 97 | 102 |
| 98 int32_t IntraFrameRequest(size_t stream_index); | 103 int32_t IntraFrameRequest(size_t stream_index); |
| 99 int32_t EnableFrameDropper(bool enable); | 104 int32_t EnableFrameDropper(bool enable); |
| 100 | 105 |
| 101 int64_t TimeUntilNextProcess() override; | 106 int64_t TimeUntilNextProcess() override; |
| 102 void Process() override; | 107 void Process() override; |
| 103 | 108 |
| 104 private: | 109 private: |
| 105 EncoderParameters UpdateEncoderParameters( | 110 EncoderParameters UpdateEncoderParameters( |
| 106 const EncoderParameters& params, | 111 const EncoderParameters& params, |
| 107 VideoBitrateAllocator* bitrate_allocator, | 112 VideoBitrateAllocator* bitrate_allocator, |
| 108 uint32_t target_bitrate_bps); | 113 uint32_t target_bitrate_bps, |
| 114 VideoBitrateAllocationObserver* bitrate_updated_callback); |
| 109 void SetEncoderParameters(EncoderParameters params, bool has_internal_source) | 115 void SetEncoderParameters(EncoderParameters params, bool has_internal_source) |
| 110 EXCLUSIVE_LOCKS_REQUIRED(encoder_crit_); | 116 EXCLUSIVE_LOCKS_REQUIRED(encoder_crit_); |
| 111 | 117 |
| 112 Clock* const clock_; | 118 Clock* const clock_; |
| 113 | 119 |
| 114 rtc::CriticalSection encoder_crit_; | 120 rtc::CriticalSection encoder_crit_; |
| 115 VCMGenericEncoder* _encoder; | 121 VCMGenericEncoder* _encoder; |
| 116 media_optimization::MediaOptimization _mediaOpt; | 122 media_optimization::MediaOptimization _mediaOpt; |
| 117 VCMEncodedFrameCallback _encodedFrameCallback GUARDED_BY(encoder_crit_); | 123 VCMEncodedFrameCallback _encodedFrameCallback GUARDED_BY(encoder_crit_); |
| 118 VCMSendStatisticsCallback* const send_stats_callback_; | 124 VCMSendStatisticsCallback* const send_stats_callback_; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 VCMProcessTimer _receiveStatsTimer; | 223 VCMProcessTimer _receiveStatsTimer; |
| 218 VCMProcessTimer _retransmissionTimer; | 224 VCMProcessTimer _retransmissionTimer; |
| 219 VCMProcessTimer _keyRequestTimer; | 225 VCMProcessTimer _keyRequestTimer; |
| 220 QpParser qp_parser_; | 226 QpParser qp_parser_; |
| 221 ThreadUnsafeOneTimeEvent first_frame_received_; | 227 ThreadUnsafeOneTimeEvent first_frame_received_; |
| 222 }; | 228 }; |
| 223 | 229 |
| 224 } // namespace vcm | 230 } // namespace vcm |
| 225 } // namespace webrtc | 231 } // namespace webrtc |
| 226 #endif // WEBRTC_MODULES_VIDEO_CODING_VIDEO_CODING_IMPL_H_ | 232 #endif // WEBRTC_MODULES_VIDEO_CODING_VIDEO_CODING_IMPL_H_ |
| OLD | NEW |