Skip to content

Commit 5155bab

Browse files
committed
libCEC 7.0.0 - Merge branch 'master' into release.
2 parents c024c00 + 87101d2 commit 5155bab

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+2098
-919
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/.vscode
12
/build
23
/cmake-build
34
/.cproject
@@ -17,6 +18,7 @@
1718
*.suo
1819
*.user
1920
*.aps
21+
*.swp
2022
env.h
2123
version.h
2224
.vs
@@ -25,6 +27,8 @@ AssemblyInfo.cs
2527
AssemblyInfo.cpp
2628

2729
*~
30+
tags
31+
cscope.*
2832

2933
/support/private
3034

CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
project(libcec)
21
cmake_minimum_required(VERSION 3.12.0)
2+
project(libcec)
33

4-
set(LIBCEC_VERSION_MAJOR 6)
4+
set(LIBCEC_VERSION_MAJOR 7)
55
set(LIBCEC_VERSION_MINOR 0)
6-
set(LIBCEC_VERSION_PATCH 2)
6+
set(LIBCEC_VERSION_PATCH 0)
77

88
# cec-client
99
add_subdirectory(src/cec-client)

COPYING LICENSE.md

File renamed without changes.

cmake/WindowsDebug.cmake

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
if(WIN32)
2+
if (MSVC)
3+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /D_HAS_ITERATOR_DEBUGGING=1 /D_SECURE_SCL=1")
4+
add_compile_definitions($<$<CONFIG:Debug>:_ITERATOR_DEBUG_LEVEL=2>)
5+
add_compile_definitions($<$<CONFIG:Debug>:_HAS_ITERATOR_DEBUGGING=1>)
6+
endif(MSVC)
7+
endif(WIN32)

debian/changelog.in

