Index: media/filters/audio_file_reader.h |
diff --git a/media/filters/audio_file_reader.h b/media/filters/audio_file_reader.h |
index 1e42abd7b018fde25b2d6fce976fa26807de0b63..126a70bc64e6b1c95332f5008effa358d55d827b 100644 |
--- a/media/filters/audio_file_reader.h |
+++ b/media/filters/audio_file_reader.h |
@@ -6,6 +6,7 @@ |
#define MEDIA_FILTERS_AUDIO_FILE_READER_H_ |
#include <memory> |
+#include <vector> |
#include "base/macros.h" |
#include "media/base/audio_codecs.h" |
@@ -38,14 +39,19 @@ class MEDIA_EXPORT AudioFileReader { |
bool Open(); |
void Close(); |
- // After a call to Open(), attempts to fully fill |audio_bus| with decoded |
- // audio data. Any unfilled frames will be zeroed out. |
- // |audio_data| must be of the same size as channels(). |
- // The audio data will be decoded as floating-point linear PCM with |
- // a nominal range of -1.0 -> +1.0. |
- // Returns the number of sample-frames actually read which will always be |
- // <= audio_bus->frames() |
- int Read(AudioBus* audio_bus); |
+ // Returns true if (an estimated) duration of the audio data is |
+ // known. Must be called after Open(); |
+ bool HasKnownDuration() const; |
+ |
+ // After a call to Open(), attempts to decode the entire data, |
+ // updating |decodedAudioPackets| with each decoded packet in order. |
+ // The caller must convert these packets into one complete set of |
+ // decoded audio data. The audio data will be decoded as |
+ // floating-point linear PCM with a nominal range of -1.0 -> +1.0. |
+ // Returns the number of sample-frames actually read which will |
+ // always be the total size of all the frames in |
+ // |decodedAudioPackets|. |
+ int Read(std::vector<std::unique_ptr<AudioBus>>& decodedAudioPackets); |
DaleCurtis
2017/02/09 18:47:36
Pass by pointer instead of ref. decoded_audio_pack
Raymond Toy
2017/02/09 18:56:12
Good point. I expect the size of this vector to be
Raymond Toy
2017/02/09 21:45:06
Passing by pointer.
Decided to keep a vector beca
|
// These methods can be called once Open() has been called. |
int channels() const { return channels_; } |