mirror of
https://github.com/morgan9e/UxPlay
synced 2026-04-14 00:04:13 +09:00
add -rc option to specify startup options file
This commit is contained in:
19
README.html
19
README.html
@@ -113,7 +113,8 @@ imposed by iOS.</p></li>
|
||||
best to use the option “uxplay -vsync no”.</p></li>
|
||||
<li><p>Add any UxPlay options you want to use as defaults to a startup
|
||||
file <code>~/.uxplayrc</code> (see “<code>man uxplay</code>” or
|
||||
“<code>uxplay -h</code>” for format and other possible locations). In
|
||||
“<code>uxplay -h</code>” for format and other possible locations; the
|
||||
location can also be set with “uxplay -rc <em>location</em>”). In
|
||||
particular, if your system uses PipeWire audio or Wayland video systems,
|
||||
you may wish to add “as pipewiresink” or “vs waylandsink” as defaults to
|
||||
the file. <em>(Output from terminal commands “ps waux | grep pulse” or
|
||||
@@ -135,8 +136,10 @@ uxplay.service. Then</p>
|
||||
start at the user’s first login and stop when they no longer have any
|
||||
open sessions. See
|
||||
https://www.baeldung.com/linux/systemd-create-user-services for more
|
||||
about systemd user services. <strong>Note: it is NOT recommended to run
|
||||
UxPlay as a root service.</strong></p></li>
|
||||
about systemd user services. If more than one user might simultaneously
|
||||
run uxplay this way, they should specify distinct -p and -m options
|
||||
(ports and deviceID) in their startup files. <strong>Note: it is NOT
|
||||
recommended to run UxPlay as a root service.</strong></p></li>
|
||||
<li><p>On Raspberry Pi: models using hardware h264 video decoding by the
|
||||
Broadcom GPU (models 4B and earlier) may require the uxplay option
|
||||
-bt709. If you use Ubuntu 22.10 or earlier, GStreamer must be <a
|
||||
@@ -422,8 +425,8 @@ the dns_sd library. OpenSSL is already installed as a System
|
||||
Library.</p></li>
|
||||
<li><p><strong>OpenBSD:</strong> (doas pkg_add) libplist
|
||||
gstreamer1-plugins-base. avahi-libs must also be installed to provide
|
||||
the dns_sd library. OpenSSL is already installed as a System
|
||||
Library.</p></li>
|
||||
the dns_sd library; (avahi-main must also be installed). OpenSSL is
|
||||
already installed as a System Library.</p></li>
|
||||
</ul>
|
||||
<h4 id="building-an-installable-rpm-package">Building an installable RPM
|
||||
package</h4>
|
||||
@@ -513,8 +516,7 @@ gstreamer1-plugins, gstreamer1-plugins-* (* = core, good, bad, x, gtk,
|
||||
gl, vulkan, pulse, v4l2, …), (+ gstreamer1-vaapi for Intel/AMD
|
||||
graphics).</p></li>
|
||||
<li><p><strong>OpenBSD:</strong> Install gstreamer1-libav,
|
||||
gstreamer-plugins-* (* = core, bad, base, good). avahi-main must also be
|
||||
installed for the avahi_daemon rc startup script.</p></li>
|
||||
gstreamer-plugins-* (* = core, bad, base, good).</p></li>
|
||||
</ul>
|
||||
<h3 id="starting-and-running-uxplay">Starting and running UxPlay</h3>
|
||||
<p>Since UxPlay-1.64, UxPlay can be started with options read from a
|
||||
@@ -1007,6 +1009,9 @@ or <code>~/.config/uxplayrc</code>); lines begining with
|
||||
“<code>#</code>” are treated as comments, and ignored. Command line
|
||||
options supersede options in the startup file.</li>
|
||||
</ul>
|
||||
<p><strong>-rc <em>file</em></strong> can also be used to specify the
|
||||
startup file location: this overrides <code>$UXPLAYRC</code>,
|
||||
<code>~/.uxplayrc</code>, etc.</p>
|
||||
<p><strong>-n server_name</strong> (Default: UxPlay);
|
||||
server_name@_hostname_ will be the name that appears offering AirPlay
|
||||
services to your iPad, iPhone etc, where <em>hostname</em> is the name
|
||||
|
||||
16
README.md
16
README.md
@@ -101,7 +101,8 @@ status](https://repology.org/badge/vertical-allrepos/uxplay.svg)](https://repolo
|
||||
|
||||
- Add any UxPlay options you want to use as defaults to a startup file
|
||||
`~/.uxplayrc` (see "`man uxplay`" or "`uxplay -h`" for format and
|
||||
other possible locations). In particular, if your system uses
|
||||
other possible locations; the location can also be set with "uxplay -rc _location_").
|
||||
In particular, if your system uses
|
||||
PipeWire audio or Wayland video systems, you may wish to add "as
|
||||
pipewiresink" or "vs waylandsink" as defaults to the file. *(Output
|
||||
from terminal commands "ps waux \| grep pulse" or "pactl info" will
|
||||
@@ -121,7 +122,9 @@ status](https://repology.org/badge/vertical-allrepos/uxplay.svg)](https://repolo
|
||||
can be used to control the daemon. If it is enabled, the daemon will start
|
||||
at the user's first login and stop when they no longer have any open sessions. See
|
||||
https://www.baeldung.com/linux/systemd-create-user-services for more about
|
||||
systemd user services. **Note: it is NOT recommended to run UxPlay as a root service.**
|
||||
systemd user services. If more than one user might simultaneously run uxplay this way, they should
|
||||
specify distinct -p and -m options (ports and deviceID) in their startup files.
|
||||
**Note: it is NOT recommended to run UxPlay as a root service.**
|
||||
|
||||
- On Raspberry Pi: models using hardware h264 video decoding by the
|
||||
Broadcom GPU (models 4B and earlier) may require the uxplay option -bt709.
|
||||
@@ -413,7 +416,8 @@ package](#building-an-installable-rpm-package).
|
||||
dns_sd library. OpenSSL is already installed as a System Library.
|
||||
|
||||
- **OpenBSD:** (doas pkg_add) libplist gstreamer1-plugins-base.
|
||||
avahi-libs must also be installed to provide the dns_sd library.
|
||||
avahi-libs must also be installed to provide the dns_sd library;
|
||||
(avahi-main must also be installed).
|
||||
OpenSSL is already installed as a System Library.
|
||||
|
||||
#### Building an installable RPM package
|
||||
@@ -498,8 +502,7 @@ repositories for those distributions.
|
||||
pulse, v4l2, ...), (+ gstreamer1-vaapi for Intel/AMD graphics).
|
||||
|
||||
- **OpenBSD:** Install gstreamer1-libav, gstreamer-plugins-\*
|
||||
(\* = core, bad, base, good). avahi-main must also be installed for
|
||||
the avahi_daemon rc startup script.
|
||||
(\* = core, bad, base, good).
|
||||
|
||||
### Starting and running UxPlay
|
||||
|
||||
@@ -995,6 +998,9 @@ Options:
|
||||
comments, and ignored. Command line options supersede options in the
|
||||
startup file.
|
||||
|
||||
**-rc _file_** can also be used to specify the startup file location: this
|
||||
overrides `$UXPLAYRC`, ``~/.uxplayrc``, etc.
|
||||
|
||||
**-n server_name** (Default: UxPlay); server_name@\_hostname\_ will be
|
||||
the name that appears offering AirPlay services to your iPad, iPhone
|
||||
etc, where *hostname* is the name of the server running uxplay. This
|
||||
|
||||
28
README.txt
28
README.txt
@@ -108,11 +108,12 @@ status](https://repology.org/badge/vertical-allrepos/uxplay.svg)](https://repolo
|
||||
|
||||
- Add any UxPlay options you want to use as defaults to a startup file
|
||||
`~/.uxplayrc` (see "`man uxplay`" or "`uxplay -h`" for format and
|
||||
other possible locations). In particular, if your system uses
|
||||
PipeWire audio or Wayland video systems, you may wish to add "as
|
||||
pipewiresink" or "vs waylandsink" as defaults to the file. *(Output
|
||||
from terminal commands "ps waux \| grep pulse" or "pactl info" will
|
||||
contain "pipewire" if your Linux/BSD system uses it).*
|
||||
other possible locations; the location can also be set with "uxplay
|
||||
-rc *location*"). In particular, if your system uses PipeWire audio
|
||||
or Wayland video systems, you may wish to add "as pipewiresink" or
|
||||
"vs waylandsink" as defaults to the file. *(Output from terminal
|
||||
commands "ps waux \| grep pulse" or "pactl info" will contain
|
||||
"pipewire" if your Linux/BSD system uses it).*
|
||||
|
||||
- For Linux systems using systemd, there is a **systemd** service file
|
||||
**uxplay.service** found in the UxPlay top directory of the
|
||||
@@ -131,8 +132,10 @@ status](https://repology.org/badge/vertical-allrepos/uxplay.svg)](https://repolo
|
||||
start at the user's first login and stop when they no longer have
|
||||
any open sessions. See
|
||||
https://www.baeldung.com/linux/systemd-create-user-services for more
|
||||
about systemd user services. **Note: it is NOT recommended to run
|
||||
UxPlay as a root service.**
|
||||
about systemd user services. If more than one user might
|
||||
simultaneously run uxplay this way, they should specify distinct -p
|
||||
and -m options (ports and deviceID) in their startup files. **Note:
|
||||
it is NOT recommended to run UxPlay as a root service.**
|
||||
|
||||
- On Raspberry Pi: models using hardware h264 video decoding by the
|
||||
Broadcom GPU (models 4B and earlier) may require the uxplay option
|
||||
@@ -426,8 +429,9 @@ package](#building-an-installable-rpm-package).
|
||||
dns_sd library. OpenSSL is already installed as a System Library.
|
||||
|
||||
- **OpenBSD:** (doas pkg_add) libplist gstreamer1-plugins-base.
|
||||
avahi-libs must also be installed to provide the dns_sd library.
|
||||
OpenSSL is already installed as a System Library.
|
||||
avahi-libs must also be installed to provide the dns_sd library;
|
||||
(avahi-main must also be installed). OpenSSL is already installed as
|
||||
a System Library.
|
||||
|
||||
#### Building an installable RPM package
|
||||
|
||||
@@ -511,8 +515,7 @@ repositories for those distributions.
|
||||
pulse, v4l2, ...), (+ gstreamer1-vaapi for Intel/AMD graphics).
|
||||
|
||||
- **OpenBSD:** Install gstreamer1-libav, gstreamer-plugins-\* (\* =
|
||||
core, bad, base, good). avahi-main must also be installed for the
|
||||
avahi_daemon rc startup script.
|
||||
core, bad, base, good).
|
||||
|
||||
### Starting and running UxPlay
|
||||
|
||||
@@ -1019,6 +1022,9 @@ Options:
|
||||
comments, and ignored. Command line options supersede options in the
|
||||
startup file.
|
||||
|
||||
**-rc *file*** can also be used to specify the startup file location:
|
||||
this overrides `$UXPLAYRC`, `~/.uxplayrc`, etc.
|
||||
|
||||
**-n server_name** (Default: UxPlay); server_name@\_hostname\_ will be
|
||||
the name that appears offering AirPlay services to your iPad, iPhone
|
||||
etc, where *hostname* is the name of the server running uxplay. This
|
||||
|
||||
2
uxplay.1
2
uxplay.1
@@ -181,6 +181,8 @@ UxPlay 1.72: An open\-source AirPlay mirroring (+ audio streaming) server:
|
||||
\fB\-v\fR Displays version information
|
||||
.TP
|
||||
\fB\-h\fR Displays help information
|
||||
.TP
|
||||
\fB\-rc\fI fn\fR Read startup options from file "fn" instead of ~/.uxplayrc, etc
|
||||
.SH
|
||||
FILES
|
||||
Options in one of $UXPLAYRC, or ~/.uxplayrc, or ~/.config/uxplayrc
|
||||
|
||||
29
uxplay.cpp
29
uxplay.cpp
@@ -741,6 +741,7 @@ static void print_info (char *name) {
|
||||
printf("-d [n] Enable debug logging; optional: n=1 to skip normal packet data\n");
|
||||
printf("-v Displays version information\n");
|
||||
printf("-h Displays this help\n");
|
||||
printf("-rc fn Read startup options from file \"fn\" instead of ~/.uxplayrc, etc\n");
|
||||
printf("Startup options in $UXPLAYRC, ~/.uxplayrc, or ~/.config/uxplayrc are\n");
|
||||
printf("applied first (command-line options may modify them): format is one \n");
|
||||
printf("option per line, no initial \"-\"; lines starting with \"#\" are ignored.\n");
|
||||
@@ -882,7 +883,9 @@ static void parse_arguments (int argc, char *argv[]) {
|
||||
// Parse arguments
|
||||
for (int i = 1; i < argc; i++) {
|
||||
std::string arg(argv[i]);
|
||||
if (arg == "-allow") {
|
||||
if (arg == "-rc") {
|
||||
i++; //specifies startup file: has already been processed
|
||||
} else if (arg == "-allow") {
|
||||
if (!option_has_value(i, argc, arg, argv[i+1])) exit(1);
|
||||
i++;
|
||||
allowed_clients.push_back(argv[i]);
|
||||
@@ -2310,7 +2313,29 @@ int main (int argc, char *argv[]) {
|
||||
if (!getenv("AVAHI_COMPAT_NOWARN")) putenv(avahi_compat_nowarn);
|
||||
#endif
|
||||
|
||||
config_file = find_uxplay_config_file();
|
||||
char *rcfile = NULL;
|
||||
/* see if option -rc was given */
|
||||
for (int i = 1; i < argc ; i++) {
|
||||
std::string arg(argv[i]);
|
||||
if (arg == "-rc") {
|
||||
struct stat sb;
|
||||
if (i+1 == argc) {
|
||||
LOGE ("option -rc requires a filename (-rc <filename>)");
|
||||
exit(1);
|
||||
}
|
||||
rcfile = argv[i+1];
|
||||
if (stat(rcfile, &sb) == -1) {
|
||||
LOGE("startup file %s specified by option -rc was not found", rcfile);
|
||||
exit(0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (rcfile) {
|
||||
config_file = rcfile;
|
||||
} else {
|
||||
config_file = find_uxplay_config_file();
|
||||
}
|
||||
if (config_file.length()) {
|
||||
read_config_file(config_file.c_str(), argv[0]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user