The path to file_apps is now configurable
This commit is contained in:
@@ -12,11 +12,14 @@
|
|||||||
unique_id = 03904e64-51da-4fb3-9afd-a9f7ff70fea4
|
unique_id = 03904e64-51da-4fb3-9afd-a9f7ff70fea4
|
||||||
|
|
||||||
# The file where info on paired devices is stored
|
# The file where info on paired devices is stored
|
||||||
file_devices = devices.json
|
# file_devices = devices.json
|
||||||
|
|
||||||
# How long to wait in milliseconds for data from moonlight before shutting down the stream
|
# How long to wait in milliseconds for data from moonlight before shutting down the stream
|
||||||
ping_timeout = 2000
|
ping_timeout = 2000
|
||||||
|
|
||||||
|
# The file where configuration for the different applications that Sunshine can run during a stream
|
||||||
|
# file_apps = apps.json
|
||||||
|
|
||||||
# How much error correcting packets must be send for every video max_b_frames
|
# How much error correcting packets must be send for every video max_b_frames
|
||||||
# This is just some random number, don't know the optimal value
|
# This is just some random number, don't know the optimal value
|
||||||
# The higher fec_percentage, the lower space for the actual data to send per frame there is
|
# The higher fec_percentage, the lower space for the actual data to send per frame there is
|
||||||
|
|||||||
+5
-2
@@ -11,7 +11,7 @@
|
|||||||
#define PRIVATE_KEY_FILE CA_DIR "/cakey.pem"
|
#define PRIVATE_KEY_FILE CA_DIR "/cakey.pem"
|
||||||
#define CERTIFICATE_FILE CA_DIR "/cacert.pem"
|
#define CERTIFICATE_FILE CA_DIR "/cacert.pem"
|
||||||
|
|
||||||
|
#define APPS_JSON SUNSHINE_ASSETS_DIR "/apps.json"
|
||||||
namespace config {
|
namespace config {
|
||||||
using namespace std::literals;
|
using namespace std::literals;
|
||||||
video_t video {
|
video_t video {
|
||||||
@@ -29,6 +29,9 @@ video_t video {
|
|||||||
|
|
||||||
stream_t stream {
|
stream_t stream {
|
||||||
2s, // ping_timeout
|
2s, // ping_timeout
|
||||||
|
|
||||||
|
APPS_JSON,
|
||||||
|
|
||||||
13 // fecPercentage
|
13 // fecPercentage
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -138,7 +141,7 @@ void parse_file(const char *file) {
|
|||||||
if(to > 0) {
|
if(to > 0) {
|
||||||
stream.ping_timeout = std::chrono::milliseconds(to);
|
stream.ping_timeout = std::chrono::milliseconds(to);
|
||||||
}
|
}
|
||||||
|
string_f(vars, "file_apps", stream.file_apps);
|
||||||
int_f(vars, "fec_percentage", stream.fec_percentage);
|
int_f(vars, "fec_percentage", stream.fec_percentage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ struct video_t {
|
|||||||
struct stream_t {
|
struct stream_t {
|
||||||
std::chrono::milliseconds ping_timeout;
|
std::chrono::milliseconds ping_timeout;
|
||||||
|
|
||||||
|
std::string file_apps;
|
||||||
|
|
||||||
int fec_percentage;
|
int fec_percentage;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -26,7 +26,7 @@ int main(int argc, char *argv[]) {
|
|||||||
config::parse_file(argv[1]);
|
config::parse_file(argv[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto proc_opt = proc::parse(SUNSHINE_ASSETS_DIR "/apps.json");
|
auto proc_opt = proc::parse(config::stream.file_apps);
|
||||||
if(!proc_opt) {
|
if(!proc_opt) {
|
||||||
return 7;
|
return 7;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user