+80
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,83 @@
1+
libcec (7.0.0.1~#DIST#) #DIST#; urgency=medium
2+
3+
[ Lars Op den Kamp ]
4+
* modernise CMakeLists.txt
5+
* Use cmake TIMESTAMP function to be more portable and to allow for reproducible builds
6+
* fixed: potential null deref. closes #556
7+
* python 3.13 compatibility
8+
* added: vs2022 support
9+
* fixed: creating (unsigned) windows installer
10+
* fixed: nsis installer not creating start menu icons and uninstaller
11+
* bump to .net framework 4.5 and .net 8.0
12+
* fixed: null terminate .net device language field. added CecLogicalAddresses::Unset()
13+
* fixed: don't call the config updated callback if nothing has changed. auto set wake devices or activate source so these values match what happens on the tv
14+
* fixed: tv would power on even if the options to power on were disabled in cec-tray
15+
* changed/fixed: windows installer, eventghost plugin, .net libraries, python imports, debug builds
16+
* fixed: use input() for python3 and raw_input() for python2
17+
* changed: debian python install to match arch specific too
18+
* fixed: libusb0.dll wasn't included in the installer
19+
* fixed: remove call to PyEcal_InitThreads(). swig already includes SWIG_PYTHON_INITIALIZE_THREADS in SWIG_init()
20+
21+
[ Evgeny Grin ]
22+
* CheckPlatformSupport.cmake: really use cache for HAVE_DRM_EDID_PARSER
23+
* CheckPlatformSupport.cmake: don't override HAVE_LIBUDEV variable, Mark HAVE_P8_USB_DETECT as internal (no way to define it externally), Always enable HAVE_P8_USB_DETECT on linux (for SYSFS detection), Fixed CMAKE_REQUIRED_LIBRARIES if libudev is used.
24+
* CheckPlatformSupport.cmake: don't override defined HAVE_RANDR
25+
* CheckPlatformSupport.cmake: don't override cache var HAVE_RPI_API
26+
* CheckPlatformSupport.cmake: don't override cache var HAVE_TDA995X_API
27+
* CheckPlatformSupport.cmake: fixed HAVE_EXYNOS_API usage Avoid resolving variable otherwise variable content could be treated as name of another variable
28+
* CheckPlatformSupport.cmake: fixed HAVE_LINUX_API usage, fixed misleading description "Linux supported: no" description could mislead users
29+
* CheckPlatformSupport.cmake: fixed usage of HAVE_AOCEC_API var
30+
* CheckPlatformSupport.cmake: fixed usage of HAVE_IMX_API, marked as CACHE var, added description
31+
* CheckPlatformSupport.cmake: unified LIB_INFO assignment
32+
* CheckPlatformSupport.cmake: removed duplicated definition of RPI_{LIB,INCLUDE}_DIR
33+
* cmake files: improved and unified descriptions and reporting
34+
* CheckPlatformSupport.cmake: corrected comments to properly document real behaviour
35+
36+
[ Tore Sinding Bekkedal ]
37+
* Ease copy-paste by invoking apt noninteractively
38+
* Update and robustify
39+
40+
[ Hedda ]
41+
* Rename COPYING to LICENSE.md so follow standard naming conversion
42+
43+
[ psykose ]
44+
* cecloader.h: fix null return
45+
46+
[ Colin Foster ]
47+
* gitignore: add vim swap files to gitignore
48+
49+
[ Teyut ]
50+
* Mark all devices as inactive when new active source is unknown
51+
52+
[ Guy Martin ]
53+
* Fix use after free in callbacks with results.
54+
* Add a commandHandler callback to allow external libs to handle CEC commands themselves.
55+
* Remove debug printfs.
56+
* Attempt to fix race condition when freeing the callback wrapper.
57+
* Allow command handler callback to intercept broadcast messages and fix inconsistent callback wrapper deletion again.
58+
* Remove useless mutex.
59+
* Remove useless 'keepResult' parameter and make sure the CCallbackWrap is only deleted once even in case of timeout.
60+
61+
[ Alberto Fanjul ]
62+
* Fix module import
63+
* Remove useless print
64+
65+
[ Rudi Heitbaum ]
66+
* fix assert issue with systemd udev
67+
68+
[ Anish Sane ]
69+
* tegra-cec support. closes #636
70+
71+
[ DDS Central ]
72+
* Add support for Windows ARM64.
73+
* Fix CMakeLists.txt files for Windows ARM64 support.
74+
* Add arm64 to available architecture list in visual-studio.cmd and build-lib.cmd. build-all.cmd: add runtime arch detection for Windows ARM64.
75+
* src/libcec/LibCEC.cpp: Add Windows ARM64 host type.
76+
* Disable building of LibCecSharp and .NET applications on ARM64.
77+
* build-all.cmd: Move toolchain setup outside of ARM64 .NET disable clause.
78+
79+
-- Lars Op den Kamp <[email protected]> Wed, 26 Feb 2025 08:50:56 +0100
80+
181
libcec (6.0.2.1~#DIST#) #DIST#; urgency=medium
282

383
* added:

debian/python-libcec.install

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
usr/lib/python*/dist-packages/*
1+
usr/lib*{/*,}/python*/dist-packages/cec/*
22
usr/bin/pyCecClient

docs/README.debian.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
### Debian
22
Use the following commands to create a Debian package:
33
```
4-
source /etc/lsb-release
5-
sed "s/#DIST#/${DISTRIB_CODENAME}/g" debian/changelog.in > debian/changelog
6-
dpkg-buildpackage
4+
sudo apt-get build-dep . # to install build dependencies
5+
sed "s/#DIST#/$(lsb_release -cs)/g" debian/changelog.in > debian/changelog
6+
dpkg-buildpackage --no-sign # omit this argument if you have a private key to sign with
77
```

docs/README.raspberrypi.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/CrossCompile.cmake \
2121
To compile libCEC on a new Raspbian installation, follow these instructions:
2222
```
2323
sudo apt-get update
24-
sudo apt-get install cmake libudev-dev libxrandr-dev python3-dev swig git
24+
sudo apt-get -y install cmake libudev-dev libxrandr-dev python3-dev swig git
2525
cd
2626
git clone https://github.com/Pulse-Eight/platform.git
2727
mkdir platform/build

include/ceccloader.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include "cecc.h"
3535

3636
#include <stdio.h>
37-
#if defined(_WIN32) || defined(_WIN64)
37+
#if defined(_WIN32) || defined(_WIN64) || defined(_M_ARM64)
3838
#include <windows.h>
3939
#include <conio.h>
4040
typedef HINSTANCE libcecc_lib_instance_t;
@@ -217,7 +217,7 @@ static int libcecc_resolve_all(void* lib, libcec_interface_t* iface)
217217
static libcecc_lib_instance_t libcecc_load_library(const char* strLib)
218218
{
219219
libcecc_lib_instance_t lib;
220-
#if defined(_WIN32) || defined(_WIN64)
220+
#if defined(_WIN32) || defined(_WIN64) || defined(_M_ARM64)
221221
lib = LoadLibrary(strLib ? strLib : "cec.dll");
222222
if (lib == NULL)
223223
printf("failed to load cec.dll\n");
@@ -235,7 +235,7 @@ static libcecc_lib_instance_t libcecc_load_library(const char* strLib)
235235

236236
static void libcecc_close_library(libcecc_lib_instance_t lib)
237237
{
238-
#if defined(_WIN32) || defined(_WIN64)
238+
#if defined(_WIN32) || defined(_WIN64) || defined(_M_ARM64)
239239
FreeLibrary(lib);
240240
#else
241241
dlclose(lib);
@@ -244,7 +244,7 @@ static void libcecc_close_library(libcecc_lib_instance_t lib)
244244

245245
static void* libcecc_resolve(void* lib, const char* name)
246246
{
247-
#if defined(_WIN32) || defined(_WIN64)
247+
#if defined(_WIN32) || defined(_WIN64) || defined(_M_ARM64)
248248
return GetProcAddress(lib, name);
249249
#else
250250
return dlsym(lib, name);

include/cecloader.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* http://www.pulse-eight.net/
3232
*/
3333

34-
#if defined(_WIN32) || defined(_WIN64)
34+
#if defined(_WIN32) || defined(_WIN64) || defined(_M_ARM64)
3535
#include <windows.h>
3636
#include <conio.h>
3737

@@ -172,7 +172,7 @@ bool LibCecBootloader(const char *strLib = NULL)
172172
if (!g_libCEC)
173173
{
174174
std::cout << dlerror() << std::endl;
175-
return NULL;
175+
return false;
176176
}
177177
}
178178

@@ -181,7 +181,7 @@ bool LibCecBootloader(const char *strLib = NULL)
181181
if (!LibCecBootloader)
182182
{
183183
std::cout << "cannot find CECStartBootloader" << std::endl;
184-
return NULL;
184+
return false;
185185
}
186186

187187
bool bReturn = LibCecBootloader();

include/cectypes.h

+14-3
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@
3838
#include <stdint.h>
3939
#include <string.h>
4040

41-
#if defined(_WIN32) || defined(_WIN64)
41+
#if defined(_WIN32) || defined(_WIN64) || defined(_M_ARM64)
4242
#define CEC_CDECL __cdecl
4343
#else
4444
#define CEC_CDECL
4545
#endif
4646

4747
#if !defined(DECLSPEC)
48-
#if defined(_WIN32) || defined(_WIN64)
48+
#if defined(_WIN32) || defined(_WIN64) || defined(_M_ARM64)
4949
#include <windows.h>
5050
#if defined DLL_EXPORT
5151
#define DECLSPEC __declspec(dllexport)
@@ -887,7 +887,8 @@ typedef enum cec_adapter_type
887887
ADAPTERTYPE_EXYNOS = 0x300,
888888
ADAPTERTYPE_LINUX = 0x400,
889889
ADAPTERTYPE_AOCEC = 0x500,
890-
ADAPTERTYPE_IMX = 0x600
890+
ADAPTERTYPE_IMX = 0x600,
891+
ADAPTERTYPE_TEGRA = 0x700
891892
} cec_adapter_type;
892893

