Skip to content

Commit 35c816a

Browse files
author
Clement Champetier
committed
Clean includes
* Remove unused includes. * Use fast forward declaration if possible.
1 parent 12465ec commit 35c816a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+61
-159
lines changed

src/AvTranscoder/CodedStream/AvInputStream.cpp

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

3-
#include <AvTranscoder/File/InputFile.hpp>
3+
#include <stdexcept>
4+
#include <cassert>
45

56
extern "C" {
67
#ifndef __STDC_CONSTANT_MACROS
@@ -9,13 +10,9 @@ extern "C" {
910

1011
#include <libavcodec/avcodec.h>
1112
#include <libavformat/avformat.h>
12-
#include <libavutil/avutil.h>
13-
#include <libavutil/pixdesc.h>
14-
#include <libavutil/avstring.h>
1513
}
1614

17-
#include <stdexcept>
18-
#include <cassert>
15+
#include <AvTranscoder/File/InputFile.hpp>
1916

2017
namespace avtranscoder
2118
{

src/AvTranscoder/CodedStream/AvOutputStream.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include <AvTranscoder/File/OutputFile.hpp>
44

55
#include <cassert>
6-
#include <iostream>
76

87
namespace avtranscoder
98
{

src/AvTranscoder/CodedStructures/AudioDesc.hpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,13 @@
33

44
#include <string>
55

6-
extern "C" {
7-
#ifndef __STDC_CONSTANT_MACROS
8-
#define __STDC_CONSTANT_MACROS
9-
#endif
10-
#ifndef INT64_C
11-
#define INT64_C(c) (c ## LL)
12-
#define UINT64_C(c) (c ## ULL)
13-
#endif
14-
#include <libavcodec/avcodec.h>
15-
}
16-
176
#include <AvTranscoder/common.hpp>
187
#include <AvTranscoder/EssenceStructures/AudioFrame.hpp>
8+
199
#include "CodedDesc.hpp"
2010

11+
class AVCodec;
12+
2113
namespace avtranscoder
2214
{
2315

src/AvTranscoder/CodedStructures/CodedDesc.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ extern "C" {
44
#ifndef __STDC_CONSTANT_MACROS
55
#define __STDC_CONSTANT_MACROS
66
#endif
7+
#include <libavcodec/avcodec.h>
78
#include <libavutil/opt.h>
89
#include <libavutil/error.h>
910
}

src/AvTranscoder/CodedStructures/CodedDesc.hpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,11 @@
33

44
#include <string>
55

6-
extern "C" {
7-
#ifndef __STDC_CONSTANT_MACROS
8-
#define __STDC_CONSTANT_MACROS
9-
#endif
10-
#ifndef INT64_C
11-
#define INT64_C(c) (c ## LL)
12-
#define UINT64_C(c) (c ## ULL)
13-
#endif
14-
#include <libavcodec/avcodec.h>
15-
}
16-
176
#include <AvTranscoder/common.hpp>
187

8+
class AVCodec;
9+
class AVCodecContext;
10+
1911
namespace avtranscoder
2012
{
2113

src/AvTranscoder/CodedStructures/DataStreamDesc.hpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
11
#ifndef _AV_TRANSCODER_DATA_DATA_STREAM_DESC_HPP_
22
#define _AV_TRANSCODER_DATA_DATA_STREAM_DESC_HPP_
33

4-
#include <string>
54
#include <vector>
6-
7-
extern "C" {
8-
#ifndef __STDC_CONSTANT_MACROS
9-
#define __STDC_CONSTANT_MACROS
10-
#endif
11-
#ifndef INT64_C
12-
#define INT64_C(c) (c ## LL)
13-
#define UINT64_C(c) (c ## ULL)
14-
#endif
15-
#include <libavcodec/avcodec.h>
16-
}
5+
#include <cstring>
176

187
namespace avtranscoder
198
{

src/AvTranscoder/CodedStructures/VideoDesc.hpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,13 @@
33

44
#include <string>
55

6-
extern "C" {
7-
#ifndef __STDC_CONSTANT_MACROS
8-
#define __STDC_CONSTANT_MACROS
9-
#endif
10-
#ifndef INT64_C
11-
#define INT64_C(c) (c ## LL)
12-
#define UINT64_C(c) (c ## ULL)
13-
#endif
14-
#include <libavcodec/avcodec.h>
15-
}
16-
176
#include <AvTranscoder/common.hpp>
187
#include <AvTranscoder/EssenceStructures/VideoFrame.hpp>
8+
199
#include "CodedDesc.hpp"
2010

11+
class AVCodec;
12+
2113
namespace avtranscoder
2214
{
2315

src/AvTranscoder/Description.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#include <vector>
55
#include <string>
6-
#include <map>
76

87
#include "common.hpp"
98

src/AvTranscoder/EssenceStream/DummyAudio.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#include "DummyAudio.hpp"
22

3-
#include <cassert>
4-
#include <cstring>
5-
63
namespace avtranscoder
74
{
85

src/AvTranscoder/EssenceStream/DummyAudio.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "InputEssence.hpp"
55

6+
#include <AvTranscoder/common.hpp>
67
#include <AvTranscoder/CodedStructures/AudioDesc.hpp>
78
#include <AvTranscoder/EssenceStructures/Frame.hpp>
89

src/AvTranscoder/EssenceStream/DummyVideo.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#include "DummyVideo.hpp"
22

3-
#include <cassert>
4-
#include <cstring>
5-
63
namespace avtranscoder
74
{
85

src/AvTranscoder/EssenceStream/DummyVideo.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "InputEssence.hpp"
55

6+
#include <AvTranscoder/common.hpp>
67
#include <AvTranscoder/CodedStructures/VideoDesc.hpp>
78
#include <AvTranscoder/EssenceStructures/Frame.hpp>
89

src/AvTranscoder/EssenceStream/InputAudio.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ extern "C" {
1212
}
1313

1414
#include <AvTranscoder/CodedStream/AvInputStream.hpp>
15+
#include <AvTranscoder/EssenceStructures/AudioFrame.hpp>
1516

1617
#include <iostream>
1718
#include <stdexcept>

src/AvTranscoder/EssenceStream/InputAudio.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
#define _AV_TRANSCODER_ESSENCE_STREAM_INPUT_AUDIO_HPP_
33

44
#include "InputEssence.hpp"
5-
#include <AvTranscoder/EssenceStructures/AudioFrame.hpp>
65

7-
class AVFormatContext;
86
class AVCodec;
97
class AVCodecContext;
108
class AVFrame;

src/AvTranscoder/EssenceStream/InputVideo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ extern "C" {
1111
}
1212

1313
#include <AvTranscoder/CodedStream/AvInputStream.hpp>
14+
#include <AvTranscoder/EssenceStructures/VideoFrame.hpp>
1415

15-
#include <iostream>
1616
#include <stdexcept>
1717

1818
namespace avtranscoder

src/AvTranscoder/EssenceStream/InputVideo.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
#define _AV_TRANSCODER_ESSENCE_STREAM_INPUT_VIDEO_HPP_
33

44
#include "InputEssence.hpp"
5-
#include <AvTranscoder/EssenceStructures/VideoFrame.hpp>
65

7-
#include <vector>
8-
9-
class AVFormatContext;
106
class AVCodec;
117
class AVCodecContext;
128
class AVFrame;

src/AvTranscoder/EssenceStream/OutputAudio.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ extern "C" {
99
#include <libavutil/avutil.h>
1010
}
1111

12+
#include <iostream>
1213
#include <stdexcept>
1314
#include <cstdlib>
1415

src/AvTranscoder/EssenceStream/OutputEssence.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
#include <AvTranscoder/EssenceStructures/Frame.hpp>
55
#include <AvTranscoder/CodedStructures/DataStreamDesc.hpp>
66

7-
#include <AvTranscoder/Profile.hpp>
8-
97
namespace avtranscoder
108
{
119

src/AvTranscoder/EssenceStream/OutputVideo.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ extern "C" {
77
#include <libavcodec/avcodec.h>
88
#include <libavformat/avformat.h>
99
#include <libavutil/avutil.h>
10-
#include <libavutil/pixdesc.h>
11-
#include <libavutil/imgutils.h>
12-
#include <libavutil/mathematics.h>
1310
}
1411

12+
#include <iostream>
1513
#include <stdexcept>
1614
#include <cstdlib>
1715

src/AvTranscoder/EssenceStream/OutputVideo.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@
99

1010
#include <AvTranscoder/Profile.hpp>
1111

12-
#include <string>
13-
#include <vector>
14-
15-
class AVFormatContext;
16-
class AVCodecContext;
17-
1812
namespace avtranscoder
1913
{
2014

src/AvTranscoder/EssenceStructures/AudioFrame.hpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,6 @@
33

44
#include <AvTranscoder/common.hpp>
55

6-
extern "C" {
7-
#ifndef __STDC_CONSTANT_MACROS
8-
#define __STDC_CONSTANT_MACROS
9-
#endif
10-
#ifndef INT64_C
11-
#define INT64_C(c) (c ## LL)
12-
#define UINT64_C(c) (c ## ULL)
13-
#endif
14-
#include <libavcodec/avcodec.h>
15-
}
16-
17-
#include <iostream>
18-
#include <string>
19-
#include <vector>
20-
#include <stdexcept>
21-
22-
//#include "Sample.hpp"
236
#include "Frame.hpp"
247

258
namespace avtranscoder

src/AvTranscoder/EssenceStructures/Frame.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#include <AvTranscoder/common.hpp>
55

6-
#include <string>
76
#include <vector>
87

98
namespace avtranscoder

src/AvTranscoder/EssenceStructures/Pixel.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ extern "C" {
55
#define __STDC_CONSTANT_MACROS
66
#endif
77
#include <libavformat/avformat.h>
8-
#include <libavutil/pixfmt.h>
98
#include <libswscale/swscale.h>
109
#include <libavutil/imgutils.h>
1110
#include <libavutil/pixdesc.h>

src/AvTranscoder/EssenceStructures/VideoFrame.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,9 @@ extern "C" {
1111
#define INT64_C(c) (c ## LL)
1212
#define UINT64_C(c) (c ## ULL)
1313
#endif
14-
#include <libavcodec/avcodec.h>
14+
#include <libavutil/pixdesc.h>
1515
}
1616

17-
#include <iostream>
18-
#include <string>
19-
#include <vector>
2017
#include <stdexcept>
2118

2219
#include "Pixel.hpp"

src/AvTranscoder/EssenceTransform/EssenceTransform.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef _AV_TRANSCODER_ESSENCE_TRANSFORM_ESSENCE_TRANSFORM_HPP_
22
#define _AV_TRANSCODER_ESSENCE_TRANSFORM_ESSENCE_TRANSFORM_HPP_
33

4+
#include <AvTranscoder/common.hpp>
45
#include <AvTranscoder/EssenceStructures/Frame.hpp>
56

67
namespace avtranscoder

src/AvTranscoder/EssenceTransform/VideoEssenceTransform.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#ifndef _AV_TRANSCODER_ESSENCE_TRANSFORM_VIDEO_ESSENCE_TRANSFORM_HPP
22
#define _AV_TRANSCODER_ESSENCE_TRANSFORM_VIDEO_ESSENCE_TRANSFORM_HPP
33

4-
#include <AvTranscoder/EssenceStructures/Frame.hpp>
4+
#include <vector>
5+
56
#include "EssenceTransform.hpp"
67

7-
#include <vector>
8+
#include <AvTranscoder/EssenceStructures/Frame.hpp>
89

910
class SwsContext;
1011

src/AvTranscoder/File/InputFile.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ extern "C" {
1616
#include <libavformat/avformat.h>
1717
#include <libavutil/avutil.h>
1818
#include <libavutil/pixdesc.h>
19-
#include <libavutil/avstring.h>
2019
}
2120

22-
#include <iostream>
2321
#include <stdexcept>
2422
#include <cassert>
2523

@@ -124,7 +122,6 @@ InputFile& InputFile::analyse( ProgressListener& progress, const EAnalyseLevel l
124122
}
125123
case AVMEDIA_TYPE_NB:
126124
{
127-
// std::cout << "NB" << std::endl;
128125
break;
129126
}
130127
}

src/AvTranscoder/File/InputFile.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
#ifndef _AV_TRANSCODER_FILE_INPUT_FILE_HPP_
22
#define _AV_TRANSCODER_FILE_INPUT_FILE_HPP_
33

4+
#include <AvTranscoder/common.hpp>
5+
46
#include <AvTranscoder/CodedStructures/DataStreamDesc.hpp>
57
#include <AvTranscoder/CodedStructures/AudioDesc.hpp>
68
#include <AvTranscoder/CodedStructures/VideoDesc.hpp>
9+
710
#include <AvTranscoder/CodedStream/AvInputStream.hpp>
11+
812
#include <AvTranscoder/Metadatas/MediaMetadatasStructures.hpp>
913
#include <AvTranscoder/ProgressListener.hpp>
1014

1115
#include <string>
1216
#include <vector>
1317

14-
class AVInputFormat;
1518
class AVFormatContext;
16-
class AVStream;
17-
class AVCodec;
18-
class AVCodecContext;
1919

2020
namespace avtranscoder
2121
{

src/AvTranscoder/File/OutputFile.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ extern "C" {
88
#include <libavformat/avformat.h>
99
#include <libavutil/avutil.h>
1010
#include <libavutil/pixdesc.h>
11-
#include <libavutil/avstring.h>
1211
}
1312

1413
#include <iostream>

0 commit comments

Comments
 (0)