Skip to content

Commit cf8cea4

Browse files
committed
Merge branch 'master' into release
2 parents 43bc27f + 0aae238 commit cf8cea4

59 files changed

Lines changed: 1575 additions & 1852 deletions

Some content is hidden

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

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,7 @@ project/RPi/firmware
8686
project/RPi/deps
8787

8888
src/libcec/libcec.pc
89-
90-
src/CecSharpTester/bin
91-
src/CecSharpTester/obj
89+
src/libcec/libcec.rc
9290

9391
src/cec-config-gui/obj
9492
src/cec-config/cec-config
@@ -106,3 +104,4 @@ src/libcec-wmc/obj
106104
/src/EventGhost/egplugin_sources/PulseEight/cec
107105
/src/EventGhost/pulse_eight.egplugin
108106

107+
/src/dotnetlib/LibCecSharp/LibCecSharp.rc

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
project(libcec)
22
cmake_minimum_required(VERSION 3.12.0)
33

4-
set(LIBCEC_VERSION_MAJOR 5)
4+
set(LIBCEC_VERSION_MAJOR 6)
55
set(LIBCEC_VERSION_MINOR 0)
66
set(LIBCEC_VERSION_PATCH 0)
77

@@ -27,8 +27,8 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/version.h.in
2727
if(WIN32)
2828
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/project/nsis/libcec-version.nsh.in
2929
${CMAKE_CURRENT_SOURCE_DIR}/project/nsis/libcec-version.nsh)
30-
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/dotnetlib/LibCecSharp/project/LibCecSharp.rc.in
31-
${CMAKE_CURRENT_SOURCE_DIR}/src/dotnetlib/LibCecSharp/project/LibCecSharp.rc)
30+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/dotnetlib/LibCecSharp/LibCecSharp.rc.in
31+
${CMAKE_CURRENT_SOURCE_DIR}/src/dotnetlib/LibCecSharp/LibCecSharp.rc)
3232
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/dotnetlib/LibCecSharp/AssemblyInfo.cpp.in
3333
${CMAKE_CURRENT_SOURCE_DIR}/src/dotnetlib/LibCecSharp/AssemblyInfo.cpp)
3434
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/dotnetlib/LibCecSharpCore/AssemblyInfo.cpp.in

