Fix frame to ARGB from GRAY when bpp is different than 8
This commit is contained in:
1 parent
d3e27c10b8
commit
de1606e302
3 files changed
+16
-10
No files matched your search
@@ -187,7 +187,7 @@ Void PlaYUVerFrame::init( UInt width, UInt height, Int pel_format, Int bitsPixel
|
||||
m_uiHeight = height;
|
||||
m_iPixelFormat = pel_format;
|
||||
m_iNumberChannels = 3;
|
||||
m_iBitsPel = bitsPixel;
|
||||
m_iBitsPel = bitsPixel > 8 ? bitsPixel : 8;
|
||||
|
||||
if( m_uiWidth == 0 || m_uiHeight == 0 || m_iPixelFormat == -1 || bitsPixel > 16 )
|
||||
{
|
||||
|
||||
@@ -371,6 +371,14 @@ Bool PlaYUVerStream::open( std::string filename, UInt width, UInt height, Int in
|
||||
return m_bInit;
|
||||
}
|
||||
|
||||
if( m_pcCurrFrame )
|
||||
{
|
||||
m_uiWidth = m_pcCurrFrame->getWidth();
|
||||
m_uiHeight = m_pcCurrFrame->getHeight();
|
||||
m_iPixelFormat = m_pcCurrFrame->getPelFormat();
|
||||
m_uiBitsPerPixel = m_pcCurrFrame->getBitsPel();
|
||||
}
|
||||
|
||||
m_cPelFmtName = PlaYUVerFrame::supportedPixelFormatListNames()[m_iPixelFormat].c_str();
|
||||
|
||||
m_iCurrFrameNum = -1;
|
||||
|
||||
@@ -77,13 +77,17 @@ private:
|
||||
std::string m_cCodedName;
|
||||
std::string m_cPelFmtName;
|
||||
|
||||
FILE* m_pFile; /**< The input file pointer >*/
|
||||
std::fstream m_fsIOStream; /**< The input file pointer >*/
|
||||
|
||||
Int m_iFileFormat;
|
||||
UInt m_uiWidth;
|
||||
UInt m_uiHeight;
|
||||
Int m_iPixelFormat;
|
||||
UInt m_uiBitsPerPixel;
|
||||
Double m_dFrameRate;
|
||||
UInt64 m_uiTotalFrameNum;
|
||||
Int64 m_iCurrFrameNum;
|
||||
|
||||
FILE* m_pFile; /**< The input file pointer >*/
|
||||
std::fstream m_fsIOStream; /**< The input file pointer >*/
|
||||
Byte* m_pStreamBuffer;
|
||||
|
||||
UInt m_uiFrameBufferSize;
|
||||
@@ -93,12 +97,6 @@ private:
|
||||
UInt m_uiFrameBufferIndex;
|
||||
UInt64 m_uiCurrFrameFileIdx;
|
||||
|
||||
UInt m_uiWidth;
|
||||
UInt m_uiHeight;
|
||||
Double m_dFrameRate;
|
||||
UInt64 m_uiTotalFrameNum;
|
||||
Int64 m_iCurrFrameNum;
|
||||
|
||||
public:
|
||||
|
||||
static std::vector<std::string> supportedReadFormatsExt();
|
||||
|
||||
Reference in new issue
Block a user