UxPlay 1.37 : append @hostname to AirPlay server name

This commit is contained in:
fduncanh
2021-09-29 19:06:28 -04:00
parent f8639656f3
commit 24f9b46b23
2 changed files with 16 additions and 12 deletions

View File

@@ -1,4 +1,4 @@
# UxPlay 1.36
# UxPlay 1.37
This project is a GPLv3 unix AirPlay server which now also works on macOS.
Its main use is to act like an AppleTV for screen-mirroring (with audio) of iOS/macOS clients
@@ -16,7 +16,7 @@ _Note: UxPlay currently only uses the AirPlay screen-mirroring protocol
(not the AirPlay audio-only streaming protocol)
but the **-vs 0** option streams audio without displaying the client's screen._
UxPlay 1.36 is based on https://github.com/FD-/RPiPlay, with GStreamer integration from
UxPlay 1.37 is based on https://github.com/FD-/RPiPlay, with GStreamer integration from
https://github.com/antimof/UxPlay.
(UxPlay only uses GStreamer, and does not contain the alternative Raspberry-Pi-specific
audio and video renderers also found in RPiPlay.)
@@ -186,10 +186,9 @@ has chosen for you. Maybe an unusual videosink was chosen. Fix: use the -vs op
Options:
**-n server_name**; server_name will be the name that appears offering
AirPlay services to your iPad, iPhone etc.
**NEW**: this will also now be the name shown above the mirror display (X11) window,
If this option is not used, the hostname of the server will be used as the server name.
**-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 will also now be the name shown above the mirror display (X11) window.
**-s wxh** (e.g. -s 1920x1080 , which is the default ) sets the display resolution (width and height,
in pixels). (This may be a
@@ -272,6 +271,9 @@ Also: image transforms that had been added to RPiPlay have been ported to UxPlay
# ChangeLog
1.37 2012-09-29 Append "@hostname" to AirPlay Server name, where "hostname" is the name of the
server running uxplay (reworked change in 1.36).
1.36 2012-09-29 Implemented suggestion (by @mrbesen and @PetrusZ) to use hostname of machine
runing uxplay as the default server name

View File

@@ -277,17 +277,18 @@ static bool get_videorotate (const char *str, videoflip_t *videoflip) {
return true;
}
static void get_name(std::string &server_name) {
static void append_hostname(std::string &server_name) {
struct utsname buf;
if (!uname(&buf)) {
server_name = buf.nodename;
} else {
server_name = DEFAULT_NAME;
std::string name = server_name;
name.append("@");
name.append(buf.nodename);
server_name = name;
}
}
int main (int argc, char *argv[]) {
std::string server_name;
std::string server_name = DEFAULT_NAME;
std::vector<char> server_hw_addr;
bool use_audio = true;
bool use_random_hw_addr = false;
@@ -303,7 +304,6 @@ int main (int argc, char *argv[]) {
if (!getenv("AVAHI_COMPAT_NOWARN")) putenv(avahi_compat_nowarn);
#endif
get_name(server_name);
// Parse arguments
for (int i = 1; i < argc; i++) {
@@ -396,6 +396,8 @@ int main (int argc, char *argv[]) {
parse_hw_addr(mac_address, server_hw_addr);
mac_address.clear();
append_hostname(server_name);
relaunch:
connections_stopped = false;
if (start_server(server_hw_addr, server_name, display, tcp, udp,