mirror of
https://github.com/mpromonet/v4l2rtspserver
synced 2024-11-17 21:25:40 +00:00
add log in JPEG source
This commit is contained in:
parent
6d988bdeca
commit
402424f014
@ -10,6 +10,7 @@
|
|||||||
**
|
**
|
||||||
** -------------------------------------------------------------------------*/
|
** -------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "logger.h"
|
||||||
#include "JPEGVideoSource.hh"
|
#include "JPEGVideoSource.hh"
|
||||||
|
|
||||||
class MJPEGVideoSource : public JPEGVideoSource
|
class MJPEGVideoSource : public JPEGVideoSource
|
||||||
@ -49,6 +50,8 @@ class MJPEGVideoSource : public JPEGVideoSource
|
|||||||
m_height = (fTo[i+5]<<5)|(fTo[i+6]>>3);
|
m_height = (fTo[i+5]<<5)|(fTo[i+6]>>3);
|
||||||
m_width = (fTo[i+7]<<5)|(fTo[i+8]>>3);
|
m_width = (fTo[i+7]<<5)|(fTo[i+8]>>3);
|
||||||
m_type = (fTo[i+11] - 0x21);
|
m_type = (fTo[i+11] - 0x21);
|
||||||
|
LOG(INFO) << "width:" << (int)m_width << " height:" << (int)m_height << " type:"<< (int)m_type;
|
||||||
|
|
||||||
}
|
}
|
||||||
// DQT
|
// DQT
|
||||||
if ( (i+5+64) < frameSize && (fTo[i] == 0xFF) && (fTo[i+1] == 0xDB))
|
if ( (i+5+64) < frameSize && (fTo[i] == 0xFF) && (fTo[i+1] == 0xDB))
|
||||||
@ -59,7 +62,10 @@ class MJPEGVideoSource : public JPEGVideoSource
|
|||||||
{
|
{
|
||||||
memcpy(m_qTable + quantSize*quantIdx, fTo + i + 5, quantSize);
|
memcpy(m_qTable + quantSize*quantIdx, fTo + i + 5, quantSize);
|
||||||
if (quantSize*quantIdx+quantSize > m_qTableSize)
|
if (quantSize*quantIdx+quantSize > m_qTableSize)
|
||||||
|
{
|
||||||
m_qTableSize = quantSize*quantIdx+quantSize;
|
m_qTableSize = quantSize*quantIdx+quantSize;
|
||||||
|
LOG(NOTICE) << "Quantization table idx:" << quantIdx << " size:" << quantSize << " total size:" << m_qTableSize;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// End of header
|
// End of header
|
||||||
@ -76,6 +82,10 @@ class MJPEGVideoSource : public JPEGVideoSource
|
|||||||
fFrameSize = frameSize - headerSize;
|
fFrameSize = frameSize - headerSize;
|
||||||
memmove( fTo, fTo + headerSize, fFrameSize );
|
memmove( fTo, fTo + headerSize, fFrameSize );
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LOG(NOTICE) << "Bad header => dropping frame";
|
||||||
|
}
|
||||||
|
|
||||||
fNumTruncatedBytes = numTruncatedBytes;
|
fNumTruncatedBytes = numTruncatedBytes;
|
||||||
fPresentationTime = presentationTime;
|
fPresentationTime = presentationTime;
|
||||||
|
Loading…
Reference in New Issue
Block a user