Skip to content

Commit

Permalink
GEODE_NOINLINE
Browse files Browse the repository at this point in the history
  • Loading branch information
Prevter authored Feb 1, 2025
1 parent e151c55 commit d42f1b6
Showing 1 changed file with 26 additions and 35 deletions.
61 changes: 26 additions & 35 deletions src/compat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,18 @@
namespace ffmpeg {
class FFMPEG_API_DLL AudioMixer {
public:
void mixVideoAudio(std::filesystem::path videoFile, std::filesystem::path audioFile, std::filesystem::path outputMp4File);
void mixVideoRaw(std::filesystem::path videoFile, const std::vector<float>& raw, std::filesystem::path outputMp4File, uint32_t sampleRate);
void mixVideoRaw(const std::filesystem::path& videoFile, const std::vector<float>& raw, const std::filesystem::path &outputMp4File);
};

void AudioMixer::mixVideoAudio(std::filesystem::path videoFile, std::filesystem::path audioFile, std::filesystem::path outputMp4File) {
(void) FFMPEG_API_VERSION_NS::AudioMixer::mixVideoAudio(std::move(videoFile), std::move(audioFile), std::move(outputMp4File));
}
GEODE_NOINLINE void mixVideoAudio(std::filesystem::path videoFile, std::filesystem::path audioFile, std::filesystem::path outputMp4File) {
(void) FFMPEG_API_VERSION_NS::AudioMixer::mixVideoAudio(std::move(videoFile), std::move(audioFile), std::move(outputMp4File));
}

void AudioMixer::mixVideoRaw(std::filesystem::path videoFile, const std::vector<float>& raw, std::filesystem::path outputMp4File, uint32_t sampleRate) {
(void) FFMPEG_API_VERSION_NS::AudioMixer::mixVideoRaw(videoFile, raw, outputMp4File);
}
GEODE_NOINLINE void mixVideoRaw(std::filesystem::path videoFile, const std::vector<float>& raw, std::filesystem::path outputMp4File, uint32_t sampleRate) {
(void) FFMPEG_API_VERSION_NS::AudioMixer::mixVideoRaw(videoFile, raw, outputMp4File);
}

void AudioMixer::mixVideoRaw(const std::filesystem::path& videoFile, const std::vector<float>& raw, const std::filesystem::path &outputMp4File) {
(void) FFMPEG_API_VERSION_NS::AudioMixer::mixVideoRaw(videoFile, raw, outputMp4File);
}
GEODE_NOINLINE void mixVideoRaw(const std::filesystem::path& videoFile, const std::vector<float>& raw, const std::filesystem::path &outputMp4File) {
(void) FFMPEG_API_VERSION_NS::AudioMixer::mixVideoRaw(videoFile, raw, outputMp4File);
}
};

typedef struct RenderSettings {
HardwareAccelerationType m_hardwareAccelerationType;
Expand Down Expand Up @@ -51,31 +47,26 @@ namespace ffmpeg {
} RenderSettingsV1;

class FFMPEG_API_DLL Recorder {
public:
bool init(const RenderSettingsV1& settings);
void stop();
bool writeFrame(const std::vector<uint8_t>& frameData);
std::vector<std::string> getAvailableCodecs();
};

#define self reinterpret_cast<FFMPEG_API_VERSION_NS::Recorder*>(this)
bool Recorder::init(const RenderSettingsV1& settings) {
auto res = self->init(settings.toV2());
return res.isOk();
}
public:
GEODE_NOINLINE bool init(const RenderSettingsV1& settings) {
auto res = self->init(settings.toV2());
return res.isOk();
}

void Recorder::stop() {
self->stop();
}
GEODE_NOINLINE void stop() {
self->stop();
}

bool Recorder::writeFrame(const std::vector<uint8_t>& frameData) {
auto res = self->writeFrame(frameData);
return res.isOk();
}
GEODE_NOINLINE bool writeFrame(const std::vector<uint8_t>& frameData) {
auto res = self->writeFrame(frameData);
return res.isOk();
}

std::vector<std::string> Recorder::getAvailableCodecs() {
return FFMPEG_API_VERSION_NS::Recorder::getAvailableCodecs();
}
GEODE_NOINLINE std::vector<std::string> getAvailableCodecs() {
return FFMPEG_API_VERSION_NS::Recorder::getAvailableCodecs();
}
#undef self
};

}

0 comments on commit d42f1b6

Please sign in to comment.