mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-09-20 04:42:18 +02:00
UI: Add supported codecs to GetClientConfiguration request
This commit is contained in:
parent
8a8019db3f
commit
9d1ac8816e
@ -24,6 +24,32 @@ constructGoLivePost(QString streamKey,
|
|||||||
client.name = "obs-studio";
|
client.name = "obs-studio";
|
||||||
client.version = obs_get_version_string();
|
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;
|
auto &preferences = post_data.preferences;
|
||||||
preferences.vod_track_audio = vod_track_enabled;
|
preferences.vod_track_audio = vod_track_enabled;
|
||||||
|
|
||||||
|
@ -109,8 +109,9 @@ using json = nlohmann::json;
|
|||||||
struct Client {
|
struct Client {
|
||||||
string name = "obs-studio";
|
string name = "obs-studio";
|
||||||
string version;
|
string version;
|
||||||
|
std::vector<string> supported_codecs;
|
||||||
|
|
||||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(Client, name, version)
|
NLOHMANN_DEFINE_TYPE_INTRUSIVE(Client, name, version, supported_codecs)
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Cpu {
|
struct Cpu {
|
||||||
|
Loading…
Reference in New Issue
Block a user