diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..26881e6 --- /dev/null +++ b/install.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +apt install cmake libglib2.0-dev libudev-dev libsystemd-dev libreadline-dev check libtool -y + +apt install gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-tools -y + +mkdir build +cd build +cmake -DCMAKE_INSTALL_PREFIX=/usr .. +make +make install + +cd .. + +echo "-- Installing: /root/.miraclecast" +cp res/.miraclecast /root/ + +echo "-- Installing: /usr/bin/run-vlc.sh" +cp res/run-vlc.sh /usr/bin/ + +echo "-- Installing: /etc/systemd/system/miracle-wifid.service" +cp systemd/system/miracle-wifid.service /etc/systemd/system/ + +echo "-- Installing: /etc/systemd/system/miracle-sink.service" +cp systemd/system/miracle-sink.service /etc/systemd/system/ \ No newline at end of file diff --git a/res/.miraclecast b/res/.miraclecast new file mode 100644 index 0000000..3931d25 --- /dev/null +++ b/res/.miraclecast @@ -0,0 +1,17 @@ +[sinkctl] +external-player=1 +#extends.wfd_video_formats=40 00 01 10 0001bdeb 051557ff 00000fff 10 0000 001f 11 0780 0438, 02 10 0001bdeb 155557ff 00000fff 10 0000 001f 11 0780 0438 +extends.wfd_audio_codecs=AAC 0000000f 00, AC3 00000007 00 +#extends.wfd_display_edid=0001 00ffffffffffff0051f38f50010000000e100104a51d10ff2f0000a057499b2610484f000000010101010101010101010101010101011a36809c70381f403020350025a510000018000000fc00496e7465726e616c204c43440a000000fd003c3c9a9a0e00000000000000000000000000000000000000000000000000000030 +extends.wfd_connector_type=05 +extends.microsoft_cursor=none +extends.microsoft_rtcp_capability=none +extends.wfd_idr_request_capability=1 +extends.microsoft_latency_management_capability=none +extends.microsoft_format_change_capability=none +extends.microsoft_diagnostics_capability=none +extends.intel_friendly_name=miraclecast +extends.intel_sink_manufacturer_name=GNU Linux +extends.intel_sink_model_name=Arch linux +extends.intel_sink_device_URL=http://github.com/albfan/miraclecast +extends.wfd_uibc_capability=none \ No newline at end of file diff --git a/res/run-vlc.sh b/res/run-vlc.sh index b43ed46..19735ad 100755 --- a/res/run-vlc.sh +++ b/res/run-vlc.sh @@ -1,2 +1,4 @@ +#!/bin/bash + export DISPLAY=:0 && su -c "cvlc --no-osd --no-video-title-show --network-caching=200 rtp://@:7236" letsving #export DISPLAY=:0 && su -c "cvlc --no-osd --no-video-title-show --network-caching=200 --no-ts-trust-pcr --h264-fps=23 rtp://@:7236" letsving diff --git a/systemd/system/miracle-sink.service b/systemd/system/miracle-sink.service index 5075600..ffc6d2a 100644 --- a/systemd/system/miracle-sink.service +++ b/systemd/system/miracle-sink.service @@ -1,11 +1,11 @@ [Unit] Description=Miraclecast sink on default link Before=network.target -After=miracle-wifid.service +Requires=miracle-wifid.service [Service] Type=simple -ExecStart=/usr/bin/miracle-sinkctl +ExecStart=/usr/bin/miracle-sinkctl -- set-friendly-name VingMiracle Restart=always User=root diff --git a/systemd/system/miracle-wifid.service b/systemd/system/miracle-wifid.service index f47819d..455c830 100644 --- a/systemd/system/miracle-wifid.service +++ b/systemd/system/miracle-wifid.service @@ -1,11 +1,15 @@ [Unit] Description=wpa_supplicant with Miracast support Before=network.target -After=dbus.service +After=dbus.socket [Service] Type=simple +ExecStartPre=/usr/bin/systemctl stop ap.service +ExecStartPre=/usr/bin/systemctl stop NetworkManager.service ExecStart=/usr/bin/miracle-wifid +ExecStopPost=/usr/bin/systemctl start NetworkManager.service +ExecStopPost=/usr/bin/systemctl start ap.service Restart=always User=root