Removed unnecessary output transcode queue
This commit is contained in:
@@ -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()) {
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user