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 Jul 10, 2020
2 parents 43bc27f + 0aae238 commit cf8cea4
Show file tree
Hide file tree
Showing 59 changed files with 1,575 additions and 1,852 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ project/RPi/firmware
project/RPi/deps

src/libcec/libcec.pc

src/CecSharpTester/bin
src/CecSharpTester/obj
src/libcec/libcec.rc

src/cec-config-gui/obj
src/cec-config/cec-config
Expand All @@ -106,3 +104,4 @@ src/libcec-wmc/obj
/src/EventGhost/egplugin_sources/PulseEight/cec
/src/EventGhost/pulse_eight.egplugin

/src/dotnetlib/LibCecSharp/LibCecSharp.rc
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project(libcec)
cmake_minimum_required(VERSION 3.12.0)

set(LIBCEC_VERSION_MAJOR 5)
set(LIBCEC_VERSION_MAJOR 6)
set(LIBCEC_VERSION_MINOR 0)
set(LIBCEC_VERSION_PATCH 0)

Expand All @@ -27,8 +27,8 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/version.h.in
if(WIN32)
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/LibCecSharp.rc.in
${CMAKE_CURRENT_SOURCE_DIR}/src/dotnetlib/LibCecSharp/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
Expand Down
28 changes: 28 additions & 0 deletions debian/changelog.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
libcec (6.0.0.1~#DIST#) #DIST#; urgency=medium

* fixed:
* eventghost installation
* loading and storing settings in eeprom
* LibCecSharp callbacks could crash
* updating the hdmi port setting or physical address while libCEC is
running
* various small robustness improvements and cosmetic changes
* icons are no longer black transperant (and nearly invisible)
* added:
* v2.0 CEC version
* new/missing functions and fields in LibCecSharp
* firmware can now be upgraded in cec-tray
* screensaver functionality in cec-tray
* MuteAudio() command
* removed:
* CanPersistConfiguration() - use CanSaveConfiguration() instead
* PersistConfiguration() - SetConfiguration() now stores the cfg in eeprom
if available
* EnableCallbacks() - use SetCallbacks() and DisableCallbacks()instead
* changed:
* unified LibCecSharp and LibCecSharpCore
* try to init submodules when not found while creating an installer. abort
if platform failed to compile

-- Pulse-Eight Packaging <[email protected]> Mon, 9 Jul 2020 23:37:00 +0100

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

* fixed:
Expand Down
42 changes: 36 additions & 6 deletions include/cec.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,14 @@ namespace CEC
*/
virtual uint8_t VolumeDown(bool bSendRelease = true) = 0;

#if CEC_LIB_VERSION_MAJOR >= 5
/*!
* @brief Toggles the mute status of an audiosystem, if it's present
* @return The new audio status.
*/
virtual uint8_t MuteAudio(void) = 0;
#endif

/*!
* @brief Send a keypress to a device on the CEC bus.
* @param iDestination The logical address of the device to send the message to.
Expand Down Expand Up @@ -303,23 +311,28 @@ namespace CEC
virtual bool GetCurrentConfiguration(libcec_configuration *configuration) = 0;

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

/*!
* @return True when this CEC adapter can persist the user configuration, false otherwise.
* @return True if this CEC adapter can save the user configuration, false otherwise.
*/
#if CEC_LIB_VERSION_MAJOR >= 5
virtual bool CanSaveConfiguration(void) = 0;
#else
virtual bool CanPersistConfiguration(void) = 0;

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

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

#if CEC_LIB_VERSION_MAJOR >= 5
/*!
* @brief Set and enable the callback methods. If this method is not called, the GetNext...() methods will have to be used.
* @brief Set and enable the callback methods
* @param callbacks The callbacks to set.
* @param cbParam Parameter to pass to callback methods.
* @return True if enabled, false otherwise.
*/
virtual bool SetCallbacks(ICECCallbacks *callbacks, void *cbParam) = 0;

/*!
* @brief Disable all callbacks
* @return True if disabled, false otherwise.
*/
virtual bool DisableCallbacks(void) = 0;
#else
/*!
* @deprecated
* @brief Set and enable the callback methods.
* @param cbParam Parameter to pass to callback methods.
* @param callbacks The callbacks to set.
* @return True when enabled, false otherwise.
*/
virtual bool EnableCallbacks(void *cbParam, ICECCallbacks *callbacks) = 0;
#endif

/*!
* @brief Changes the active HDMI port.
Expand Down Expand Up @@ -438,7 +468,7 @@ namespace CEC
* @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
* @return The number of devices that were found, or -1 when an error occurred.
*/
virtual int8_t DetectAdapters(cec_adapter_descriptor *deviceList, uint8_t iBufSize, const char *strDevicePath = NULL, bool bQuickScan = false) = 0;
virtual int8_t DetectAdapters(cec_adapter_descriptor *deviceList, uint8_t iBufSize, const char *strDevicePath = nullptr, bool bQuickScan = false) = 0;

/*!
* Create a new cec_command from a string
Expand Down Expand Up @@ -468,7 +498,7 @@ extern "C" DECLSPEC void CECDestroy(CEC::ICECAdapter *instance);
/*!
* @brief Load the CEC adapter library.
* @param configuration The configuration to pass to libCEC
* @return An instance of ICECAdapter or NULL on error.
* @return An instance of ICECAdapter or nullptr on error.
*/
extern "C" DECLSPEC CEC::ICECAdapter* CECInitialise(CEC::libcec_configuration *configuration);

Expand Down
11 changes: 11 additions & 0 deletions include/cecc.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ extern DECLSPEC void libcec_destroy(libcec_connection_t connection);
extern DECLSPEC int libcec_open(libcec_connection_t connection, const char* strPort, uint32_t iTimeout);
extern DECLSPEC void libcec_close(libcec_connection_t connection);
extern DECLSPEC void libcec_clear_configuration(CEC_NAMESPACE libcec_configuration* configuration);
#if CEC_LIB_VERSION_MAJOR >= 5
extern DECLSPEC int libcec_set_callbacks(libcec_connection_t connection, CEC_NAMESPACE ICECCallbacks* callbacks, void* cbParam);
extern DECLSPEC int libcec_disabled_callbacks(libcec_connection_t connection);
#else
extern DECLSPEC int libcec_enable_callbacks(libcec_connection_t connection, void* cbParam, CEC_NAMESPACE ICECCallbacks* callbacks);
#endif
extern DECLSPEC int8_t libcec_find_adapters(libcec_connection_t connection, CEC_NAMESPACE cec_adapter* deviceList, uint8_t iBufSize, const char* strDevicePath);
extern DECLSPEC int libcec_ping_adapters(libcec_connection_t connection);
extern DECLSPEC int libcec_start_bootloader(libcec_connection_t connection);
Expand Down Expand Up @@ -83,16 +88,22 @@ extern DECLSPEC int libcec_is_active_device_type(libcec_connection_t connection,
extern DECLSPEC int libcec_set_hdmi_port(libcec_connection_t connection, CEC_NAMESPACE cec_logical_address baseDevice, uint8_t iPort);
extern DECLSPEC int libcec_volume_up(libcec_connection_t connection, int bSendRelease);
extern DECLSPEC int libcec_volume_down(libcec_connection_t connection, int bSendRelease);
#if CEC_LIB_VERSION_MAJOR >= 5
extern DECLSPEC int libcec_mute_audio(libcec_connection_t connection, int bSendRelease);
#endif
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);
extern DECLSPEC int libcec_send_key_release(libcec_connection_t connection, CEC_NAMESPACE cec_logical_address iDestination, int bWait);
extern DECLSPEC int libcec_get_device_osd_name(libcec_connection_t connection, CEC_NAMESPACE cec_logical_address iAddress, CEC_NAMESPACE cec_osd_name name);
extern DECLSPEC int libcec_set_stream_path_logical(libcec_connection_t connection, CEC_NAMESPACE cec_logical_address iAddress);
extern DECLSPEC int libcec_set_stream_path_physical(libcec_connection_t connection, uint16_t iPhysicalAddress);
extern DECLSPEC CEC_NAMESPACE cec_logical_addresses libcec_get_logical_addresses(libcec_connection_t connection);
extern DECLSPEC int libcec_get_current_configuration(libcec_connection_t connection, CEC_NAMESPACE libcec_configuration* configuration);
#if CEC_LIB_VERSION_MAJOR >= 5
extern DECLSPEC int libcec_can_save_configuration(libcec_connection_t connection);
#else
extern DECLSPEC int libcec_can_persist_configuration(libcec_connection_t connection);
extern DECLSPEC int libcec_persist_configuration(libcec_connection_t connection, CEC_NAMESPACE libcec_configuration* configuration);
#endif
extern DECLSPEC int libcec_set_configuration(libcec_connection_t connection, const CEC_NAMESPACE libcec_configuration* configuration);
extern DECLSPEC void libcec_rescan_devices(libcec_connection_t connection);
extern DECLSPEC int libcec_is_libcec_active_source(libcec_connection_t connection);
Expand Down
9 changes: 5 additions & 4 deletions include/cectypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,8 @@ typedef enum cec_version
CEC_VERSION_1_2A = 0x02,
CEC_VERSION_1_3 = 0x03,
CEC_VERSION_1_3A = 0x04,
CEC_VERSION_1_4 = 0x05
CEC_VERSION_1_4 = 0x05,
CEC_VERSION_2_0 = 0x06,
} cec_version;

