OLD | NEW |
1 /* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 1 /* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
2 * | 2 * |
3 * Use of this source code is governed by a BSD-style license | 3 * Use of this source code is governed by a BSD-style license |
4 * that can be found in the LICENSE file in the root of the source | 4 * that can be found in the LICENSE file in the root of the source |
5 * tree. An additional intellectual property rights grant can be found | 5 * tree. An additional intellectual property rights grant can be found |
6 * in the file PATENTS. All contributing project authors may | 6 * in the file PATENTS. All contributing project authors may |
7 * be found in the AUTHORS file in the root of the source tree. | 7 * be found in the AUTHORS file in the root of the source tree. |
8 */ | 8 */ |
9 /* | 9 /* |
10 * This file defines classes for doing temporal layers with VP8. | 10 * This file defines classes for doing temporal layers with VP8. |
(...skipping 10 matching lines...) Expand all Loading... |
21 namespace webrtc { | 21 namespace webrtc { |
22 | 22 |
23 class DefaultTemporalLayers : public TemporalLayers { | 23 class DefaultTemporalLayers : public TemporalLayers { |
24 public: | 24 public: |
25 DefaultTemporalLayers(int number_of_temporal_layers, | 25 DefaultTemporalLayers(int number_of_temporal_layers, |
26 uint8_t initial_tl0_pic_idx); | 26 uint8_t initial_tl0_pic_idx); |
27 virtual ~DefaultTemporalLayers() {} | 27 virtual ~DefaultTemporalLayers() {} |
28 | 28 |
29 // Returns the recommended VP8 encode flags needed. May refresh the decoder | 29 // Returns the recommended VP8 encode flags needed. May refresh the decoder |
30 // and/or update the reference buffers. | 30 // and/or update the reference buffers. |
31 TemporalReferences UpdateLayerConfig(uint32_t timestamp) override; | 31 TemporalLayers::FrameConfig UpdateLayerConfig(uint32_t timestamp) override; |
32 | 32 |
33 // Update state based on new bitrate target and incoming framerate. | 33 // Update state based on new bitrate target and incoming framerate. |
34 // Returns the bitrate allocation for the active temporal layers. | 34 // Returns the bitrate allocation for the active temporal layers. |
35 std::vector<uint32_t> OnRatesUpdated(int bitrate_kbps, | 35 std::vector<uint32_t> OnRatesUpdated(int bitrate_kbps, |
36 int max_bitrate_kbps, | 36 int max_bitrate_kbps, |
37 int framerate) override; | 37 int framerate) override; |
38 | 38 |
39 bool UpdateConfiguration(vpx_codec_enc_cfg_t* cfg) override; | 39 bool UpdateConfiguration(vpx_codec_enc_cfg_t* cfg) override; |
40 | 40 |
41 void PopulateCodecSpecific(bool frame_is_keyframe, | 41 void PopulateCodecSpecific(bool frame_is_keyframe, |
| 42 TemporalLayers::FrameConfig tl_config, |
42 CodecSpecificInfoVP8* vp8_info, | 43 CodecSpecificInfoVP8* vp8_info, |
43 uint32_t timestamp) override; | 44 uint32_t timestamp) override; |
44 | 45 |
45 void FrameEncoded(unsigned int size, int qp) override {} | 46 void FrameEncoded(unsigned int size, int qp) override {} |
46 | 47 |
47 int CurrentLayerId() const override; | 48 int GetTemporalLayerId(TemporalLayers::FrameConfig references) const override; |
48 | 49 |
49 private: | 50 private: |
50 const size_t num_layers_; | 51 const size_t num_layers_; |
51 const std::vector<unsigned int> temporal_ids_; | 52 const std::vector<unsigned int> temporal_ids_; |
52 const std::vector<TemporalReferences> temporal_pattern_; | 53 const std::vector<TemporalLayers::FrameConfig> temporal_pattern_; |
53 | 54 |
54 uint8_t tl0_pic_idx_; | 55 uint8_t tl0_pic_idx_; |
55 uint8_t pattern_idx_; | 56 uint8_t pattern_idx_; |
56 uint32_t timestamp_; | 57 uint32_t timestamp_; |
57 bool last_base_layer_sync_; | 58 bool last_base_layer_sync_; |
58 rtc::Optional<std::vector<uint32_t>> new_bitrates_kbps_; | 59 rtc::Optional<std::vector<uint32_t>> new_bitrates_kbps_; |
59 }; | 60 }; |
60 | 61 |
61 } // namespace webrtc | 62 } // namespace webrtc |
62 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_DEFAULT_TEMPORAL_LAYERS_H_ | 63 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_DEFAULT_TEMPORAL_LAYERS_H_ |
OLD | NEW |