6
6
namespace ffmpeg {
7
7
class FFMPEG_API_DLL AudioMixer {
8
8
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
+ }
17
12
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
+ }
21
16
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
+ };
25
21
26
22
typedef struct RenderSettings {
27
23
HardwareAccelerationType m_hardwareAccelerationType;
@@ -51,31 +47,26 @@ namespace ffmpeg {
51
47
} RenderSettingsV1;
52
48
53
49
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
-
61
50
#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
+ }
66
56
67
- void Recorder:: stop () {
68
- self->stop ();
69
- }
57
+ GEODE_NOINLINE void stop () {
58
+ self->stop ();
59
+ }
70
60
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
+ }
75
65
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
+ }
79
69
#undef self
70
+ };
80
71
81
72
}
0 commit comments