Skip to content

Commit 2104457

Browse files
Adding statis method to get propertie of any file easily
1 parent cfdc32d commit 2104457

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/AvTranscoder/InputFile.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,15 @@ InputFile& InputFile::analyse()
136136
return *this;
137137
}
138138

139+
Properties InputFile::analyseFile( const std::string& filename )
140+
{
141+
InputFile file( filename );
142+
file.analyse();
143+
Properties properties;
144+
file.getProperties( properties );
145+
return properties;
146+
}
147+
139148
AVMediaType InputFile::getStreamType( size_t index )
140149
{
141150
if( index >= m_formatContext->nb_streams )

src/AvTranscoder/InputFile.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ class AvExport InputFile
3434
/// get file properties
3535
const Properties& getProperties() const { return m_properties; }
3636

37+
void getProperties( Properties& properties ) const { properties = m_properties; }
38+
39+
static Properties analyseFile( const std::string& filename );
40+
3741
AVMediaType getStreamType( size_t index );
3842

3943
AvInputStream& getStream( size_t index );

0 commit comments

Comments
 (0)