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 ) 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
+ };
12
13
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
+ }
16
17
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
+ }
21
25
22
26
typedef struct RenderSettings {
23
27
HardwareAccelerationType m_hardwareAccelerationType;
@@ -47,26 +51,31 @@ namespace ffmpeg {
47
51
} RenderSettingsV1;
48
52
49
53
class FFMPEG_API_DLL Recorder {
50
- #define self reinterpret_cast <FFMPEG_API_VERSION_NS::Recorder*>(this )
51
54
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
+ };
56
60
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
+ }
60
66
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
+ }
65
70
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
+ }
69
79
#undef self
70
- };
71
80
72
81
}
0 commit comments