Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ OPTION(BUILD_ENABLE_DEBUG "Enable Debug" ON )
OPTION(RELY_UDEV "Rely in udev tag to select device" OFF )
OPTION(BUILD_TESTS "Enable TEST" ON )
OPTION(BUILD_ENABLE_CPPCHECK "Enable CPPCheck static analysis" OFF )
SET(IP_BINARY "/bin/ip" CACHE STRING "Path to ip binary")

if(BUILD_ENABLE_DEBUG)
add_definitions(-DBUILD_ENABLE_DEBUG)
Expand Down
2 changes: 1 addition & 1 deletion COPYING
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This software was written by:
This software is licensed under the terms of the LGPL. Please see each source
file for the related copyright notice and license.

If a file does not contain a copright notice, the following notice shall apply:
If a file does not contain a copyright notice, the following notice shall apply:

MiracleCast - Wifi-Display/Miracast Implementation

Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

The MiracleCast project provides software to connect external monitors to your system via Wi-Fi. It is compatible to the Wifi-Display specification also known as Miracast. MiracleCast implements the Display-Source as well as Display-Sink side.

The Display-Source side allows you to connect external displays to your system and stream local content to the device. A lot of effort is put into making this as easy as connecting external displays via HDMI. *Note: This is not implemented yet. Please see [#4](./issues/4)*
The Display-Source side allows you to connect external displays to your system and stream local content to the device. A lot of effort is put into making this as easy as connecting external displays via HDMI. *Note: This is not implemented yet. Please see [#4](../../issues/4).*

On the other hand, the Display-Sink side allows you to create wifi-capable external displays yourself. You can use it on your embedded devices or even on full desktops to allow other systems to use your device as external display.

Expand All @@ -21,13 +21,15 @@ The MiracleCast projects requires the following software to be installed:
- **glib**: A utility library. Used by the current DHCP implementation. Will be removed once sd-dns gains DHCP-server capabilities.
*required*: ~=glib2-2.38 (might work with older releases, untested..)

- **check**: Test-suite for C programs. Used for optional tests of the MiracleCast code base.
*optional*: ~=check-0.9.11 (might work with older releases, untested..)

- **gstreamer**: MiracleCast rely on gstreamer to show cast its output. You can test if all needed is installed launching [res/test-viewer.sh](https://github.com/albfan/miraclecast/blob/master/res/test-viewer.sh)

- **wpa_supplicant**: MiracleCast spawns wpa_supplicant with a custom config.

- **P2P Wi-Fi device** Although widespread these days, there are some devices not compatible with [Wi-Fi Direct](http://en.wikipedia.org/wiki/Wi-Fi_Direct) (prior know as Wi-Fi P2P). Test yours with [res/test-hardware-capabilities.sh](https://github.com/albfan/miraclecast/blob/master/res/test-hardware-capabilities.sh)

- **check**: Test-suite for C programs. Used for optional tests of the MiracleCast code base.
*optional*: ~=check-0.9.11 (might work with older releases, untested..)

- copy the dbus policy **res/org.freedesktop.miracle.conf** to `/etc/dbus-1/system.d/`

## Build and install
Expand Down
4 changes: 0 additions & 4 deletions autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,18 @@ if [ "x$1" = "xc" ]; then
shift
args="$args $@"
$topdir/configure CFLAGS='-g -O0 -ftrapv' $args
make clean
elif [ "x$1" = "xg" ]; then
shift
args="$args $@"
$topdir/configure CFLAGS='-g -O0 -ftrapv' $args
make clean
elif [ "x$1" = "xa" ]; then
shift
args="$args $@"
$topdir/configure CFLAGS='-g -O0 -Wsuggest-attribute=pure -Wsuggest-attribute=const -ftrapv' $args
make clean
elif [ "x$1" = "xl" ]; then
shift
args="$args $@"
$topdir/configure CC=clang CFLAGS='-g -O0 -ftrapv' $args
make clean
elif [ "x$1" = "xs" ]; then
shift
args="$args $@"
Expand Down
2 changes: 2 additions & 0 deletions config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#define CONFIG_H

#cmakedefine BUILD_BINDIR "@BUILD_BINDIR@"
#cmakedefine RELY_UDEV @RELY_UDEV@
#cmakedefine IP_BINARY @IP_BINARY@

#cmakedefine PACKAGE_STRING "@PACKAGE_STRING@"

Expand Down
14 changes: 12 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ AC_ARG_ENABLE([rely-udev],
AS_HELP_STRING([--enable-rely-udev], [Use tagged device with miraclecast]), AC_DEFINE([RELY_UDEV], [], [Rely on udev to find miraclecast device]))
AC_ARG_ENABLE([log-debug],
AS_HELP_STRING([--disable-log-debug], [Disable log debug]), , AC_DEFINE([BUILD_ENABLE_DEBUG], [], [Enable debug log level]))
AC_ARG_VAR(IP_BINARY, [Path for ip binary])
if test -z "$IP_BINARY"; then
IP_BINARY=/bin/ip
fi
AC_DEFINE_UNQUOTED([IP_BINARY], [$IP_BINARY], [Path for ip binary])

#
# Mandatory dependencies
#
Expand Down Expand Up @@ -165,13 +171,15 @@ AC_MSG_NOTICE([Build configuration:
bindir: $bindir
libdir: $libdir
includedir: $includedir
sysconfdir: $sysconfdir
ip-binary: $IP_BINARY

Miscellaneous Options:
building tests: $have_check
code coverage: $use_gcov
rely udev: ${enable_rely_udev:-no}

Compilation
mkdir build && cd build
"${MAKE-make}" to start compilation process
"${MAKE-make}" check to pass test])
else
Expand All @@ -181,11 +189,13 @@ AC_MSG_NOTICE([Build configuration:
bindir: $bindir
libdir: $libdir
includedir: $includedir
sysconfdir: $sysconfdir
ip-binary: $IP_BINARY

Miscellaneous Options:
building tests: $have_check
rely udev: ${enable_rely_udev:-no}

Compilation
mkdir build && cd build
"${MAKE-make}" to start compilation process])
fi
2 changes: 2 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ if get_option('rely-udev')
add_project_arguments('-DRELY_UDEV', language: 'c')
endif

add_project_arguments('-DIP_BINARY='+get_option('ip-binary'), language: 'c')

glib2 = dependency('glib-2.0')
udev = dependency('libudev')
libsystemd = dependency('libsystemd')
Expand Down
4 changes: 4 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ option('build-tests',
type: 'boolean',
value: true,
description: 'Enable TEST')
option('ip-binary',
type: 'string',
value: '/bin/ip',
description: 'Path for ip binary')
2 changes: 1 addition & 1 deletion res/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ install_data('miracle-gst', 'gstplayer', 'uibc-viewer',

install_data(
'miracle-wifid', 'miracle-sinkctl', 'miracle-wifictl',
install_dir: join_paths(get_option('datadir'), 'bash-completions', 'completions')
install_dir: join_paths(get_option('datadir'), 'bash-completion', 'completions')
)
76 changes: 42 additions & 34 deletions res/miraclecast.spec
Original file line number Diff line number Diff line change
@@ -1,60 +1,68 @@
%global commit c3c868e523f450ad4f0d77f5484a3b61f08120b7
%global commit 264a222d242734da369ca287aa6cfc6ca4f1f7bf
%global shortcommit %(c=%{commit}; echo ${c:0:7})

Name: miraclecast
Version: 1.0
Release: 1.git%{shortcommit}%{?dist}
Summary: Connect external monitors to your system via Wifi-Display
License: LGPL
Release: 2.git%{shortcommit}%{?dist}
Summary: Connect external monitors to your system via Wi-Fi Display (miracast)
License: LGPLv2
URL: https://github.com/albfan/miraclecast
Source0: https://github.com/albfan/miraclecast/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
BuildRequires: autoconf, automake, libtool
BuildRequires: readline-devel, glib2-devel, systemd-devel

%description
The MiracleCast project provides software to connect external monitors to your system via Wi-Fi. It is compatible to the Wifi-Display specification also known as Miracast. MiracleCast implements the Display-Source as well as Display-Sink side.
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool

The Display-Source side allows you to connect external displays to your system and stream local content to the device. A lot of effort is put into making this as easy as connecting external displays via HDMI.
BuildRequires: glib2-devel
BuildRequires: readline-devel
BuildRequires: systemd-devel

On the other hand, the Display-Sink side allows you to create wifi-capable external displays yourself. You can use it on your embedded devices or even on full desktops to allow other systems to use your device as external display.
# "Recommends" is stronger than "Suggests", and gets installed by default by DNF.

# for gstplayer
Recommends: python3-gobject-base

%prep
%autosetup -n %{name}-%{shortcommit}
# for miracle-gst (/usr/bin/gst-launch-1.0)
Suggests: gstreamer

# for miracle-omxplayer
Suggests: omxplayer

%description
The MiracleCast project provides software to connect external monitors to your
system via Wi-Fi. It is compatible to the Wi-Fi Display specification also
known as Miracast. MiracleCast implements the Display-Source as well as
Display-Sink side.

The Display-Source side allows you to connect external displays to your system
and stream local content to the device. A lot of effort is put into making
this as easy as connecting external displays via HDMI.

On the other hand, the Display-Sink side allows you to create Wi-Fi capable
external displays yourself. You can use it on your embedded devices or even on
full desktops to allow other systems to use your device as external display.

%prep
%autosetup -n %{name}-%{commit}

%build
mkdir build
cd build
../autogen.sh g --prefix=%{_prefix}
autoreconf -fiv
%configure
%make_build


%install
rm -rf $RPM_BUILD_ROOT
cd build
%make_install


%files
%license COPYING LICENSE_gdhcp LICENSE_htable LICENSE_lgpl
%doc README.md
%{_sysconfdir}/dbus-1/system.d/org.freedesktop.miracle.conf
%{_bindir}/miracle-wifictl
%{_bindir}/miracle-omxplayer
%{_bindir}/miracle-gst
%{_bindir}/miracle-sinkctl
%{_bindir}/miracled
%{_bindir}/miracle-dhcp
%{_bindir}/miracle-uibcctl
%{_bindir}/miracle-wifid
%{_bindir}/gstplayer
%{_bindir}/uibc-viewer
%{_datadir}/bash-completion/completions/miracle-wifictl
%{_datadir}/bash-completion/completions/miracle-sinkctl
%{_datadir}/bash-completion/completions/miracle-wifid

%config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.miracle.conf
%{_bindir}/*
%{_datadir}/bash-completion/completions/*

%changelog
* Wed Jan 05 2022 Korenberg Mark
- Fix .spec-file, bump version

* Wed Nov 21 2018 Graham White
- first build
2 changes: 1 addition & 1 deletion res/normal-wifi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ETHER_COUNT=$(echo "$ETHER_NAMES" | wc -l)

if [ 0 = $ETHER_COUNT ]
then
echo There is no net devices avaliable
echo There is no net devices available
exit 1
elif [ 1 = $ETHER_COUNT ]
then
Expand Down
18 changes: 18 additions & 0 deletions res/sinkctl.protocol-extension.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#Example of extra parameters to extend sink request

[sinkctl]
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=LPCM 00000003 00, 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=input_category_list=GENERIC, HIDC;generic_cap_list=Keyboard;hidc_cap_list=Keyboard/USB, Mouse/USB, MultiTouch/USB, Gesture/USB, RemoteControl/USB;port=none
2 changes: 1 addition & 1 deletion res/write-udev-rule.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ETHER_COUNT=$(echo "$ETHER_NAMES" | wc -l)

if [ 0 = $ETHER_COUNT ]
then
echo There is no net devices avaliable
echo There is no net devices available
exit 1
elif [ 1 = $ETHER_COUNT ]
then
Expand Down
Loading