Skip to content

Commit e151c55

Browse files
authored
uninline funcs
1 parent 88e13ba commit e151c55

File tree

1 file changed

+35
-26
lines changed

1 file changed

+35
-26
lines changed

src/compat.cpp

+35-26
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,22 @@
66
namespace ffmpeg {
77
class FFMPEG_API_DLL AudioMixer {
88
public:
9-
void mixVideoAudio(std::filesystem::path videoFile, std::filesystem::path audioFile, std::filesystem::path outputMp4File) {
10-
(void) FFMPEG_API_VERSION_NS::AudioMixer::mixVideoAudio(std::move(videoFile), std::move(audioFile), std::move(outputMp4File));
11-
}
9+
void mixVideoAudio(std::filesystem::path videoFile, std::filesystem::path audioFile, std::filesystem::path outputMp4File);
10+
void mixVideoRaw(std::filesystem::path videoFile, const std::vector<float>& raw, std::filesystem::path outputMp4File, uint32_t sampleRate);
11+
void mixVideoRaw(const std::filesystem::path& videoFile, const std::vector<float>& raw, const std::filesystem::path &outputMp4File);
12+
};
1213

13-
void mixVideoRaw(std::filesystem::path videoFile, const std::vector<float>& raw, std::filesystem::path outputMp4File, uint32_t sampleRate) {
14-
(void) FFMPEG_API_VERSION_NS::AudioMixer::mixVideoRaw(videoFile, raw, outputMp4File);
15-
}
14+
void AudioMixer::mixVideoAudio(std::filesystem::path videoFile, std::filesystem::path audioFile, std::filesystem::path outputMp4File) {
15+
(void) FFMPEG_API_VERSION_NS::AudioMixer::mixVideoAudio(std::move(videoFile), std::move(audioFile), std::move(outputMp4File));
16+
}
1617

17-
void mixVideoRaw(const std::filesystem::path& videoFile, const std::vector<float>& raw, const std::filesystem::path &outputMp4File) {
18-
(void) FFMPEG_API_VERSION_NS::AudioMixer::mixVideoRaw(videoFile, raw, outputMp4File);
19-
}
20-
};
18+
void AudioMixer::mixVideoRaw(std::filesystem::path videoFile, const std::vector<float>& raw, std::filesystem::path outputMp4File, uint32_t sampleRate) {
19+
(void) FFMPEG_API_VERSION_NS::AudioMixer::mixVideoRaw(videoFile, raw, outputMp4File);
20+
}
21+
22+
void AudioMixer::mixVideoRaw(const std::filesystem::path& videoFile, const std::vector<float>& raw, const std::filesystem::path &outputMp4File) {
23+
(void) FFMPEG_API_VERSION_NS::AudioMixer::mixVideoRaw(videoFile, raw, outputMp4File);
24+
}
2125

2226
typedef struct RenderSettings {
2327
HardwareAccelerationType m_hardwareAccelerationType;
@@ -47,26 +51,31 @@ namespace ffmpeg {
4751
} RenderSettingsV1;
4852

4953
class FFMPEG_API_DLL Recorder {
50-
#define self reinterpret_cast<FFMPEG_API_VERSION_NS::Recorder*>(this)
5154
public:
52-
bool init(const RenderSettingsV1& settings) {
53-
auto res = self->init(settings.toV2());
54-
return res.isOk();
55-
}
55+
bool init(const RenderSettingsV1& settings);
56+
void stop();
57+
bool writeFrame(const std::vector<uint8_t>& frameData);
58+
std::vector<std::string> getAvailableCodecs();
59+
};
5660

57-
void stop() {
58-
self->stop();
59-
}
61+
#define self reinterpret_cast<FFMPEG_API_VERSION_NS::Recorder*>(this)
62+
bool Recorder::init(const RenderSettingsV1& settings) {
63+
auto res = self->init(settings.toV2());
64+
return res.isOk();
65+
}
6066

61-
bool writeFrame(const std::vector<uint8_t>& frameData) {
62-
auto res = self->writeFrame(frameData);
63-
return res.isOk();
64-
}
67+
void Recorder::stop() {
68+
self->stop();
69+
}
6570

66-
std::vector<std::string> getAvailableCodecs() {
67-
return FFMPEG_API_VERSION_NS::Recorder::getAvailableCodecs();
68-
}
71+
bool Recorder::writeFrame(const std::vector<uint8_t>& frameData) {
72+
auto res = self->writeFrame(frameData);
73+
return res.isOk();
74+
}
75+
76+
std::vector<std::string> Recorder::getAvailableCodecs() {
77+
return FFMPEG_API_VERSION_NS::Recorder::getAvailableCodecs();
78+
}
6979
#undef self
70-
};
7180

7281
}

0 commit comments

Comments
 (0)