Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
opdenkamp committed Apr 27, 2020
2 parents d54093a + 1167779 commit 47cbcc2
Show file tree
Hide file tree
Showing 134 changed files with 6,186 additions and 1,640 deletions.
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
*.aps
env.h
version.h
.vs

*.rc
AssemblyInfo.cs
AssemblyInfo.cpp

Expand Down Expand Up @@ -73,15 +73,13 @@ project/obj
project/Properties
project/_*
project/x64
project/LibCecSharp/x64
project/LibCecSharp/Debug
project/LibCecSharp/Release
project/libcec/x64
project/libcec/Debug
project/libcec/Release
project/testclient/x64
project/testclient/Debug
project/testclient/Release
project/nsis/libcec-version.nsh

project/RPi/toolchain
project/RPi/firmware
Expand All @@ -104,3 +102,7 @@ src/libcec-wmc/obj
/dpinst-amd64.exe

/documentation

/src/EventGhost/egplugin_sources/PulseEight/cec
/src/EventGhost/pulse_eight.egplugin

26 changes: 17 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
project(libcec)
cmake_minimum_required(VERSION 2.8.9)
cmake_minimum_required(VERSION 3.12.0)

set(LIBCEC_VERSION_MAJOR 4)
set(LIBCEC_VERSION_MINOR 0)
set(LIBCEC_VERSION_PATCH 2)
set(LIBCEC_VERSION_PATCH 5)

# cec-client
add_subdirectory(src/cec-client)
Expand All @@ -23,12 +23,20 @@ add_subdirectory(src/libcec)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/version.h.in
${CMAKE_CURRENT_SOURCE_DIR}/include/version.h)

# resource files for windows
# windows specific files
if(WIN32)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/project/LibCecSharp/LibCecSharp.rc.in
${CMAKE_CURRENT_SOURCE_DIR}/project/LibCecSharp/LibCecSharp.rc)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/LibCecSharp/AssemblyInfo.cpp.in
${CMAKE_CURRENT_SOURCE_DIR}/src/LibCecSharp/AssemblyInfo.cpp)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/project/libCEC-version.nsh.in
${CMAKE_CURRENT_SOURCE_DIR}/project/libCEC-version.nsh)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/project/nsis/libcec-version.nsh.in
${CMAKE_CURRENT_SOURCE_DIR}/project/nsis/libcec-version.nsh)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/dotnetlib/LibCecSharp/project/LibCecSharp.rc.in
${CMAKE_CURRENT_SOURCE_DIR}/src/dotnetlib/LibCecSharp/project/LibCecSharp.rc)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/dotnetlib/LibCecSharp/AssemblyInfo.cpp.in
${CMAKE_CURRENT_SOURCE_DIR}/src/dotnetlib/LibCecSharp/AssemblyInfo.cpp)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/dotnetlib/LibCecSharpCore/AssemblyInfo.cpp.in
${CMAKE_CURRENT_SOURCE_DIR}/src/dotnetlib/LibCecSharpCore/AssemblyInfo.cpp)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/dotnet/src/LibCecTray/LibCECTray.csproj.in
${CMAKE_CURRENT_SOURCE_DIR}/src/dotnet/src/LibCecTray/LibCECTray.csproj)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/dotnet/src/CecSharpTester/netcore/CecSharpCoreTester.csproj.in
${CMAKE_CURRENT_SOURCE_DIR}/src/dotnet/src/CecSharpTester/netcore/CecSharpCoreTester.csproj)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/dotnet/src/CecSharpTester/netfx/CecSharpTester.csproj.in
${CMAKE_CURRENT_SOURCE_DIR}/src/dotnet/src/CecSharpTester/netfx/CecSharpTester.csproj)
endif()
2 changes: 1 addition & 1 deletion COPYING
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
This file is part of the libCEC(R) library.

libCEC(R) is Copyright (C) 2011-2015 Pulse-Eight Limited. All rights reserved.
libCEC(R) is Copyright (C) 2011-2020 Pulse-Eight Limited. All rights reserved.
libCEC(R) is a original work, containing original code.

libCEC(R) is a trademark of Pulse-Eight Limited.
Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# About
This library provides support for Pulse-Eight's USB-CEC adapter and other CEC capable hardware, like the Raspberry Pi.

