Merge branch 'master' into stable

This commit is contained in:
2016-11-24 18:24:49 +00:00
7 changed files with 76 additions and 17 deletions
+28 -4
View File
@@ -23,6 +23,8 @@
* Based on the work of Glad Deschrijver <glad.deschrijver@gmail.com> in KTikZ project
*/
#include <config.h>
#include "AboutDialog.h"
#include <QApplication>
#include <QDialogButtonBox>
@@ -30,24 +32,46 @@
#include <QTextEdit>
#include <QVBoxLayout>
#define TAB_FROM_SPACES "&nbsp;&nbsp;&nbsp;"
AboutDialog::AboutDialog( QWidget *parent ) :
QDialog( parent )
{
QPixmap logo = QPixmap( ":/images/playuver-backgroud-logo.png" ).scaled( QSize( 350, 350 ), Qt::KeepAspectRatio );
QPixmap logo = QPixmap( ":/images/playuver-backgroud-logo.png" ).scaled( QSize( 500, 350 ), Qt::KeepAspectRatio );
QLabel *pixmapLabel = new QLabel;
pixmapLabel->setPixmap( logo );
QLabel *label = new QLabel( QString( "<h1>%1 Version %2</h1><p>%3</p><p>%4</p>" )
QLabel *label = new QLabel( QString( "<h1 style='text-align:center'>%1 Version %2</h1><h2>%3</h2>" )
.arg( QApplication::applicationName() )
.arg( QApplication::applicationVersion() )
.arg( tr( "Enhanced open-source Qt-based raw video player" ) )
.arg( tr( "Copyright © 2014–2015 Luis Lucas and Joao Carreira" ) ) );
.arg( tr( "Enhanced open-source Qt-based raw video player" ) ) );
label->setWordWrap( true );
QString featuresList = QStringLiteral( "<p><b>Features:</b><ul>" );
#ifdef USE_QTDBUS
featuresList.append( QStringLiteral( "<li>Support for Qt DBus messages" ) );
#endif
#ifdef USE_FFMPEG
featuresList.append( QStringLiteral( "<li>Support for FFmpeg" ) );
#endif
#ifdef USE_OPENCV
featuresList.append( QStringLiteral( "<li>Support for OpenCV" ) );
#endif
featuresList.append( QStringLiteral( "</ul></p>" ) );
QLabel *labelFeatures = new QLabel( featuresList );
QLabel *labelCopyright = new QLabel( QStringLiteral( "Copyright © 2014–2015 Luis Lucas and Joao Carreira" ) );
QWidget *topWidget = new QWidget;
QVBoxLayout *topLayout = new QVBoxLayout;
topLayout->addWidget( pixmapLabel );
topLayout->addWidget( label );
topLayout->addWidget( labelFeatures );
topLayout->addWidget( labelCopyright );
topWidget->setLayout( topLayout );
// QTextEdit *textEdit = new QTextEdit(tr("<p>This program is free "
+8 -3
View File
@@ -33,12 +33,13 @@
#include <QSpinBox>
#include <QString>
#include <QWidget>
#include <QDebug>
#include "lib/PlaYUVerFrame.h"
#include "ConfigureFormatDialog.h"
#define MAX_SUPPORTED_RESOLUTION 9999
#define MAX_SUPPORTED_RESOLUTION 99999
QDataStream& operator<<( QDataStream& out, const PlaYUVerStdResolutionVector& array )
{
@@ -423,19 +424,23 @@ Int ConfigureFormatDialog::runConfigureFormatDialog( const QString& Filename, UI
m_widgetEndianness->setVisible( false );
}
m_spinBoxFrameRate->setValue( rFrameRate );
for( Int i = 0; i < standardResolutionSizes.size(); i++ )
for( Int i = 0; i < standardResolutionSizes.size() - 1; i++ )
{
if( standardResolutionSizes.at( i ) == QSize( rWidth, rHeight ) )
{
m_comboBoxStandardResolution->setCurrentIndex( i );
qDebug() << "ola";
break;
}
}
if( exec() == QDialog::Rejected )
{
writeSettings();
return QDialog::Rejected;
}
rWidth = m_spinBoxWidth->value();
rHeight = m_spinBoxheight->value();
colorSpace = m_comboBoxColorSpace->currentIndex();
@@ -472,8 +477,8 @@ void ConfigureFormatDialog::slotStandardResolutionSelected( Int idx )
m_comboBoxStandardResolution->blockSignals( true );
m_comboBoxStandardResolution->insertItem( 0, name );
m_comboBoxStandardResolution->setCurrentIndex( 0 );
m_comboBoxStandardResolution->blockSignals( false );
m_comboBoxStandardResolution->setCurrentIndex( 0 );
}
}
if( idx >= 0 )
+18 -4
View File
@@ -317,7 +317,7 @@ Bool VideoSubWindow::loadFile( QString cFilename, Bool bForceDialog )
m_pCurrStream = new PlaYUVerStream;
}
if( guessFormat( cFilename, Width, Height, InputFormat, FrameRate ) || bForceDialog )
if( guessFormat( cFilename, Width, Height, InputFormat, BitsPel ) || bForceDialog )
{
if( formatDialog.runConfigureFormatDialog( QFileInfo( cFilename ).fileName(), Width, Height, InputFormat, BitsPel, Endianness, FrameRate )
== QDialog::Rejected )
@@ -428,7 +428,7 @@ Void VideoSubWindow::updateVideoWindowInfo()
}
}
Bool VideoSubWindow::guessFormat( QString filename, UInt& rWidth, UInt& rHeight, Int& rInputFormat, UInt& rFrameRate )
Bool VideoSubWindow::guessFormat( QString filename, UInt& rWidth, UInt& rHeight, Int& rInputFormat, UInt& rBitsPerPixel )
{
std::vector<PlaYUVerStdResolution> stdResList = PlaYUVerStream::stdResolutionSizes();
Bool bGuessed = true;
@@ -440,7 +440,7 @@ Bool VideoSubWindow::guessFormat( QString filename, UInt& rWidth, UInt& rHeight,
{
return false;
}
if( !fileExtension.compare( "yuv" ) )
if( !fileExtension.compare( "yuv" ) || !fileExtension.compare( "rgb" ) || !fileExtension.compare( "gray" ) )
{
bGuessed = false;
// Guess pixel format
@@ -470,8 +470,9 @@ Bool VideoSubWindow::guessFormat( QString filename, UInt& rWidth, UInt& rHeight,
rWidth = stdResList[iMatch].uiWidth;
rHeight = stdResList[iMatch].uiHeight;
}
// Guess resolution - match %dx%d
#if( QT_VERSION_PLAYUVER == 5 )
// Guess resolution - match %dx%d
QRegularExpressionMatch resolutionMatch = QRegularExpression( "_\\d*x\\d*" ).match( FilenameShort );
if( resolutionMatch.hasMatch() )
{
@@ -487,6 +488,19 @@ Bool VideoSubWindow::guessFormat( QString filename, UInt& rWidth, UInt& rHeight,
}
}
}
// Guess bits per pixel - match %dbpp
QRegularExpressionMatch BppMatch = QRegularExpression( "_\\d*bpp" ).match( FilenameShort );
if( BppMatch.hasMatch() )
{
QString matchString = BppMatch.captured( 0 );
matchString.remove( "_" );
matchString.remove( "bpp" );
rBitsPerPixel = matchString.toUInt();
if( !( rBitsPerPixel > 0 && rBitsPerPixel < 16 ) )
{
rBitsPerPixel = -1;
}
}
#endif
}
+1 -1
View File
@@ -103,7 +103,7 @@ private:
Void refreshFrameOperation();
static Bool guessFormat( QString filename, UInt& rWidth, UInt& rHeight, Int& rInputFormat, UInt& rFrameRate );
static Bool guessFormat( QString filename, UInt& rWidth, UInt& rHeight, Int& rInputFormat, UInt& rBitsPerPixel );
/**
* Private zoom function to handle
+1
View File
@@ -58,6 +58,7 @@ public:
YUV422p,
YUYV422,
GRAY,
RGBp,
RGB24,
BGR24,
NUMBER_PEL_FORMATS
+19 -5
View File
@@ -268,7 +268,21 @@ const PlaYUVerPixFmtDescriptor g_PlaYUVerPixFmtDescriptorsList[PlaYUVerFrame::NU
{ { 0, 0, 1 } }, /* Y */
},
{
"RGB24",
"RGBp",
PlaYUVerPixel::COLOR_RGB,
3,
3,
0,
0,
ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_RGB24 ),
{
{ 0, 0, 1 }, /* R */
{ 1, 0, 1 }, /* G */
{ 2, 0, 1 }, /* B */
},
},
{
"RGB",
PlaYUVerPixel::COLOR_RGB,
3,
1,
@@ -282,7 +296,7 @@ const PlaYUVerPixFmtDescriptor g_PlaYUVerPixFmtDescriptorsList[PlaYUVerFrame::NU
},
},
{
"BGR24",
"BGR",
PlaYUVerPixel::COLOR_RGB,
3,
1,
@@ -290,9 +304,9 @@ const PlaYUVerPixFmtDescriptor g_PlaYUVerPixFmtDescriptorsList[PlaYUVerFrame::NU
0,
ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_BGR24 ),
{
{ 0, 2, 3}, /* R */
{ 0, 2, 2}, /* G */
{ 0, 2, 1}, /* B */
{ 0, 2, 3}, /* B */
{ 0, 2, 2}, /* R */
{ 0, 2, 1}, /* G */
},
}
};
+1
View File
@@ -48,6 +48,7 @@ std::vector<PlaYUVerSupportedFormat> PlaYUVerStream::supportedReadFormats()
INI_REGIST_PLAYUVER_SUPPORTED_FMT;
REGIST_PLAYUVER_SUPPORTED_FMT( &StreamHandlerRaw::Create, "Raw Video", "yuv" );
REGIST_PLAYUVER_SUPPORTED_FMT( &StreamHandlerRaw::Create, "Raw Video", "gray" );
REGIST_PLAYUVER_SUPPORTED_FMT( &StreamHandlerRaw::Create, "Raw Video", "rgb" );
REGIST_PLAYUVER_SUPPORTED_FMT( &StreamHandlerPortableMap::Create, "Portable BitMap ", "pbm" );
REGIST_PLAYUVER_SUPPORTED_FMT( &StreamHandlerPortableMap::Create, "Portable GrayMap ", "pgm" );
REGIST_PLAYUVER_SUPPORTED_FMT( &StreamHandlerPortableMap::Create, "Portable PixMap ", "ppm" );