Change stream info to PlaYUVerStream file

This commit is contained in:
jfmcarreira committed 2014-10-04 18:36:51 +01:00
1 parent 9906befa92
commit 60b82a0bf0
5 files changed
+71 -67

No files matched your search

+7 -45
View File
@@ -29,39 +29,6 @@
namespace plaYUVer
{
QDataStream& operator<<( QDataStream& out, const PlaYUVerStreamInfoVector& array )
{
PlaYUVerStreamInfo d;
out << array.size();
for( Int i = 0; i < array.size(); i++ )
{
d = array.at( i );
out << d.m_cFilename << d.m_uiWidth
<< d.m_uiHeight
<< d.m_iPelFormat
<< d.m_uiFrameRate;
}
return out;
}
QDataStream& operator>>( QDataStream& in, PlaYUVerStreamInfoVector& array )
{
PlaYUVerStreamInfo d;
Int array_size;
in >> array_size;
for( Int i = 0; i < array_size; i++ )
{
in >> d.m_cFilename;
in >> d.m_uiWidth;
in >> d.m_uiHeight;
in >> d.m_iPelFormat;
in >> d.m_uiFrameRate;
array.append( d );
}
return in;
}
SubWindowHandle::SubWindowHandle( QWidget * parent, Bool isModule ) :
QMdiSubWindow( parent ),
m_pCurrStream( NULL ),
@@ -108,7 +75,7 @@ SubWindowHandle::~SubWindowHandle()
Void SubWindowHandle::reloadFile()
{
Int currFrameNum = m_pCurrStream->getCurrFrameNum();
loadFile( m_sStreamInfo.m_cFilename, false );
loadFile( m_cFilename, false );
seekAbsoluteEvent( currFrameNum );
}
@@ -145,12 +112,7 @@ Bool SubWindowHandle::loadFile( QString cFilename, Bool bForceDialog )
refreshFrame();
m_sStreamInfo.m_cFilename = cFilename;
m_sStreamInfo.m_uiWidth = Width;
m_sStreamInfo.m_uiHeight = Height;
m_sStreamInfo.m_iPelFormat = InputFormat;
m_sStreamInfo.m_uiFrameRate = FrameRate;
m_cFilename = cFilename;
m_cWindowName = m_pCurrStream->getStreamInformationString();
m_cWindowShortName = QFileInfo( cFilename ).fileName();
setWindowTitle( m_cWindowName );
@@ -163,10 +125,9 @@ Bool SubWindowHandle::loadFile( PlaYUVerStreamInfo* streamInfo )
{
m_pCurrStream = new PlaYUVerStream;
}
m_sStreamInfo = *streamInfo;
if( !m_pCurrStream->open( m_sStreamInfo.m_cFilename, m_sStreamInfo.m_uiWidth, m_sStreamInfo.m_uiHeight, m_sStreamInfo.m_iPelFormat,
m_sStreamInfo.m_uiFrameRate ) )
if( !m_pCurrStream->open( streamInfo->m_cFilename, streamInfo->m_uiWidth, streamInfo->m_uiHeight, streamInfo->m_iPelFormat,
streamInfo->m_uiFrameRate ) )
{
return false;
}
@@ -177,8 +138,9 @@ Bool SubWindowHandle::loadFile( PlaYUVerStreamInfo* streamInfo )
refreshFrame();
m_cFilename = streamInfo->m_cFilename;
m_cWindowName = m_pCurrStream->getStreamInformationString();
m_cWindowShortName = QFileInfo( m_sStreamInfo.m_cFilename ).fileName();
m_cWindowShortName = QFileInfo( streamInfo->m_cFilename ).fileName();
setWindowTitle( m_cWindowName );
return true;
}
@@ -323,7 +285,7 @@ Int SubWindowHandle::playEvent()
m_pCurrStream->readFrame();
if( m_pCurrStream->checkErrors( PlaYUVerStream::READING ) )
{
QMessageBox::warning( this, tr( "plaYUVer" ), tr( "Cannot read %1." ).arg( m_sStreamInfo.m_cFilename ) );
QMessageBox::warning( this, tr( "plaYUVer" ), tr( "Cannot read %1." ).arg( m_cFilename ) );
return -3;
}
return 0;