Skip to content

Commit

Permalink
[cec] bump to libCEC 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
opdenkamp committed May 3, 2015
1 parent f74f8c9 commit be8f33d
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 77 deletions.
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1672,9 +1672,9 @@ if test "x$use_libcec" != "xno"; then
# libcec is dyloaded, so we need to check for its headers and link any depends.
if test "x$use_libcec" != "xno"; then
if test "x$use_libcec" != "xauto"; then
PKG_CHECK_MODULES([CEC],[libcec >= 2.1.0],,[use_libcec="no";AC_MSG_ERROR($libcec_disabled)])
PKG_CHECK_MODULES([CEC],[libcec >= 3.0.0],,[use_libcec="no";AC_MSG_ERROR($libcec_disabled)])
else
PKG_CHECK_MODULES([CEC],[libcec >= 2.1.0],,[use_libcec="no";AC_MSG_RESULT($libcec_disabled)])
PKG_CHECK_MODULES([CEC],[libcec >= 3.0.0],,[use_libcec="no";AC_MSG_RESULT($libcec_disabled)])
fi

if test "x$use_libcec" != "xno"; then
Expand Down
54 changes: 0 additions & 54 deletions lib/libcec/Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion project/BuildDependencies/scripts/0_package.list
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jsonschemabuilder-1.0.0-win32-3.7z
libass-0.12.1-win32.7z
libbluray-0.4.0-win32.zip
libcdio-0.83-win32-2.7z
libcec-2.2.0-win32-1.7z
libcec-3.0.0-win32-1.7z
libexpat_2.0.1-win32.7z
libflac-1.2.1-win32.7z
libfribidi-0.19.2-win32.7z
Expand Down
3 changes: 2 additions & 1 deletion tools/depends/target/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ DEPENDS = \
python26 libshairplay \
libplist libcec libbluray boost tinyxml dummy-libxbmc \
libamplayer libssh taglib libusb libnfs libmp3lame \
pythonmodule-pil libxslt ffmpeg
pythonmodule-pil libxslt ffmpeg platform

FFMPEG_DEPENDS = gnutls

Expand Down Expand Up @@ -97,6 +97,7 @@ pythonmodule-pil: $(ZLIB) libjpeg-turbo libpng freetype2 python26
libsdl2: $(LINUX_SYSTEM_LIBS)
libxslt: libgcrypt
ffmpeg: $(ICONV) $(ZLIB) bzip2 libvorbis $(FFMPEG_DEPENDS)
libcec: platform

.installed-$(PLATFORM): $(DEPENDS)
touch $@
Expand Down
30 changes: 15 additions & 15 deletions tools/depends/target/libcec/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,36 @@ DEPS= ../../Makefile.include Makefile

# lib name, version
LIBNAME=libcec
VERSION=2.2.0
SOURCE=$(LIBNAME)-$(VERSION)
ARCHIVE=$(SOURCE)-3.tar.gz
VERSION_MAJOR=3
VERSION_MINOR=0
VERSION_PATCH=0

# configuration settings
CONFIGURE=./configure --prefix=$(PREFIX) --disable-rpi \
VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)
SOURCE=$(LIBNAME)-$(VERSION)-6
ARCHIVE=$(SOURCE).tar.gz

LIBDYLIB=$(PLATFORM)/src/lib/.libs/libcec.la
LIBDYLIB=$(PLATFORM)/build/src/$(LIBNAME).la

all: .installed-$(PLATFORM)

$(TARBALLS_LOCATION)/$(ARCHIVE):
cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)

$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS)
rm -rf $(PLATFORM); mkdir -p $(PLATFORM)
rm -rf $(PLATFORM); mkdir -p $(PLATFORM)/build
cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(PLATFORM); $(AUTORECONF) -vif
cd $(PLATFORM); $(CONFIGURE)
cd $(PLATFORM)/build; $(CMAKE) -DBUILD_SHARED_LIBS=1 -DSKIP_PYTHON_WRAPPER:STRING=1 -DCMAKE_INSTALL_LIBDIR=$(PREFIX)/lib ..

$(LIBDYLIB): $(PLATFORM)
$(MAKE) -C $(PLATFORM)/src/lib
$(MAKE) -C $(PLATFORM)/build

.installed-$(PLATFORM): $(LIBDYLIB)
$(MAKE) -C $(PLATFORM)/src/lib install
$(MAKE) -C $(PLATFORM)/build install
ifeq ($(OS),android)
rm -f $(PREFIX)/lib/libcec.la $(PREFIX)/lib/libcec.so $(PREFIX)/lib/libcec.so.2
mv -f $(PREFIX)/lib/libcec.so.2.0.1 $(PREFIX)/lib/libcec.so
$(RPL) -e "libcec.so.2" "libcec.so\x00\x00" $(PREFIX)/lib/libcec.so
-$(READELF) --dynamic $(PREFIX)/lib/libcec.so | grep ibrary
rm -f $(PREFIX)/lib/$(LIBNAME).la $(PREFIX)/lib/$(LIBNAME).so $(PREFIX)/lib/$(LIBNAME).so.$(VERSION_MAJOR) $(PREFIX)/lib/$(LIBNAME).so.$(VERSION_MAJOR).$(VERSION_MINOR)
mv -f $(PREFIX)/lib/$(LIBNAME).so.$(VERSION) $(PREFIX)/lib/$(LIBNAME).so
$(RPL) -e "$(LIBNAME).so.$(VERSION_MAJOR)" "$(LIBNAME).so\x00\x00" $(PREFIX)/lib/$(LIBNAME).so
-$(READELF) --dynamic $(PREFIX)/lib/$(LIBNAME).so | grep ibrary
endif
touch $@

