UI: Add supported codecs to GetClientConfiguration request

This commit is contained in:
Ruwen Hahn
2024-06-19 12:27:13 -04:00
committed by Ryan Foster
parent 8a8019db3f
commit 9d1ac8816e
2 changed files with 28 additions and 1 deletions
+26
View File
@@ -24,6 +24,32 @@ constructGoLivePost(QString streamKey,
client.name = "obs-studio";
client.version = obs_get_version_string();
auto add_codec = [&](const char *codec) {
auto it = std::find(std::begin(client.supported_codecs),
std::end(client.supported_codecs), codec);
if (it != std::end(client.supported_codecs))
return;
client.supported_codecs.push_back(codec);
};
const char *encoder_id = nullptr;
for (size_t i = 0; obs_enum_encoder_types(i, &encoder_id); i++) {
auto codec = obs_get_encoder_codec(encoder_id);
if (!codec)
continue;
if (qstricmp(codec, "h264") == 0) {
add_codec("h264");
#ifdef ENABLE_HEVC
} else if (qstricmp(codec, "hevc")) {
add_codec("h265");
#endif
} else if (qstricmp(codec, "av1")) {
add_codec("av1");
}
}
auto &preferences = post_data.preferences;
preferences.vod_track_audio = vod_track_enabled;