summaryrefslogtreecommitdiffstats
path: root/src/input/File.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-08-27 11:02:23 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-08-27 11:02:23 +0200
commit0298076eea4f92685f9a01974261da41c2a01e5b (patch)
treef72831cd212da64c1a3ea124bb9b590ced8558f2 /src/input/File.cpp
parentcac39dedee89d62ebf5d0135b84ccaa2e387a7cb (diff)
downloaddabmux-0298076eea4f92685f9a01974261da41c2a01e5b.tar.gz
dabmux-0298076eea4f92685f9a01974261da41c2a01e5b.tar.bz2
dabmux-0298076eea4f92685f9a01974261da41c2a01e5b.zip
EDI input: add new buffer management
Diffstat (limited to 'src/input/File.cpp')
-rw-r--r--src/input/File.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/input/File.cpp b/src/input/File.cpp
index 99dd68d..9c36263 100644
--- a/src/input/File.cpp
+++ b/src/input/File.cpp
@@ -74,6 +74,14 @@ void FileBase::open(const std::string& name)
}
}
+size_t FileBase::readFrame(uint8_t *buffer, size_t size, uint32_t seconds, uint32_t tsta)
+{
+ // Will not be implemented, as there is no obvious way to carry timestamps
+ // in files.
+ memset(buffer, 0, size);
+ return 0;
+}
+
int FileBase::setBitrate(int bitrate)
{
if (bitrate <= 0) {
@@ -181,7 +189,7 @@ ssize_t FileBase::readFromFile(uint8_t* buffer, size_t size)
return size;
}
-int MPEGFile::readFrame(uint8_t* buffer, size_t size)
+size_t MPEGFile::readFrame(uint8_t *buffer, size_t size)
{
int result;
bool do_rewind = false;
@@ -274,6 +282,9 @@ MUTE_SUBCHANNEL:
}
}
}
+
+ // TODO this is probably wrong, because it should return
+ // the number of bytes written.
return result;
}
@@ -296,7 +307,7 @@ int MPEGFile::setBitrate(int bitrate)
return bitrate;
}
-int RawFile::readFrame(uint8_t* buffer, size_t size)
+size_t RawFile::readFrame(uint8_t *buffer, size_t size)
{
return readFromFile(buffer, size);
}
@@ -306,7 +317,7 @@ PacketFile::PacketFile(bool enhancedPacketMode)
m_enhancedPacketEnabled = enhancedPacketMode;
}
-int PacketFile::readFrame(uint8_t* buffer, size_t size)
+size_t PacketFile::readFrame(uint8_t *buffer, size_t size)
{
size_t written = 0;
int length;