Skip to content

Commit 8030af4

Browse files
adding method to get Stream type
1 parent 13d9df9 commit 8030af4

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/AvTranscoder/InputFile.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,13 @@ InputFile& InputFile::analyse()
123123
return *this;
124124
}
125125

126+
AVMediaType InputFile::getStreamType( size_t index )
127+
{
128+
if( index >= m_formatContext->nb_streams )
129+
return AVMEDIA_TYPE_UNKNOWN;
130+
return m_formatContext->streams[index]->codec->codec_type;
131+
}
132+
126133
InputStream& InputFile::getStream( size_t index )
127134
{
128135
return m_inputStreams.at( index );

src/AvTranscoder/InputFile.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ class AvExport InputFile
3232
/// get file properties
3333
const Properties& getProperties() const { return m_properties; }
3434

35+
AVMediaType getStreamType( size_t index );
36+
3537
::avtranscoder::InputStream& getStream( size_t index );
3638

3739
protected:

0 commit comments

Comments
 (0)