Change endianness to Int

This commit is contained in:
jfmcarreira committed 2016-04-01 12:13:20 +01:00
1 parent 8b154a2808
commit 6449412206
7 files changed
+30 -26

No files matched your search

+1 -1
View File
@@ -112,7 +112,7 @@ Void LibAvContextHandle::closeAvFormat()
m_bHasStream = false;
}
Bool LibAvContextHandle::initAvFormat( const char* filename, UInt& width, UInt& height, Int& pixel_format, UInt& endianness, UInt& bits_pel, Double& frame_rate,
Bool LibAvContextHandle::initAvFormat( const char* filename, UInt& width, UInt& height, Int& pixel_format, UInt& bits_pel, Int& endianness, Double& frame_rate,
UInt64& num_frames )
{
fmt_ctx = NULL;
+1 -1
View File
@@ -65,7 +65,7 @@ public:
m_bHasStream( false )
{
}
Bool initAvFormat( const char* filename, UInt& width, UInt& height, Int& pixel_format, UInt& bits_pel, UInt& endianness, Double& frame_rate, UInt64& num_frames );
Bool initAvFormat( const char* filename, UInt& width, UInt& height, Int& pixel_format, UInt& bits_pel, Int& endianness, Double& frame_rate, UInt64& num_frames );
Void closeAvFormat();
Bool decodeAvFormat();
+10 -9
View File
@@ -116,6 +116,7 @@ PlaYUVerStream::PlaYUVerStream()
m_iCurrFrameNum = -1;
m_iPixelFormat = -1;
m_uiBitsPerPixel = 8;
m_iEndianness = -1;
m_dFrameRate = 30;
m_pStreamBuffer = NULL;
m_cFilename = "";
@@ -190,7 +191,7 @@ Void PlaYUVerStream::findHandler()
}
}
Bool PlaYUVerStream::open( std::string filename, std::string resolution, std::string input_format_name, UInt bitsPel, UInt endianness, UInt frame_rate, Bool bInput )
Bool PlaYUVerStream::open( std::string filename, std::string resolution, std::string input_format_name, UInt bitsPel, Int endianness, UInt frame_rate, Bool bInput )
{
UInt width;
UInt height;
@@ -215,7 +216,7 @@ Bool PlaYUVerStream::open( std::string filename, std::string resolution, std::st
return open( filename, width, height, input_format, bitsPel, endianness, frame_rate, bInput );
}
Bool PlaYUVerStream::open( std::string filename, UInt width, UInt height, Int input_format, UInt bitsPel, UInt endianness, UInt frame_rate, Bool bInput )
Bool PlaYUVerStream::open( std::string filename, UInt width, UInt height, Int input_format, UInt bitsPel, Int endianness, UInt frame_rate, Bool bInput )
{
if( m_bInit )
{
@@ -228,7 +229,7 @@ Bool PlaYUVerStream::open( std::string filename, UInt width, UInt height, Int in
m_uiHeight = height;
m_iPixelFormat = input_format;
m_uiBitsPerPixel = bitsPel;
m_uiEndianness = endianness;
m_iEndianness = endianness;
m_dFrameRate = frame_rate;
m_pchFilename = new Char[m_cFilename.size() + 1];
@@ -248,7 +249,7 @@ Bool PlaYUVerStream::open( std::string filename, UInt width, UInt height, Int in
#ifdef USE_FFMPEG
if( m_iStreamHandler == FFMPEG )
{
if( !m_cLibAvContext->initAvFormat( m_pchFilename, m_uiWidth, m_uiHeight, m_iPixelFormat, m_uiBitsPerPixel, m_uiEndianness, m_dFrameRate, m_uiTotalFrameNum ) )
if( !m_cLibAvContext->initAvFormat( m_pchFilename, m_uiWidth, m_uiHeight, m_iPixelFormat, m_uiBitsPerPixel, m_iEndianness, m_dFrameRate, m_uiTotalFrameNum ) )
{
throw "Cannot open file using FFmpeg libs";
}
@@ -371,7 +372,7 @@ Bool PlaYUVerStream::reload()
if( m_iStreamHandler == FFMPEG )
{
m_cLibAvContext->closeAvFormat();
if( !m_cLibAvContext->initAvFormat( m_pchFilename, m_uiWidth, m_uiHeight, m_iPixelFormat, m_uiBitsPerPixel, m_uiEndianness, m_dFrameRate, m_uiTotalFrameNum ) )
if( !m_cLibAvContext->initAvFormat( m_pchFilename, m_uiWidth, m_uiHeight, m_iPixelFormat, m_uiBitsPerPixel, m_iEndianness, m_dFrameRate, m_uiTotalFrameNum ) )
{
throw "Cannot open file using FFmpeg libs";
}
@@ -462,7 +463,7 @@ Void PlaYUVerStream::close()
m_bInit = false;
}
Void PlaYUVerStream::getFormat( UInt& rWidth, UInt& rHeight, Int& rInputFormat, UInt& rBitsPerPel, UInt& rEndianness, UInt& rFrameRate )
Void PlaYUVerStream::getFormat( UInt& rWidth, UInt& rHeight, Int& rInputFormat, UInt& rBitsPerPel, Int& rEndianness, UInt& rFrameRate )
{
if( m_bInit )
{
@@ -470,7 +471,7 @@ Void PlaYUVerStream::getFormat( UInt& rWidth, UInt& rHeight, Int& rInputFormat,
rHeight = m_uiHeight;
rInputFormat = m_iPixelFormat;
rBitsPerPel = m_uiBitsPerPixel;
rEndianness = m_uiEndianness;
rEndianness = m_iEndianness;
rFrameRate = m_dFrameRate;
}
else
@@ -581,7 +582,7 @@ Void PlaYUVerStream::readFrame()
throw "[PlaYUVerStream] Error reading frame from libav";
return;
}
m_pcNextFrame->frameFromBuffer( m_cLibAvContext->m_pchFrameBuffer, m_cLibAvContext->m_uiFrameBufferSize, m_uiEndianness );
m_pcNextFrame->frameFromBuffer( m_cLibAvContext->m_pchFrameBuffer, m_cLibAvContext->m_uiFrameBufferSize, m_iEndianness );
}
#endif
if( m_iStreamHandler == YUV_IO )
@@ -593,7 +594,7 @@ Void PlaYUVerStream::readFrame()
throw "[PlaYUVerStream] Cannot read file";
return;
}
m_pcNextFrame->frameFromBuffer( m_pStreamBuffer, bytes_read, m_uiEndianness );
m_pcNextFrame->frameFromBuffer( m_pStreamBuffer, bytes_read, m_iEndianness );
}
m_uiCurrFrameFileIdx++;
return;
+4 -4
View File
@@ -95,8 +95,8 @@ public:
END_OF_SEQ,
};
Bool open( std::string filename, std::string resolution, std::string input_format, UInt bitsPel, UInt endianness, UInt frame_rate, Bool bInput = true );
Bool open( std::string filename, UInt width, UInt height, Int input_format, UInt bitsPel, UInt endianness, UInt frame_rate, Bool bInput = true );
Bool open( std::string filename, std::string resolution, std::string input_format, UInt bitsPel, Int endianness, UInt frame_rate, Bool bInput = true );
Bool open( std::string filename, UInt width, UInt height, Int input_format, UInt bitsPel, Int endianness, UInt frame_rate, Bool bInput = true );
Bool reload();
@@ -105,7 +105,7 @@ public:
Bool openFile();
Void closeFile();
Void getFormat( UInt& rWidth, UInt& rHeight, Int& rInputFormat, UInt& rBitsPerPel, UInt& rEndianness, UInt& rFrameRate );
Void getFormat( UInt& rWidth, UInt& rHeight, Int& rInputFormat, UInt& rBitsPerPel, Int& rEndianness, UInt& rFrameRate );
Void loadAll();
@@ -194,7 +194,7 @@ private:
UInt m_uiHeight;
Int m_iPixelFormat;
UInt m_uiBitsPerPixel;
UInt m_uiEndianness;
Int m_iEndianness;
Double m_dFrameRate;
UInt64 m_uiTotalFrameNum;
Int64 m_iCurrFrameNum;