mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-19 01:36:12 +08:00
frontend: Update multitrack API model
"revision" was defined to be a string in the schema but accepted integers, this is enforced with the new schema version.
This commit is contained in:
committed by
Ryan Foster
parent
811072d0fd
commit
8117c89b9a
@@ -10,7 +10,7 @@ GoLiveApi::PostData constructGoLivePost(QString streamKey, const std::optional<u
|
||||
{
|
||||
GoLiveApi::PostData post_data{};
|
||||
post_data.service = "IVS";
|
||||
post_data.schema_version = "2024-06-04";
|
||||
post_data.schema_version = "2025-01-25";
|
||||
post_data.authentication = streamKey.toStdString();
|
||||
|
||||
system_info(post_data.capabilities);
|
||||
@@ -50,15 +50,12 @@ GoLiveApi::PostData constructGoLivePost(QString streamKey, const std::optional<u
|
||||
|
||||
obs_video_info ovi;
|
||||
if (obs_get_video_info(&ovi)) {
|
||||
preferences.width = ovi.output_width;
|
||||
preferences.height = ovi.output_height;
|
||||
preferences.framerate.numerator = ovi.fps_num;
|
||||
preferences.framerate.denominator = ovi.fps_den;
|
||||
|
||||
preferences.canvas_width = ovi.base_width;
|
||||
preferences.canvas_height = ovi.base_height;
|
||||
|
||||
preferences.composition_gpu_index = ovi.adapter;
|
||||
preferences.canvases.emplace_back(GoLiveApi::Canvas{ovi.output_width,
|
||||
ovi.output_height,
|
||||
ovi.base_width,
|
||||
ovi.base_height,
|
||||
{ovi.fps_num, ovi.fps_den}});
|
||||
}
|
||||
|
||||
obs_audio_info2 oai2;
|
||||
|
||||
@@ -144,7 +144,7 @@ struct System {
|
||||
string name;
|
||||
int build;
|
||||
string release;
|
||||
int revision;
|
||||
string revision;
|
||||
int bits;
|
||||
bool arm;
|
||||
bool armEmulation;
|
||||
@@ -162,25 +162,30 @@ struct Capabilities {
|
||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(Capabilities, cpu, memory, gaming_features, system, gpu)
|
||||
};
|
||||
|
||||
struct Canvas {
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
uint32_t canvas_width;
|
||||
uint32_t canvas_height;
|
||||
media_frames_per_second framerate;
|
||||
|
||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(Canvas, width, height, canvas_width, canvas_height, framerate)
|
||||
};
|
||||
|
||||
struct Preferences {
|
||||
optional<uint64_t> maximum_aggregate_bitrate;
|
||||
optional<uint32_t> maximum_video_tracks;
|
||||
bool vod_track_audio;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
media_frames_per_second framerate;
|
||||
uint32_t canvas_width;
|
||||
uint32_t canvas_height;
|
||||
optional<uint32_t> composition_gpu_index;
|
||||
uint32_t audio_samples_per_sec;
|
||||
uint32_t audio_channels;
|
||||
uint32_t audio_max_buffering_ms;
|
||||
bool audio_fixed_buffering;
|
||||
std::vector<Canvas> canvases;
|
||||
|
||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(Preferences, maximum_aggregate_bitrate, maximum_video_tracks, vod_track_audio,
|
||||
width, height, framerate, canvas_width, canvas_height, composition_gpu_index,
|
||||
audio_samples_per_sec, audio_channels, audio_max_buffering_ms,
|
||||
audio_fixed_buffering)
|
||||
composition_gpu_index, audio_samples_per_sec, audio_channels,
|
||||
audio_max_buffering_ms, audio_fixed_buffering, canvases)
|
||||
};
|
||||
|
||||
struct PostData {
|
||||
@@ -244,9 +249,10 @@ struct VideoEncoderConfiguration {
|
||||
optional<video_range_type> range;
|
||||
optional<video_format> format;
|
||||
json settings;
|
||||
uint32_t canvas_index;
|
||||
|
||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT(VideoEncoderConfiguration, type, width, height, framerate,
|
||||
gpu_scale_type, colorspace, range, format, settings)
|
||||
gpu_scale_type, colorspace, range, format, settings, canvas_index)
|
||||
};
|
||||
|
||||
struct AudioEncoderConfiguration {
|
||||
|
||||
@@ -242,7 +242,7 @@ void system_info(GoLiveApi::Capabilities &capabilities)
|
||||
system_data.name = "Windows";
|
||||
system_data.build = ver.build;
|
||||
system_data.release = win_release_id;
|
||||
system_data.revision = ver.revis;
|
||||
system_data.revision = std::to_string(ver.revis);
|
||||
system_data.bits = is_64_bit_windows() ? 64 : 32;
|
||||
system_data.arm = is_arm64_windows();
|
||||
system_data.armEmulation = os_get_emulation_status();
|
||||
|
||||
Reference in New Issue
Block a user