debian/changelog.in

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
libcec (6.0.0.1~#DIST#) #DIST#; urgency=medium
2+
3+
* fixed:
4+
* eventghost installation
5+
* loading and storing settings in eeprom
6+
* LibCecSharp callbacks could crash
7+
* updating the hdmi port setting or physical address while libCEC is
8+
running
9+
* various small robustness improvements and cosmetic changes
10+
* icons are no longer black transperant (and nearly invisible)
11+
* added:
12+
* v2.0 CEC version
13+
* new/missing functions and fields in LibCecSharp
14+
* firmware can now be upgraded in cec-tray
15+
* screensaver functionality in cec-tray
16+
* MuteAudio() command
17+
* removed:
18+
* CanPersistConfiguration() - use CanSaveConfiguration() instead
19+
* PersistConfiguration() - SetConfiguration() now stores the cfg in eeprom
20+
if available
21+
* EnableCallbacks() - use SetCallbacks() and DisableCallbacks()instead
22+
* changed:
23+
* unified LibCecSharp and LibCecSharpCore
24+
* try to init submodules when not found while creating an installer. abort
25+
if platform failed to compile
26+
27+
-- Pulse-Eight Packaging <packaging@pulse-eight.com> Mon, 9 Jul 2020 23:37:00 +0100
28+
129
libcec (5.0.0.1~#DIST#) #DIST#; urgency=medium
230

331
* fixed:

include/cec.h

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,14 @@ namespace CEC
239239
*/
240240
virtual uint8_t VolumeDown(bool bSendRelease = true) = 0;
241241

242+
#if CEC_LIB_VERSION_MAJOR >= 5
243+
/*!
244+
* @brief Toggles the mute status of an audiosystem, if it's present
245+
* @return The new audio status.
246+
*/
247+
virtual uint8_t MuteAudio(void) = 0;
248+
#endif
249+
242250
/*!
243251
* @brief Send a keypress to a device on the CEC bus.
244252
* @param iDestination The logical address of the device to send the message to.
@@ -303,23 +311,28 @@ namespace CEC
303311
virtual bool GetCurrentConfiguration(libcec_configuration *configuration) = 0;
304312

305313
/*!
306-
* @brief Change libCEC's configuration.
314+
* @brief Change libCEC's configuration. Store it updated settings in the eeprom of the device (if supported)
307315
* @param configuration The new configuration.
308316
* @return True when the configuration was changed successfully, false otherwise.
309317
*/
310318
virtual bool SetConfiguration(const libcec_configuration *configuration) = 0;
311319

312320
/*!
313-
* @return True when this CEC adapter can persist the user configuration, false otherwise.
321+
* @return True if this CEC adapter can save the user configuration, false otherwise.
314322
*/
323+
#if CEC_LIB_VERSION_MAJOR >= 5
324+
virtual bool CanSaveConfiguration(void) = 0;
325+
#else
315326
virtual bool CanPersistConfiguration(void) = 0;
316327

317328
/*!
318-
* @brief Persist the given configuration in adapter (if supported)
329+
* @deprecated Use SetConfiguration() instead
330+
* @brief Change libCEC's configuration. Store it updated settings in the eeprom of the device (if supported)
319331
* @brief configuration The configuration to store.
320332
* @return True when the configuration was persisted, false otherwise.
321333
*/
322334
virtual bool PersistConfiguration(libcec_configuration *configuration) = 0;
335+
#endif
323336

324337
/*!
325338
* @brief Tell libCEC to poll for active devices on the bus.
@@ -340,13 +353,30 @@ namespace CEC
340353
*/
341354
virtual bool GetDeviceInformation(const char *strPort, libcec_configuration *config, uint32_t iTimeoutMs = 10000) = 0;
342355

356+
#if CEC_LIB_VERSION_MAJOR >= 5
343357
/*!
344-
* @brief Set and enable the callback methods. If this method is not called, the GetNext...() methods will have to be used.
358+
* @brief Set and enable the callback methods
359+
* @param callbacks The callbacks to set.
360+
* @param cbParam Parameter to pass to callback methods.
361+
* @return True if enabled, false otherwise.
362+
*/
363+
virtual bool SetCallbacks(ICECCallbacks *callbacks, void *cbParam) = 0;
364+
365+
/*!
366+
* @brief Disable all callbacks
367+
* @return True if disabled, false otherwise.
368+
*/
369+
virtual bool DisableCallbacks(void) = 0;
370+
#else
371+
/*!
372+
* @deprecated
373+
* @brief Set and enable the callback methods.
345374
* @param cbParam Parameter to pass to callback methods.
346375
* @param callbacks The callbacks to set.
347376
* @return True when enabled, false otherwise.
348377
*/
349378
virtual bool EnableCallbacks(void *cbParam, ICECCallbacks *callbacks) = 0;
379+
#endif
350380

351381
/*!
352382
* @brief Changes the active HDMI port.
@@ -438,7 +468,7 @@ namespace CEC
438468
* @param bQuickScan True to do a "quick scan", which will not open a connection to the adapter. Firmware version information and the exact device type will be missing
439469
* @return The number of devices that were found, or -1 when an error occurred.
440470
*/
441-
virtual int8_t DetectAdapters(cec_adapter_descriptor *deviceList, uint8_t iBufSize, const char *strDevicePath = NULL, bool bQuickScan = false) = 0;
471+
virtual int8_t DetectAdapters(cec_adapter_descriptor *deviceList, uint8_t iBufSize, const char *strDevicePath = nullptr, bool bQuickScan = false) = 0;
442472

443473
/*!
444474
* Create a new cec_command from a string
@@ -468,7 +498,7 @@ extern "C" DECLSPEC void CECDestroy(CEC::ICECAdapter *instance);
468498
/*!
469499
* @brief Load the CEC adapter library.
470500
* @param configuration The configuration to pass to libCEC
471-
* @return An instance of ICECAdapter or NULL on error.
501+
* @return An instance of ICECAdapter or nullptr on error.
472502
*/
473503
extern "C" DECLSPEC CEC::ICECAdapter* CECInitialise(CEC::libcec_configuration *configuration);
474504

include/cecc.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ extern DECLSPEC void libcec_destroy(libcec_connection_t connection);
5353
extern DECLSPEC int libcec_open(libcec_connection_t connection, const char* strPort, uint32_t iTimeout);
5454
extern DECLSPEC void libcec_close(libcec_connection_t connection);
5555
extern DECLSPEC void libcec_clear_configuration(CEC_NAMESPACE libcec_configuration* configuration);
56+
#if CEC_LIB_VERSION_MAJOR >= 5
57+
extern DECLSPEC int libcec_set_callbacks(libcec_connection_t connection, CEC_NAMESPACE ICECCallbacks* callbacks, void* cbParam);
58+
extern DECLSPEC int libcec_disabled_callbacks(libcec_connection_t connection);
59+
#else
5660
extern DECLSPEC int libcec_enable_callbacks(libcec_connection_t connection, void* cbParam, CEC_NAMESPACE ICECCallbacks* callbacks);
61+
#endif
5762
extern DECLSPEC int8_t libcec_find_adapters(libcec_connection_t connection, CEC_NAMESPACE cec_adapter* deviceList, uint8_t iBufSize, const char* strDevicePath);
5863
extern DECLSPEC int libcec_ping_adapters(libcec_connection_t connection);
5964
extern DECLSPEC int libcec_start_bootloader(libcec_connection_t connection);
@@ -83,16 +88,22 @@ extern DECLSPEC int libcec_is_active_device_type(libcec_connection_t connection,
8388
extern DECLSPEC int libcec_set_hdmi_port(libcec_connection_t connection, CEC_NAMESPACE cec_logical_address baseDevice, uint8_t iPort);
8489
extern DECLSPEC int libcec_volume_up(libcec_connection_t connection, int bSendRelease);
8590
extern DECLSPEC int libcec_volume_down(libcec_connection_t connection, int bSendRelease);
91+
#if CEC_LIB_VERSION_MAJOR >= 5
8692
extern DECLSPEC int libcec_mute_audio(libcec_connection_t connection, int bSendRelease);
93+
#endif
8794
extern DECLSPEC int libcec_send_keypress(libcec_connection_t connection, CEC_NAMESPACE cec_logical_address iDestination, CEC_NAMESPACE cec_user_control_code key, int bWait);
8895
extern DECLSPEC int libcec_send_key_release(libcec_connection_t connection, CEC_NAMESPACE cec_logical_address iDestination, int bWait);
8996
extern DECLSPEC int libcec_get_device_osd_name(libcec_connection_t connection, CEC_NAMESPACE cec_logical_address iAddress, CEC_NAMESPACE cec_osd_name name);
9097
extern DECLSPEC int libcec_set_stream_path_logical(libcec_connection_t connection, CEC_NAMESPACE cec_logical_address iAddress);
9198
extern DECLSPEC int libcec_set_stream_path_physical(libcec_connection_t connection, uint16_t iPhysicalAddress);
9299
extern DECLSPEC CEC_NAMESPACE cec_logical_addresses libcec_get_logical_addresses(libcec_connection_t connection);
93100
extern DECLSPEC int libcec_get_current_configuration(libcec_connection_t connection, CEC_NAMESPACE libcec_configuration* configuration);
101+
#if CEC_LIB_VERSION_MAJOR >= 5
102+
extern DECLSPEC int libcec_can_save_configuration(libcec_connection_t connection);
103+
#else
94104
extern DECLSPEC int libcec_can_persist_configuration(libcec_connection_t connection);
95105
extern DECLSPEC int libcec_persist_configuration(libcec_connection_t connection, CEC_NAMESPACE libcec_configuration* configuration);
106+
#endif
96107
extern DECLSPEC int libcec_set_configuration(libcec_connection_t connection, const CEC_NAMESPACE libcec_configuration* configuration);
97108
extern DECLSPEC void libcec_rescan_devices(libcec_connection_t connection);
98109
extern DECLSPEC int libcec_is_libcec_active_source(libcec_connection_t connection);

include/cectypes.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,8 @@ typedef enum cec_version
375375
CEC_VERSION_1_2A = 0x02,
376376
CEC_VERSION_1_3 = 0x03,
377377
CEC_VERSION_1_3A = 0x04,
378-
CEC_VERSION_1_4 = 0x05
378+
CEC_VERSION_1_4 = 0x05,
379+
CEC_VERSION_2_0 = 0x06,
379380
} cec_version;
380381

381382
typedef enum cec_channel_identifier
@@ -886,7 +887,7 @@ typedef enum cec_adapter_type
886887
ADAPTERTYPE_EXYNOS = 0x300,
887888
ADAPTERTYPE_LINUX = 0x400,
888889
ADAPTERTYPE_AOCEC = 0x500,
889-
ADAPTERTYPE_IMX = 0x600
890+
ADAPTERTYPE_IMX = 0x600
890891
} cec_adapter_type;
891892

892893
/** force exporting through swig */
@@ -1502,7 +1503,7 @@ struct libcec_configuration
15021503
uint8_t bMonitorOnly; /*!< won't allocate a CCECClient when starting the connection when set (same as monitor mode). added in 1.6.3 */
15031504
cec_version cecVersion; /*!< CEC spec version to use by libCEC. defaults to v1.4. added in 1.8.0 */
15041505
cec_adapter_type adapterType; /*!< type of the CEC adapter that we're connected to. added in 1.8.2 */
1505-
cec_user_control_code comboKey; /*!< key code that initiates combo keys. defaults to CEC_USER_CONTROL_CODE_F1_BLUE. CEC_USER_CONTROL_CODE_UNKNOWN to disable. added in 2.0.5 */
1506+
cec_user_control_code comboKey; /*!< key code that initiates combo keys. defaults to CEC_USER_CONTROL_CODE_STOP. CEC_USER_CONTROL_CODE_UNKNOWN to disable. added in 2.0.5 */
15061507
uint32_t iComboKeyTimeoutMs; /*!< timeout until the combo key is sent as normal keypress */
15071508
uint32_t iButtonRepeatRateMs; /*!< rate at which buttons autorepeat. 0 means rely on CEC device */
15081509
uint32_t iButtonReleaseDelayMs;/*!< duration after last update until a button is considered released */
@@ -1584,7 +1585,7 @@ struct libcec_configuration
15841585
iButtonReleaseDelayMs = CEC_BUTTON_TIMEOUT;
15851586
bAutoWakeAVR = 0;
15861587
#if CEC_LIB_VERSION_MAJOR >= 5
1587-
bAutoPowerOn = 0;
1588+
bAutoPowerOn = 2;
15881589
#endif
15891590

15901591
strDeviceName[0] = (char)0;

project/favicon.ico

-352 KB
Binary file not shown.

project/libcec.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 16
44
VisualStudioVersion = 16.0.30011.22
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibCecSharp", "..\src\dotnetlib\LibCecSharp\project\LibCecSharp.vcxproj", "{E54D4581-CD59-4687-BB10-694B8192EABA}"
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibCecSharp", "..\src\dotnetlib\LibCecSharp\LibCecSharp.vcxproj", "{E54D4581-CD59-4687-BB10-694B8192EABA}"
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B119505D-5CD1-48E4-BED1-9C2BF26153D5}"
99
EndProject
10-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibCecSharpCore", "..\src\dotnetlib\LibCecSharpCore\project\LibCecSharpCore.vcxproj", "{E8C30CBD-64D1-44F8-9172-82B728986DCC}"
10+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibCecSharpCore", "..\src\dotnetlib\LibCecSharpCore\LibCecSharpCore.vcxproj", "{E8C30CBD-64D1-44F8-9172-82B728986DCC}"
1111
EndProject
1212
Global
1313
GlobalSection(SolutionConfigurationPlatforms) = preSolution