893894
/** force exporting through swig */
@@ -1450,6 +1451,15 @@ typedef struct ICECCallbacks
14501451
*/
14511452
void (CEC_CDECL* sourceActivated)(void* cbParam, const cec_logical_address logicalAddress, const uint8_t bActivated);
14521453

1454+
/*!
1455+
* @brief Allow the client handle a CEC command instead of libcec.
1456+
* @param cbparam Callback parameter provided when the callbacks were set up
1457+
* @param command The command to handle.
1458+
*
1459+
* @return 1 if the command has been handled and if libCEC should not take any action
1460+
*/
1461+
int (CEC_CDECL* commandHandler)(void* cbparam, const cec_command* command);
1462+
14531463
#ifdef __cplusplus
14541464
ICECCallbacks(void) { Clear(); }
14551465
~ICECCallbacks(void) { Clear(); };
@@ -1463,6 +1473,7 @@ typedef struct ICECCallbacks
14631473
alert = nullptr;
14641474
menuStateChanged = nullptr;
14651475
sourceActivated = nullptr;
1476+
commandHandler = nullptr;
14661477
}
14671478
#endif
14681479
} ICECCallbacks;

project/eventghost.nsi

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
;libCEC EventGhost Plugin installer
2+
;Copyright (C) 2025 Pulse-Eight Ltd.
3+
;http://www.pulse-eight.com/
4+
5+
XPStyle on
6+
RequestExecutionLevel user
7+
SetCompressor /SOLID lzma
8+
9+
!include "LogicLib.nsh"
10+
!include "MUI2.nsh"
11+
!include "nsDialogs.nsh"
12+
!include "nsis\libcec-version.nsh"
13+
14+
Name "Pulse-Eight libCEC v${LIBCEC_VERSION_STRING} EventGhost Plugin"
15+
OutFile "..\build\libcec-eventghost-plugin-${LIBCEC_VERSION_STRING}.exe"
16+
InstType "Full installation"
17+
18+
Var EventGhostLocation
19+
20+
Section "EventGhost plugin" SecEvGhostCec
21+
SetShellVarContext current
22+
SectionIn 1
23+
SectionIn RO
24+
25+
SetOutPath "$%TEMP%\"
26+
File "..\build\EventGhost\pulse_eight.egplugin"
27+
28+
ExecWait '"$EventGhostLocation\eventghost.exe" "$%TEMP%\pulse_eight.egplugin"'
29+
Delete "$%TEMP%\pulse_eight.egplugin"
30+
SectionEnd
31+
32+
Function EventGhost
33+
ReadRegDword $1 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\EventGhost_is1" "InstallLocation"
34+
${If} $1 != ""
35+
StrCpy $EventGhostLocation "$1"
36+
${Else}
37+
MessageBox MB_OK "EventGhost is not installed. Exiting."
38+
Quit
39+
${Endif}
40+
FunctionEnd
41+
42+
!define MUI_FINISHPAGE_LINK "Visit https://libcec.pulse-eight.com/ for more information."
43+
!define MUI_FINISHPAGE_LINK_LOCATION "https://libcec.pulse-eight.com/"
44+
!define MUI_ABORTWARNING
45+
46+
!insertmacro MUI_PAGE_WELCOME
47+
!insertmacro MUI_PAGE_LICENSE "..\LICENSE.md"
48+
!insertmacro MUI_PAGE_COMPONENTS
49+
50+
!insertmacro MUI_PAGE_INSTFILES
51+
!insertmacro MUI_PAGE_FINISH
52+
53+
!insertmacro MUI_LANGUAGE "English"
54+
55+
Function .onInit
56+
; check for EventGhost
57+
Call EventGhost
58+
FunctionEnd

0 commit comments

Comments
 (0)