Chromium Code Reviews| Index: webrtc/modules/video_coding/codecs/vp9/screenshare_layers.h |
| diff --git a/webrtc/modules/video_coding/codecs/vp9/screenshare_layers.h b/webrtc/modules/video_coding/codecs/vp9/screenshare_layers.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..53dc401ded147911fa2c16cadf019102c6d70818 |
| --- /dev/null |
| +++ b/webrtc/modules/video_coding/codecs/vp9/screenshare_layers.h |
| @@ -0,0 +1,53 @@ |
| +/* Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
| +* |
| +* Use of this source code is governed by a BSD-style license |
| +* that can be found in the LICENSE file in the root of the source |
| +* tree. An additional intellectual property rights grant can be found |
| +* in the file PATENTS. All contributing project authors may |
| +* be found in the AUTHORS file in the root of the source tree. |
| +*/ |
| + |
| +#ifndef WEBRTC_SCREENSHARE_LAYERS_H |
| +#define WEBRTC_SCREENSHARE_LAYERS_H |
| + |
| +#include "webrtc/modules/video_coding/codecs/vp9/vp9_impl.h" |
| + |
| +namespace webrtc { |
| + |
| +class ScreenshareLayersVP9 { |
|
stefan-webrtc
2015/10/28 13:59:04
Maybe we should add a comment above here to descri
philipel1
2015/10/29 14:49:27
Done.
|
| + public: |
| + explicit ScreenshareLayersVP9(uint8_t num_layers); |
| + |
| + // The target bitrate for layer with id layer_id. |
| + void ConfigureBitrate(int threshold_kbps, uint8_t layer_id); |
| + |
| + // The current start layer. |
| + uint8_t GetStartLayer() const; |
| + |
| + // Update the layer with the size of the layer frame. |
| + void LayerFrameEncoded(unsigned int size_bytes, uint8_t layer_id); |
| + |
| + // Get the layer settings for the next superframe. |
| + VP9EncoderImpl::SuperFrameRefSettings GetSuperFrameSettings( |
| + uint32_t timestamp, |
| + bool is_keyframe); |
| + |
| + private: |
| + uint8_t num_layers_; |
| + uint8_t current_layer_; |
| + |
| + // Cummulative target kbps for the different layers. |
| + float threshold_kbps_[kMaxVp9NumberOfSpatialLayers - 1]; |
| + |
| + // How many bits that has been used for a certain layer. Increased in |
| + // FrameEncoded() by the size of the encoded frame and decreased in |
| + // GetSuperFrameSettings() depending on the time between frames. |
| + float bits_used_[kMaxVp9NumberOfSpatialLayers]; |
| + |
| + // Timestamp of last frame. |
| + uint32_t last_ts_; |
|
stefan-webrtc
2015/10/28 13:59:04
last_timestamp_
philipel1
2015/10/29 14:49:26
Done.
|
| +}; |
| + |
| +} // namespace webrtc |
| + |
| +#endif // WEBRTC_SCREENSHARE_LAYERS_H |