Skip to content

Commit cf55eba

Browse files
author
Clement Champetier
committed
Rename AvInput/OutputStream to Input/OutputStream
Keep 'AV' prefix for ffmpeg/libav objects.
1 parent 5d846be commit cf55eba

14 files changed

+50
-50
lines changed

src/AvTranscoder/avTranscoder.i

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
#include <AvTranscoder/codec/DataCodec.hpp>
2222

2323
#include <AvTranscoder/codedStream/IOutputStream.hpp>
24-
#include <AvTranscoder/codedStream/AvOutputStream.hpp>
24+
#include <AvTranscoder/codedStream/OutputStream.hpp>
2525

2626
#include <AvTranscoder/codedStream/IInputStream.hpp>
27-
#include <AvTranscoder/codedStream/AvInputStream.hpp>
27+
#include <AvTranscoder/codedStream/InputStream.hpp>
2828

2929
#include <AvTranscoder/transcoder/StreamTranscoder.hpp>
3030
#include <AvTranscoder/transcoder/Transcoder.hpp>
@@ -49,10 +49,10 @@ namespace std {
4949
%include <AvTranscoder/codec/DataCodec.hpp>
5050

5151
%include <AvTranscoder/codedStream/IOutputStream.hpp>
52-
%include <AvTranscoder/codedStream/AvOutputStream.hpp>
52+
%include <AvTranscoder/codedStream/OutputStream.hpp>
5353

5454
%include <AvTranscoder/codedStream/IInputStream.hpp>
55-
%include <AvTranscoder/codedStream/AvInputStream.hpp>
55+
%include <AvTranscoder/codedStream/InputStream.hpp>
5656

5757
%include "AvTranscoder/decoder/decoder.i"
5858
%include "AvTranscoder/encoder/encoder.i"

src/AvTranscoder/codedStream/AvInputStream.cpp renamed to src/AvTranscoder/codedStream/InputStream.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "AvInputStream.hpp"
1+
#include "InputStream.hpp"
22

33
#include <AvTranscoder/file/InputFile.hpp>
44

@@ -13,7 +13,7 @@ extern "C" {
1313
namespace avtranscoder
1414
{
1515

16-
AvInputStream::AvInputStream( InputFile& inputFile, const size_t streamIndex )
16+
InputStream::InputStream( InputFile& inputFile, const size_t streamIndex )
1717
: IInputStream( )
1818
, _inputFile( &inputFile )
1919
, _codec( NULL )
@@ -54,7 +54,7 @@ AvInputStream::AvInputStream( InputFile& inputFile, const size_t streamIndex )
5454
}
5555
}
5656

57-
AvInputStream::AvInputStream( const AvInputStream& inputStream )
57+
InputStream::InputStream( const InputStream& inputStream )
5858
: IInputStream( )
5959
, _inputFile( inputStream._inputFile )
6060
, _codec( inputStream._codec )
@@ -64,12 +64,12 @@ AvInputStream::AvInputStream( const AvInputStream& inputStream )
6464
{
6565
}
6666

67-
AvInputStream::~AvInputStream( )
67+
InputStream::~InputStream( )
6868
{
6969
delete _codec;
7070
}
7171

72-
bool AvInputStream::readNextPacket( CodedData& data )
72+
bool InputStream::readNextPacket( CodedData& data )
7373
{
7474
if( ! _isActivated )
7575
throw std::runtime_error( "Can't read packet on non-activated input stream." );
@@ -89,7 +89,7 @@ bool AvInputStream::readNextPacket( CodedData& data )
8989
return true;
9090
}
9191

92-
VideoCodec& AvInputStream::getVideoCodec()
92+
VideoCodec& InputStream::getVideoCodec()
9393
{
9494
assert( _streamIndex <= _inputFile->getFormatContext().getNbStreams() );
9595

@@ -101,7 +101,7 @@ VideoCodec& AvInputStream::getVideoCodec()
101101
return *static_cast<VideoCodec*>( _codec );;
102102
}
103103

104-
AudioCodec& AvInputStream::getAudioCodec()
104+
AudioCodec& InputStream::getAudioCodec()
105105
{
106106
assert( _streamIndex <= _inputFile->getFormatContext().getNbStreams() );
107107

@@ -113,7 +113,7 @@ AudioCodec& AvInputStream::getAudioCodec()
113113
return *static_cast<AudioCodec*>( _codec );;
114114
}
115115

116-
DataCodec& AvInputStream::getDataCodec()
116+
DataCodec& InputStream::getDataCodec()
117117
{
118118
assert( _streamIndex <= _inputFile->getFormatContext().getNbStreams() );
119119

@@ -125,17 +125,17 @@ DataCodec& AvInputStream::getDataCodec()
125125
return *static_cast<DataCodec*>( _codec );;
126126
}
127127

128-
AVMediaType AvInputStream::getStreamType() const
128+
AVMediaType InputStream::getStreamType() const
129129
{
130130
return _inputFile->getFormatContext().getAVStream( _streamIndex ).codec->codec_type;
131131
}
132132

133-
double AvInputStream::getDuration() const
133+
double InputStream::getDuration() const
134134
{
135135
return 1.0 * _inputFile->getFormatContext().getDuration() / AV_TIME_BASE;
136136
}
137137

138-
void AvInputStream::addPacket( AVPacket& packet )
138+
void InputStream::addPacket( AVPacket& packet )
139139
{
140140
// Do not cache data if the stream is declared as unused in process
141141
if( ! _isActivated )
@@ -146,7 +146,7 @@ void AvInputStream::addPacket( AVPacket& packet )
146146
_streamCache.back().copyData( packet.data, packet.size );
147147
}
148148

149-
void AvInputStream::clearBuffering()
149+
void InputStream::clearBuffering()
150150
{
151151
_streamCache = std::queue<CodedData>();
152152
}

src/AvTranscoder/codedStream/AvInputStream.hpp renamed to src/AvTranscoder/codedStream/InputStream.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ namespace avtranscoder
1212

1313
class InputFile;
1414

15-
class AvExport AvInputStream : public IInputStream
15+
class AvExport InputStream : public IInputStream
1616
{
1717
public:
18-
AvInputStream( InputFile& inputFile, const size_t streamIndex );
19-
AvInputStream( const AvInputStream& inputStream ); ///< Does not copy _streamCache
20-
~AvInputStream( );
18+
InputStream( InputFile& inputFile, const size_t streamIndex );
19+
InputStream( const InputStream& inputStream ); ///< Does not copy _streamCache
20+
~InputStream( );
2121

2222
bool readNextPacket( CodedData& data );
2323

src/AvTranscoder/codedStream/AvOutputStream.cpp renamed to src/AvTranscoder/codedStream/OutputStream.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "AvOutputStream.hpp"
1+
#include "OutputStream.hpp"
22

33
#include <AvTranscoder/file/OutputFile.hpp>
44

@@ -7,14 +7,14 @@
77
namespace avtranscoder
88
{
99

10-
AvOutputStream::AvOutputStream( OutputFile& outputFile, const size_t streamIndex )
10+
OutputStream::OutputStream( OutputFile& outputFile, const size_t streamIndex )
1111
: IOutputStream()
1212
, _outputFile( &outputFile )
1313
, _streamIndex( streamIndex )
1414
{
1515
}
1616

17-
IOutputStream::EWrappingStatus AvOutputStream::wrap( const CodedData& data )
17+
IOutputStream::EWrappingStatus OutputStream::wrap( const CodedData& data )
1818
{
1919
assert( _outputFile != NULL );
2020
return _outputFile->wrap( data, _streamIndex );

src/AvTranscoder/codedStream/AvOutputStream.hpp renamed to src/AvTranscoder/codedStream/OutputStream.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ namespace avtranscoder
88

99
class OutputFile;
1010

11-
class AvExport AvOutputStream : public IOutputStream
11+
class AvExport OutputStream : public IOutputStream
1212
{
1313
public:
14-
AvOutputStream( OutputFile& outputFile, const size_t streamIndex );
14+
OutputStream( OutputFile& outputFile, const size_t streamIndex );
1515

1616
size_t getStreamIndex() const { return _streamIndex; }
1717

src/AvTranscoder/decoder/AudioDecoder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "AudioDecoder.hpp"
22

33
#include <AvTranscoder/codec/ICodec.hpp>
4-
#include <AvTranscoder/codedStream/AvInputStream.hpp>
4+
#include <AvTranscoder/codedStream/InputStream.hpp>
55
#include <AvTranscoder/frame/AudioFrame.hpp>
66

77
extern "C" {
@@ -18,7 +18,7 @@ extern "C" {
1818
namespace avtranscoder
1919
{
2020

21-
AudioDecoder::AudioDecoder( AvInputStream& inputStream )
21+
AudioDecoder::AudioDecoder( InputStream& inputStream )
2222
: _inputStream ( &inputStream )
2323
, _frame ( NULL )
2424
{

src/AvTranscoder/decoder/AudioDecoder.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ struct AVFrame;
88
namespace avtranscoder
99
{
1010

11-
class AvInputStream;
11+
class InputStream;
1212

1313
class AvExport AudioDecoder : public IDecoder
1414
{
1515
public:
16-
AudioDecoder( AvInputStream& inputStream );
16+
AudioDecoder( InputStream& inputStream );
1717
~AudioDecoder();
1818

1919
void setup();
@@ -25,7 +25,7 @@ class AvExport AudioDecoder : public IDecoder
2525
bool decodeNextFrame();
2626

2727
private:
28-
AvInputStream* _inputStream; ///< Stream from which we read next frames (no ownership, has link)
28+
InputStream* _inputStream; ///< Stream from which we read next frames (no ownership, has link)
2929
AVFrame* _frame; ///< Libav object to store decoded data (has ownership)
3030
};
3131

src/AvTranscoder/decoder/VideoDecoder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "VideoDecoder.hpp"
22

33
#include <AvTranscoder/codec/ICodec.hpp>
4-
#include <AvTranscoder/codedStream/AvInputStream.hpp>
4+
#include <AvTranscoder/codedStream/InputStream.hpp>
55
#include <AvTranscoder/frame/VideoFrame.hpp>
66

77
extern "C" {
@@ -17,7 +17,7 @@ extern "C" {
1717
namespace avtranscoder
1818
{
1919

20-
VideoDecoder::VideoDecoder( AvInputStream& inputStream )
20+
VideoDecoder::VideoDecoder( InputStream& inputStream )
2121
: _inputStream ( &inputStream )
2222
, _frame ( NULL )
2323
{

src/AvTranscoder/decoder/VideoDecoder.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ struct AVFrame;
99
namespace avtranscoder
1010
{
1111

12-
class AvInputStream;
12+
class InputStream;
1313

1414
class AvExport VideoDecoder : public IDecoder
1515
{
1616
public:
17-
VideoDecoder( AvInputStream& inputStream );
17+
VideoDecoder( InputStream& inputStream );
1818
~VideoDecoder();
1919

2020
void setup();
@@ -30,7 +30,7 @@ class AvExport VideoDecoder : public IDecoder
3030
bool decodeNextFrame();
3131

3232
private:
33-
AvInputStream* _inputStream; ///< Stream from which we read next frames (no ownership, has link)
33+
InputStream* _inputStream; ///< Stream from which we read next frames (no ownership, has link)
3434
AVFrame* _frame; ///< Libav object to store decoded data (has ownership)
3535
};
3636

src/AvTranscoder/file/InputFile.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ InputFile::InputFile( const std::string& filename )
3131
// Create streams
3232
for( size_t streamIndex = 0; streamIndex < _formatContext.getNbStreams(); ++streamIndex )
3333
{
34-
_inputStreams.push_back( new AvInputStream( *this, streamIndex ) );
34+
_inputStreams.push_back( new InputStream( *this, streamIndex ) );
3535
}
3636
}
3737

3838
InputFile::~InputFile()
3939
{
40-
for( std::vector< AvInputStream* >::iterator it = _inputStreams.begin(); it != _inputStreams.end(); ++it )
40+
for( std::vector< InputStream* >::iterator it = _inputStreams.begin(); it != _inputStreams.end(); ++it )
4141
{
4242
delete (*it);
4343
}
@@ -149,7 +149,7 @@ void InputFile::seekAtFrame( const size_t frame )
149149
std::cerr << "Error during seek at " << frame << " (" << pos << ") in file" << std::endl;
150150
}
151151

152-
for( std::vector<AvInputStream*>::iterator it = _inputStreams.begin(); it != _inputStreams.end(); ++it )
152+
for( std::vector<InputStream*>::iterator it = _inputStreams.begin(); it != _inputStreams.end(); ++it )
153153
{
154154
(*it)->clearBuffering();
155155
}
@@ -160,7 +160,7 @@ void InputFile::activateStream( const size_t streamIndex, bool activate )
160160
getStream( streamIndex ).activate( activate );
161161
}
162162

163-
AvInputStream& InputFile::getStream( size_t index )
163+
InputStream& InputFile::getStream( size_t index )
164164
{
165165
try
166166
{

0 commit comments

Comments
 (0)