Expand Down
34 changes: 34 additions & 0 deletions tools/depends/target/platform/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
include ../../Makefile.include
DEPS= ../../Makefile.include Makefile

# lib name, version
LIBNAME=platform
VERSION=1.0.4

This comment has been minimized.

Copy link
@Memphiz

Memphiz May 9, 2015

Member

@opdenkamp args - this tarball isn't on our mirrors - while jenkins might have that tarball in its cache i can'T compile on one of my rigs here ...

This comment has been minimized.

Copy link
@opdenkamp

opdenkamp May 9, 2015

Author Member

it's been superseded. 1.0.7 now in that other PR that you commented on

This comment has been minimized.

Copy link
@Memphiz

Memphiz May 9, 2015

Member

@opdenkamp we never ever delete stuff from the mirrors. And we never delete stuff from the mirrors if master relies on it - see:
https://github.com/xbmc/xbmc/blob/master/tools/depends/target/platform/Makefile#L6

This comment has been minimized.

Copy link
@opdenkamp

opdenkamp via email May 9, 2015

Author Member

This comment has been minimized.

Copy link
@Memphiz

Memphiz May 10, 2015

Member

@opdenkamp fyi i have uploaded 1.0.4 back to our mirrors (from my tarballs folder) because a user also found out that the build is broken now ;). Also you don't need to upload to darwin-libs anymore. All platforms using unified depends pull the tarballs from the sources folder ...

This comment has been minimized.

Copy link
@Memphiz

Memphiz May 11, 2015

Member

@opdenkamp if there is anything i can help you with just give me a sign and i try to free some spare time.

This comment has been minimized.

Copy link
@opdenkamp

opdenkamp May 11, 2015

Author Member

I'll ping you, thanks. got the logs now with the issues, so I should be able to fix the defines at least (those need guard ifdefs for mac anyway from the looks of it) and it looked like the add-ons that didn't build need some work too.

SOURCE=$(LIBNAME)-$(VERSION)
ARCHIVE=$(SOURCE).tar.gz

LIBDYLIB=$(PLATFORM)/build/src/$(LIBNAME).a

all: .installed-$(PLATFORM)

$(TARBALLS_LOCATION)/$(ARCHIVE):
cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)

$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS)
rm -rf $(PLATFORM); mkdir -p $(PLATFORM)/build
cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(PLATFORM)/build; $(CMAKE) -DBUILD_SHARED_LIBS=0 -DCMAKE_INSTALL_LIBDIR=$(PREFIX)/lib ..

$(LIBDYLIB): $(PLATFORM)
$(MAKE) -C $(PLATFORM)/build

.installed-$(PLATFORM): $(LIBDYLIB)
$(MAKE) -C $(PLATFORM)/build install
touch $@

clean:
rm -rf $(PLATFORM) .installed-$(PLATFORM)

distclean::
rm -rf $(PLATFORM) .installed-$(PLATFORM)

8 changes: 4 additions & 4 deletions xbmc/peripherals/devices/PeripheralCecAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ using namespace ANNOUNCEMENT;
using namespace CEC;
using namespace std;

#define CEC_LIB_SUPPORTED_VERSION 0x2100
#define CEC_LIB_SUPPORTED_VERSION LIBCEC_VERSION_TO_UINT(3, 0, 0)

/* time in seconds to ignore standby commands from devices after the screensaver has been activated */
#define SCREENSAVER_TIMEOUT 20
Expand Down Expand Up @@ -284,7 +284,7 @@ bool CPeripheralCecAdapter::InitialiseFeature(const PeripheralFeature feature)
}
else
{
CLog::Log(LOGDEBUG, "%s - using libCEC v%s", __FUNCTION__, m_cecAdapter->ToString((cec_server_version)m_configuration.serverVersion));
CLog::Log(LOGDEBUG, "%s - using libCEC v%s", __FUNCTION__, m_cecAdapter->VersionToString(m_configuration.serverVersion).c_str());
SetVersionInfo(m_configuration);
}

Expand All @@ -297,7 +297,7 @@ bool CPeripheralCecAdapter::InitialiseFeature(const PeripheralFeature feature)

void CPeripheralCecAdapter::SetVersionInfo(const libcec_configuration &configuration)
{
m_strVersionInfo = StringUtils::Format("libCEC %s - firmware v%d", m_cecAdapter->ToString((cec_server_version)configuration.serverVersion), configuration.iFirmwareVersion);
m_strVersionInfo = StringUtils::Format("libCEC %s - firmware v%d", m_cecAdapter->VersionToString(configuration.serverVersion).c_str(), configuration.iFirmwareVersion);

// append firmware build date
if (configuration.iFirmwareBuildDate != CEC_FW_BUILD_UNKNOWN)
Expand Down Expand Up @@ -1322,7 +1322,7 @@ void CPeripheralCecAdapter::SetConfigurationFromLibCEC(const CEC::libcec_configu
void CPeripheralCecAdapter::SetConfigurationFromSettings(void)
{
// client version matches the version of libCEC that we originally used the API from
m_configuration.clientVersion = CEC_CLIENT_VERSION_2_2_0;
m_configuration.clientVersion = LIBCEC_VERSION_TO_UINT(3, 0, 0);

// device name 'XBMC'
snprintf(m_configuration.strDeviceName, 13, "%s", GetSettingString("device_name").c_str());
Expand Down

0 comments on commit be8f33d

Please sign in to comment.