Update sending resolution only on top spatial layer frame.
Don't update frame resolution in sender stats if current frame is not top spatial layer frame. Bug: webrtc:9715 Change-Id: I8361f8ccf7e7d092d143291fc54ab20ae091954b Reviewed-on: https://webrtc-review.googlesource.com/97608 Commit-Queue: Sergey Silkin <ssilkin@webrtc.org> Reviewed-by: Åsa Persson <asapersson@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24595}
This commit is contained in:
parent
37bbf799d2
commit
bb081a62dc
@ -916,10 +916,17 @@ void SendStatisticsProxy::OnSendEncodedImage(
|
||||
if (!stats)
|
||||
return;
|
||||
|
||||
// TODO(ssilkin): Fix stats reporting for spatial layers in SVC.
|
||||
// Report resolution of top spatial layer in case of VP9 SVC.
|
||||
bool is_svc_low_spatial_layer =
|
||||
(codec_info && codec_info->codecType == kVideoCodecVP9)
|
||||
? !codec_info->codecSpecific.VP9.end_of_picture
|
||||
: false;
|
||||
|
||||
if (!stats->width || !stats->height || !is_svc_low_spatial_layer) {
|
||||
stats->width = encoded_image._encodedWidth;
|
||||
stats->height = encoded_image._encodedHeight;
|
||||
update_times_[ssrc].resolution_update_ms = clock_->TimeInMilliseconds();
|
||||
}
|
||||
|
||||
uma_container_->key_frame_counter_.Add(encoded_image._frameType ==
|
||||
kVideoFrameKey);
|
||||
|
||||
@ -2177,6 +2177,43 @@ TEST_F(SendStatisticsProxyTest, GetStatsReportsEncoderImplementationName) {
|
||||
kName, statistics_proxy_->GetStats().encoder_implementation_name.c_str());
|
||||
}
|
||||
|
||||
TEST_F(SendStatisticsProxyTest, Vp9SvcLowSpatialLayerDoesNotUpdateResolution) {
|
||||
static const int kEncodedWidth = 123;
|
||||
static const int kEncodedHeight = 81;
|
||||
EncodedImage encoded_image;
|
||||
encoded_image._encodedWidth = kEncodedWidth;
|
||||
encoded_image._encodedHeight = kEncodedHeight;
|
||||
encoded_image.SetSpatialIndex(0);
|
||||
|
||||
CodecSpecificInfo codec_info;
|
||||
codec_info.codecType = kVideoCodecVP9;
|
||||
|
||||
// For first picture, it is expected that low layer updates resolution.
|
||||
codec_info.codecSpecific.VP9.end_of_picture = false;
|
||||
statistics_proxy_->OnSendEncodedImage(encoded_image, &codec_info);
|
||||
VideoSendStream::Stats stats = statistics_proxy_->GetStats();
|
||||
EXPECT_EQ(kEncodedWidth, stats.substreams[config_.rtp.ssrcs[0]].width);
|
||||
EXPECT_EQ(kEncodedHeight, stats.substreams[config_.rtp.ssrcs[0]].height);
|
||||
|
||||
// Top layer updates resolution.
|
||||
encoded_image._encodedWidth = kEncodedWidth * 2;
|
||||
encoded_image._encodedHeight = kEncodedHeight * 2;
|
||||
codec_info.codecSpecific.VP9.end_of_picture = true;
|
||||
statistics_proxy_->OnSendEncodedImage(encoded_image, &codec_info);
|
||||
stats = statistics_proxy_->GetStats();
|
||||
EXPECT_EQ(kEncodedWidth * 2, stats.substreams[config_.rtp.ssrcs[0]].width);
|
||||
EXPECT_EQ(kEncodedHeight * 2, stats.substreams[config_.rtp.ssrcs[0]].height);
|
||||
|
||||
// Low layer of next frame doesn't update resolution.
|
||||
encoded_image._encodedWidth = kEncodedWidth;
|
||||
encoded_image._encodedHeight = kEncodedHeight;
|
||||
codec_info.codecSpecific.VP9.end_of_picture = false;
|
||||
statistics_proxy_->OnSendEncodedImage(encoded_image, &codec_info);
|
||||
stats = statistics_proxy_->GetStats();
|
||||
EXPECT_EQ(kEncodedWidth * 2, stats.substreams[config_.rtp.ssrcs[0]].width);
|
||||
EXPECT_EQ(kEncodedHeight * 2, stats.substreams[config_.rtp.ssrcs[0]].height);
|
||||
}
|
||||
|
||||
class ForcedFallbackTest : public SendStatisticsProxyTest {
|
||||
public:
|
||||
explicit ForcedFallbackTest(const std::string& field_trials)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user