A list of frequently asked questions can be found on [libCEC's FAQ page] (http://libcec.pulse-eight.com/faq).
A list of FAQ (Frequently Asked Questions) can be found on [libCEC's FAQ page](http://libcec.pulse-eight.com/faq).

.Net client applications, previously part of this repository, have been moved to [this repository](https://github.com/Pulse-Eight/cec-dotnet).

Expand All @@ -21,10 +21,19 @@ See [docs/README.windows.md](docs/README.windows.md).
# Supported hardware
* [Pulse-Eight USB-CEC Adapter](https://www.pulse-eight.com/p/104/usb-hdmi-cec-adapter)
* [Pulse-Eight Intel NUC CEC Adapter](https://www.pulse-eight.com/p/154/intel-nuc-hdmi-cec-adapter)
* [Pulse-Eight CEC Adapter for Skull Canyon and Hades Canyon NUC systems](https://www.pulse-eight.com/p/207/skull-canyon-nuc-cec-adapter)
* [Raspberry Pi](https://www.raspberrypi.org/)
* Some Exynos SoCs
* NXP TDA995x
* Odroid C2 (Amlogic S905)

# Developers
See [docs/README.developers.md](docs/README.developers.md).

# Vendor specific notes

## Panasonic
* On Panasonic to enable media control buttons on bottom of the remote, you may have to change the operation mode. To change it, press bottom Power-button, keep it pressed, and press 7 3 Stop. After releasing Power-button, Play, Pause, etc should work in XBMC.

## Raspberry Pi
* If your TV cannot detect the Raspberry Pi's CEC, or if the the Pi can't detect the TV, try adding the following line in `/boot/config.txt` and reboot the Pi: `hdmi_force_hotplug=1`
88 changes: 88 additions & 0 deletions debian/changelog.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,91 @@
libcec (4.0.5.1~#DIST#) #DIST#; urgency=medium

* fixed:
* windows 64-bit detection. issue #473
* windows build with spaces in path. issue #475 #474
* USBCECAdapterDetection: Only scan tty. issue #495
* don't probe all devices in CCECClient::IsActiveDeviceType(). issue #492
* use cmake TIMESTAMP for reproducible builds. issue #485 #487
* python 3 client. issue #479
* add O_CLOEXEC to prevent child process locking. issue #478 #477
* fix build if hostname does not support '-f' argument. issue #471
* hyperlinks in README files. issue #465 #455
* replace SWIG_ADD_MODULE and force python2 on win x86. issue #481
* cb_cec_log_message() formatting in cecc-client
* missing SetupDiDestroyDeviceInfoList()
* various build script improvements on Windows
* 15 and 16 byte frames didn't fit and couldn't be sent. issue #443
* added:
* Linux CEC framework adapter. issue #380
* .Net Core support. issue #130
* P8 adapter discovery via Linux sysfs. issue #472
* iMX6 support. issue #323
* Apple vendor ID. issue #486
* link to Skull Canyon and Hades Canyon NUC adapter. issue #448
* Request/Report SAD messages. issue #404
* changed:
* use hex format for cec-client address input. issue #480
* adapter detection on windows without advapi
* build using VS2019 on Windows, required for .Net Core
* CMake 3.12+ is now required

-- Pulse-Eight Packaging <[email protected]> Mon, 27 Apr 2020 13:28:00 +0100

libcec (4.0.4.1~#DIST#) #DIST#; urgency=medium

* fixed: only prevent TV polls when a Samsung TV is detected instead of
suppressing all logical addresses. issue #424 #444

-- Pulse-Eight Packaging <[email protected]> Fri, 21 Dec 2018 22:34:14 +0100

libcec (4.0.3.1~#DIST#) #DIST#; urgency=medium

* fixed:
* detect debian based distros properly when installing python. closes #314
* don't filter out broadcast in HandleDeviceVendorCommandWithId(). issue
#309
* send an active source message when a routing change has been received with
libCEC's address as new route and no active source message has been sent
yet. issue #309 #205 #233
* vs2015 c++ redistributables
* fix missing tinfo linking in cec-client. #341
* set wrong variable. #343 #352
* LG - don't activate the source when receiving vendor command 0xB. #344
* LG TV always changing input when turned on #307
* Fix menu language string. #360
* correct python lib path for python 2.7+/3+. #356
* Fix build if tinfo library is not present. #398
* disable autonomous mode when a Samsung TV is connected. Samsung 2017+ TVs
will power on randomly (Samsung bug). don't poll the TV. #424
* CRPiCECAdapterMessageQueue::Write() accessed the queue without locking.
#423
* use sig_atomic_t for shared object between sig handler and main. #425
* python 3.5+ import. #356
* TDA995x: Fix logical address readback. #303
* TDA995x: Handle physical address change, optimize logical address setup.
#303
* Pulse-Eight USB CEC adapter detection on macOS Mojave. #434
* Fix broken Python version check and failure to build on cmake < 3.7. #409
* 13 char device name got truncated

* changed:
* log a warning when we detect that RPi's CEC service is used by something
else, blocking libCEC. issue #191
* const IAdapterCommunication::GetLogicalAddresses(), making the mutex
mutable for now without changing the platform lib. closes #259
* Add a Reinitialze action. Useful for after the device has been powered
down. #299
* Panasonic media control info to the readme
* detect WIN64 in cmake automatically. #322
* README.developers.md. #330
* instructions for hdmi_force_hotplug=1 on the pi
* eventghost plugin install/create. #375
* Include C version of libCEC loader when installing. #397
* Explicitly use python3 in pyCecClient. #433
* build with vs 2015

-- Pulse-Eight Packaging <[email protected]> Thu, 8 Nov 2018 18:05:36 +0100

libcec (4.0.2.1~#DIST#) #DIST#; urgency=medium

* fixed:
Expand Down
2 changes: 1 addition & 1 deletion debian/python-libcec.install
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
usr/lib/python*/dist-packages/cec/*
usr/lib/python*/dist-packages/*
usr/bin/pyCecClient
21 changes: 13 additions & 8 deletions docs/README.developers.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,27 @@ We provide a C, C++, Python and .NET CLR interface to the adapter.

## C++ developers
* the API can be found in `include/cec.h`
* an example implementation can be found on https://github.com/Pulse-Eight/cec-utils/blob/master/src/cec-client/cec-client.cpp
* an example implementation can be found on https://github.com/Pulse-Eight/libcec/blob/master/src/cec-client/cec-client.cpp

## C developers
* the API can be found in `include/cecc.h`
* an example implementation can be found on https://github.com/Pulse-Eight/cec-utils/blob/master/src/cecc-client/cecc-client.cpp
* an example implementation can be found on https://github.com/Pulse-Eight/libcec/blob/master/src/cecc-client/cecc-client.c

## .NET developers
* add a reference to `LibCecSharp.dll`
* add `cec.dll` to your project and enable "copy to output directory"
* an example implementation can be found on https://github.com/Pulse-Eight/cec-utils/blob/master/src/CecSharpTester/CecSharpClient.cs
## .NET Framework developers
* add a reference to LibCecSharp.dll for the target architecture (x86/amd64). It's installed to `C:\Program Files (x86)\Pulse-Eight\USB-CEC Adapter\netfx` by default
* the minimum .Net Framework version required for LibCecSharp is 4.0
* an example implementation can be found on https://github.com/Pulse-Eight/cec-dotnet/blob/master/src/CecSharpTester/CecSharpClient.cs

## .NET Core developers
* add a reference to LibCecSharpCore.dll for the target architecture (x86/amd64). It's installed to `C:\Program Files (x86)\Pulse-Eight\USB-CEC Adapter\netcore` by default
* the minimum .Net Core version required for LibCecSharpCore is 3.1
* an example implementation can be found on https://github.com/Pulse-Eight/cec-dotnet/blob/master/src/CecSharpTester/CecSharpClient.cs

## Python developers
* the API is exported to Python through Swig
* an example implementation can be found on https://github.com/Pulse-Eight/cec-utils/blob/master/src/pyCecClient/pyCecClient.py
* an example implementation can be found on https://github.com/Pulse-Eight/libcec/blob/master/src/pyCecClient/pyCecClient.py

# Developers Agreement

If you wish to contribute to this project, you must first sign our contributors agreement.
Please see [the contributors agreement] (http://www.pulse-eight.net/contributors) for more information.
Please see [the contributors agreement](http://www.pulse-eight.com/contributors) for more information.
10 changes: 8 additions & 2 deletions docs/README.linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

### Prerequisites
libCEC needs the following dependencies in order to work correctly:
* [p8-platform] (https://github.com/Pulse-Eight/platform) 2.0 or later
* [p8-platform](https://github.com/Pulse-Eight/platform) 2.0 or later
* udev v151 or later
* cdc-acm support compiled into the kernel or available as module

To compile libCEC on Linux, you'll need the following dependencies:
* [cmake 2.6 or better] (http://www.cmake.org/)
* [cmake 2.6 or better](http://www.cmake.org/)
* a supported C++ 11 compiler

The following dependencies are recommended. Without them, the adapter can not
Expand Down Expand Up @@ -51,5 +51,11 @@ Pass the argument `-DHAVE_TDA995X_API=1` to the cmake command in the compilation
cmake -DHAVE_TDA995X_API=1 ..
```

### Linux CEC Framework (v4.10+)
Pass the argument `-DHAVE_LINUX_API=1` to the cmake command in the compilation instructions:
```
cmake -DHAVE_LINUX_API=1 ..
```

### Debian / Ubuntu .deb packaging
See [docs/README.debian.md](README.debian.md).
8 changes: 4 additions & 4 deletions docs/README.osx.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

### MacPorts

libCEC is available through [MacPorts] (https://www.macports.org/) and has been tested on OS X 10.9 through 10.12
libCEC is available through [MacPorts](https://www.macports.org/) and has been tested on OS X 10.9 through 10.12

### Prerequisites
To compile libCEC on OS X, you'll need the following dependencies:
* [p8-platform] (https://github.com/Pulse-Eight/platform) 2.0 or later
* [cmake 2.6 or better] (http://www.cmake.org/)
* [p8-platform](https://github.com/Pulse-Eight/platform) 2.0 or later
* [cmake 2.6 or better](http://www.cmake.org/)
* a supported C++ 11 compiler. Support for C++11 was added in OS X 10.9
* xcode 3.2.6 or later
* optional: [Python 3.4 or later] (https://www.python.org/) and [Swig] (http://www.swig.org/) to generate Python bindings
* optional: [Python 3.4 or later](https://www.python.org/) and [Swig](http://www.swig.org/) to generate Python bindings
* optional: libX11 and xrandr to read the sink's EDID, used to determine the PC's HDMI physical address

### Compilation
Expand Down
9 changes: 7 additions & 2 deletions docs/README.raspberrypi.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/CrossCompile.cmake \
To compile libCEC on a new Raspbian installation, follow these instructions:
```
sudo apt-get update
sudo apt-get install cmake libudev-dev libxrandr-dev python-dev swig
sudo apt-get install cmake libudev-dev libxrandr-dev python3-dev swig
cd
git clone https://github.com/Pulse-Eight/platform.git
mkdir platform/build
Expand All @@ -37,4 +37,9 @@ cmake -DRPI_INCLUDE_DIR=/opt/vc/include -DRPI_LIB_DIR=/opt/vc/lib ..
make -j4
sudo make install
sudo ldconfig
```
```

## Examples
Example implementations using libCEC can be found here:
* [github.com/Pulse-Eight/libcec/blob/master/src/cec-client/cec-client.cpp](https://github.com/Pulse-Eight/libcec/blob/master/src/cec-client/cec-client.cpp)
* [github.com/DrGeoff/cec_simplest](https://github.com/DrGeoff/cec_simplest)
54 changes: 23 additions & 31 deletions docs/README.windows.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,37 @@
## Microsoft Windows

### Developing a .Net application
Building this library is only required if you want to change libCEC or LibCecSharp internally.
To develop a .Net application that uses LibCecSharp:
### Developing a .Net Framework application
To develop a .Net Framework application that uses LibCecSharp:
* download the latest binary version from [our website](http://libcec.pulse-eight.com/Downloads)
* add a reference to LibCecSharp.dll for the target architecture (x86/amd64). It's installed to `C:\Program Files (x86)\Pulse-Eight\USB-CEC Adapter` by default
* add cec.dll to your project from the same directory
* right click on cec.dll in the project explorer
* change the copy mode to "copy if newer"
* add a reference to LibCecSharp.dll for the target architecture (x86/amd64). It's installed to `C:\Program Files (x86)\Pulse-Eight\USB-CEC Adapter\netfx` by default
* the minimum .Net Framework version required for LibCecSharp is 4.0

Example implementations can be found on [Github](https://github.com/Pulse-Eight/cec-dotnet).
An example implementation can be found on [Github](https://github.com/Pulse-Eight/cec-dotnet/tree/master/src/CecSharpTester/netfx/).

### Prerequisites
To compile libCEC on Windows, you'll need the following dependencies:
* [p8-platform] (https://github.com/Pulse-Eight/platform) 2.0 or later
* [cmake 2.6 or better] (http://www.cmake.org/)
* [Visual Studio 2008 (v90) Professional] (https://www.visualstudio.com/)
* [Visual Studio 2010 (v110) (for x64 builds: Professional)] (https://www.visualstudio.com/)
* [Visual Studio 2013 (v120) or 2015 (v140)] (https://www.visualstudio.com/)
* To create an installer, you'll need [Nullsoft's NSIS] (http://nsis.sourceforge.net/)

Visual Studio version must be installed in ascending order, and each version of Visual Studio must be started at least once before the next version is installed.

The reason for needing all of these versions is that LibCecSharp targets .Net 2.0, to maximise compatibility, but libCEC itself requires C++11.
This means that LibCecSharp requires the 9.0 toolchain and libCEC the 12.0 toolchain.
Because of changes in Visual Studio's build system, Visual Studio 2010 Professional is required to build LibCecSharp in Visual Studio 2013.
### Developing a .Net Core application
To develop a .Net Core application that uses LibCecSharp:
* download the latest binary version from [our website](http://libcec.pulse-eight.com/Downloads)
* add a reference to LibCecSharpCore.dll for the target architecture (x86/amd64). It's installed to `C:\Program Files (x86)\Pulse-Eight\USB-CEC Adapter\netcore` by default
* the minimum .Net Core version required for LibCecSharpCore is 3.1

### Installation check
An example implementation can be found on [Github](https://github.com/Pulse-Eight/cec-dotnet/tree/master/src/CecSharpTester/netcore/).

You can check whether all versions of Visual Studio got installed correctly by checking if the following directories exist:
* Visual Studio 2008: `X:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\msclr`
* Visual Studio 2010: `X:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets\v90`
* Visual Studio 2010 x64: `X:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\PlatformToolsets\v90`
### Prerequisites
To compile libCEC on Windows, you'll need the following dependencies:
* [p8-platform](https://github.com/Pulse-Eight/platform) 2.0 or later
* [cmake 3.12 or newer](http://www.cmake.org/)
* [Visual Studio 2019 (v16) or newer](https://www.visualstudio.com/), with the following options selected: Universal Windows Platform development, Desktop development with C++, .NET Core cross platform development
* [.Net Core 3.1](https://dotnet.microsoft.com/download/dotnet-core/3.1)
* To create an installer, you'll need [Nullsoft's NSIS](http://nsis.sourceforge.net/)
* You also need two versions of Python to build an installer: [Python 2.7.13 for x86](https://www.python.org/ftp/python/2.7.13/python-2.7.13.msi), required by the EventGhost plugin and [Python 3.6 or newer for x64](https://www.python.org/)

### Visual Studio 2015
The build scripts have been configured for building with Visual Studio 2013. To use Visual Studio 2015, change `windows\build.cmd`: `SET VSVERSION=12` to `SET VSVERSION=14`.
### Visual Studio
The build scripts have been configured for building with Visual Studio 2019. To use another version Visual Studio, pass the verion number as parameter: `windows\visual-studio.cmd 2019`

### Compilation
To compile libCEC, follow these instructions:
To only compile libCEC, follow these instructions:
* `git submodule update --init --recursive`
* run `windows\build.cmd` to build libCEC and LibCecSharp
* run `windows\build-all.cmd` to build libCEC and LibCecSharp

To develop for libCEC in Visual Studio:
* `git submodule update --init --recursive`
Expand Down
4 changes: 4 additions & 0 deletions include/cec.h
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,10 @@ namespace CEC
* @return True if the command was sent, false otherwise
*/
virtual bool AudioEnable(bool enable) = 0;

#if CEC_LIB_VERSION_MAJOR >= 5
virtual bool GetStats(struct cec_adapter_stats* stats) = 0;
#endif
};
};

Expand Down
Loading

0 comments on commit 47cbcc2

Please sign in to comment.