summaryrefslogtreecommitdiffstats
path: root/src/input/File.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-02-13 17:21:00 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-02-13 17:21:00 +0100
commitab64249989657e9b9e14735d3a1752f0f921056b (patch)
tree16021499f08a9c7fd03eae4fc57c4e6bb2e902d7 /src/input/File.h
parente526c97dcdaf12de4d4c6324ca007eec60884165 (diff)
downloaddabmux-ab64249989657e9b9e14735d3a1752f0f921056b.tar.gz
dabmux-ab64249989657e9b9e14735d3a1752f0f921056b.tar.bz2
dabmux-ab64249989657e9b9e14735d3a1752f0f921056b.zip
Make nonblock available again for file inputs
Diffstat (limited to 'src/input/File.h')
-rw-r--r--src/input/File.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/input/File.h b/src/input/File.h
index 080d6b5..62a6707 100644
--- a/src/input/File.h
+++ b/src/input/File.h
@@ -2,7 +2,7 @@
Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
Research Center Canada)
- Copyright (C) 2016 Matthias P. Braendli
+ Copyright (C) 2018 Matthias P. Braendli
http://www.opendigitalradio.org
*/
@@ -28,7 +28,7 @@
#include <vector>
#include <array>
#include <string>
-#include <stdint.h>
+#include <cstdint>
#include "input/inputs.h"
#include "ManagementServer.h"
@@ -41,6 +41,8 @@ class FileBase : public InputBase {
virtual int setBitrate(int bitrate);
virtual int close();
+ virtual void setNonblocking(bool nonblock);
+
/* Rewind the file
* Returns -1 on failure, 0 on success
*/
@@ -52,8 +54,11 @@ class FileBase : public InputBase {
virtual ssize_t readFromFile(uint8_t* buf, size_t len);
// We use unix open() instead of fopen() because
- // we might want to do non-blocking I/O in the future
+ // of non-blocking I/O
int m_fd = -1;
+
+ bool m_nonblock = false;
+ std::vector<uint8_t> m_nonblock_buffer;
};
class MPEGFile : public FileBase {