Merge branch 'master' of https://github.com/pixlra/playuver
This commit is contained in:
commit
b93038904b
3 files changed
+29
-17
No files matched your search
@@ -49,7 +49,7 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget *parent ) :
|
|||||||
headLayout = new QHBoxLayout();
|
headLayout = new QHBoxLayout();
|
||||||
headLayout->setObjectName( QStringLiteral( "headLayout" ) );
|
headLayout->setObjectName( QStringLiteral( "headLayout" ) );
|
||||||
|
|
||||||
dialogTitleLabel = new QLabel( this );
|
dialogTitleLabel = new QLabel();
|
||||||
dialogTitleLabel->setObjectName( QStringLiteral( "dialogTitleLabel" ) );
|
dialogTitleLabel->setObjectName( QStringLiteral( "dialogTitleLabel" ) );
|
||||||
QFont font;
|
QFont font;
|
||||||
font.setPointSize( 11 );
|
font.setPointSize( 11 );
|
||||||
@@ -60,7 +60,7 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget *parent ) :
|
|||||||
|
|
||||||
headerSpacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
|
headerSpacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
|
||||||
|
|
||||||
dialogIconLabel = new QLabel( this );
|
dialogIconLabel = new QLabel( );
|
||||||
dialogIconLabel->setObjectName( QStringLiteral( "dialogIconLabel" ) );
|
dialogIconLabel->setObjectName( QStringLiteral( "dialogIconLabel" ) );
|
||||||
dialogIconLabel->setPixmap( QPixmap( ":/images/dialogheader-grid.png" ) );
|
dialogIconLabel->setPixmap( QPixmap( ":/images/dialogheader-grid.png" ) );
|
||||||
|
|
||||||
@@ -75,15 +75,15 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget *parent ) :
|
|||||||
verticalSpacer = new QSpacerItem( 10, 20, QSizePolicy::Minimum );
|
verticalSpacer = new QSpacerItem( 10, 20, QSizePolicy::Minimum );
|
||||||
MainLayout->addItem( verticalSpacer );
|
MainLayout->addItem( verticalSpacer );
|
||||||
|
|
||||||
standardResolutionLayout = new QHBoxLayout( );
|
standardResolutionLayout = new QHBoxLayout();
|
||||||
standardResolutionLayout->setObjectName( QStringLiteral( "standardResolutionLayout" ) );
|
standardResolutionLayout->setObjectName( QStringLiteral( "standardResolutionLayout" ) );
|
||||||
standardResolutionLabel = new QLabel( this );
|
standardResolutionLabel = new QLabel( );
|
||||||
standardResolutionLabel->setObjectName( QStringLiteral( "standardResolutionLabel" ) );
|
standardResolutionLabel->setObjectName( QStringLiteral( "standardResolutionLabel" ) );
|
||||||
standardResolutionLabel->setText( QApplication::translate( "ConfigureFormat", "Standard Resolution", 0 ) );
|
standardResolutionLabel->setText( QApplication::translate( "ConfigureFormat", "Standard Resolution", 0 ) );
|
||||||
|
|
||||||
horizontalSpacer = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
|
horizontalSpacer = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
|
||||||
|
|
||||||
standardResolutionBox = new QComboBox( this );
|
standardResolutionBox = new QComboBox( );
|
||||||
standardResolutionBox->setObjectName( QStringLiteral( "standardResolutionBox" ) );
|
standardResolutionBox->setObjectName( QStringLiteral( "standardResolutionBox" ) );
|
||||||
QSizePolicy sizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed );
|
QSizePolicy sizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed );
|
||||||
sizePolicy.setHorizontalStretch( 0 );
|
sizePolicy.setHorizontalStretch( 0 );
|
||||||
@@ -107,10 +107,10 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget *parent ) :
|
|||||||
resolutionGridVerticalSpacer = new QSpacerItem( 10, 20, QSizePolicy::Minimum );
|
resolutionGridVerticalSpacer = new QSpacerItem( 10, 20, QSizePolicy::Minimum );
|
||||||
MainLayout->addItem( resolutionGridVerticalSpacer );
|
MainLayout->addItem( resolutionGridVerticalSpacer );
|
||||||
|
|
||||||
resolutionGrid = new QGridLayout( this );
|
resolutionGrid = new QGridLayout( );
|
||||||
resolutionGrid->setObjectName( QStringLiteral( "resolutionGrid" ) );
|
resolutionGrid->setObjectName( QStringLiteral( "resolutionGrid" ) );
|
||||||
|
|
||||||
resolutionLabel = new QLabel( this );
|
resolutionLabel = new QLabel( );
|
||||||
resolutionLabel->setObjectName( QStringLiteral( "resolutionLabel" ) );
|
resolutionLabel->setObjectName( QStringLiteral( "resolutionLabel" ) );
|
||||||
QFont font1;
|
QFont font1;
|
||||||
font1.setBold( true );
|
font1.setBold( true );
|
||||||
@@ -118,23 +118,23 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget *parent ) :
|
|||||||
resolutionLabel->setFont( font1 );
|
resolutionLabel->setFont( font1 );
|
||||||
resolutionLabel->setText( QApplication::translate( "ConfigureFormat", "Resolution chosen", 0 ) );
|
resolutionLabel->setText( QApplication::translate( "ConfigureFormat", "Resolution chosen", 0 ) );
|
||||||
|
|
||||||
widthLabel = new QLabel( this );
|
widthLabel = new QLabel( );
|
||||||
widthLabel->setObjectName( QStringLiteral( "widthLabel" ) );
|
widthLabel->setObjectName( QStringLiteral( "widthLabel" ) );
|
||||||
widthLabel->setText( QApplication::translate( "ConfigureFormat", "Width", 0 ) );
|
widthLabel->setText( QApplication::translate( "ConfigureFormat", "Width", 0 ) );
|
||||||
widthSpinBox = new QSpinBox( this );
|
widthSpinBox = new QSpinBox( );
|
||||||
widthSpinBox->setObjectName( QStringLiteral( "widthSpinBox" ) );
|
widthSpinBox->setObjectName( QStringLiteral( "widthSpinBox" ) );
|
||||||
widthSpinBox->setRange( 0, 5000 );
|
widthSpinBox->setRange( 0, 5000 );
|
||||||
widthSpinBox->setValue( 0 );
|
widthSpinBox->setValue( 0 );
|
||||||
|
|
||||||
heightLabel = new QLabel( this );
|
heightLabel = new QLabel( );
|
||||||
heightLabel->setObjectName( QStringLiteral( "heightLabel" ) );
|
heightLabel->setObjectName( QStringLiteral( "heightLabel" ) );
|
||||||
heightLabel->setText( QApplication::translate( "ConfigureFormat", "Height", 0 ) );
|
heightLabel->setText( QApplication::translate( "ConfigureFormat", "Height", 0 ) );
|
||||||
heightSpinBox = new QSpinBox( this );
|
heightSpinBox = new QSpinBox( );
|
||||||
heightSpinBox->setObjectName( QStringLiteral( "heightSpinBox" ) );
|
heightSpinBox->setObjectName( QStringLiteral( "heightSpinBox" ) );
|
||||||
heightSpinBox->setRange( 0, 5000 );
|
heightSpinBox->setRange( 0, 5000 );
|
||||||
heightSpinBox->setValue( 0 );
|
heightSpinBox->setValue( 0 );
|
||||||
|
|
||||||
pixelsLabel = new QLabel( this );
|
pixelsLabel = new QLabel( );
|
||||||
pixelsLabel->setObjectName( QStringLiteral( "pixelsLabel" ) );
|
pixelsLabel->setObjectName( QStringLiteral( "pixelsLabel" ) );
|
||||||
pixelsLabel->setText( QApplication::translate( "ConfigureFormat", "Pixels", 0 ) );
|
pixelsLabel->setText( QApplication::translate( "ConfigureFormat", "Pixels", 0 ) );
|
||||||
|
|
||||||
@@ -155,13 +155,13 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget *parent ) :
|
|||||||
pixelFormatLayout = new QHBoxLayout( );
|
pixelFormatLayout = new QHBoxLayout( );
|
||||||
pixelFormatLayout->setObjectName( QStringLiteral( "pixelFormatLayout" ) );
|
pixelFormatLayout->setObjectName( QStringLiteral( "pixelFormatLayout" ) );
|
||||||
|
|
||||||
pixelFormatLabel = new QLabel( this );
|
pixelFormatLabel = new QLabel( );
|
||||||
pixelFormatLabel->setObjectName( QStringLiteral( "pixelFormatLabel" ) );
|
pixelFormatLabel->setObjectName( QStringLiteral( "pixelFormatLabel" ) );
|
||||||
pixelFormatLabel->setText( QApplication::translate( "pixelFormat", "Pixel FormatBox", 0 ) );
|
pixelFormatLabel->setText( QApplication::translate( "pixelFormat", "Pixel FormatBox", 0 ) );
|
||||||
|
|
||||||
pixelFormatHorizontalSpacer = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
|
pixelFormatHorizontalSpacer = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
|
||||||
|
|
||||||
pixelFormatBox = new QComboBox( this );
|
pixelFormatBox = new QComboBox( );
|
||||||
pixelFormatBox->setObjectName( QStringLiteral( "pixelFormatBox" ) );
|
pixelFormatBox->setObjectName( QStringLiteral( "pixelFormatBox" ) );
|
||||||
QSizePolicy sizePolicyPixelFormat( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed );
|
QSizePolicy sizePolicyPixelFormat( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed );
|
||||||
sizePolicyPixelFormat.setHorizontalStretch( 0 );
|
sizePolicyPixelFormat.setHorizontalStretch( 0 );
|
||||||
@@ -184,7 +184,7 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget *parent ) :
|
|||||||
verticalSpacerConfirmation = new QSpacerItem( 20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
verticalSpacerConfirmation = new QSpacerItem( 20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||||
MainLayout->addItem( verticalSpacerConfirmation );
|
MainLayout->addItem( verticalSpacerConfirmation );
|
||||||
|
|
||||||
dialogButtonOkCancel = new QDialogButtonBox( this );
|
dialogButtonOkCancel = new QDialogButtonBox( );
|
||||||
dialogButtonOkCancel->setObjectName( QString::fromUtf8( "dialogButtonBox" ) );
|
dialogButtonOkCancel->setObjectName( QString::fromUtf8( "dialogButtonBox" ) );
|
||||||
dialogButtonOkCancel->setStandardButtons( QDialogButtonBox::Cancel | QDialogButtonBox::Ok );
|
dialogButtonOkCancel->setStandardButtons( QDialogButtonBox::Cancel | QDialogButtonBox::Ok );
|
||||||
dialogButtonOkCancel->setCenterButtons( false );
|
dialogButtonOkCancel->setCenterButtons( false );
|
||||||
|
|||||||
@@ -109,7 +109,6 @@ QStringList InputStream::supportedPixelFormatList()
|
|||||||
|
|
||||||
Bool InputStream::needFormatDialog( QString filename )
|
Bool InputStream::needFormatDialog( QString filename )
|
||||||
{
|
{
|
||||||
return true;
|
|
||||||
QString fileExtension = QFileInfo( filename ).completeSuffix();
|
QString fileExtension = QFileInfo( filename ).completeSuffix();
|
||||||
if( !fileExtension.compare( QString( "yuv" ) ) )
|
if( !fileExtension.compare( QString( "yuv" ) ) )
|
||||||
{
|
{
|
||||||
@@ -130,7 +129,7 @@ Void InputStream::init( QString filename, UInt width, UInt height, Int input_for
|
|||||||
m_iPixelFormat = input_format;
|
m_iPixelFormat = input_format;
|
||||||
|
|
||||||
#ifdef USE_FFMPEG
|
#ifdef USE_FFMPEG
|
||||||
Bool avStatus = m_cLibAvContext.initAvFormat( filename, width, height, input_format );
|
Bool avStatus = m_cLibAvContext.initAvFormat( filename, m_uiWidth, m_uiHeight, m_iPixelFormat );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if( m_uiWidth <= 0 || m_uiHeight <= 0 )
|
if( m_uiWidth <= 0 || m_uiHeight <= 0 )
|
||||||
|
|||||||
@@ -135,6 +135,19 @@ Bool LibAvContextHandle::initAvFormat( QString filename, UInt& width, UInt& heig
|
|||||||
video_dst_bufsize = ret;
|
video_dst_bufsize = ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AVCodecContext *in_codec = fmt_ctx->streams[0]->codec;
|
||||||
|
width = in_codec->width;
|
||||||
|
height = in_codec->height;
|
||||||
|
switch( in_codec->pix_fmt )
|
||||||
|
{
|
||||||
|
case AV_PIX_FMT_YUV420P:
|
||||||
|
pixel_format = PlaYUVerFrame::YUV420;
|
||||||
|
break;
|
||||||
|
case AV_PIX_FMT_GRAY8:
|
||||||
|
pixel_format = PlaYUVerFrame::YUV400;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* dump input information to stderr */
|
/* dump input information to stderr */
|
||||||
av_dump_format( fmt_ctx, 0, src_filename, 0 );
|
av_dump_format( fmt_ctx, 0, src_filename, 0 );
|
||||||
if( !video_stream )
|
if( !video_stream )
|
||||||
|
|||||||
Reference in new issue
Block a user