mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Don't use C++20 designated initializer (since we target C++17)
growl
This commit is contained in:
parent
aefc12e40e
commit
bf8d90af8c
2 changed files with 12 additions and 20 deletions
|
|
@ -38,8 +38,8 @@ Impl::Impl(Config cfg) :
|
||||||
max_duration_(cfg.max_duration),
|
max_duration_(cfg.max_duration),
|
||||||
|
|
||||||
container_(std::make_unique<WebmContainer>(MediaContainer::Config {
|
container_(std::make_unique<WebmContainer>(MediaContainer::Config {
|
||||||
.file_name = cfg.file_name,
|
cfg.file_name,
|
||||||
.destructor_callback = [this](const MediaContainer& container) { container_dtor_handler(container); },
|
[this](const MediaContainer& container) { container_dtor_handler(container); },
|
||||||
})),
|
})),
|
||||||
|
|
||||||
audio_encoder_(make_audio_encoder(cfg)),
|
audio_encoder_(make_audio_encoder(cfg)),
|
||||||
|
|
@ -60,10 +60,7 @@ std::unique_ptr<AudioEncoder> Impl::make_audio_encoder(const Config cfg) const
|
||||||
|
|
||||||
const Config::Audio& a = *cfg.audio;
|
const Config::Audio& a = *cfg.audio;
|
||||||
|
|
||||||
return container_->make_audio_encoder({
|
return container_->make_audio_encoder({2, a.sample_rate});
|
||||||
.channels = 2,
|
|
||||||
.sample_rate = a.sample_rate,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<VideoEncoder> Impl::make_video_encoder(const Config cfg) const
|
std::unique_ptr<VideoEncoder> Impl::make_video_encoder(const Config cfg) const
|
||||||
|
|
@ -75,12 +72,7 @@ std::unique_ptr<VideoEncoder> Impl::make_video_encoder(const Config cfg) const
|
||||||
|
|
||||||
const Config::Video& v = *cfg.video;
|
const Config::Video& v = *cfg.video;
|
||||||
|
|
||||||
return container_->make_video_encoder({
|
return container_->make_video_encoder({v.width, v.height, v.frame_rate, kBufferMethod});
|
||||||
.width = v.width,
|
|
||||||
.height = v.height,
|
|
||||||
.frame_rate = v.frame_rate,
|
|
||||||
.buffer_method = kBufferMethod,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Impl::~Impl()
|
Impl::~Impl()
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,9 @@ std::vector<consvar_t*> Options::cvars_;
|
||||||
// clang-format off
|
// clang-format off
|
||||||
const Options VorbisEncoder::options_("vorbis", {
|
const Options VorbisEncoder::options_("vorbis", {
|
||||||
{"quality", Options::values<float>("0", {-0.1f, 1.f})},
|
{"quality", Options::values<float>("0", {-0.1f, 1.f})},
|
||||||
{"max_bitrate", Options::values<int>("-1", {.min = -1})},
|
{"max_bitrate", Options::values<int>("-1", {-1})},
|
||||||
{"nominal_bitrate", Options::values<int>("-1", {.min = -1})},
|
{"nominal_bitrate", Options::values<int>("-1", {-1})},
|
||||||
{"min_bitrate", Options::values<int>("-1", {.min = -1})},
|
{"min_bitrate", Options::values<int>("-1", {-1})},
|
||||||
});
|
});
|
||||||
|
|
||||||
const Options VP8Encoder::options_("vp8", {
|
const Options VP8Encoder::options_("vp8", {
|
||||||
|
|
@ -39,20 +39,20 @@ const Options VP8Encoder::options_("vp8", {
|
||||||
{"cq", VPX_CQ},
|
{"cq", VPX_CQ},
|
||||||
{"q", VPX_Q},
|
{"q", VPX_Q},
|
||||||
})},
|
})},
|
||||||
{"target_bitrate", Options::values<int>("800", {.min = 1})},
|
{"target_bitrate", Options::values<int>("800", {1})},
|
||||||
{"min_q", Options::values<int>("4", {4, 63})},
|
{"min_q", Options::values<int>("4", {4, 63})},
|
||||||
{"max_q", Options::values<int>("55", {4, 63})},
|
{"max_q", Options::values<int>("55", {4, 63})},
|
||||||
{"kf_min", Options::values<int>("0", {.min = 0})},
|
{"kf_min", Options::values<int>("0", {0})},
|
||||||
{"kf_max", Options::values<int>("auto", {.min = 0}, {
|
{"kf_max", Options::values<int>("auto", {0}, {
|
||||||
{"auto", static_cast<int>(KeyFrameOption::kAuto)},
|
{"auto", static_cast<int>(KeyFrameOption::kAuto)},
|
||||||
})},
|
})},
|
||||||
{"cpu_used", Options::values<int>("0", {-16, 16})},
|
{"cpu_used", Options::values<int>("0", {-16, 16})},
|
||||||
{"cq_level", Options::values<int>("10", {0, 63})},
|
{"cq_level", Options::values<int>("10", {0, 63})},
|
||||||
{"deadline", Options::values<int>("10", { .min = 1}, {
|
{"deadline", Options::values<int>("10", {1}, {
|
||||||
{"infinite", static_cast<int>(DeadlineOption::kInfinite)},
|
{"infinite", static_cast<int>(DeadlineOption::kInfinite)},
|
||||||
})},
|
})},
|
||||||
{"sharpness", Options::values<int>("7", {0, 7})},
|
{"sharpness", Options::values<int>("7", {0, 7})},
|
||||||
{"token_parts", Options::values<int>("0", {0, 3})},
|
{"token_parts", Options::values<int>("0", {0, 3})},
|
||||||
{"threads", Options::values<int>("1", {.min = 1})},
|
{"threads", Options::values<int>("1", {1})},
|
||||||
});
|
});
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue