Commit eb99693a authored by Jose Lopes's avatar Jose Lopes Committed by Commit Bot

media: Migrate FIFO read callback.

Callback called every time the audio buffer needs to be filled:
* https://cs.chromium.org/chromium/src/media/base/audio_pull_fifo.h?rcl=177e90911c8bcb0c547c7974acdf4b249fa67062&l=28

Called as part of a while loop:
* https://cs.chromium.org/chromium/src/media/base/audio_pull_fifo.cc?rcl=177e90911c8bcb0c547c7974acdf4b249fa67062&l=37

This is part of the base::Callback migration.

Context: https://cs.chromium.org/chromium/src/docs/callback.md?rcl=9fcc3764aea8f97e9f6de4a9ee61d554e67edcda&l=40

Bug: 714018
Change-Id: I98bd69edcd0a3162e1a730d64319f0a85ee61bd0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2047027
Commit-Queue: Jose Lopes <jabolopes@google.com>
Auto-Submit: Jose Lopes <jabolopes@google.com>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#743498}
parent 04857487
......@@ -11,8 +11,8 @@
namespace media {
AudioPullFifo::AudioPullFifo(int channels, int frames, const ReadCB& read_cb)
: read_cb_(read_cb),
AudioPullFifo::AudioPullFifo(int channels, int frames, ReadCB read_cb)
: read_cb_(std::move(read_cb)),
fifo_(AudioBus::Create(channels, frames)),
fifo_index_(frames) {}
......
......@@ -25,13 +25,14 @@ class MEDIA_EXPORT AudioPullFifo {
// to be completely filled with data upon return; zero padded if not enough
// frames are available to satisfy the request. |frame_delay| is the number
// of output frames already processed and can be used to estimate delay.
typedef base::Callback<void(int frame_delay, AudioBus* audio_bus)> ReadCB;
using ReadCB =
base::RepeatingCallback<void(int frame_delay, AudioBus* audio_bus)>;
// Constructs an AudioPullFifo with the specified |read_cb|, which is used to
// read audio data to the FIFO if data is not already available. The internal
// FIFO can contain |channel| number of channels, where each channel is of
// length |frames| audio frames.
AudioPullFifo(int channels, int frames, const ReadCB& read_cb);
AudioPullFifo(int channels, int frames, ReadCB read_cb);
virtual ~AudioPullFifo();
// Consumes |frames_to_consume| audio frames from the FIFO and copies
......
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