typedef enum cec_channel_identifier
Expand Down Expand Up @@ -886,7 +887,7 @@ typedef enum cec_adapter_type
ADAPTERTYPE_EXYNOS = 0x300,
ADAPTERTYPE_LINUX = 0x400,
ADAPTERTYPE_AOCEC = 0x500,
ADAPTERTYPE_IMX = 0x600
ADAPTERTYPE_IMX = 0x600
} cec_adapter_type;

/** force exporting through swig */
Expand Down Expand Up @@ -1502,7 +1503,7 @@ struct libcec_configuration
uint8_t bMonitorOnly; /*!< won't allocate a CCECClient when starting the connection when set (same as monitor mode). added in 1.6.3 */
cec_version cecVersion; /*!< CEC spec version to use by libCEC. defaults to v1.4. added in 1.8.0 */
cec_adapter_type adapterType; /*!< type of the CEC adapter that we're connected to. added in 1.8.2 */
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 */
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 */
uint32_t iComboKeyTimeoutMs; /*!< timeout until the combo key is sent as normal keypress */
uint32_t iButtonRepeatRateMs; /*!< rate at which buttons autorepeat. 0 means rely on CEC device */
uint32_t iButtonReleaseDelayMs;/*!< duration after last update until a button is considered released */
Expand Down Expand Up @@ -1584,7 +1585,7 @@ struct libcec_configuration
iButtonReleaseDelayMs = CEC_BUTTON_TIMEOUT;
bAutoWakeAVR = 0;
#if CEC_LIB_VERSION_MAJOR >= 5
bAutoPowerOn = 0;
bAutoPowerOn = 2;
#endif

