Skip to content

Commit 3490499

Browse files
author
Clement Champetier
committed
Transcoder: can add a dummy with a profile name
* Need this new function to add a dummy stream with a preset name (no profile desc is needed).
1 parent 323f28b commit 3490499

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

src/AvTranscoder/Transcoder/Transcoder.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,27 @@ void Transcoder::add( const std::string& filename, const size_t streamIndex, con
4747
add( filename, streamIndex, transcodeProfile );
4848
}
4949

50+
void Transcoder::add( const std::string& filename, const size_t streamIndex, const std::string& profileName, CodedDesc& essenceDesc )
51+
{
52+
if( profileName.length() == 0 ) // no profile, only re-wrap stream
53+
{
54+
if( _verbose )
55+
std::cout << "add re-wrap stream" << std::endl;
56+
57+
if( filename.length() == 0 )
58+
{
59+
std::cerr << "can't add a dummy stream with no profileName indicated" << std::endl;
60+
return;
61+
}
62+
63+
addRewrapStream( filename, streamIndex );
64+
return;
65+
}
66+
67+
Profile::ProfileDesc& transcodeProfile = _profile.getProfile( profileName );
68+
add( filename, streamIndex, transcodeProfile, essenceDesc );
69+
}
70+
5071
void Transcoder::add( const std::string& filename, const size_t streamIndex, Profile::ProfileDesc& profileDesc )
5172
{
5273
_profile.update( profileDesc );

src/AvTranscoder/Transcoder/Transcoder.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ class Transcoder
4343
* @note If profileName is empty, rewrap.
4444
*/
4545
void add( const std::string& filename, const size_t streamIndex, const std::string& profileName = "" );
46+
/*
47+
* @note If filename is empty, add a dummy stream.
48+
* @note If filename is empty, profileName can't be empty (no sens to rewrap a dummy stream).
49+
*/
50+
void add( const std::string& filename, const size_t streamIndex, const std::string& profileName, CodedDesc& essenceDesc );
4651

4752
/**
4853
* @brief Add a stream and set a custom profile

0 commit comments

Comments
 (0)