aboutsummaryrefslogtreecommitdiffstats
path: root/src/InputInterface.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/InputInterface.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/InputInterface.h')
-rw-r--r--src/InputInterface.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/InputInterface.h b/src/InputInterface.h
index b582c33..d2fcf97 100644
--- a/src/InputInterface.h
+++ b/src/InputInterface.h
@@ -32,6 +32,20 @@ class InputInterface {
*/
virtual void prepare(void) = 0;
- /*! Return true if the input detected some sort of fault */
+ /*! Return true if the input detected some sort of fault or
+ * abnormal termination
+ */
virtual bool fault_detected(void) const = 0;
+
+ /*! Tell the input that it shall read from source and fill the queue.
+ * The num_samples argument is an indication on how many bytes
+ * the encoder needs.
+ * Some inputs fill the queue from another thread, in which case
+ * this function might only serve as indication that data gets
+ * consumed.
+ *
+ * A return value of true means data was read, a return value of
+ * false means a normal termination of the input (e.g. end of file)
+ */
+ virtual bool read_source(size_t num_bytes) = 0;
};