Skip to content

Commit d25be6f

Browse files
author
Clement Champetier
committed
StreamTranscoder: setProfile of encoders to set some key options to specific values
1 parent 07582b2 commit d25be6f

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/AvTranscoder/transcoder/StreamTranscoder.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,11 @@ StreamTranscoder::StreamTranscoder(
133133
case AVMEDIA_TYPE_VIDEO :
134134
{
135135
// input decoder
136-
_inputDecoder = new VideoDecoder( *static_cast<InputStream*>( _inputStream ) );
137-
_inputDecoder->setup();
136+
VideoDecoder* inputVideo = new VideoDecoder( *static_cast<InputStream*>( _inputStream ) );
137+
// set decoder options with empty profile to set some key options to specific values (example: threads to auto)
138+
inputVideo->setProfile( ProfileLoader::Profile() );
139+
inputVideo->setup();
140+
_inputDecoder = inputVideo;
138141
_currentDecoder = _inputDecoder;
139142

140143
// output encoder
@@ -165,8 +168,11 @@ StreamTranscoder::StreamTranscoder(
165168
case AVMEDIA_TYPE_AUDIO :
166169
{
167170
// input decoder
168-
_inputDecoder = new AudioDecoder( *static_cast<InputStream*>( _inputStream ) );
169-
_inputDecoder->setup();
171+
AudioDecoder* inputAudio = new AudioDecoder( *static_cast<InputStream*>( _inputStream ) );
172+
// set decoder options with empty profile to set some key options to specific values (example: threads to auto)
173+
inputAudio->setProfile( ProfileLoader::Profile() );
174+
inputAudio->setup();
175+
_inputDecoder = inputAudio;
170176
_currentDecoder = _inputDecoder;
171177

172178
// output encoder

0 commit comments

Comments
 (0)