Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/AvTranscoder/DatasStructures/VideoDesc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace avtranscoder
class AvExport VideoDesc
{
public:
VideoDesc( const std::string& codecName = "" );
VideoDesc( const std::string& codecName );
VideoDesc( const AVCodecID codecId );

void setVideoCodec( const std::string& codecName );
Expand Down
2 changes: 2 additions & 0 deletions src/AvTranscoder/InputStream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class AvExport InputStream
double getDuration() const;
double getPacketDuration() const;

AVCodecID getVideoCodecId() const { return m_formatContext->streams[m_streamIndex]->codec->codec_id; }

// protected:
bool readNextPacket( AVPacket& packet ) const;

Expand Down
4 changes: 2 additions & 2 deletions src/AvTranscoder/InputStreamVideo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ InputStreamVideo::InputStreamVideo( const InputStream& inputStream )
, m_selectedStream( -1 )
{
av_register_all();

m_codec = avcodec_find_decoder( m_inputStream.getVideoDesc().getVideoCodecId() );
m_codec = avcodec_find_decoder( inputStream.getVideoCodecId() );

if( m_codec == NULL )
{
throw std::runtime_error( "codec not supported" );
Expand Down