@@ -153,6 +153,23 @@ StreamTranscoder::StreamTranscoder(
153
153
if ( ! profile.count ( Profile::avProfileType ) )
154
154
throw std::runtime_error ( " unable to found stream type (audio, video, etc.)" );
155
155
156
+ if ( profile.find ( Profile::avProfileType )->second == Profile::avProfileTypeVideo )
157
+ {
158
+ OutputVideo* outputVideo = new OutputVideo ();
159
+
160
+ _outputEssence = outputVideo;
161
+ VideoFrameDesc inputVideoFrameDesc = static_cast <DummyVideo*>( _inputEssence )->getVideoDesc ().getVideoFrameDesc ();
162
+ outputVideo->setProfile ( profile, inputVideoFrameDesc );
163
+
164
+ _outputStream = &outputFile.addVideoStream ( outputVideo->getVideoDesc () );
165
+ _sourceBuffer = new VideoFrame ( outputVideo->getVideoDesc ().getVideoFrameDesc () );
166
+ _frameBuffer = new VideoFrame ( outputVideo->getVideoDesc ().getVideoFrameDesc () );
167
+
168
+ _transform = new VideoEssenceTransform ();
169
+
170
+ return ;
171
+ }
172
+
156
173
if ( profile.find ( Profile::avProfileType )->second == Profile::avProfileTypeAudio )
157
174
{
158
175
OutputAudio* outputAudio = new OutputAudio ();
@@ -172,23 +189,6 @@ StreamTranscoder::StreamTranscoder(
172
189
return ;
173
190
}
174
191
175
- if ( profile.find ( Profile::avProfileType )->second == Profile::avProfileTypeVideo )
176
- {
177
- OutputVideo* outputVideo = new OutputVideo ();
178
-
179
- _outputEssence = outputVideo;
180
- VideoFrameDesc inputVideoFrameDesc = static_cast <DummyVideo*>( _inputEssence )->getVideoDesc ().getVideoFrameDesc ();
181
- outputVideo->setProfile ( profile, inputVideoFrameDesc );
182
-
183
- _outputStream = &outputFile.addVideoStream ( outputVideo->getVideoDesc () );
184
- _sourceBuffer = new VideoFrame ( outputVideo->getVideoDesc ().getVideoFrameDesc () );
185
- _frameBuffer = new VideoFrame ( outputVideo->getVideoDesc ().getVideoFrameDesc () );
186
-
187
- _transform = new VideoEssenceTransform ();
188
-
189
- return ;
190
- }
191
-
192
192
throw std::runtime_error ( " unupported stream type" );
193
193
}
194
194
0 commit comments