project/nsis/cec-tray.nsh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Section "libCEC Tray" SecTray
2+
SetShellVarContext current
3+
SectionIn 1
4+
5+
; Copy to the installation directory
6+
SetOutPath "$INSTDIR\x86\netfx"
7+
File "..\build\x86\cec-tray.exe"
8+
SetOutPath "$INSTDIR\x64\netfx"
9+
File /nonfatal "..\build\amd64\cec-tray.exe"
10+
11+
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
12+
SetOutPath "$INSTDIR"
13+
14+
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
15+
${If} ${RunningX64}
16+
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\cec-tray.lnk" "$INSTDIR\x64\netfx\cec-tray.exe" \
17+
"" "$INSTDIR\x64\netfx\cec-tray.exe" 0 SW_SHOWNORMAL \
18+
"" "Start libCEC Tray (x64)."
19+
${Else}
20+
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\cec-tray.lnk" "$INSTDIR\x86\netfx\cec-tray.exe" \
21+
"" "$INSTDIR\netfx\cec-tray.exe" 0 SW_SHOWNORMAL \
22+
"" "Start libCEC Tray."
23+
${EndIf}
24+
!insertmacro MUI_STARTMENU_WRITE_END
25+
SectionEnd

project/nsis/functions.nsh

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,3 @@
1212
!undef _TEMPFILE
1313
!macroend
1414
!define !defineifexist "!insertmacro !defineifexist"
15-
16-
; Function used to get the parent directory of the installer
17-
Function GetParentDirectory
18-
19-
Exch $R0
20-
Push $R1
21-
Push $R2
22-
Push $R3
23-
24-
StrCpy $R1 0
25-
StrLen $R2 $R0
26-
27-
loop:
28-
IntOp $R1 $R1 + 1
29-
IntCmp $R1 $R2 get 0 get
30-
StrCpy $R3 $R0 1 -$R1
31-
StrCmp $R3 "\" get
32-
Goto loop
33-
34-
get:
35-
StrCpy $R0 $R0 -$R1
36-
37-
Pop $R3
38-
Pop $R2
39-
Pop $R1
40-
Exch $R0
41-
42-
FunctionEnd

0 commit comments

Comments
 (0)