Change InputStream class name and minor fix in open function

This commit is contained in:
jfmcarreira committed 2014-06-17 17:28:59 +01:00
1 parent cf9edc1b59
commit aaaeb9da14
10 files changed
+52 -52

No files matched your search

+1 -1
View File
@@ -123,7 +123,7 @@ QSize StreamPropertiesSideBar::sizeHint() const
return bestSize( size() );
}
Void StreamPropertiesSideBar::setData( InputStream* pcStream )
Void StreamPropertiesSideBar::setData( PlaYUVerStream* pcStream )
{
// Clear information.
labelFormatValue->clear();
+2 -2
View File
@@ -49,10 +49,10 @@ public:
QSize sizeHint() const;
Void setData( InputStream* m_pcStream );
Void setData( PlaYUVerStream* m_pcStream );
private:
InputStream* m_pcStream;
PlaYUVerStream* m_pcStream;
Bool m_bIsVisible;
QLabel* labelFormatValue;
+10 -10
View File
@@ -55,7 +55,7 @@ SubWindowHandle::SubWindowHandle( QWidget * parent, Bool isModule ) :
m_cScrollArea->setWidgetResizable( true );
m_pCurrStream = NULL;
//m_pCurrStream = new InputStream;
//m_pCurrStream = new PlaYUVerStream;
m_pcCurrFrame = NULL;
m_pcCurrentModule = NULL;
@@ -80,19 +80,19 @@ Void SubWindowHandle::reloadFile()
seekAbsoluteEvent( currFrameNum );
}
Bool SubWindowHandle::loadFile( const QString &rcFilename, Bool bForceDialog )
Bool SubWindowHandle::loadFile( QString cFilename, Bool bForceDialog )
{
UInt Width = 0, Height = 0, FrameRate = 30;
Int InputFormat = -1;
if( !m_pCurrStream )
{
m_pCurrStream = new InputStream;
m_pCurrStream = new PlaYUVerStream;
}
m_pCurrStream->getFormat( Width, Height, InputFormat, FrameRate );
if( m_pCurrStream->guessFormat( rcFilename, Width, Height, InputFormat, FrameRate ) || bForceDialog )
if( m_pCurrStream->guessFormat( cFilename, Width, Height, InputFormat, FrameRate ) || bForceDialog )
{
ConfigureFormatDialog formatDialog( this );
if( formatDialog.runConfigureFormatDialog( Width, Height, InputFormat, FrameRate ) == QDialog::Rejected )
@@ -102,7 +102,7 @@ Bool SubWindowHandle::loadFile( const QString &rcFilename, Bool bForceDialog )
}
QApplication::setOverrideCursor( Qt::WaitCursor );
QApplication::restoreOverrideCursor();
if( !m_pCurrStream->open( rcFilename, Width, Height, InputFormat, FrameRate ) )
if( !m_pCurrStream->open( cFilename, Width, Height, InputFormat, FrameRate ) )
{
return false;
}
@@ -113,7 +113,7 @@ Bool SubWindowHandle::loadFile( const QString &rcFilename, Bool bForceDialog )
refreshFrame();
m_cCurrFileName = rcFilename;
m_cCurrFileName = cFilename;
m_cWindowName = m_pCurrStream->getStreamInformationString();
setWindowTitle( m_cWindowName );
return true;
@@ -194,13 +194,13 @@ Void SubWindowHandle::refreshFrame()
Bool SubWindowHandle::save()
{
QString supported = tr( "Supported Files" );
QString formats = InputStream::supportedWriteFormats();
QString formats = PlaYUVerStream::supportedWriteFormats();
formats.prepend( " (" );
formats.append( ")" );
supported.append( formats ); // supported=="Supported Files (*.pbm *.jpg...)"
QStringList filter;
filter << supported
<< InputStream::supportedWriteFormatsList()
<< PlaYUVerStream::supportedWriteFormatsList()
<< tr( "All Files (*)" );
QString fileName = QFileDialog::getSaveFileName( this, tr( "Save As" ), m_cCurrFileName, filter.join( ";;" ) );
if( fileName.isEmpty() )
@@ -231,12 +231,12 @@ Int SubWindowHandle::playEvent()
{
m_pCurrStream->setNextFrame();
refreshFrame();
if( m_pCurrStream->checkErrors( InputStream::END_OF_SEQ ) )
if( m_pCurrStream->checkErrors( PlaYUVerStream::END_OF_SEQ ) )
{
return -2;
}
m_pCurrStream->readNextFrame();
if( m_pCurrStream->checkErrors( InputStream::READING ) )
if( m_pCurrStream->checkErrors( PlaYUVerStream::READING ) )
{
QMessageBox::warning( this, tr( "plaYUVer" ), tr( "Cannot read %1." ).arg( m_cCurrFileName ) );
return -3;
+3 -3
View File
@@ -50,7 +50,7 @@ private:
PlaYUVerModuleIf* m_pcCurrentModule;
InputStream* m_pCurrStream;
PlaYUVerStream* m_pCurrStream;
PlaYUVerFrame* m_pcCurrFrame;
QString m_cWindowName;
@@ -66,7 +66,7 @@ public:
~SubWindowHandle();
Bool mayClose();
Bool loadFile( const QString &rcFilename, Bool bForceDialog = false );
Bool loadFile( QString cFilename, Bool bForceDialog = false );
Void reloadFile();
Bool save();
@@ -88,7 +88,7 @@ public:
Void refreshFrame();
Void setCurrFrame( PlaYUVerFrame* pcCurrFrame );
InputStream* getInputStream()
PlaYUVerStream* getInputStream()
{
return m_pCurrStream;
}
+2 -2
View File
@@ -875,12 +875,12 @@ void ViewArea::updateMask( const QRect &rect )
}
void ViewArea::setInputStream( InputStream *stream )
void ViewArea::setInputStream( PlaYUVerStream *stream )
{
m_pStream = stream;
}
InputStream* ViewArea::getInputStream()
PlaYUVerStream* ViewArea::getInputStream()
{
return m_pStream;
}
+4 -4
View File
@@ -38,7 +38,7 @@
namespace plaYUVer
{
class InputStream;
class PlaYUVerStream;
/**
*
@@ -99,8 +99,8 @@ public:
return m_maskColor;
}
void setInputStream( InputStream *stream );
InputStream* getInputStream();
void setInputStream( PlaYUVerStream *stream );
PlaYUVerStream* getInputStream();
Void zoomChangeEvent(Double factor, QPoint center);
Double getZoomFactor();
@@ -167,7 +167,7 @@ private:
bool m_snapToGrid;
bool m_cursorInGrid;
InputStream *m_pStream;
PlaYUVerStream *m_pStream;
};
+2 -2
View File
@@ -189,14 +189,14 @@ Void plaYUVerApp::loadFile( QString fileName )
Void plaYUVerApp::open()
{
QString supported = tr( "Supported Files" );
QString formats = InputStream::supportedReadFormats();
QString formats = PlaYUVerStream::supportedReadFormats();
formats.prepend( " (" );
formats.append( ")" );
supported.append( formats ); // supported=="Supported Files (*.pbm *.jpg...)"
QStringList filter;
filter << supported
<< InputStream::supportedReadFormatsList()
<< PlaYUVerStream::supportedReadFormatsList()
<< tr( "All Files (*)" );
QString fileName = QFileDialog::getOpenFileName( this, tr( "Open File" ), m_cLastOpenPath, filter.join( ";;" ) );
+1 -1
View File
@@ -40,7 +40,7 @@ namespace plaYUVer
{
class SubWindowHandle;
class InputStream;
class PlaYUVerStream;
class plaYUVerApp: public QMainWindow
{
+19 -19
View File
@@ -32,7 +32,7 @@
namespace plaYUVer
{
InputStream::InputStream()
PlaYUVerStream::PlaYUVerStream()
{
m_bInit = false;
m_bLoadAll = false;
@@ -57,12 +57,12 @@ InputStream::InputStream()
m_uiAveragePlayInterval = 0;
}
InputStream::~InputStream()
PlaYUVerStream::~PlaYUVerStream()
{
close();
}
QString InputStream::supportedReadFormats()
QString PlaYUVerStream::supportedReadFormats()
{
QString formats;
formats = "*.yuv " // Raw video
@@ -75,7 +75,7 @@ QString InputStream::supportedReadFormats()
return formats;
}
QString InputStream::supportedWriteFormats()
QString PlaYUVerStream::supportedWriteFormats()
{
QString formats;
formats = "*.bmp " // Windows Bitmap
@@ -86,7 +86,7 @@ QString InputStream::supportedWriteFormats()
return formats;
}
QStringList InputStream::supportedReadFormatsList()
QStringList PlaYUVerStream::supportedReadFormatsList()
{
QStringList formats;
formats << "Raw video (*.yuv)"
@@ -99,7 +99,7 @@ QStringList InputStream::supportedReadFormatsList()
return formats;
}
QStringList InputStream::supportedWriteFormatsList()
QStringList PlaYUVerStream::supportedWriteFormatsList()
{
QStringList formats;
formats << "Windows Bitmap (*.bmp)"
@@ -108,7 +108,7 @@ QStringList InputStream::supportedWriteFormatsList()
return formats;
}
Bool InputStream::open( QString filename, UInt width, UInt height, Int input_format, UInt frame_rate )
Bool PlaYUVerStream::open( QString filename, UInt width, UInt height, Int input_format, UInt frame_rate )
{
Bool avStatus = false;
@@ -199,7 +199,7 @@ Bool InputStream::open( QString filename, UInt width, UInt height, Int input_for
return m_bInit;
}
Void InputStream::close()
Void PlaYUVerStream::close()
{
if( m_pFile )
fclose( m_pFile );
@@ -231,7 +231,7 @@ Void InputStream::close()
m_bInit = false;
}
Void InputStream::getFormat( UInt& rWidth, UInt& rHeight, Int& rInputFormat, UInt& rFrameRate )
Void PlaYUVerStream::getFormat( UInt& rWidth, UInt& rHeight, Int& rInputFormat, UInt& rFrameRate )
{
if( m_bInit )
{
@@ -249,7 +249,7 @@ Void InputStream::getFormat( UInt& rWidth, UInt& rHeight, Int& rInputFormat, UIn
}
}
Bool InputStream::guessFormat( QString filename, UInt& rWidth, UInt& rHeight, Int& rInputFormat, UInt& rFrameRate )
Bool PlaYUVerStream::guessFormat( QString filename, UInt& rWidth, UInt& rHeight, Int& rInputFormat, UInt& rFrameRate )
{
Bool bRet = false;
QString fileExtension = QFileInfo( filename ).suffix();
@@ -292,7 +292,7 @@ Bool InputStream::guessFormat( QString filename, UInt& rWidth, UInt& rHeight, In
return bRet;
}
Void InputStream::loadAll()
Void PlaYUVerStream::loadAll()
{
if( m_bLoadAll )
return;
@@ -331,7 +331,7 @@ Void InputStream::loadAll()
seekInput( 0 );
}
Void InputStream::getDuration( Int* duration_array )
Void PlaYUVerStream::getDuration( Int* duration_array )
{
Int hours, mins, secs;
#ifdef USE_FFMPEG
@@ -353,7 +353,7 @@ Void InputStream::getDuration( Int* duration_array )
*duration_array++ = secs;
}
Void InputStream::readNextFrame()
Void PlaYUVerStream::readNextFrame()
{
UInt64 bytes_read = 0;
//m_cTimer.restart();
@@ -396,13 +396,13 @@ Void InputStream::readNextFrame()
return;
}
Bool InputStream::writeFrame( const QString& filename )
Bool PlaYUVerStream::writeFrame( const QString& filename )
{
//m_pcCurrFrame->getQimage().save( filename );
return true;
}
Void InputStream::setNextFrame()
Void PlaYUVerStream::setNextFrame()
{
if( m_pcNextFrame )
{
@@ -422,7 +422,7 @@ Void InputStream::setNextFrame()
}
}
PlaYUVerFrame* InputStream::getCurrFrame( PlaYUVerFrame *pyuv_image )
PlaYUVerFrame* PlaYUVerStream::getCurrFrame( PlaYUVerFrame *pyuv_image )
{
if( pyuv_image == NULL )
pyuv_image = new PlaYUVerFrame( m_pcCurrFrame );
@@ -431,12 +431,12 @@ PlaYUVerFrame* InputStream::getCurrFrame( PlaYUVerFrame *pyuv_image )
return pyuv_image;
}
PlaYUVerFrame* InputStream::getCurrFrame()
PlaYUVerFrame* PlaYUVerStream::getCurrFrame()
{
return m_pcCurrFrame;
}
Void InputStream::seekInput( UInt64 new_frame_num )
Void PlaYUVerStream::seekInput( UInt64 new_frame_num )
{
if( !m_pFile || new_frame_num < 0 || new_frame_num >= m_uiTotalFrameNum || (Int64)new_frame_num == m_iCurrFrameNum )
return;
@@ -471,7 +471,7 @@ Void InputStream::seekInput( UInt64 new_frame_num )
readNextFrame();
}
Bool InputStream::checkErrors( Int error_type )
Bool PlaYUVerStream::checkErrors( Int error_type )
{
if( m_iErrorStatus == error_type )
{
+8 -8
View File
@@ -22,8 +22,8 @@
* \brief Input stream handling
*/
#ifndef __INPUTSTREAM_H__
#define __INPUTSTREAM_H__
#ifndef __PLAYUVERSTREAM_H__
#define __PLAYUVERSTREAM_H__
#ifdef PLAYUVER
#include "config.h"
@@ -44,7 +44,7 @@
namespace plaYUVer
{
class InputStream
class PlaYUVerStream
{
private:
@@ -83,21 +83,21 @@ private:
Int64 m_iCurrFrameNum;
public:
InputStream();
~InputStream();
PlaYUVerStream();
~PlaYUVerStream();
static QString supportedReadFormats();
static QString supportedWriteFormats();
static QStringList supportedReadFormatsList();
static QStringList supportedWriteFormatsList();
enum InputStreamFormats
enum PlaYUVerStreamFormats
{
INVALID = -1,
YUVFormat = 0, // Use color space.
};
enum InputStreamErrors
enum PlaYUVerStreamErrors
{
NO_STREAM_ERROR = 0,
READING,
@@ -185,4 +185,4 @@ public:
} // NAMESPACE
#endif // __INPUTSTREAM_H__
#endif // __PLAYUVERSTREAM_H__