mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00
Test and fix unscalable video structure.
Bug: webrtc:11999 Change-Id: I94e3a97ebadbf92ca741d750f67fbea5cbd2b66f Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206984 Reviewed-by: Philip Eliasson <philipel@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/master@{#33237}
This commit is contained in:
parent
dea374a467
commit
45d2234a5c
3 changed files with 27 additions and 5 deletions
|
@ -292,7 +292,8 @@ TEST_P(ScalabilityStructureTest, ProduceNoFrameForDisabledLayers) {
|
|||
INSTANTIATE_TEST_SUITE_P(
|
||||
Svc,
|
||||
ScalabilityStructureTest,
|
||||
Values(SvcTestParam{"L1T2", /*num_temporal_units=*/4},
|
||||
Values(SvcTestParam{"NONE", /*num_temporal_units=*/3},
|
||||
SvcTestParam{"L1T2", /*num_temporal_units=*/4},
|
||||
SvcTestParam{"L1T3", /*num_temporal_units=*/8},
|
||||
SvcTestParam{"L2T1", /*num_temporal_units=*/3},
|
||||
SvcTestParam{"L2T1_KEY", /*num_temporal_units=*/3},
|
||||
|
|
|
@ -32,14 +32,28 @@ FrameDependencyStructure
|
|||
ScalableVideoControllerNoLayering::DependencyStructure() const {
|
||||
FrameDependencyStructure structure;
|
||||
structure.num_decode_targets = 1;
|
||||
FrameDependencyTemplate a_template;
|
||||
a_template.decode_target_indications = {DecodeTargetIndication::kSwitch};
|
||||
structure.templates.push_back(a_template);
|
||||
structure.num_chains = 1;
|
||||
structure.decode_target_protected_by_chain = {0};
|
||||
|
||||
FrameDependencyTemplate key_frame;
|
||||
key_frame.decode_target_indications = {DecodeTargetIndication::kSwitch};
|
||||
key_frame.chain_diffs = {0};
|
||||
structure.templates.push_back(key_frame);
|
||||
|
||||
FrameDependencyTemplate delta_frame;
|
||||
delta_frame.decode_target_indications = {DecodeTargetIndication::kSwitch};
|
||||
delta_frame.chain_diffs = {1};
|
||||
delta_frame.frame_diffs = {1};
|
||||
structure.templates.push_back(delta_frame);
|
||||
|
||||
return structure;
|
||||
}
|
||||
|
||||
std::vector<ScalableVideoController::LayerFrameConfig>
|
||||
ScalableVideoControllerNoLayering::NextFrameConfig(bool restart) {
|
||||
if (!enabled_) {
|
||||
return {};
|
||||
}
|
||||
std::vector<LayerFrameConfig> result(1);
|
||||
if (restart || start_) {
|
||||
result[0].Id(0).Keyframe().Update(0);
|
||||
|
@ -61,7 +75,13 @@ GenericFrameInfo ScalableVideoControllerNoLayering::OnEncodeDone(
|
|||
}
|
||||
}
|
||||
frame_info.decode_target_indications = {DecodeTargetIndication::kSwitch};
|
||||
frame_info.part_of_chain = {true};
|
||||
return frame_info;
|
||||
}
|
||||
|
||||
void ScalableVideoControllerNoLayering::OnRatesUpdated(
|
||||
const VideoBitrateAllocation& bitrates) {
|
||||
enabled_ = bitrates.GetBitrate(0, 0) > 0;
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
|
|
@ -28,10 +28,11 @@ class ScalableVideoControllerNoLayering : public ScalableVideoController {
|
|||
|
||||
std::vector<LayerFrameConfig> NextFrameConfig(bool restart) override;
|
||||
GenericFrameInfo OnEncodeDone(const LayerFrameConfig& config) override;
|
||||
void OnRatesUpdated(const VideoBitrateAllocation& bitrates) override {}
|
||||
void OnRatesUpdated(const VideoBitrateAllocation& bitrates) override;
|
||||
|
||||
private:
|
||||
bool start_ = true;
|
||||
bool enabled_ = true;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
|
Loading…
Reference in a new issue