From 77212f48f972b5e9a7241eed949eb5b8735ee99f Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Wed, 25 May 2016 10:43:28 +0200 Subject: [PATCH 1/3] StreamProperties: added list of private codec options Do not print them with other properties, since: * they are very specific options. * not all of them can be printed. * we can access them with getter methods (getCodecOptions). --- .../properties/StreamProperties.cpp | 23 +++++++++++++++++++ .../properties/StreamProperties.hpp | 14 +++++++++++ 2 files changed, 37 insertions(+) diff --git a/src/AvTranscoder/properties/StreamProperties.cpp b/src/AvTranscoder/properties/StreamProperties.cpp index 1bc28f31..65dd8c9d 100644 --- a/src/AvTranscoder/properties/StreamProperties.cpp +++ b/src/AvTranscoder/properties/StreamProperties.cpp @@ -28,8 +28,21 @@ StreamProperties::StreamProperties(const FormatContext& formatContext, const siz _codecContext = _formatContext->streams[_streamIndex]->codec; } + // find the decoder if(_formatContext && _codecContext) + { _codec = avcodec_find_decoder(_codecContext->codec_id); + + if(_codec) + { + // load specific options of the codec + if(avcodec_open2(_codecContext, _codec, NULL) == 0) + { + loadOptions(_options, _codecContext); + avcodec_close(_codecContext); + } + } + } } StreamProperties::~StreamProperties() @@ -98,6 +111,16 @@ std::string StreamProperties::getCodecLongName() const return std::string(_codec->long_name); } +std::vector