Merge frame rate configuration
This commit is contained in:
@@ -147,7 +147,7 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget *parent ) :
|
||||
|
||||
MainLayout->addLayout( resolutionGrid );
|
||||
|
||||
// Pixel format
|
||||
|
||||
|
||||
pixelFormatVerticalSpacer = new QSpacerItem( 10, 20, QSizePolicy::Minimum );
|
||||
MainLayout->addItem( pixelFormatVerticalSpacer );
|
||||
@@ -179,6 +179,31 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget *parent ) :
|
||||
|
||||
MainLayout->addLayout( pixelFormatLayout );
|
||||
|
||||
// Frame rate format
|
||||
|
||||
framerateFormatVerticalSpacer = new QSpacerItem( 10, 20, QSizePolicy::Minimum );
|
||||
MainLayout->addItem( pixelFormatVerticalSpacer );
|
||||
|
||||
framerateFormatLayout = new QHBoxLayout();
|
||||
framerateFormatLayout->setObjectName( QStringLiteral( "pixelFormatLayout" ) );
|
||||
|
||||
framerateFormatLabel = new QLabel();
|
||||
framerateFormatLabel->setObjectName( QStringLiteral( "pixelFormatLabel" ) );
|
||||
framerateFormatLabel->setText( QApplication::translate( "pixelFormat", "Pixel FormatBox", 0 ) );
|
||||
|
||||
framerateFormatHorizontalSpacer = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
|
||||
|
||||
framerateSpinBox = new QSpinBox( );
|
||||
framerateSpinBox->setObjectName( QStringLiteral( "framerateSpinBox" ) );
|
||||
framerateSpinBox->setRange( 0, 200 );
|
||||
framerateSpinBox->setValue( 30 );
|
||||
|
||||
framerateFormatLayout->addWidget( framerateFormatLabel );
|
||||
framerateFormatLayout->addItem( framerateFormatHorizontalSpacer );
|
||||
framerateFormatLayout->addWidget( framerateSpinBox );
|
||||
|
||||
MainLayout->addLayout( framerateFormatLayout );
|
||||
|
||||
// Confirmation buttons
|
||||
|
||||
verticalSpacerConfirmation = new QSpacerItem( 20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||
@@ -191,7 +216,6 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget *parent ) :
|
||||
|
||||
MainLayout->addWidget( dialogButtonOkCancel );
|
||||
|
||||
Int idx;
|
||||
connect( standardResolutionBox, SIGNAL( currentIndexChanged(int) ), this, SLOT( StandardResolutionSelection() ) );
|
||||
connect( dialogButtonOkCancel, SIGNAL( accepted() ), this, SLOT( accept() ) );
|
||||
connect( dialogButtonOkCancel, SIGNAL( rejected() ), this, SLOT( reject() ) );
|
||||
|
||||
@@ -66,6 +66,11 @@ public:
|
||||
return pixelFormatBox->currentIndex();
|
||||
}
|
||||
|
||||
UInt getFrameRate()
|
||||
{
|
||||
return framerateSpinBox->value();
|
||||
}
|
||||
|
||||
private Q_SLOTS:
|
||||
void StandardResolutionSelection();
|
||||
|
||||
@@ -98,6 +103,12 @@ private:
|
||||
QSpacerItem *pixelFormatHorizontalSpacer;
|
||||
QComboBox *pixelFormatBox;
|
||||
|
||||
QSpacerItem *framerateFormatVerticalSpacer;
|
||||
QHBoxLayout *framerateFormatLayout;
|
||||
QLabel *framerateFormatLabel;
|
||||
QSpacerItem *framerateFormatHorizontalSpacer;
|
||||
QSpinBox *framerateSpinBox;
|
||||
|
||||
QSpacerItem *verticalSpacerConfirmation;
|
||||
QDialogButtonBox *dialogButtonOkCancel;
|
||||
|
||||
|
||||
@@ -124,16 +124,17 @@ Bool InputStream::needFormatDialog( QString filename )
|
||||
}
|
||||
}
|
||||
|
||||
Void InputStream::init( QString filename, UInt width, UInt height, Int input_format )
|
||||
Void InputStream::init( QString filename, UInt width, UInt height, Int input_format, UInt frame_rate )
|
||||
{
|
||||
m_uiWidth = width;
|
||||
m_uiHeight = height;
|
||||
m_uiFrameRate = frame_rate;
|
||||
|
||||
m_iFileFormat = YUVFormat;
|
||||
m_iPixelFormat = input_format;
|
||||
|
||||
#ifdef USE_FFMPEG
|
||||
Bool avStatus = m_cLibAvContext.initAvFormat( filename, m_uiWidth, m_uiHeight, m_iPixelFormat );
|
||||
Bool avStatus = m_cLibAvContext.initAvFormat( filename, m_uiWidth, m_uiHeight, m_iPixelFormat, m_uiFrameRate );
|
||||
#endif
|
||||
|
||||
if( m_uiWidth <= 0 || m_uiHeight <= 0 )
|
||||
|
||||
@@ -92,7 +92,7 @@ public:
|
||||
|
||||
Bool needFormatDialog( QString filename );
|
||||
|
||||
Void init( QString filename, UInt width, UInt height, Int input_format );
|
||||
Void init( QString filename, UInt width, UInt height, Int input_format, UInt frame_rate );
|
||||
|
||||
Void readFrame();
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ Void LibAvContextHandle::closeAvFormat()
|
||||
av_free( video_dst_data[0] );
|
||||
}
|
||||
|
||||
Bool LibAvContextHandle::initAvFormat( QString filename, UInt& width, UInt& height, Int& pixel_format )
|
||||
Bool LibAvContextHandle::initAvFormat( QString filename, UInt& width, UInt& height, Int& pixel_format, UInt& frame_rate )
|
||||
{
|
||||
Bool bRet = true;
|
||||
int ret = 0;
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace plaYUVer
|
||||
class LibAvContextHandle
|
||||
{
|
||||
public:
|
||||
Bool initAvFormat( QString filename, UInt& width, UInt& height, Int& pixel_format );
|
||||
Bool initAvFormat( QString filename, UInt& width, UInt& height, Int& pixel_format, UInt& frame_rate );
|
||||
Void closeAvFormat();
|
||||
Bool decodeAvFormat();
|
||||
|
||||
|
||||
@@ -67,11 +67,11 @@ bool SubWindowHandle::loadFile( const QString &fileName )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
m_currStream.init( fileName, formatDialog.getResolution().width(), formatDialog.getResolution().height(), formatDialog.getPixelFormat() );
|
||||
m_currStream.init( fileName, formatDialog.getResolution().width(), formatDialog.getResolution().height(), formatDialog.getPixelFormat(), formatDialog.getFrameRate() );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_currStream.init( fileName, 0, 0, 0 );
|
||||
m_currStream.init( fileName, 0, 0, 0, 0 );
|
||||
}
|
||||
QApplication::setOverrideCursor( Qt::WaitCursor );
|
||||
QApplication::restoreOverrideCursor();
|
||||
|
||||
Reference in New Issue
Block a user