work on decoder classes

This commit is contained in:
itsmattkc
2019-05-29 03:05:10 +10:00
parent d76ac6ff38
commit aa0832c482
29 changed files with 6238 additions and 12556 deletions
+25 -4
View File
@@ -4,16 +4,33 @@
#include <stdint.h>
#include "global/rational.h"
#include "project/footage.h"
#include "frame.h"
class Decoder
/**
* @brief The Decoder class
*
* A decoder's is the main class for bringing external media into Olive. Its responsibilities are to serve as
* abstraction from codecs/decoders and provide complete frames. These frames can be video or audio data and are
* provided as Frame objects in shared pointers to alleviate the responsibility of memory handling.
*
* A decoder does NOT perform any pixel format conversion
*/
class Decoder : public QObject
{
Q_OBJECT
public:
Decoder();
Decoder(QObject* parent = nullptr);
Decoder(FootageStream* fs, QObject *parent = nullptr);
virtual ~Decoder();
FootageStream* stream();
void set_stream(FootageStream* fs);
virtual bool Open() = 0;
virtual void Request(const rational& timecode) = 0;
virtual void Retrieve(uint8_t** buffer, int* linesize) = 0;
virtual FramePtr Retrieve(const rational& timecode, const rational& length = 0) = 0;
virtual void Close() = 0;
// For video decoding
@@ -23,6 +40,10 @@ public:
protected:
bool open_;
private:
FootageStream* stream_;
};
using DecoderPtr = std::shared_ptr<Decoder>;
#endif // DECODER_H