@@ -40,7 +40,7 @@ Transcoder::~Transcoder()
40
40
}
41
41
}
42
42
43
- void Transcoder::add ( const std::string& filename, const size_t streamIndex, const std::string& profileName )
43
+ void Transcoder::add ( const std::string& filename, const size_t streamIndex, const std::string& profileName, const size_t offset )
44
44
{
45
45
if ( profileName.length () == 0 ) // no profile, only re-wrap stream
46
46
{
@@ -51,10 +51,10 @@ void Transcoder::add( const std::string& filename, const size_t streamIndex, con
51
51
}
52
52
53
53
Profile::ProfileDesc& transcodeProfile = _profile.getProfile ( profileName );
54
- add ( filename, streamIndex, transcodeProfile );
54
+ add ( filename, streamIndex, transcodeProfile, offset );
55
55
}
56
56
57
- void Transcoder::add ( const std::string& filename, const size_t streamIndex, const std::string& profileName, CodedDesc& essenceDesc )
57
+ void Transcoder::add ( const std::string& filename, const size_t streamIndex, const std::string& profileName, CodedDesc& essenceDesc, const size_t offset )
58
58
{
59
59
if ( profileName.length () == 0 ) // no profile, only re-wrap stream
60
60
{
@@ -72,10 +72,10 @@ void Transcoder::add( const std::string& filename, const size_t streamIndex, con
72
72
}
73
73
74
74
Profile::ProfileDesc& transcodeProfile = _profile.getProfile ( profileName );
75
- add ( filename, streamIndex, transcodeProfile, essenceDesc );
75
+ add ( filename, streamIndex, transcodeProfile, essenceDesc, offset );
76
76
}
77
77
78
- void Transcoder::add ( const std::string& filename, const size_t streamIndex, Profile::ProfileDesc& profileDesc )
78
+ void Transcoder::add ( const std::string& filename, const size_t streamIndex, Profile::ProfileDesc& profileDesc, const size_t offset )
79
79
{
80
80
_profile.update ( profileDesc );
81
81
if ( ! filename.length () )
@@ -87,10 +87,10 @@ void Transcoder::add( const std::string& filename, const size_t streamIndex, Pro
87
87
88
88
if ( _verbose )
89
89
std::cout << " add transcoding stream" << std::endl;
90
- addTranscodeStream ( filename, streamIndex, profileDesc );
90
+ addTranscodeStream ( filename, streamIndex, profileDesc, offset );
91
91
}
92
92
93
- void Transcoder::add ( const std::string& filename, const size_t streamIndex, Profile::ProfileDesc& profileDesc, CodedDesc& essenceDesc )
93
+ void Transcoder::add ( const std::string& filename, const size_t streamIndex, Profile::ProfileDesc& profileDesc, CodedDesc& essenceDesc, const size_t offset )
94
94
{
95
95
_profile.update ( profileDesc );
96
96
if ( ! filename.length () )
@@ -103,14 +103,14 @@ void Transcoder::add( const std::string& filename, const size_t streamIndex, Pro
103
103
104
104
if ( _verbose )
105
105
std::cout << " add transcoding stream" << std::endl;
106
- addTranscodeStream ( filename, streamIndex, profileDesc );
106
+ addTranscodeStream ( filename, streamIndex, profileDesc, offset );
107
107
}
108
108
109
- void Transcoder::add ( const std::string& filename, const size_t streamIndex, const int subStreamIndex, const std::string& profileName )
109
+ void Transcoder::add ( const std::string& filename, const size_t streamIndex, const int subStreamIndex, const std::string& profileName, const size_t offset )
110
110
{
111
111
if ( subStreamIndex < 0 )
112
112
{
113
- add ( filename, streamIndex, profileName );
113
+ add ( filename, streamIndex, profileName, offset );
114
114
return ;
115
115
}
116
116
@@ -124,10 +124,10 @@ void Transcoder::add( const std::string& filename, const size_t streamIndex, con
124
124
}
125
125
126
126
Profile::ProfileDesc& transcodeProfile = _profile.getProfile ( profileName );
127
- add ( filename, streamIndex, subStreamIndex, transcodeProfile );
127
+ add ( filename, streamIndex, subStreamIndex, transcodeProfile, offset );
128
128
}
129
129
130
- void Transcoder::add ( const std::string& filename, const size_t streamIndex, const int subStreamIndex, const std::string& profileName, CodedDesc& essenceDesc )
130
+ void Transcoder::add ( const std::string& filename, const size_t streamIndex, const int subStreamIndex, const std::string& profileName, CodedDesc& essenceDesc, const size_t offset )
131
131
{
132
132
if ( subStreamIndex < 0 )
133
133
{
@@ -151,16 +151,16 @@ void Transcoder::add( const std::string& filename, const size_t streamIndex, con
151
151
}
152
152
153
153
Profile::ProfileDesc& transcodeProfile = _profile.getProfile ( profileName );
154
- add ( filename, streamIndex, subStreamIndex, transcodeProfile, essenceDesc );
154
+ add ( filename, streamIndex, subStreamIndex, transcodeProfile, essenceDesc, offset );
155
155
}
156
156
157
- void Transcoder::add ( const std::string& filename, const size_t streamIndex, const int subStreamIndex, Profile::ProfileDesc& profileDesc )
157
+ void Transcoder::add ( const std::string& filename, const size_t streamIndex, const int subStreamIndex, Profile::ProfileDesc& profileDesc, const size_t offset )
158
158
{
159
159
_profile.update ( profileDesc );
160
160
161
161
if ( subStreamIndex < 0 )
162
162
{
163
- add ( filename, streamIndex, profileDesc );
163
+ add ( filename, streamIndex, profileDesc, offset );
164
164
return ;
165
165
}
166
166
@@ -173,10 +173,10 @@ void Transcoder::add( const std::string& filename, const size_t streamIndex, con
173
173
174
174
if ( _verbose )
175
175
std::cout << " add transcoding stream for substream " << subStreamIndex << std::endl;
176
- addTranscodeStream ( filename, streamIndex, subStreamIndex, profileDesc );
176
+ addTranscodeStream ( filename, streamIndex, subStreamIndex, profileDesc, offset );
177
177
}
178
178
179
- void Transcoder::add ( const std::string& filename, const size_t streamIndex, const int subStreamIndex, Profile::ProfileDesc& profileDesc, CodedDesc& essenceDesc )
179
+ void Transcoder::add ( const std::string& filename, const size_t streamIndex, const int subStreamIndex, Profile::ProfileDesc& profileDesc, CodedDesc& essenceDesc, const size_t offset )
180
180
{
181
181
_profile.update ( profileDesc );
182
182
@@ -196,7 +196,7 @@ void Transcoder::add( const std::string& filename, const size_t streamIndex, con
196
196
197
197
if ( _verbose )
198
198
std::cout << " add transcoding stream for substream " << subStreamIndex << std::endl;
199
- addTranscodeStream ( filename, streamIndex, subStreamIndex, profileDesc );
199
+ addTranscodeStream ( filename, streamIndex, subStreamIndex, profileDesc, offset );
200
200
}
201
201
202
202
void Transcoder::add ( StreamTranscoder& stream )
@@ -344,7 +344,7 @@ void Transcoder::addRewrapStream( const std::string& filename, const size_t stre
344
344
_inputStreams.push_back ( &referenceFile->getStream ( streamIndex ) );
345
345
}
346
346
347
- void Transcoder::addTranscodeStream ( const std::string& filename, const size_t streamIndex, Profile::ProfileDesc& profile )
347
+ void Transcoder::addTranscodeStream ( const std::string& filename, const size_t streamIndex, Profile::ProfileDesc& profile, const size_t offset )
348
348
{
349
349
InputFile* referenceFile = addInputFile ( filename, streamIndex );
350
350
@@ -353,7 +353,7 @@ void Transcoder::addTranscodeStream( const std::string& filename, const size_t s
353
353
case AVMEDIA_TYPE_VIDEO:
354
354
case AVMEDIA_TYPE_AUDIO:
355
355
{
356
- _streamTranscoders.push_back ( new StreamTranscoder ( referenceFile->getStream ( streamIndex ), _outputFile, profile ) );
356
+ _streamTranscoders.push_back ( new StreamTranscoder ( referenceFile->getStream ( streamIndex ), _outputFile, profile, - 1 , offset ) );
357
357
_inputStreams.push_back ( &referenceFile->getStream ( streamIndex ) );
358
358
break ;
359
359
}
@@ -367,7 +367,7 @@ void Transcoder::addTranscodeStream( const std::string& filename, const size_t s
367
367
}
368
368
}
369
369
370
- void Transcoder::addTranscodeStream ( const std::string& filename, const size_t streamIndex, const size_t subStreamIndex, Profile::ProfileDesc& profile )
370
+ void Transcoder::addTranscodeStream ( const std::string& filename, const size_t streamIndex, const size_t subStreamIndex, Profile::ProfileDesc& profile, const size_t offset )
371
371
{
372
372
InputFile* referenceFile = addInputFile ( filename, streamIndex );
373
373
@@ -376,7 +376,7 @@ void Transcoder::addTranscodeStream( const std::string& filename, const size_t s
376
376
case AVMEDIA_TYPE_VIDEO:
377
377
case AVMEDIA_TYPE_AUDIO:
378
378
{
379
- _streamTranscoders.push_back ( new StreamTranscoder ( referenceFile->getStream ( streamIndex ), _outputFile, profile, subStreamIndex ) );
379
+ _streamTranscoders.push_back ( new StreamTranscoder ( referenceFile->getStream ( streamIndex ), _outputFile, profile, subStreamIndex, offset ) );
380
380
_inputStreams.push_back ( &referenceFile->getStream ( streamIndex ) );
381
381
break ;
382
382
}
0 commit comments