Removed unnecessary output transcode queue

This commit is contained in:
emeric
2014-10-11 18:28:35 +02:00
parent 92891ea070
commit dcf9137b19
5 changed files with 41 additions and 55 deletions
+8 -5
View File
@@ -168,14 +168,17 @@ AvConvTranscoder::AvConvTranscoder(const Parameters& parameters)
}
void
AvConvTranscoder::process(void)
AvConvTranscoder::process(std::vector<unsigned char>& output, std::size_t maxSize)
{
std::size_t readDatasSize = 1024; // TODO parametrize elsewhere?
std::size_t readDataSize = 0;
if (_isComplete)
return;
char ch;
while(readDatasSize != 0 && _in && _in.get(ch)) {
_data.push_back(ch);
--readDatasSize;
while(readDataSize < maxSize && _in && _in.get(ch)) {
output.push_back(ch);
readDataSize++;
}
if (!_in || _in.fail() || _in.eof()) {
+5 -9
View File
@@ -22,7 +22,7 @@
#include <memory>
#include <iostream>
#include <deque>
#include <vector>
#include <boost/iostreams/stream.hpp>
#include <boost/process.hpp>
@@ -37,21 +37,18 @@ namespace Transcode
class AvConvTranscoder
{
public:
typedef std::deque<unsigned char> data_type;
static void init();
~AvConvTranscoder();
AvConvTranscoder(const Parameters& parameters);
data_type& getOutputData() { return _data; }
const Parameters& getParameters(void) const { return _parameters; }
// Process a bunch of input data
void process(void);
// Get a bunch of input data
// Place it at the end of the parameter, no more that maxSize bytes
void process(std::vector<unsigned char>& output, std::size_t maxSize);
bool isComplete(void) const { return _isComplete;};
private:
@@ -74,7 +71,6 @@ class AvConvTranscoder
static boost::filesystem::path _avConvPath;
data_type _data;
bool _isComplete;
};