Skip to content

Commit d42f1b6

Browse files
authored
GEODE_NOINLINE
1 parent e151c55 commit d42f1b6

File tree

1 file changed

+26
-35
lines changed

1 file changed

+26
-35
lines changed

src/compat.cpp

+26-35
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,18 @@
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 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-
};
13-
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-
}
9+
GEODE_NOINLINE 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+
}
1712

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-
}
13+
GEODE_NOINLINE 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+
}
2116

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-
}
17+
GEODE_NOINLINE 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+
};
2521

2622
typedef struct RenderSettings {
2723
HardwareAccelerationType m_hardwareAccelerationType;
@@ -51,31 +47,26 @@ namespace ffmpeg {
5147
} RenderSettingsV1;
5248

5349
class FFMPEG_API_DLL Recorder {
54-
public:
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-
};
60-
6150
#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-
}
51+
public:
52+
GEODE_NOINLINE bool init(const RenderSettingsV1& settings) {
53+
auto res = self->init(settings.toV2());
54+
return res.isOk();
55+
}
6656

67-
void Recorder::stop() {
68-
self->stop();
69-
}
57+
GEODE_NOINLINE void stop() {
58+
self->stop();
59+
}
7060

71-
bool Recorder::writeFrame(const std::vector<uint8_t>& frameData) {
72-
auto res = self->writeFrame(frameData);
73-
return res.isOk();
74-
}
61+
GEODE_NOINLINE bool writeFrame(const std::vector<uint8_t>& frameData) {
62+
auto res = self->writeFrame(frameData);
63+
return res.isOk();
64+
}
7565

76-
std::vector<std::string> Recorder::getAvailableCodecs() {
77-
return FFMPEG_API_VERSION_NS::Recorder::getAvailableCodecs();
78-
}
66+
GEODE_NOINLINE std::vector<std::string> getAvailableCodecs() {
67+
return FFMPEG_API_VERSION_NS::Recorder::getAvailableCodecs();
68+
}
7969
#undef self
70+
};
8071

8172
}

0 commit comments

Comments
 (0)