Skip to content

Commit 51cf36e

Browse files
author
Clement Champetier
committed
Transcoder: call init in process method
* No need to expect the user to call init() before process(). * Note: the init() method can be called several times with no side effects. * Update pyTest.
1 parent 362bf2b commit 51cf36e

File tree

5 files changed

+6
-11
lines changed

5 files changed

+6
-11
lines changed

src/AvTranscoder/transcoder/StreamTranscoder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ StreamTranscoder::~StreamTranscoder()
259259

260260
void StreamTranscoder::init()
261261
{
262-
// rewrap
262+
// rewrap case: no need to take care of the latency of codec
263263
if( ! _inputEssence )
264264
return;
265265

src/AvTranscoder/transcoder/Transcoder.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,10 @@ void Transcoder::process( IProgress& progress )
282282
{
283283
throw std::runtime_error( "missing input streams in transcoder" );
284284
}
285-
285+
286286
if( _verbose )
287287
std::cout << "begin transcoding" << std::endl;
288+
init();
288289

289290
_outputFile.beginWrap();
290291

src/AvTranscoder/transcoder/Transcoder.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ class AvExport Transcoder
112112

113113
/**
114114
* @brief Process all the streams, and ended the process depending on the transcode politic.
115-
* @param progress
115+
* @note The function manages all process: init(), beginWrap(), processFrame()s, and endWrap().
116+
* @param progress: choose a progress, or create your own in C++ or in bindings by inherit IProgress class.
117+
* @see IProgress
116118
*/
117119
void process( IProgress& progress );
118120

test/pyTest/testTranscoderAdd.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,5 @@ def testAddStreamTranscoder():
2525

2626
# process
2727
progress = av.NoDisplayProgress()
28-
transcoder.init()
2928
transcoder.process( progress )
3029

test/pyTest/testTranscoderTranscode.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ def testTranscodeWave24b48kmono():
1717

1818
transcoder.add( inputFileName, 0, "wave24b48kmono" )
1919

20-
transcoder.init()
2120
progress = av.ConsoleProgress()
2221
transcoder.process( progress )
2322

@@ -47,7 +46,6 @@ def testTranscodeWave16b48kmono():
4746

4847
transcoder.add( inputFileName, 0, "wave16b48kmono" )
4948

50-
transcoder.init()
5149
progress = av.ConsoleProgress()
5250
transcoder.process( progress )
5351

@@ -77,7 +75,6 @@ def testTranscodeWave16b48kmono():
7775

7876
# transcoder.add( inputFileName, 0, "dnxhd120" )
7977

80-
# transcoder.init()
8178
# progress = av.ConsoleProgress()
8279
# transcoder.process( progress )
8380

@@ -106,7 +103,6 @@ def testTranscodeWave16b48kmono():
106103

107104
# transcoder.add( inputFileName, 0, "dnxhd185" )
108105

109-
# transcoder.init()
110106
# progress = av.ConsoleProgress()
111107
# transcoder.process( progress )
112108

@@ -135,7 +131,6 @@ def testTranscodeWave16b48kmono():
135131

136132
# transcoder.add( inputFileName, 0, "dnxhd185x" )
137133

138-
# transcoder.init()
139134
# progress = av.ConsoleProgress()
140135
# transcoder.process( progress )
141136

@@ -164,7 +159,6 @@ def testTranscodeWave16b48kmono():
164159

165160
# transcoder.add( inputFileName, 0, "xdcamhd422" )
166161

167-
# transcoder.init()
168162
# progress = av.ConsoleProgress()
169163
# transcoder.process( progress )
170164

@@ -213,7 +207,6 @@ def testTranscodeWave16b48kmono():
213207

214208
# transcoder.add( inputFileName, 0, customProfile )
215209

216-
# transcoder.init()
217210
# progress = av.ConsoleProgress()
218211
# transcoder.process( progress )
219212

0 commit comments

Comments
 (0)