Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1714)

Unified Diff: webrtc/modules/audio_coding/test/PCMFile.h

Issue 1513223002: Reduce the runtime of some ACM tests in modules_tests (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing win64 build Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/audio_coding/test/EncodeDecodeTest.cc ('k') | webrtc/modules/audio_coding/test/PCMFile.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_coding/test/PCMFile.h
diff --git a/webrtc/modules/audio_coding/test/PCMFile.h b/webrtc/modules/audio_coding/test/PCMFile.h
index 9365180208046de1bef4da3aa4bf6f96e5803ba7..840933a1bd88c73708cc0f378d17a74fa365ab11 100644
--- a/webrtc/modules/audio_coding/test/PCMFile.h
+++ b/webrtc/modules/audio_coding/test/PCMFile.h
@@ -16,6 +16,7 @@
#include <string>
+#include "webrtc/base/optional.h"
#include "webrtc/modules/include/module_common_types.h"
#include "webrtc/typedefs.h"
@@ -45,12 +46,21 @@ class PCMFile {
bool EndOfFile() const {
return end_of_file_;
}
+ // Moves forward the specified number of 10 ms blocks. If a limit has been set
+ // with SetNum10MsBlocksToRead, fast-forwarding does not count towards this
+ // limit.
+ void FastForward(int num_10ms_blocks);
void Rewind();
static int16_t ChooseFile(std::string* file_name, int16_t max_len,
uint16_t* frequency_hz);
bool Rewinded();
void SaveStereo(bool is_stereo = true);
void ReadStereo(bool is_stereo = true);
+ // If set, the reading will stop after the specified number of blocks have
+ // been read. When that has happened, EndOfFile() will return true. Calling
+ // Rewind() will reset the counter and start over.
+ void SetNum10MsBlocksToRead(int value);
+
private:
FILE* pcm_file_;
uint16_t samples_10ms_;
@@ -61,6 +71,8 @@ class PCMFile {
uint32_t timestamp_;
bool read_stereo_;
bool save_stereo_;
+ rtc::Optional<int> num_10ms_blocks_to_read_;
+ int blocks_read_ = 0;
};
} // namespace webrtc
« no previous file with comments | « webrtc/modules/audio_coding/test/EncodeDecodeTest.cc ('k') | webrtc/modules/audio_coding/test/PCMFile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698