strDeviceName[0] = (char)0;
Expand Down
Binary file modified project/favicon.ico
Binary file not shown.
4 changes: 2 additions & 2 deletions project/libcec.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30011.22
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibCecSharp", "..\src\dotnetlib\LibCecSharp\project\LibCecSharp.vcxproj", "{E54D4581-CD59-4687-BB10-694B8192EABA}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibCecSharp", "..\src\dotnetlib\LibCecSharp\LibCecSharp.vcxproj", "{E54D4581-CD59-4687-BB10-694B8192EABA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B119505D-5CD1-48E4-BED1-9C2BF26153D5}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibCecSharpCore", "..\src\dotnetlib\LibCecSharpCore\project\LibCecSharpCore.vcxproj", "{E8C30CBD-64D1-44F8-9172-82B728986DCC}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibCecSharpCore", "..\src\dotnetlib\LibCecSharpCore\LibCecSharpCore.vcxproj", "{E8C30CBD-64D1-44F8-9172-82B728986DCC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
25 changes: 25 additions & 0 deletions project/nsis/cec-tray.nsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Section "libCEC Tray" SecTray
SetShellVarContext current
SectionIn 1

; Copy to the installation directory
SetOutPath "$INSTDIR\x86\netfx"
File "..\build\x86\cec-tray.exe"
SetOutPath "$INSTDIR\x64\netfx"
File /nonfatal "..\build\amd64\cec-tray.exe"

!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
SetOutPath "$INSTDIR"

CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
${If} ${RunningX64}
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\cec-tray.lnk" "$INSTDIR\x64\netfx\cec-tray.exe" \
"" "$INSTDIR\x64\netfx\cec-tray.exe" 0 SW_SHOWNORMAL \
"" "Start libCEC Tray (x64)."
${Else}
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\cec-tray.lnk" "$INSTDIR\x86\netfx\cec-tray.exe" \
"" "$INSTDIR\netfx\cec-tray.exe" 0 SW_SHOWNORMAL \
"" "Start libCEC Tray."
${EndIf}
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
28 changes: 0 additions & 28 deletions project/nsis/functions.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,3 @@
!undef _TEMPFILE
!macroend
!define !defineifexist "!insertmacro !defineifexist"

; Function used to get the parent directory of the installer
Function GetParentDirectory

Exch $R0
Push $R1
Push $R2
Push $R3

StrCpy $R1 0
StrLen $R2 $R0

loop:
IntOp $R1 $R1 + 1
IntCmp $R1 $R2 get 0 get
StrCpy $R3 $R0 1 -$R1
StrCmp $R3 "\" get
Goto loop

get:
StrCpy $R0 $R0 -$R1

Pop $R3
Pop $R2
Pop $R1
Exch $R0

FunctionEnd
Loading

0 comments on commit cf8cea4

Please sign in to comment.