summaryrefslogtreecommitdiffstats
path: root/src/FileInput.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2017-10-07 11:47:05 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2017-10-07 11:51:46 +0200
commit84febca8b268129cdd79ff0d1c4f8eeed092c5fb (patch)
tree3e75880241e0fcd2951c04aad77d7077b4ec130c /src/FileInput.h
parent9c2615425bb4f35a417eb04b1ceebfc77d8e2c8b (diff)
downloadODR-AudioEnc-84febca8b268129cdd79ff0d1c4f8eeed092c5fb.tar.gz
ODR-AudioEnc-84febca8b268129cdd79ff0d1c4f8eeed092c5fb.tar.bz2
ODR-AudioEnc-84febca8b268129cdd79ff0d1c4f8eeed092c5fb.zip
Use queue for all inputs and unify interface
This also changes the --fifo-silence option. Instead of inserting silence separately, it uses the drift compensation to do that.
Diffstat (limited to 'src/FileInput.h')
-rw-r--r--src/FileInput.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/FileInput.h b/src/FileInput.h
index 59e0f0b..c839b42 100644
--- a/src/FileInput.h
+++ b/src/FileInput.h
@@ -31,6 +31,7 @@
#include <stdint.h>
#include <cstdio>
#include <string>
+#include "SampleQueue.h"
#include "InputInterface.h"
class FileInput : public InputInterface
@@ -38,10 +39,14 @@ class FileInput : public InputInterface
public:
FileInput(const std::string& filename,
bool raw_input,
- int sample_rate) :
+ int sample_rate,
+ bool continue_after_eof,
+ SampleQueue<uint8_t>& queue) :
m_filename(filename),
m_raw_input(raw_input),
- m_sample_rate(sample_rate) {}
+ m_sample_rate(sample_rate),
+ m_continue_after_eof(continue_after_eof),
+ m_queue(queue) {}
~FileInput();
FileInput(const FileInput& other) = delete;
@@ -52,17 +57,14 @@ class FileInput : public InputInterface
virtual bool fault_detected(void) const override { return false; };
- /*! Read length bytes into buf.
- *
- * \return the number of bytes read.
- */
- ssize_t read(uint8_t* buf, size_t length);
- int eof();
+ virtual bool read_source(size_t num_bytes) override;
protected:
std::string m_filename;
bool m_raw_input;
int m_sample_rate;
+ bool m_continue_after_eof;
+ SampleQueue<uint8_t>& m_queue;
/* handle to the wav reader */
void *m_wav = nullptr;