Skip to content

Commit cf8619f

Browse files
author
Clement Champetier
committed
OuputFile: rename streamId argument to streamIndex
1 parent e41021a commit cf8619f

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

src/AvTranscoder/file/IOutputFile.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ class AvExport IOutputFile
5959
/**
6060
* @brief Wrap a packet of data in the output ressource
6161
* @param data coded packet information for the current stream
62-
* @param streamId refers to the stream in output ressource
62+
* @param streamIndex refers to the stream in output ressource
63+
* @return the wrapping status after wrapping
64+
* @see EWrappingStatus
6365
**/
6466
virtual IOutputStream::EWrappingStatus wrap( const CodedData& data, const size_t streamIndex ) = 0;
6567

@@ -70,7 +72,7 @@ class AvExport IOutputFile
7072

7173
/**
7274
* @brief Get the output stream
73-
* @param streamId select the output stream
75+
* @param streamIndex select the output stream
7476
* @return the output stream reference
7577
**/
7678
virtual IOutputStream& getStream( const size_t streamIndex ) = 0;

src/AvTranscoder/file/OutputFile.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ IOutputStream& OutputFile::addDataStream( const DataCodec& dataDesc )
101101
return *outputStream;
102102
}
103103

104-
IOutputStream& OutputFile::getStream( const size_t streamId )
104+
IOutputStream& OutputFile::getStream( const size_t streamIndex )
105105
{
106-
if( streamId >= _outputStreams.size() )
106+
if( streamIndex >= _outputStreams.size() )
107107
throw std::runtime_error( "unable to get output stream (out of range)" );
108-
return *_outputStreams.at( streamId );
108+
return *_outputStreams.at( streamIndex );
109109
}
110110

111111
std::string OutputFile::getFilename() const
@@ -159,16 +159,16 @@ bool OutputFile::beginWrap( )
159159
return true;
160160
}
161161

162-
IOutputStream::EWrappingStatus OutputFile::wrap( const CodedData& data, const size_t streamId )
162+
IOutputStream::EWrappingStatus OutputFile::wrap( const CodedData& data, const size_t streamIndex )
163163
{
164164
if( ! data.getSize() )
165165
return IOutputStream::eWrappingSuccess;
166166

167-
LOG_DEBUG( "Wrap on stream " << streamId << " (" << data.getSize() << " bytes for frame " << _frameCount.at( streamId ) << ")" )
167+
LOG_DEBUG( "Wrap on stream " << streamIndex << " (" << data.getSize() << " bytes for frame " << _frameCount.at( streamIndex ) << ")" )
168168

169169
AVPacket packet;
170170
av_init_packet( &packet );
171-
packet.stream_index = streamId;
171+
packet.stream_index = streamIndex;
172172
packet.data = (uint8_t*)data.getData();
173173
packet.size = data.getSize();
174174

@@ -177,15 +177,15 @@ IOutputStream::EWrappingStatus OutputFile::wrap( const CodedData& data, const si
177177
// free packet.side_data, set packet.data to NULL and packet.size to 0
178178
av_free_packet( &packet );
179179

180-
const double currentStreamDuration = _outputStreams.at( streamId )->getStreamDuration();
180+
const double currentStreamDuration = _outputStreams.at( streamIndex )->getStreamDuration();
181181
if( currentStreamDuration < _previousProcessedStreamDuration )
182182
{
183183
// if the current stream is strictly shorter than the previous, wait for more data
184184
return IOutputStream::eWrappingWaitingForData;
185185
}
186186

187187
_previousProcessedStreamDuration = currentStreamDuration;
188-
_frameCount.at( streamId )++;
188+
_frameCount.at( streamIndex )++;
189189

190190
return IOutputStream::eWrappingSuccess;
191191
}

src/AvTranscoder/file/OutputFile.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ class AvExport OutputFile : public IOutputFile
3737
* @brief Open ressource, write header, and setup specific wrapping options given when call setupWrapping.
3838
* @note Need to add the streams to mux before calling this method.
3939
* @note After this call, a new list of AVOption, relative to the format choosen, will be available for the OutputFile.
40-
*/
40+
*/
4141
bool beginWrap();
4242

43-
IOutputStream::EWrappingStatus wrap( const CodedData& data, const size_t streamId );
43+
IOutputStream::EWrappingStatus wrap( const CodedData& data, const size_t streamIndex );
4444

4545
/**
4646
* @brief Close ressource and write trailer.
@@ -54,7 +54,7 @@ class AvExport OutputFile : public IOutputFile
5454
void addMetadata( const PropertyVector& data );
5555
void addMetadata( const std::string& key, const std::string& value );
5656

57-
IOutputStream& getStream( const size_t streamId );
57+
IOutputStream& getStream( const size_t streamIndex );
5858

5959
std::string getFilename() const;
6060

0 commit comments

Comments
 (0)