Skip to content

Commit 6a1d191

Browse files
author
Clement Champetier
committed
Transcoder/StreamTranscoder: add documentation
1 parent 7c3539f commit 6a1d191

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

src/AvTranscoder/transcoder/StreamTranscoder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,10 @@ bool StreamTranscoder::processTranscode( const int subStreamIndex )
329329
assert( _frameBuffer != NULL );
330330
assert( _transform != NULL );
331331

332-
CodedData data;
333332
if( _verbose )
334333
std::cout << "transcode a frame " << std::endl;
335334

335+
// check offset
336336
if( _offset &&
337337
_frameProcessed > _offset &&
338338
! _offsetPassed &&
@@ -348,6 +348,7 @@ bool StreamTranscoder::processTranscode( const int subStreamIndex )
348348
else
349349
decodingStatus = _currentDecoder->decodeNextFrame( *_sourceBuffer, subStreamIndex );
350350

351+
CodedData data;
351352
if( decodingStatus )
352353
{
353354
if( _verbose )
@@ -375,7 +376,6 @@ bool StreamTranscoder::processTranscode( const int subStreamIndex )
375376
std::cout << "wrap (" << data.getSize() << " bytes)" << std::endl;
376377

377378
IOutputStream::EWrappingStatus wrappingStatus = _outputStream->wrap( data );
378-
379379
switch( wrappingStatus )
380380
{
381381
case IOutputStream::eWrappingSuccess:

src/AvTranscoder/transcoder/StreamTranscoder.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,18 @@ class AvExport StreamTranscoder
7979
bool processTranscode( const int subStreamIndex = -1 ); ///< By default transcode all channels
8080

8181
private:
82-
IInputStream* _inputStream;
83-
IOutputStream* _outputStream;
82+
IInputStream* _inputStream; ///< Input stream to read next packet (has link, no ownership)
83+
IOutputStream* _outputStream; ///< Output stream to wrap next packet (has link, no ownership)
8484

85-
Frame* _sourceBuffer;
86-
Frame* _frameBuffer;
85+
Frame* _sourceBuffer; ///< Has ownership
86+
Frame* _frameBuffer; ///< Has ownership
8787

88-
IDecoder* _inputDecoder;
89-
IDecoder* _generator;
90-
IDecoder* _currentDecoder;
91-
IEncoder* _outputEncoder;
88+
IDecoder* _inputDecoder; ///< Decoder of packets read from _inputStream (has ownership)
89+
IDecoder* _generator; ///< Generator of audio or video packets (has ownership)
90+
IDecoder* _currentDecoder; ///< Link to _inputDecoder or _generator
91+
IEncoder* _outputEncoder; ///< Encoder of packets which will be wrapped by _outputStream (has ownership)
9292

93-
ITransform* _transform;
93+
ITransform* _transform; ///< Video or audio transform (has ownership)
9494

9595
int _subStreamIndex; ///< Index of channel that is processed from the input stream (-1 if no demultiplexing).
9696

src/AvTranscoder/transcoder/Transcoder.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,16 +172,15 @@ class AvExport Transcoder
172172
void manageInfinityStreamFromProcessMethod();
173173

174174
private:
175-
IOutputFile& _outputFile; ///< The output media file after process.
176-
std::vector< InputFile* > _inputFiles; ///< The list of input files which contain added streams.
175+
IOutputFile& _outputFile; ///< The output media file after process (has link)
176+
std::vector< InputFile* > _inputFiles; ///< The list of input files which contain added streams (has ownership)
177177

178178
std::vector< StreamTranscoder* > _streamTranscoders; ///< All streams of the output media file after process.
179-
std::vector< StreamTranscoder* > _streamTranscodersAllocated; ///< Streams allocated inside the Transcoder.
179+
std::vector< StreamTranscoder* > _streamTranscodersAllocated; ///< Streams allocated inside the Transcoder (has ownership)
180180

181181
ProfileLoader _profileLoader; ///< Objet to get existing profiles, and add new ones for the Transcoder.
182182

183-
EProcessMethod _eProcessMethod;
184-
183+
EProcessMethod _eProcessMethod; ///< Transcoding policy
185184
size_t _mainStreamIndex; ///< Index of stream used to stop the process of transcode in case of eProcessMethodBasedOnStream.
186185

187186
bool _verbose;

0 commit comments

Comments
 (0)