Skip to content

Commit 9868167

Browse files
author
Clement Champetier
committed
Format src files
1 parent 76f2b3f commit 9868167

21 files changed

+71
-64
lines changed

src/AvTranscoder/data/decoded/AudioFrame.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class AvExport AudioFrame : public Frame
4545
size_t getSampleRate() const { return av_frame_get_sample_rate(_frame); }
4646
size_t getNbChannels() const { return av_frame_get_channels(_frame); }
4747
size_t getChannelLayout() const { return av_frame_get_channel_layout(_frame); }
48-
std::string getChannelLayoutDesc() const; ///< Get a description of a channel layout (example: '5.1').
48+
std::string getChannelLayoutDesc() const; ///< Get a description of a channel layout (example: '5.1').
4949
AVSampleFormat getSampleFormat() const { return static_cast<AVSampleFormat>(_frame->format); }
5050
size_t getNbSamplesPerChannel() const { return _frame->nb_samples; }
5151
AudioFrameDesc desc() const { return AudioFrameDesc(getSampleRate(), getNbChannels(), getSampleFormat()); }

src/AvTranscoder/decoder/AudioDecoder.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ bool AudioDecoder::decodeNextFrame(Frame& frameBuffer, const std::vector<size_t>
137137
return false;
138138

139139
// check if each expected channel exists
140-
for(std::vector<size_t>::const_iterator channelIndex = channelIndexArray.begin(); channelIndex != channelIndexArray.end(); ++channelIndex)
140+
for(std::vector<size_t>::const_iterator channelIndex = channelIndexArray.begin();
141+
channelIndex != channelIndexArray.end(); ++channelIndex)
141142
{
142143
if((*channelIndex) > srcNbChannels - 1)
143144
{
@@ -174,7 +175,7 @@ bool AudioDecoder::decodeNextFrame(Frame& frameBuffer, const std::vector<size_t>
174175

175176
// shift to the corresponding sample in the next channel of the current layout
176177
if(i < channelIndexArray.size() - 1)
177-
src += (channelIndexArray.at(i+1) - channelIndexArray.at(i)) * bytePerSample;
178+
src += (channelIndexArray.at(i + 1) - channelIndexArray.at(i)) * bytePerSample;
178179
// else shift to the next layout
179180
else
180181
{

src/AvTranscoder/decoder/AudioGenerator.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ bool AudioGenerator::decodeNextFrame(Frame& frameBuffer)
3434
if(frameBuffer.getAVFrame().channel_layout == 0)
3535
{
3636
const size_t channelLayout = av_get_default_channel_layout(frameBuffer.getAVFrame().channels);
37-
LOG_WARN("Channel layout en the audio frame is not set. Set it to '" << channelLayout << "' to be able to copy silence data.")
37+
LOG_WARN("Channel layout en the audio frame is not set. Set it to '" << channelLayout
38+
<< "' to be able to copy silence data.")
3839
av_frame_set_channel_layout(&frameBuffer.getAVFrame(), channelLayout);
3940
}
4041

src/AvTranscoder/decoder/AudioGenerator.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ class AvExport AudioGenerator : public IDecoder
2424
void setNextFrame(Frame& inputFrame) { _inputFrame = &inputFrame; }
2525

2626
private:
27-
Frame* _inputFrame; ///< Has link (no ownership)
28-
AudioFrame* _silent; ///< The generated silent (has ownership)
27+
Frame* _inputFrame; ///< Has link (no ownership)
28+
AudioFrame* _silent; ///< The generated silent (has ownership)
2929
const AudioFrameDesc _frameDesc; ///< The description of the silence (sampleRate, channels...)
3030
};
3131
}

src/AvTranscoder/decoder/VideoGenerator.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ class AvExport VideoGenerator : public IDecoder
2424
void setNextFrame(Frame& inputFrame) { _inputFrame = &inputFrame; }
2525

2626
private:
27-
Frame* _inputFrame; ///< A frame given from outside (has link, no ownership)
28-
VideoFrame* _blackImage; ///< The generated black image (has ownership)
27+
Frame* _inputFrame; ///< A frame given from outside (has link, no ownership)
28+
VideoFrame* _blackImage; ///< The generated black image (has ownership)
2929
const VideoFrameDesc _frameDesc; ///< The description of the black image (width, height...)
3030
};
3131
}

src/AvTranscoder/encoder/AudioEncoder.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,5 +139,4 @@ bool AudioEncoder::encode(const AVFrame* decodedData, AVPacket& encodedData)
139139
return true;
140140
#endif
141141
}
142-
143142
}

src/AvTranscoder/encoder/VideoEncoder.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,5 +152,4 @@ bool VideoEncoder::encode(const AVFrame* decodedData, AVPacket& encodedData)
152152
return true;
153153
#endif
154154
}
155-
156155
}

src/AvTranscoder/file/FormatContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ AVStream& FormatContext::addAVStream(const AVCodec& avCodec)
144144

145145
bool FormatContext::seek(const uint64_t position, const int flag)
146146
{
147-
LOG_INFO("Seek in '" << _avFormatContext->filename << "' at " << position << " with flag '"<< flag << "'")
147+
LOG_INFO("Seek in '" << _avFormatContext->filename << "' at " << position << " with flag '" << flag << "'")
148148
const int err = av_seek_frame(_avFormatContext, -1, position, flag);
149149
if(err < 0)
150150
{

src/AvTranscoder/file/FormatContext.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ class AvExport FormatContext
7878
* @param position: can be in AV_TIME_BASE units, in frames... depending on the flag value
7979
* @param flag: seeking mode (AVSEEK_FLAG_xxx)
8080
* @return seek status
81-
* @warn seeking on a raw bitstreams (without any container) could produce an error (because of a lack of timing information)
81+
* @warn seeking on a raw bitstreams (without any container) could produce an error (because of a lack of timing
82+
* information)
8283
* @see flushDecoder
8384
*/
8485
bool seek(const uint64_t position, const int flag);

src/AvTranscoder/file/InputFile.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ bool InputFile::readNextPacket(CodedData& data, const size_t streamIndex)
6161
const int ret = av_read_frame(&_formatContext.getAVFormatContext(), &data.getAVPacket());
6262
if(ret < 0) // error or end of file
6363
{
64-
LOG_INFO("Stop reading the next frame of file '" << _filename << "', stream " << streamIndex << " (" << getDescriptionFromErrorCode(ret) << ")")
64+
LOG_INFO("Stop reading the next frame of file '" << _filename << "', stream " << streamIndex << " ("
65+
<< getDescriptionFromErrorCode(ret) << ")")
6566
return false;
6667
}
6768

0 commit comments

Comments
 (0)