Commit 3797ae2c authored by Sergey Ulanov's avatar Sergey Ulanov Committed by Commit Bot

[Fuchsia] Fix FuchsiaAudioRenderer to report decoder stats.

Previously FuchsiaAudioRenderer wasn't reporting any statistics to the
pipeline. As the result the pipeline was always reporting 0 for
audio_decoded_bytes. Fixed it to report this parameter after every
packet it sent to the AudioConsumer. Note that decoding itself is
handled by the AudioConsumer implementation, so the data may be decoded
a bit later than it's reported.

Bug: 1067068
Change-Id: Iecbce0d757b6c753360073faf5a073b71b33e1f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2148379
Auto-Submit: Sergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Kevin Marshall <kmarshall@chromium.org>
Reviewed-by: default avatarKevin Marshall <kmarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#760561}
parent 9c1d49e3
......@@ -254,7 +254,6 @@ void FuchsiaAudioRenderer::StartTicking() {
SetPlaybackState(PlaybackState::kStarting);
}
audio_consumer_->Start(flags, fuchsia::media::NO_TIMESTAMP,
media_pos.ToZxDuration());
}
......@@ -528,6 +527,13 @@ void FuchsiaAudioRenderer::OnDemuxerStreamReadDone(
OnStreamSendDone(buffer_index);
});
// AudioConsumer doesn't report exact time when the data is decoded, but it's
// safe to report it as decoded right away since the packet is expected to be
// decoded soon after AudioConsumer receives it.
PipelineStatistics stats;
stats.audio_bytes_decoded = buffer->data_size();
client_->OnStatisticsUpdate(stats);
last_packet_timestamp_ = buffer->timestamp();
ScheduleReadDemuxerStream();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment