1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- // live header
- #include "JPEGVideoSource.hh"
- #include "sdc_def_ext.h"
- #include "JpegQueue.h"
- #include "Encoder.h"
- using namespace HWYolov3App;
- /*!*****************************************************************************
- * \brief MJPEG Video Source (RFC 2345)
- *************************************************************************************/
- class MJPEGVideoSource : public JPEGVideoSource
- {
- public:
- static MJPEGVideoSource* createNew (UsageEnvironment& env, FramedSource* source, JpegQueue* JpegQueue, Encoder* encoder)
- {
- return new MJPEGVideoSource(env, source, JpegQueue, encoder);
- }
-
- public:
- virtual void doGetNextFrame();
- static void afterGettingFrameSub(void* clientData, unsigned frameSize,unsigned numTruncatedBytes,struct timeval presentationTime,unsigned durationInMicroseconds)
- {
- MJPEGVideoSource* source = (MJPEGVideoSource*)clientData;
- source->afterGettingFrame(frameSize, numTruncatedBytes, presentationTime, durationInMicroseconds);
- }
- void afterGettingFrame(unsigned frameSize,unsigned numTruncatedBytes,struct timeval presentationTime,unsigned durationInMicroseconds);
- virtual u_int8_t type() { return 1; };
- virtual u_int8_t qFactor() { return 128; };
- virtual u_int8_t width() { return m_width; };
- virtual u_int8_t height() { return m_height; };
- u_int8_t const* quantizationTables( u_int8_t& precision, u_int16_t& length );
-
- protected:
- MJPEGVideoSource(UsageEnvironment& env, FramedSource* source, JpegQueue* JpegQueue, Encoder* encoder);
- virtual ~MJPEGVideoSource();
- protected:
- FramedSource* m_inputSource;
- u_int8_t m_width;
- u_int8_t m_height;
- u_int8_t m_qTable[128];
- bool m_qTable0Init;
- bool m_qTable1Init;
- JpegQueue* m_JpegQueue = NULL;
- Encoder* m_Encoder = NULL;
- };
|