@@ -30,6 +30,7 @@ StreamTranscoder::StreamTranscoder(IInputStream& inputStream, IOutputFile& outpu
30
30
, _currentDecoder(NULL )
31
31
, _outputEncoder(NULL )
32
32
, _transform(NULL )
33
+ , _filterGraph(NULL )
33
34
, _subStreamIndex(-1 )
34
35
, _offset(offset)
35
36
, _needToSwitchToGenerator(false )
@@ -44,6 +45,9 @@ StreamTranscoder::StreamTranscoder(IInputStream& inputStream, IOutputFile& outpu
44
45
45
46
try
46
47
{
48
+ // filter
49
+ _filterGraph = new FilterGraph (_inputStream->getVideoCodec ());
50
+
47
51
VideoFrameDesc inputFrameDesc (_inputStream->getVideoCodec ().getVideoFrameDesc ());
48
52
49
53
// generator decoder
@@ -78,6 +82,9 @@ StreamTranscoder::StreamTranscoder(IInputStream& inputStream, IOutputFile& outpu
78
82
79
83
try
80
84
{
85
+ // filter
86
+ _filterGraph = new FilterGraph (_inputStream->getAudioCodec ());
87
+
81
88
AudioFrameDesc inputFrameDesc (_inputStream->getAudioCodec ().getAudioFrameDesc ());
82
89
83
90
// generator decoder
@@ -128,6 +135,7 @@ StreamTranscoder::StreamTranscoder(IInputStream& inputStream, IOutputFile& outpu
128
135
, _currentDecoder(NULL )
129
136
, _outputEncoder(NULL )
130
137
, _transform(NULL )
138
+ , _filterGraph(NULL )
131
139
, _subStreamIndex(subStreamIndex)
132
140
, _offset(offset)
133
141
, _needToSwitchToGenerator(false )
@@ -137,6 +145,9 @@ StreamTranscoder::StreamTranscoder(IInputStream& inputStream, IOutputFile& outpu
137
145
{
138
146
case AVMEDIA_TYPE_VIDEO:
139
147
{
148
+ // filter
149
+ _filterGraph = new FilterGraph (_inputStream->getVideoCodec ());
150
+
140
151
// input decoder
141
152
VideoDecoder* inputVideo = new VideoDecoder (*static_cast <InputStream*>(_inputStream));
142
153
inputVideo->setupDecoder ();
@@ -170,6 +181,9 @@ StreamTranscoder::StreamTranscoder(IInputStream& inputStream, IOutputFile& outpu
170
181
}
171
182
case AVMEDIA_TYPE_AUDIO:
172
183
{
184
+ // filter
185
+ _filterGraph = new FilterGraph (_inputStream->getAudioCodec ());
186
+
173
187
// input decoder
174
188
AudioDecoder* inputAudio = new AudioDecoder (*static_cast <InputStream*>(_inputStream));
175
189
inputAudio->setupDecoder ();
@@ -228,6 +242,7 @@ StreamTranscoder::StreamTranscoder(const ICodec& inputCodec, IOutputFile& output
228
242
, _currentDecoder(NULL )
229
243
, _outputEncoder(NULL )
230
244
, _transform(NULL )
245
+ , _filterGraph(NULL )
231
246
, _subStreamIndex(-1 )
232
247
, _offset(0 )
233
248
, _needToSwitchToGenerator(false )
@@ -241,6 +256,9 @@ StreamTranscoder::StreamTranscoder(const ICodec& inputCodec, IOutputFile& output
241
256
_generator = generatorVideo;
242
257
_currentDecoder = _generator;
243
258
259
+ // filter
260
+ _filterGraph = new FilterGraph (inputVideoCodec);
261
+
244
262
// buffers to process
245
263
VideoFrameDesc inputFrameDesc = inputVideoCodec.getVideoFrameDesc ();
246
264
VideoFrameDesc outputFrameDesc = inputFrameDesc;
@@ -267,6 +285,9 @@ StreamTranscoder::StreamTranscoder(const ICodec& inputCodec, IOutputFile& output
267
285
_generator = generatorAudio;
268
286
_currentDecoder = _generator;
269
287
288
+ // filter
289
+ _filterGraph = new FilterGraph (inputAudioCodec);
290
+
270
291
// buffers to process
271
292
AudioFrameDesc inputFrameDesc = inputAudioCodec.getAudioFrameDesc ();
272
293
AudioFrameDesc outputFrameDesc = inputFrameDesc;
@@ -298,6 +319,7 @@ StreamTranscoder::~StreamTranscoder()
298
319
delete _generator;
299
320
delete _outputEncoder;
300
321
delete _transform;
322
+ delete _filterGraph;
301
323
delete _inputDecoder;
302
324
}
303
325
0 commit comments