-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(main): move remaining entry related code #2127
refactor(main): move remaining entry related code #2127
Conversation
char **argv; | ||
std::atomic_int desired_exit_code; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static
was removed from these, as it wouldn't compile.
a82200a
to
eb78805
Compare
eb78805
to
ba2906b
Compare
{ "creds"sv, args::creds }, | ||
{ "help"sv, args::help }, | ||
{ "version"sv, args::version }, | ||
#ifdef _WIN32 | ||
{ "restore-nvprefs-undo"sv, restore_nvprefs_undo::entry }, | ||
{ "restore-nvprefs-undo"sv, args::restore_nvprefs_undo }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored CLI args into one namepsace.
This comment was marked as resolved.
This comment was marked as resolved.
c00d53c
to
5310c7d
Compare
src/stream.cpp
Outdated
@@ -18,14 +18,16 @@ extern "C" { | |||
} | |||
|
|||
#include "config.h" | |||
#include "entry_handler.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What entry handler functions are these (stream.cpp, rtsp.cpp, etc) using?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me double check... it might have been from before I created the globals
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's a table of the files I added entry_handler
to. I'll remove it from the ones without a check.
source file | nv_prefs_instance | lifetime | service_ctlr | launch_ui | launch_ui_with_path | |
---|---|---|---|---|---|---|
src/audio.cpp | ✅ | |||||
src/config.cpp | ✅ | ✅ | ||||
src/confighttp.cpp | ✅ | |||||
src/input.cpp | ||||||
src/nvhttp.cpp | ✅ | |||||
src/platform/linux/audio.cpp | ||||||
src/platform/linux/misc.cpp | ✅ | |||||
src/platform/linux/x11grab.cpp | ||||||
src/platform/macos/misc.mm | ✅ | |||||
src/platform/windows/input.cpp | ||||||
src/platform/windows/misc.cpp | ✅ | ✅ | ||||
src/rtsp.cpp | ✅ | |||||
src/stream.cpp | ||||||
src/system_tray.cpp | ✅ | ✅ | ✅ | |||
src/upnp.cpp | ✅ | |||||
src/video.cpp |
src/platform/linux/audio.cpp
gives the following errors without entry_handler.h
:
- No type named 'thread' in namespace 'std'; did you mean 'boost::thread'?: 201
- No member named 'thread' in namespace 'std': 238
- Expected ';' after expression: 238
- Expected ';' after expression: 239
Probably a better fix than inclduing entry_handler.h
exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solved audio.cpp by including <thread>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think moving the whole mail
namespace into globals.cpp/h
would clean things up nicely. It's a process-wide communication mechanism, so I think it makes sense for it to live with other global state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. I'll work on that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in a71d3b6
There was no mail
in entry_handler.cpp
, only in the header.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a few more tweaks, but I think this is ready now.
- moved
nvprefs_instance
toglobals
- added/updated some documentation blocks in
globals.cpp
andentry_handler.cpp
- changed the input validation of the
creds
arg to the just use thehelp
function within theargs
namespace
e7faeb5
to
a71d3b6
Compare
5a95c69
to
dc2d416
Compare
Description
This PR moves remaining entry point related code out of main. I wasn't sure of a better way to separate this.
Screenshot
Issues Fixed or Closed
Type of Change
.github/...
)Checklist
Branch Updates
LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.