Add support for FFMPEG! currently only supports YUV420p and still needs

resolution input. Add support in ImageInterface.cpp to only show dialog
box when it is necessary
This commit is contained in:
jfmcarreira committed 2014-02-01 13:07:42 +00:00
1 parent b1f0d47e82
commit 4230166d9f
3 files changed
+136 -88

No files matched your search

+24 -26
View File
@@ -67,12 +67,15 @@ bool ImageInterface::loadFile( const QString &fileName )
{
return false;
}
m_currStream.init( fileName, formatDialog.getResolution().width(), formatDialog.getResolution().height(), formatDialog.getPixelFormat() );
}
else
{
m_currStream.init( fileName, 0, 0, 0 );
}
QApplication::setOverrideCursor( Qt::WaitCursor );
m_currStream.init( fileName, formatDialog.getResolution().width(), formatDialog.getResolution().height(), formatDialog.getPixelFormat() );
if( m_currStream.getStatus() == 0 )
{
return false;
@@ -99,37 +102,32 @@ bool ImageInterface::loadFile( const QString &fileName )
bool ImageInterface::save()
{
QString supported = tr("Supported Files");
QString formats = InputStream::supportedWriteFormats();
formats.prepend(" (");
formats.append(")");
supported.append(formats); // supported=="Supported Files (*.pbm *.jpg...)"
QString supported = tr( "Supported Files" );
QString formats = InputStream::supportedWriteFormats();
formats.prepend( " (" );
formats.append( ")" );
supported.append( formats ); // supported=="Supported Files (*.pbm *.jpg...)"
QStringList filter;
filter << supported
<< InputStream::supportedWriteFormatsList()
<< tr( "All Files (*)" );
QStringList filter;
filter << supported << InputStream::supportedWriteFormatsList() << tr( "All Files (*)" );
QString fileName = QFileDialog::getSaveFileName( this, tr( "Save As" ),
m_cCurrFileName, filter.join(";;") );
QString fileName = QFileDialog::getSaveFileName( this, tr( "Save As" ), m_cCurrFileName, filter.join( ";;" ) );
if ( fileName.isEmpty() )
return false;
if( fileName.isEmpty() )
return false;
QApplication::setOverrideCursor( Qt::WaitCursor );
if ( !m_currStream.writeFrame( fileName ) )
{
QApplication::restoreOverrideCursor();
QMessageBox::warning( this, tr( "SCode" ),
tr( "Cannot save file %1" )
.arg( fileName ));
return false;
}
QApplication::setOverrideCursor( Qt::WaitCursor );
if( !m_currStream.writeFrame( fileName ) )
{
QApplication::restoreOverrideCursor();
QMessageBox::warning( this, tr( "SCode" ), tr( "Cannot save file %1" ).arg( fileName ) );
return false;
}
return true;
QApplication::restoreOverrideCursor();
return true;
}
bool ImageInterface::nextVideoFrame()