Finish three stream handlers: Raw, OpenCv, Libav
This commit is contained in:
1 parent
5f9533b212
commit
2ab86e5aee
12 files changed
+289
-257
No files matched your search
@@ -26,13 +26,16 @@
|
||||
#define __PLAYUVERSTREAMHANDLERIF_H__
|
||||
|
||||
#include "PlaYUVerDefs.h"
|
||||
// #include <iostream>
|
||||
// #include <fstream>
|
||||
// #include <cstdio>
|
||||
#include "LibMemory.h"
|
||||
|
||||
namespace plaYUVer
|
||||
{
|
||||
|
||||
#define REGISTER_STREAM_HANDLER(X) \
|
||||
public: \
|
||||
static PlaYUVerStreamHandlerIf* Create() { return new X(); } \
|
||||
void Delete() { delete this; }
|
||||
|
||||
/**
|
||||
* \class PlaYUVerStreamHandlerIf
|
||||
* \ingroup PlaYUVerLib PlaYUVerLib_Stream
|
||||
@@ -45,16 +48,21 @@ public:
|
||||
{
|
||||
m_bIsInput = true;
|
||||
}
|
||||
~PlaYUVerStreamHandlerIf()
|
||||
virtual ~PlaYUVerStreamHandlerIf()
|
||||
{
|
||||
}
|
||||
virtual Bool openHandler( std::string strFilename, Bool bInput ) = 0;
|
||||
virtual UInt64 calculateFrameNumber() = 0;
|
||||
virtual Void closeHandler() = 0;
|
||||
virtual Bool read( Byte* pchBuffer ) = 0;
|
||||
virtual Bool write( Byte* pchBuffer ) = 0;
|
||||
virtual Bool read( PlaYUVerFrame* pcFrame ) = 0;
|
||||
virtual Bool write( PlaYUVerFrame* pcFrame ) = 0;
|
||||
virtual Bool seek( UInt64 iFrameNum ) = 0;
|
||||
|
||||
virtual Bool configureBuffer( PlaYUVerFrame* pcFrame )
|
||||
{
|
||||
return getMem1D<Byte>( &m_pStreamBuffer, pcFrame->getBytesPerFrame() );
|
||||
}
|
||||
|
||||
virtual Void getFormat( UInt& rWidth, UInt& rHeight, Int& rInputFormat, UInt& rBitsPerPel, Int& rEndianness, Double& rFrameRate )
|
||||
{
|
||||
return;
|
||||
@@ -71,8 +79,10 @@ public:
|
||||
{
|
||||
return m_strCodecName;
|
||||
}
|
||||
|
||||
protected:
|
||||
Bool m_bIsInput;
|
||||
Byte* m_pStreamBuffer;
|
||||
UInt64 m_uiNBytesPerFrame;
|
||||
std::string m_strFormatName;
|
||||
std::string m_strCodecName;
|
||||
|
||||
Reference in new issue
Block a user