Add kick streaming option

This commit is contained in:
dec05eba
2026-01-18 16:22:49 +01:00
parent aa717a95ec
commit 40b2af5668
6 changed files with 28 additions and 2 deletions

2
TODO
View File

@@ -252,8 +252,6 @@ When running replay for a long time and then stopping it it takes a while. Impro
Make it possible to resize webcam box from top left, top right and bottom left as well.
Add kick streaming option (add /app at the end of the url).
The flatpak version can for some get stuck at shutdown when instant replay is running. It only happens in the flatpak version and only when instant replay is running and it happens always. Manual SIGINT on gsr-ui stops gsr-ui properly, so why does it fail when shutting down the computer when the systemd stop signal is SIGINT? Maybe its related to the flatpak version being launched through gsr-gtk. I cant personally reproduce it.
Redesign the UI to allow capturing multiple video sources. Move webcam to capture sources as well then. Maybe design the UI to work more like obs studio then, where you start recording and then add sources at capture time, with a preview.

View File

@@ -97,6 +97,11 @@ namespace gsr {
std::string stream_key;
};
struct KickStreamConfig {
std::string stream_url;
std::string stream_key;
};
struct CustomStreamConfig {
std::string url;
std::string key;
@@ -109,6 +114,7 @@ namespace gsr {
YoutubeStreamConfig youtube;
TwitchStreamConfig twitch;
RumbleStreamConfig rumble;
KickStreamConfig kick;
CustomStreamConfig custom;
ConfigHotkey start_stop_hotkey;
};

View File

@@ -206,6 +206,8 @@ namespace gsr {
Entry *twitch_stream_key_entry_ptr = nullptr;
Entry *youtube_stream_key_entry_ptr = nullptr;
Entry *rumble_stream_key_entry_ptr = nullptr;
Entry *kick_stream_url_entry_ptr = nullptr;
Entry *kick_stream_key_entry_ptr = nullptr;
Entry *stream_url_entry_ptr = nullptr;
Entry *stream_key_entry_ptr = nullptr;
Entry *replay_time_entry_ptr = nullptr;

View File

@@ -213,6 +213,8 @@ namespace gsr {
{"streaming.youtube.key", &config.streaming_config.youtube.stream_key},
{"streaming.twitch.key", &config.streaming_config.twitch.stream_key},
{"streaming.rumble.key", &config.streaming_config.rumble.stream_key},
{"streaming.kick.url", &config.streaming_config.kick.stream_url},
{"streaming.kick.key", &config.streaming_config.kick.stream_key},
{"streaming.custom.url", &config.streaming_config.custom.url},
{"streaming.custom.key", &config.streaming_config.custom.key},
{"streaming.custom.container", &config.streaming_config.custom.container},

View File

@@ -3146,6 +3146,7 @@ namespace gsr {
static std::string streaming_get_url(const Config &config) {
std::string url;
fprintf(stderr, "streaming service: %s\n", config.streaming_config.streaming_service.c_str());
if(config.streaming_config.streaming_service == "twitch") {
url += "rtmp://live.twitch.tv/app/";
url += config.streaming_config.twitch.stream_key;
@@ -3155,6 +3156,13 @@ namespace gsr {
} else if(config.streaming_config.streaming_service == "rumble") {
url += "rtmp://rtmp.rumble.com/live/";
url += config.streaming_config.rumble.stream_key;
} else if(config.streaming_config.streaming_service == "kick") {
fprintf(stderr, "kick: %s, %s\n", config.streaming_config.kick.stream_url.c_str(), config.streaming_config.kick.stream_key.c_str());
url += config.streaming_config.kick.stream_url;
if(!url.empty() && url.back() != '/')
url += "/";
url += "app/";
url += config.streaming_config.kick.stream_key;
} else if(config.streaming_config.streaming_service == "custom") {
url = config.streaming_config.custom.url;
if(url.size() >= 7 && strncmp(url.c_str(), "rtmp://", 7) == 0)

View File

@@ -1268,6 +1268,7 @@ namespace gsr {
streaming_service_box->add_item("Twitch", "twitch");
streaming_service_box->add_item("YouTube", "youtube");
streaming_service_box->add_item("Rumble", "rumble");
streaming_service_box->add_item("Kick", "kick");
streaming_service_box->add_item("Custom", "custom");
streaming_service_box_ptr = streaming_service_box.get();
return streaming_service_box;
@@ -1311,6 +1312,8 @@ namespace gsr {
twitch_stream_key_entry_ptr = add_stream_key_entry_to_list(stream_key_list.get());
youtube_stream_key_entry_ptr = add_stream_key_entry_to_list(stream_key_list.get());
rumble_stream_key_entry_ptr = add_stream_key_entry_to_list(stream_key_list.get());
kick_stream_url_entry_ptr = add_stream_key_entry_to_list(stream_key_list.get());
kick_stream_key_entry_ptr = add_stream_key_entry_to_list(stream_key_list.get());
stream_key_list_ptr = stream_key_list.get();
return stream_key_list;
@@ -1386,12 +1389,15 @@ namespace gsr {
const bool twitch_option = id == "twitch";
const bool youtube_option = id == "youtube";
const bool rumble_option = id == "rumble";
const bool kick_option = id == "kick";
const bool custom_option = id == "custom";
stream_key_list_ptr->set_visible(!custom_option);
custom_stream_list_ptr->set_visible(custom_option);
twitch_stream_key_entry_ptr->get_parent_widget()->set_visible(twitch_option);
youtube_stream_key_entry_ptr->get_parent_widget()->set_visible(youtube_option);
rumble_stream_key_entry_ptr->get_parent_widget()->set_visible(rumble_option);
kick_stream_url_entry_ptr->get_parent_widget()->set_visible(kick_option);
kick_stream_key_entry_ptr->get_parent_widget()->set_visible(kick_option);
return true;
};
streaming_service_box_ptr->on_selection_changed("Twitch", "twitch");
@@ -1603,6 +1609,8 @@ namespace gsr {
youtube_stream_key_entry_ptr->set_text(config.streaming_config.youtube.stream_key);
twitch_stream_key_entry_ptr->set_text(config.streaming_config.twitch.stream_key);
rumble_stream_key_entry_ptr->set_text(config.streaming_config.rumble.stream_key);
kick_stream_url_entry_ptr->set_text(config.streaming_config.kick.stream_url);
kick_stream_key_entry_ptr->set_text(config.streaming_config.kick.stream_key);
stream_url_entry_ptr->set_text(config.streaming_config.custom.url);
stream_key_entry_ptr->set_text(config.streaming_config.custom.key);
container_box_ptr->set_selected_item(config.streaming_config.custom.container);
@@ -1752,6 +1760,8 @@ namespace gsr {
config.streaming_config.youtube.stream_key = youtube_stream_key_entry_ptr->get_text();
config.streaming_config.twitch.stream_key = twitch_stream_key_entry_ptr->get_text();
config.streaming_config.rumble.stream_key = rumble_stream_key_entry_ptr->get_text();
config.streaming_config.kick.stream_url = kick_stream_url_entry_ptr->get_text();
config.streaming_config.kick.stream_key = kick_stream_key_entry_ptr->get_text();
config.streaming_config.custom.url = stream_url_entry_ptr->get_text();
config.streaming_config.custom.key = stream_key_entry_ptr->get_text();
config.streaming_config.custom.container = container_box_ptr->get_selected_id();