Add new open stream function

This commit is contained in:
jfmcarreira committed 2015-02-21 20:23:59 +00:00
1 parent 974fa27814
commit 6feedc95b0
2 files changed
+27

No files matched your search

+26
View File
@@ -155,6 +155,32 @@ PlaYUVerStream::~PlaYUVerStream()
close();
}
Bool PlaYUVerStream::open( std::string filename, std::string resolution, std::string input_format_name, UInt frame_rate, Bool bInput )
{
UInt width;
UInt height;
Int input_format = -1;
sscanf( resolution.c_str(), "%ux%u", &width, &height );
if( width <= 0 || height <= 0 )
{
return false;
}
for( UInt i = 0; i < PlaYUVerFrame::supportedPixelFormatListNames().size(); i++ )
{
if( PlaYUVerFrame::supportedPixelFormatListNames()[i] == input_format_name )
{
input_format = i;
break;
}
}
if( width > 0 && height > 0 && input_format >= 0 )
{
return open( filename, width, height, input_format, frame_rate, bInput );
}
return false;
}
Bool PlaYUVerStream::open( std::string filename, UInt width, UInt height, Int input_format, UInt frame_rate, Bool bInput )
{
if( m_bInit )
+1
View File
@@ -115,6 +115,7 @@ public:
END_OF_SEQ,
};
Bool open( std::string filename, std::string resolution, std::string input_format, UInt frame_rate, Bool bInput = true );
Bool open( std::string filename, UInt width, UInt height, Int input_format, UInt frame_rate, Bool bInput = true );
Void close();