Skip to content

Commit 7df8d30

Browse files
committed
Fix Mac build. Move the stream history settings.
1 parent 379e44b commit 7df8d30

File tree

4 files changed

+25
-24
lines changed

4 files changed

+25
-24
lines changed

SerialPrograms/Source/CommonFramework/GlobalSettingsPanel.cpp

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,26 @@ StreamHistoryOption::StreamHistoryOption()
5959
IS_BETA_VERSION
6060
)
6161
, DESCRIPTION(
62-
"Keep a record of this many seconds of video+audio. This will allow "
63-
"video capture for unexpected events.<br>"
64-
"<font color=\"orange\">Warning: The current implementation is inefficient "
65-
"and may write a lot of data to disk. "
66-
"This feature is still a work-in-progress."
62+
"Keep a record of the recent video+audio streams. This will allow video capture "
63+
"for unexpected events.<br><br>"
64+
"<font color=\"orange\">Warning: This feature is computationally expensive and "
65+
"will require a more powerful computer to run (especially for multi-Switch programs).<br>"
66+
"Furthermore, the current implementation is inefficient as it will write a lot "
67+
"of data to disk. This feature is still a work-in-progress."
6768
"</font>"
6869
)
69-
, VIDEO_HISTORY_SECONDS(
70-
"<b>Video History (seconds):</b><br>"
71-
"Keep this many seconds of video feed for video capture and debugging purposes.",
70+
, HISTORY_SECONDS(
71+
"<b>History (seconds):</b><br>"
72+
"Keep this many seconds of video and audio feed for video capture and debugging purposes.<br><br>"
73+
"<font color=\"orange\">Do not set this too large as it will consume a lot of memory and may exceed the "
74+
"attachment size limit for Discord notifications."
75+
"</font>",
7276
LockMode::UNLOCK_WHILE_RUNNING,
7377
30
7478
)
7579
{
7680
PA_ADD_STATIC(DESCRIPTION);
77-
PA_ADD_OPTION(VIDEO_HISTORY_SECONDS);
81+
PA_ADD_OPTION(HISTORY_SECONDS);
7882
}
7983

8084

@@ -265,6 +269,11 @@ GlobalSettings::GlobalSettings()
265269
PA_ADD_OPTION(ALL_STATS);
266270
PA_ADD_OPTION(WINDOW_SIZE);
267271
PA_ADD_OPTION(THEME);
272+
#if (QT_VERSION_MAJOR == 6) && (QT_VERSION_MINOR >= 8)
273+
PA_ADD_OPTION(STREAM_HISTORY);
274+
#else
275+
STREAM_HISTORY.set_enabled(false);
276+
#endif
268277
#ifdef PA_ENABLE_SLEEP_SUPPRESS
269278
PA_ADD_OPTION(SLEEP_SUPPRESS);
270279
#endif
@@ -292,11 +301,6 @@ GlobalSettings::GlobalSettings()
292301
#if QT_VERSION_MAJOR == 5
293302
PA_ADD_OPTION(ENABLE_FRAME_SCREENSHOTS);
294303
#endif
295-
#if (QT_VERSION_MAJOR == 6) && (QT_VERSION_MINOR >= 8)
296-
PA_ADD_OPTION(STREAM_HISTORY);
297-
#else
298-
STREAM_HISTORY.set_enabled(false);
299-
#endif
300304

301305
PA_ADD_OPTION(AUTO_RESET_AUDIO_SECONDS);
302306
PA_ADD_OPTION(AUTO_RESET_VIDEO_SECONDS);

SerialPrograms/Source/CommonFramework/GlobalSettingsPanel.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class StreamHistoryOption : public GroupOption{
5353
StreamHistoryOption();
5454

5555
StaticTextOption DESCRIPTION;
56-
SimpleIntegerOption<uint16_t> VIDEO_HISTORY_SECONDS;
56+
SimpleIntegerOption<uint16_t> HISTORY_SECONDS;
5757
};
5858

5959

@@ -95,6 +95,7 @@ class GlobalSettings : public BatchOption, private ConfigOption::Listener{
9595
ResolutionOption WINDOW_SIZE;
9696
ThemeSelectorOption THEME;
9797

98+
StreamHistoryOption STREAM_HISTORY;
9899
SleepSuppressOptions SLEEP_SUPPRESS;
99100

100101
SectionDividerOption m_discord_settings;
@@ -122,8 +123,6 @@ class GlobalSettings : public BatchOption, private ConfigOption::Listener{
122123
#if QT_VERSION_MAJOR == 5
123124
BooleanCheckBoxOption ENABLE_FRAME_SCREENSHOTS;
124125
#endif
125-
// SimpleIntegerOption<uint16_t> VIDEO_HISTORY_SECONDS;
126-
StreamHistoryOption STREAM_HISTORY;
127126

128127
SimpleIntegerOption<uint8_t> AUTO_RESET_AUDIO_SECONDS;
129128
SimpleIntegerOption<uint8_t> AUTO_RESET_VIDEO_SECONDS;

SerialPrograms/Source/CommonFramework/Recording/StreamHistorySession.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct StreamHistorySession::Data{
3838

3939
Data(Logger& logger)
4040
: m_logger(logger)
41-
, m_window(GlobalSettings::instance().STREAM_HISTORY.VIDEO_HISTORY_SECONDS)
41+
, m_window(GlobalSettings::instance().STREAM_HISTORY.HISTORY_SECONDS)
4242
, m_audio_format(AudioChannelFormat::NONE)
4343
{}
4444
};
@@ -62,9 +62,8 @@ void StreamHistorySession::start(AudioChannelFormat format){
6262

6363
class HistorySaverThread : public QThread{
6464
public:
65-
HistorySaverThread(Logger& logger, StreamHistoryTracker& tracker, const std::string& filename)
66-
: m_logger(logger)
67-
, m_tracker(tracker)
65+
HistorySaverThread(StreamHistoryTracker& tracker, const std::string& filename)
66+
: m_tracker(tracker)
6867
, m_filename(filename)
6968
{
7069
}
@@ -84,7 +83,6 @@ class HistorySaverThread : public QThread{
8483
}
8584

8685
private:
87-
Logger& m_logger;
8886
StreamHistoryTracker& m_tracker;
8987
const std::string& m_filename;
9088
bool m_success = false;
@@ -107,7 +105,7 @@ bool StreamHistorySession::save(const std::string& filename) const{
107105
}
108106

109107
// tracker->save(m_logger, filename);
110-
HistorySaverThread saver(data.m_logger, *tracker, filename);
108+
HistorySaverThread saver(*tracker, filename);
111109
return saver.save();
112110
}
113111
void StreamHistorySession::on_samples(const float* samples, size_t frames){

SerialPrograms/Source/CommonFramework/VideoPipeline/Backends/CameraWidgetQt6.5.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ CameraSession::CameraSession(Logger& logger, Resolution default_resolution)
116116
, m_last_frame_seqnum(0)
117117
, m_last_image_timestamp(WallClock::min())
118118
, m_stats_conversion("ConvertFrame", "ms", 1000, std::chrono::seconds(10))
119-
// , m_history(GlobalSettings::instance().VIDEO_HISTORY_SECONDS * 1000000)
119+
// , m_history(GlobalSettings::instance().HISTORY_SECONDS * 1000000)
120120
{
121121
uint8_t watchdog_timeout = GlobalSettings::instance().AUTO_RESET_VIDEO_SECONDS;
122122
if (watchdog_timeout != 0){

0 commit comments

Comments
 (0)