Skip to content

Commit 64b2338

Browse files
Conan-Kudoammen99
authored andcommitted
Add a compile-time option to set the default container file format
This allows configuration of the file format if a distributor wants to use a different default from mkv.
1 parent a4e740f commit 64b2338

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

config.h.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#define DEFAULT_FRAMERATE @default_framerate@
55
#define DEFAULT_AUDIO_CODEC "@default_audio_codec@"
66
#define DEFAULT_AUDIO_SAMPLE_RATE @default_audio_sample_rate@
7+
#define DEFAULT_CONTAINER_FORMAT @default_container_format@
78
#define FALLBACK_AUDIO_SAMPLE_FMT "@fallback_audio_sample_fmt@"
89
#mesondefine HAVE_PULSE
910
#mesondefine HAVE_OPENCL

meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ conf_data.set('default_codec', get_option('default_codec'))
1919
conf_data.set('default_framerate', get_option('default_framerate'))
2020
conf_data.set('default_audio_codec', get_option('default_audio_codec'))
2121
conf_data.set('default_audio_sample_rate', get_option('default_audio_sample_rate'))
22+
conf_data.set('default_container_format', get_option('default_container_format'))
2223
conf_data.set('fallback_audio_sample_fmt', get_option('fallback_audio_sample_fmt'))
2324

2425
version = '"@0@"'.format(meson.project_version())

meson_options.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ option('default_codec', type: 'string', value: 'libvpx-vp9', description: 'Codec
22
option('default_framerate', type: 'integer', value: 60, description: 'Video framerate that will be used by default')
33
option('default_audio_codec', type: 'string', value: 'libopus', description: 'Audio codec that will be used by default')
44
option('default_audio_sample_rate', type: 'integer', value: 48000, description: 'Audio sample rate that will be used by default')
5+
option('default_container_format', type: 'string', value: 'mkv', description: 'Container file format that will be used by default')
56
option('fallback_audio_sample_fmt', type: 'string', value: 's16', description: 'Fallback audio sample format that will be used if wf-recorder cannot determine the sample formats supported by a codec')
67
option('pulse', type: 'feature', value: 'auto', description: 'Enable Pulseaudio')

src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ static void parse_codec_opts(std::map<std::string, std::string>& options, const
697697
int main(int argc, char *argv[])
698698
{
699699
FrameWriterParams params = FrameWriterParams(exit_main_loop);
700-
params.file = "recording.mkv";
700+
params.file = "recording" + "." + DEFAULT_CONTAINER_FORMAT;
701701
params.codec = DEFAULT_CODEC;
702702
params.framerate = DEFAULT_FRAMERATE;
703703
params.audio_codec = DEFAULT_AUDIO_CODEC;

0 commit comments

Comments
 (0)