Show codec and format inforamtion in sidebar and title bar
This commit is contained in:
1 parent
9df1f6cf12
commit
bda951126d
4 files changed
+30
-9
No files matched your search
@@ -134,8 +134,8 @@ Bool InputStream::open( QString filename, UInt width, UInt height, Int input_for
|
||||
if( QFileInfo( filename ).completeSuffix().compare( QString( "yuv" ) ) )
|
||||
{
|
||||
avStatus = m_cLibAvContext.initAvFormat( m_cFilename.toLocal8Bit().data(), m_uiWidth, m_uiHeight, m_iPixelFormat, m_uiFrameRate );
|
||||
m_cFormatName = QString::fromUtf8( m_cLibAvContext.getCodecName() );
|
||||
|
||||
m_cFormatName = QFileInfo( filename ).completeSuffix().toUpper();
|
||||
m_cCodedName = QString::fromUtf8( m_cLibAvContext.getCodecName() ).toUpper();
|
||||
m_uiTotalFrameNum = 100;
|
||||
}
|
||||
#endif
|
||||
@@ -173,7 +173,8 @@ Bool InputStream::open( QString filename, UInt width, UInt height, Int input_for
|
||||
fseek( m_pFile, 0, SEEK_END );
|
||||
m_uiTotalFrameNum = ftell( m_pFile ) / ( frame_bytes_input );
|
||||
fseek( m_pFile, 0, SEEK_SET );
|
||||
m_cFormatName = QString::fromUtf8( "Raw Video" );
|
||||
m_cFormatName = QString::fromUtf8( "YUV" );
|
||||
m_cCodedName = QString::fromUtf8( "Raw Video" );
|
||||
}
|
||||
if( !getMem1D<Pel>( &m_pInputBuffer, m_pcCurrFrame->getBytesPerFrame() ) )
|
||||
{
|
||||
@@ -184,6 +185,8 @@ Bool InputStream::open( QString filename, UInt width, UInt height, Int input_for
|
||||
m_cStreamInformationString = QString( "[" );
|
||||
m_cStreamInformationString.append( m_cFormatName );
|
||||
m_cStreamInformationString.append( QString( " / " ) );
|
||||
m_cStreamInformationString.append( m_cCodedName );
|
||||
m_cStreamInformationString.append( QString( " / " ) );
|
||||
m_cStreamInformationString.append( PlaYUVerFrame::supportedPixelFormatList().at( m_iPixelFormat ) );
|
||||
m_cStreamInformationString.append( "] " );
|
||||
m_cStreamInformationString.append( QFileInfo( m_cFilename ).fileName() );
|
||||
|
||||
@@ -62,6 +62,7 @@ private:
|
||||
|
||||
QString m_cFilename;
|
||||
QString m_cFormatName;
|
||||
QString m_cCodedName;
|
||||
QString m_cStreamInformationString;
|
||||
|
||||
QTime m_cTimer;
|
||||
@@ -142,6 +143,10 @@ public:
|
||||
{
|
||||
return m_cFormatName;
|
||||
}
|
||||
QString getCodecName()
|
||||
{
|
||||
return m_cCodedName;
|
||||
}
|
||||
UInt getFrameNum()
|
||||
{
|
||||
return m_uiTotalFrameNum;
|
||||
|
||||
@@ -53,6 +53,11 @@ StreamPropertiesSideBar::StreamPropertiesSideBar( QWidget* parent ) :
|
||||
labelFormatValue = new QLabel;
|
||||
labelFormatValue->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
|
||||
|
||||
QLabel *codecLabel = new QLabel( tr( "Codec:" ) );
|
||||
codecLabel->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
|
||||
labelCodecValue = new QLabel;
|
||||
labelCodecValue->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
|
||||
|
||||
QLabel *sizeLabel = new QLabel( tr( "Size (pixels):" ) );
|
||||
sizeLabel->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
|
||||
labelSizeValue = new QLabel;
|
||||
@@ -64,12 +69,18 @@ StreamPropertiesSideBar::StreamPropertiesSideBar( QWidget* parent ) :
|
||||
labelColorSpaceValue->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
|
||||
|
||||
QGridLayout *propertiesLayout = new QGridLayout;
|
||||
propertiesLayout->addWidget( formatLabel, 0, 0 );
|
||||
propertiesLayout->addWidget( labelFormatValue, 0, 1 );
|
||||
propertiesLayout->addWidget( sizeLabel, 1, 0 );
|
||||
propertiesLayout->addWidget( labelSizeValue, 1, 1 );
|
||||
propertiesLayout->addWidget( colorSpaceLabel, 2, 0 );
|
||||
propertiesLayout->addWidget( labelColorSpaceValue, 2, 1 );
|
||||
Int layout_line = 0;
|
||||
propertiesLayout->addWidget( formatLabel, layout_line, 0 );
|
||||
propertiesLayout->addWidget( labelFormatValue, layout_line, 1 );
|
||||
layout_line++;
|
||||
propertiesLayout->addWidget( codecLabel, layout_line, 0 );
|
||||
propertiesLayout->addWidget( labelCodecValue, layout_line, 1 );
|
||||
layout_line++;
|
||||
propertiesLayout->addWidget( sizeLabel, layout_line, 0 );
|
||||
propertiesLayout->addWidget( labelSizeValue, layout_line, 1 );
|
||||
layout_line++;
|
||||
propertiesLayout->addWidget( colorSpaceLabel, layout_line, 0 );
|
||||
propertiesLayout->addWidget( labelColorSpaceValue, layout_line, 1 );
|
||||
|
||||
QGroupBox *propertiesGroup = new QGroupBox( tr( "Properties" ) );
|
||||
propertiesGroup->setLayout( propertiesLayout );
|
||||
@@ -110,6 +121,7 @@ Void StreamPropertiesSideBar::setData( InputStream* pcStream )
|
||||
|
||||
QString value;
|
||||
labelFormatValue->setText( m_pcStream->getFormatName() );
|
||||
labelCodecValue->setText( m_pcStream->getCodecName() );
|
||||
uint width = m_pcStream->getWidth();
|
||||
uint height = m_pcStream->getHeight();
|
||||
value = QString( tr( "%1 x %2" ) ).arg( width ).arg( height );
|
||||
|
||||
@@ -52,6 +52,7 @@ private:
|
||||
InputStream* m_pcStream;
|
||||
|
||||
QLabel* labelFormatValue;
|
||||
QLabel* labelCodecValue;
|
||||
QLabel* labelSizeValue;
|
||||
QLabel* labelColorSpaceValue;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user