Change stream info to PlaYUVerStream file
This commit is contained in:
1 parent
9906befa92
commit
60b82a0bf0
5 files changed
+71
-67
No files matched your search
@@ -29,39 +29,6 @@
|
|||||||
namespace plaYUVer
|
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 ) :
|
SubWindowHandle::SubWindowHandle( QWidget * parent, Bool isModule ) :
|
||||||
QMdiSubWindow( parent ),
|
QMdiSubWindow( parent ),
|
||||||
m_pCurrStream( NULL ),
|
m_pCurrStream( NULL ),
|
||||||
@@ -108,7 +75,7 @@ SubWindowHandle::~SubWindowHandle()
|
|||||||
Void SubWindowHandle::reloadFile()
|
Void SubWindowHandle::reloadFile()
|
||||||
{
|
{
|
||||||
Int currFrameNum = m_pCurrStream->getCurrFrameNum();
|
Int currFrameNum = m_pCurrStream->getCurrFrameNum();
|
||||||
loadFile( m_sStreamInfo.m_cFilename, false );
|
loadFile( m_cFilename, false );
|
||||||
seekAbsoluteEvent( currFrameNum );
|
seekAbsoluteEvent( currFrameNum );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,12 +112,7 @@ Bool SubWindowHandle::loadFile( QString cFilename, Bool bForceDialog )
|
|||||||
|
|
||||||
refreshFrame();
|
refreshFrame();
|
||||||
|
|
||||||
m_sStreamInfo.m_cFilename = cFilename;
|
m_cFilename = cFilename;
|
||||||
m_sStreamInfo.m_uiWidth = Width;
|
|
||||||
m_sStreamInfo.m_uiHeight = Height;
|
|
||||||
m_sStreamInfo.m_iPelFormat = InputFormat;
|
|
||||||
m_sStreamInfo.m_uiFrameRate = FrameRate;
|
|
||||||
|
|
||||||
m_cWindowName = m_pCurrStream->getStreamInformationString();
|
m_cWindowName = m_pCurrStream->getStreamInformationString();
|
||||||
m_cWindowShortName = QFileInfo( cFilename ).fileName();
|
m_cWindowShortName = QFileInfo( cFilename ).fileName();
|
||||||
setWindowTitle( m_cWindowName );
|
setWindowTitle( m_cWindowName );
|
||||||
@@ -163,10 +125,9 @@ Bool SubWindowHandle::loadFile( PlaYUVerStreamInfo* streamInfo )
|
|||||||
{
|
{
|
||||||
m_pCurrStream = new PlaYUVerStream;
|
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,
|
if( !m_pCurrStream->open( streamInfo->m_cFilename, streamInfo->m_uiWidth, streamInfo->m_uiHeight, streamInfo->m_iPelFormat,
|
||||||
m_sStreamInfo.m_uiFrameRate ) )
|
streamInfo->m_uiFrameRate ) )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -177,8 +138,9 @@ Bool SubWindowHandle::loadFile( PlaYUVerStreamInfo* streamInfo )
|
|||||||
|
|
||||||
refreshFrame();
|
refreshFrame();
|
||||||
|
|
||||||
|
m_cFilename = streamInfo->m_cFilename;
|
||||||
m_cWindowName = m_pCurrStream->getStreamInformationString();
|
m_cWindowName = m_pCurrStream->getStreamInformationString();
|
||||||
m_cWindowShortName = QFileInfo( m_sStreamInfo.m_cFilename ).fileName();
|
m_cWindowShortName = QFileInfo( streamInfo->m_cFilename ).fileName();
|
||||||
setWindowTitle( m_cWindowName );
|
setWindowTitle( m_cWindowName );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -323,7 +285,7 @@ Int SubWindowHandle::playEvent()
|
|||||||
m_pCurrStream->readFrame();
|
m_pCurrStream->readFrame();
|
||||||
if( m_pCurrStream->checkErrors( PlaYUVerStream::READING ) )
|
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 -3;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -41,20 +41,6 @@ namespace plaYUVer
|
|||||||
|
|
||||||
class SubWindowHandle;
|
class SubWindowHandle;
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
QString m_cFilename;
|
|
||||||
UInt m_uiWidth;
|
|
||||||
UInt m_uiHeight;
|
|
||||||
Int m_iPelFormat;
|
|
||||||
UInt m_uiFrameRate;
|
|
||||||
}PlaYUVerStreamInfo;
|
|
||||||
typedef QVector<PlaYUVerStreamInfo> PlaYUVerStreamInfoVector;
|
|
||||||
|
|
||||||
QDataStream& operator<<(QDataStream& out, const PlaYUVerStreamInfoVector& d);
|
|
||||||
QDataStream& operator>>(QDataStream& in, PlaYUVerStreamInfoVector& d);
|
|
||||||
|
|
||||||
|
|
||||||
class SubWindowHandle: public QMdiSubWindow
|
class SubWindowHandle: public QMdiSubWindow
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -64,11 +50,10 @@ private:
|
|||||||
QScrollArea* m_cScrollArea;
|
QScrollArea* m_cScrollArea;
|
||||||
ViewArea* m_cViewArea;
|
ViewArea* m_cViewArea;
|
||||||
|
|
||||||
PlaYUVerStreamInfo m_sStreamInfo;
|
|
||||||
|
|
||||||
PlaYUVerStream* m_pCurrStream;
|
PlaYUVerStream* m_pCurrStream;
|
||||||
PlaYUVerFrame* m_pcCurrFrame;
|
PlaYUVerFrame* m_pcCurrFrame;
|
||||||
|
|
||||||
|
QString m_cFilename;
|
||||||
PlaYUVerModuleIf* m_pcCurrentModule;
|
PlaYUVerModuleIf* m_pcCurrentModule;
|
||||||
|
|
||||||
SubWindowHandle* m_pcReferenceSubWindow;
|
SubWindowHandle* m_pcReferenceSubWindow;
|
||||||
@@ -113,7 +98,10 @@ public:
|
|||||||
|
|
||||||
PlaYUVerStreamInfo getStreamInfo()
|
PlaYUVerStreamInfo getStreamInfo()
|
||||||
{
|
{
|
||||||
return m_sStreamInfo;
|
PlaYUVerStreamInfo info;
|
||||||
|
if( m_pCurrStream )
|
||||||
|
info = m_pCurrStream->getStreamInfo();
|
||||||
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
PlaYUVerStream* getInputStream()
|
PlaYUVerStream* getInputStream()
|
||||||
@@ -214,7 +202,7 @@ public:
|
|||||||
}
|
}
|
||||||
QString getCurrentFileName()
|
QString getCurrentFileName()
|
||||||
{
|
{
|
||||||
return m_sStreamInfo.m_cFilename;
|
return m_cFilename;
|
||||||
}
|
}
|
||||||
|
|
||||||
Bool getIsModule()
|
Bool getIsModule()
|
||||||
@@ -233,8 +221,5 @@ public Q_SLOTS:
|
|||||||
|
|
||||||
} // NAMESPACE
|
} // NAMESPACE
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(plaYUVer::PlaYUVerStreamInfo);
|
|
||||||
Q_DECLARE_METATYPE(plaYUVer::PlaYUVerStreamInfoVector);
|
|
||||||
|
|
||||||
#endif // __SUBWINDOWHANDLE_H__
|
#endif // __SUBWINDOWHANDLE_H__
|
||||||
|
|
||||||
+1
-1
@@ -25,7 +25,7 @@
|
|||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "plaYUVerApp.h"
|
#include "plaYUVerApp.h"
|
||||||
#include "SubWindowHandle.h"
|
#include "PlaYUVerStream.h"
|
||||||
#ifdef USE_FERVOR
|
#ifdef USE_FERVOR
|
||||||
#include "fvupdater.h"
|
#include "fvupdater.h"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -34,6 +34,40 @@
|
|||||||
namespace plaYUVer
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
PlaYUVerStream::PlaYUVerStream()
|
PlaYUVerStream::PlaYUVerStream()
|
||||||
{
|
{
|
||||||
m_bInit = false;
|
m_bInit = false;
|
||||||
|
|||||||
@@ -36,6 +36,20 @@ namespace plaYUVer
|
|||||||
|
|
||||||
class LibAvContextHandle;
|
class LibAvContextHandle;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
QString m_cFilename;
|
||||||
|
UInt m_uiWidth;
|
||||||
|
UInt m_uiHeight;
|
||||||
|
Int m_iPelFormat;
|
||||||
|
UInt m_uiFrameRate;
|
||||||
|
}PlaYUVerStreamInfo;
|
||||||
|
typedef QVector<PlaYUVerStreamInfo> PlaYUVerStreamInfoVector;
|
||||||
|
|
||||||
|
QDataStream& operator<<(QDataStream& out, const PlaYUVerStreamInfoVector& d);
|
||||||
|
QDataStream& operator>>(QDataStream& in, PlaYUVerStreamInfoVector& d);
|
||||||
|
|
||||||
|
|
||||||
class PlaYUVerStream
|
class PlaYUVerStream
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
@@ -47,6 +61,8 @@ private:
|
|||||||
Bool m_bLoadAll;
|
Bool m_bLoadAll;
|
||||||
Int m_iErrorStatus;
|
Int m_iErrorStatus;
|
||||||
|
|
||||||
|
PlaYUVerStreamInfo m_sStreamInfo;
|
||||||
|
|
||||||
LibAvContextHandle* m_cLibAvContext;
|
LibAvContextHandle* m_cLibAvContext;
|
||||||
|
|
||||||
QString m_cFilename;
|
QString m_cFilename;
|
||||||
@@ -297,8 +313,15 @@ public:
|
|||||||
m_uiHeight = new_height;
|
m_uiHeight = new_height;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
PlaYUVerStreamInfo getStreamInfo()
|
||||||
|
{
|
||||||
|
return m_sStreamInfo;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // NAMESPACE
|
} // NAMESPACE
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(plaYUVer::PlaYUVerStreamInfo);
|
||||||
|
Q_DECLARE_METATYPE(plaYUVer::PlaYUVerStreamInfoVector);
|
||||||
|
|
||||||
#endif // __PLAYUVERSTREAM_H__
|
#endif // __PLAYUVERSTREAM_H__
|
||||||
Reference in new issue
Block a user