Change exceptions handle to the PlaYUVerExcpetions
This commit is contained in:
1 parent
617c42563d
commit
d7d3e9f4ea
4 files changed
+11
-8
No files matched your search
+6
-6
@@ -239,10 +239,10 @@ Void PlaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo )
|
||||
videoSubWindow->close();
|
||||
}
|
||||
}
|
||||
catch( const char *msg )
|
||||
catch( PlaYUVerFailure& e )
|
||||
{
|
||||
videoSubWindow->close();
|
||||
QString warningMsg = "Cannot open file " + QFileInfo( fileName ).fileName() + " with the following error: \n" + msg;
|
||||
QString warningMsg = "Cannot open file " + QFileInfo( fileName ).fileName() + " with the following error: \n" + e.what();
|
||||
QMessageBox::warning( this, QApplication::applicationName(), warningMsg );
|
||||
printMessage( warningMsg, LOG_ERROR );
|
||||
}
|
||||
@@ -329,10 +329,10 @@ Void PlaYUVerApp::save()
|
||||
{
|
||||
saveWindow->save( fileName );
|
||||
}
|
||||
catch( const char *msg )
|
||||
catch( PlaYUVerFailure& e )
|
||||
{
|
||||
QApplication::restoreOverrideCursor();
|
||||
QString warningMsg = "Cannot save file " + QFileInfo( fileName ).fileName() + " with the following error: \n" + msg;
|
||||
QString warningMsg = "Cannot save file " + QFileInfo( fileName ).fileName() + " with the following error: \n" + e.what();
|
||||
QMessageBox::warning( this, QApplication::applicationName(), warningMsg );
|
||||
printMessage( warningMsg, LOG_ERROR );
|
||||
return;
|
||||
@@ -353,9 +353,9 @@ Void PlaYUVerApp::format()
|
||||
addStreamInfoToRecentList( pcVideoSubWindow->getStreamInfo() );
|
||||
}
|
||||
}
|
||||
catch( const char *msg )
|
||||
catch( PlaYUVerFailure& e )
|
||||
{
|
||||
QString warningMsg = "Cannot change format of " + QFileInfo( pcVideoSubWindow->getCurrentFileName() ).fileName() + " with the following error: \n" + msg;
|
||||
QString warningMsg = "Cannot change format of " + QFileInfo( pcVideoSubWindow->getCurrentFileName() ).fileName() + " with the following error: \n" + e.what();
|
||||
QMessageBox::warning( this, QApplication::applicationName(), warningMsg );
|
||||
printMessage( warningMsg, LOG_ERROR );
|
||||
qDebug( ) << warningMsg;
|
||||
|
||||
@@ -330,7 +330,7 @@ Bool VideoSubWindow::loadFile( QString cFilename, Bool bForceDialog )
|
||||
{
|
||||
m_pCurrStream->open( cFilename.toStdString(), Width, Height, InputFormat, BitsPel, Endianness, FrameRate, true );
|
||||
}
|
||||
catch( const char *msg )
|
||||
catch( ... )
|
||||
{
|
||||
if( formatDialog.runConfigureFormatDialog( QFileInfo( cFilename ).fileName(), Width, Height, InputFormat, BitsPel, Endianness, FrameRate )
|
||||
== QDialog::Rejected )
|
||||
|
||||
@@ -237,7 +237,7 @@ Bool PlaYUVerStream::open( String filename, UInt width, UInt height, Int input_f
|
||||
m_ppcFrameBuffer[i] = new PlaYUVerFrame( m_pcHandler->m_uiWidth, m_pcHandler->m_uiHeight, m_pcHandler->m_iPixelFormat, m_pcHandler->m_uiBitsPerPixel,
|
||||
m_pcHandler->m_iEndianness );
|
||||
}
|
||||
catch( const char *msg )
|
||||
catch( PlaYUVerFailure& e )
|
||||
{
|
||||
close();
|
||||
throw PlaYUVerFailure( "PlaYUVerStream", "Cannot allocated frame buffer" );
|
||||
@@ -308,6 +308,7 @@ Void PlaYUVerStream::close()
|
||||
return;
|
||||
|
||||
m_pcHandler->closeHandler();
|
||||
m_pcHandler->Delete();
|
||||
|
||||
if( m_ppcFrameBuffer )
|
||||
{
|
||||
|
||||
@@ -57,6 +57,8 @@ class PlaYUVerStreamHandlerIf
|
||||
{
|
||||
}
|
||||
|
||||
virtual void Delete() = 0;
|
||||
|
||||
virtual Bool openHandler( String strFilename, Bool bInput ) = 0;
|
||||
virtual Void closeHandler() = 0;
|
||||
virtual Bool configureBuffer( PlaYUVerFrame* pcFrame ) = 0;
|
||||
|
||||
Reference in new issue
Block a user