@@ -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,10 @@ 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
+ _filterGraph->addFilter (" scale" , " 78:54" );
151
+
140
152
// input decoder
141
153
VideoDecoder* inputVideo = new VideoDecoder (*static_cast <InputStream*>(_inputStream));
142
154
inputVideo->setupDecoder ();
@@ -170,6 +182,9 @@ StreamTranscoder::StreamTranscoder(IInputStream& inputStream, IOutputFile& outpu
170
182
}
171
183
case AVMEDIA_TYPE_AUDIO:
172
184
{
185
+ // filter
186
+ _filterGraph = new FilterGraph (_inputStream->getAudioCodec ());
187
+
173
188
// input decoder
174
189
AudioDecoder* inputAudio = new AudioDecoder (*static_cast <InputStream*>(_inputStream));
175
190
inputAudio->setupDecoder ();
@@ -228,6 +243,7 @@ StreamTranscoder::StreamTranscoder(const ICodec& inputCodec, IOutputFile& output
228
243
, _currentDecoder(NULL )
229
244
, _outputEncoder(NULL )
230
245
, _transform(NULL )
246
+ , _filterGraph(NULL )
231
247
, _subStreamIndex(-1 )
232
248
, _offset(0 )
233
249
, _needToSwitchToGenerator(false )
@@ -241,6 +257,9 @@ StreamTranscoder::StreamTranscoder(const ICodec& inputCodec, IOutputFile& output
241
257
_generator = generatorVideo;
242
258
_currentDecoder = _generator;
243
259
260
+ // filter
261
+ _filterGraph = new FilterGraph (inputVideoCodec);
262
+
244
263
// buffers to process
245
264
VideoFrameDesc inputFrameDesc = inputVideoCodec.getVideoFrameDesc ();
246
265
VideoFrameDesc outputFrameDesc = inputFrameDesc;
@@ -267,6 +286,9 @@ StreamTranscoder::StreamTranscoder(const ICodec& inputCodec, IOutputFile& output
267
286
_generator = generatorAudio;
268
287
_currentDecoder = _generator;
269
288
289
+ // filter
290
+ _filterGraph = new FilterGraph (inputAudioCodec);
291
+
270
292
// buffers to process
271
293
AudioFrameDesc inputFrameDesc = inputAudioCodec.getAudioFrameDesc ();
272
294
AudioFrameDesc outputFrameDesc = inputFrameDesc;
@@ -298,6 +320,7 @@ StreamTranscoder::~StreamTranscoder()
298
320
delete _generator;
299
321
delete _outputEncoder;
300
322
delete _transform;
323
+ delete _filterGraph;
301
324
delete _inputDecoder;
302
325
}
303
326
0 commit comments