Skip to content

Commit 6946e6c

Browse files
author
Clement Champetier
committed
Transcoder: add getter to a specific stream
* An external library could need to update a specific stream during process. * Also add a getter to the current Essence in StreamTranscoder, for the same reason above.
1 parent 2f2e0ff commit 6946e6c

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

src/AvTranscoder/transcoder/StreamTranscoder.hpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,23 @@ class AvExport StreamTranscoder
5757
void switchToGeneratorEssence();
5858
void switchToInputEssence();
5959

60-
void setVerbose( bool verbose = true ){ _verbose = verbose; }
61-
62-
void setInfinityStream( bool isInfinity ) { _infinityStream = isInfinity; }
63-
64-
void setOffset( bool offset = true ){ _offset = offset; }
65-
6660
/**
6761
* @brief Get the duration of the stream.
6862
* @note if it's a generated stream, return limit of double.
6963
*/
7064
double getDuration() const;
7165

66+
/**
67+
* @return a reference to the current essence processed in this stream.
68+
*/
69+
IInputEssence& getCurrentEssence() const { return *_currentEssence; }
70+
71+
void setVerbose( bool verbose = true ){ _verbose = verbose; }
72+
73+
void setInfinityStream( bool isInfinity ) { _infinityStream = isInfinity; }
74+
75+
void setOffset( bool offset = true ){ _offset = offset; }
76+
7277
private:
7378
bool processRewrap();
7479
bool processRewrap( const int subStreamIndex );

src/AvTranscoder/transcoder/Transcoder.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ class AvExport Transcoder
113113
*/
114114
void process( IProgress& progress );
115115

116+
/**
117+
* @param streamIndex: careful about the order of stream insertion of the Transcoder.
118+
* @return a reference to a stream manage by the Transcoder.
119+
*/
120+
StreamTranscoder& getStream( size_t streamIndex ) const { return *_streamTranscoders.at( streamIndex ); }
121+
116122
/**
117123
* @brief Set the transcodage politic.
118124
* @note Call it after adding the streams.

0 commit comments

Comments
 (0)