Skip to content

Commit 89b87b8

Browse files
author
Clement Champetier
committed
Transcoder: can add a dummy with a profile name and a subStreamIndex indicated
Complete the API, with keeping symmetry. Now there are: * 4 add functions with only a streamIndex indicated * 4 add functions with a streamIndex and a subStreamIndex indicated
1 parent 3490499 commit 89b87b8

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

src/AvTranscoder/Transcoder/Transcoder.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,33 @@ void Transcoder::add( const std::string& filename, const size_t streamIndex, con
120120
add( filename, streamIndex, subStreamIndex, transcodeProfile );
121121
}
122122

123+
void Transcoder::add( const std::string& filename, const size_t streamIndex, const int subStreamIndex, const std::string& profileName, CodedDesc& essenceDesc )
124+
{
125+
if( subStreamIndex < 0 )
126+
{
127+
add( filename, streamIndex, profileName, essenceDesc );
128+
return;
129+
}
130+
131+
if( profileName.length() == 0 ) // no profile, only re-wrap stream
132+
{
133+
if( _verbose )
134+
std::cout << "add re-wrap stream for substream " << subStreamIndex << std::endl;
135+
136+
if( filename.length() == 0 )
137+
{
138+
std::cerr << "can't add a dummy stream with no profileName indicated" << std::endl;
139+
return;
140+
}
141+
142+
addRewrapStream( filename, streamIndex );
143+
return;
144+
}
145+
146+
Profile::ProfileDesc& transcodeProfile = _profile.getProfile( profileName );
147+
add( filename, streamIndex, subStreamIndex, transcodeProfile, essenceDesc );
148+
}
149+
123150
void Transcoder::add( const std::string& filename, const size_t streamIndex, const int subStreamIndex, Profile::ProfileDesc& profileDesc )
124151
{
125152
_profile.update( profileDesc );

src/AvTranscoder/Transcoder/Transcoder.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ class Transcoder
6565
* @note If subStreamIndex is negative, no substream is selected it's the stream.
6666
*/
6767
void add( const std::string& filename, const size_t streamIndex, const int subStreamIndex, const std::string& profileName = "" );
68+
/**
69+
* @note If filename is empty, add a dummy stream.
70+
* @note If filename is empty, profileName can't be empty (no sens to rewrap a dummy stream).
71+
*/
72+
void add( const std::string& filename, const size_t streamIndex, const int subStreamIndex, const std::string& profileName, CodedDesc& essenceDesc );
6873

6974
/**
7075
* @brief Add a stream and set a custom profile

0 commit comments

Comments
 (0)