Code Monkey home page Code Monkey logo

libcec's Introduction

About

This library provides support for Pulse-Eight's USB-CEC adapter and other CEC capable hardware, like the Raspberry Pi.

You can find a list of frequently asked questions on [libCEC's FAQ page] (http://libcec.pulse-eight.com/faq)

Supported platforms

Linux & BSD

Prerequisites

libCEC needs the following dependencies in order to work correctly:

To compile libCEC on Linux, you'll need the following dependencies:

The following dependencies are recommended. Without them, the adapter can not be (fully) auto-detected.

  • pkg-config
  • udev development headers v151 or later
  • X randr development headers

Compilation

To compile libCEC on a new Debian/Ubuntu installation, follow these instructions:

apt-get update
apt-get install cmake liblockdev1-dev libudev-dev libxrandr-dev python-dev swig
cd
git clone https://github.com/Pulse-Eight/platform.git
mkdir platform/build
cd platform/build
cmake ..
make
sudo make install
cd
git clone https://github.com/Pulse-Eight/libcec.git
mkdir libcec/build
cd libcec/build
cmake ..
make -j4
sudo make install
sudo ldconfig

Raspberry Pi

If you're compiling for a Raspberry Pi, then the path to the required headers and libraries can be set manually, in case it's not in a standard system directory:

cmake -DRPI_INCLUDE_DIR=/path/to/vc/include \
      -DRPI_LIB_DIR=/path/to/vc/lib \
      ..

If you're cross compiling, then you can set the correct toolchain like this (for the Raspberry Pi):

cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/CrossCompile.cmake \
      -DXCOMPILE_BASE_PATH=/path/to/tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi \
      -DXCOMPILE_LIB_PATH=/path/to/firmware/hardfp/opt/vc/lib \
      -DRPI_INCLUDE_DIR=/path/to/firmware/hardfp/opt/vc/include \
      -DRPI_LIB_DIR=/path/to/firmware/hardfp/opt/vc/lib \
      ..

To compile libCEC on a new Raspbian installation, follow these instructions:

apt-get update
apt-get install cmake liblockdev1-dev libudev-dev libxrandr-dev python-dev swig
cd
git clone https://github.com/Pulse-Eight/platform.git
mkdir platform/build
cd platform/build
cmake ..
make
sudo make install
cd
git clone https://github.com/Pulse-Eight/libcec.git
mkdir libcec/build
cd libcec/build
cmake -DRPI_INCLUDE_DIR=/opt/vc/include -DRPI_LIB_DIR=/opt/vc/lib ..
make -j4
sudo make install
sudo ldconfig

Exynos

To compile in support for Exynos devices, you have to pass the argument -DHAVE_EXYNOS_API=1 to cmake:

cmake -DHAVE_EXYNOS_API=1 ..

TDA995x

To compile in support for TDA995x devices, you have to pass the argument -DHAVE_TDA995X_API=1 to cmake:

cmake -DHAVE_TDA995X_API=1 ..

Debian

Use the following commands to create a debian package:

source /etc/lsb-release
sed "s/#DIST#/${DISTRIB_CODENAME}/g" debian/changelog.in > debian/changelog
dpkg-buildpackage

Apple OS X

Prerequisites

To compile libCEC on OS X, you'll need the following dependencies:

Compilation

To compile, execute the following command:

mkdir build
cd build
cmake ..
make
sudo make install

Note: You may need to copy pkg.m4 to your m4 sources directory

Microsoft Windows

Prerequisites

To compile libCEC on Windows, you'll need the following dependencies:

When compiling LibCecSharp, you'll need the following versions too:

  • Visual Studio 2012
  • Visual Studio 2010
  • Visual Studio 2008

Compilation

To compile libCEC, follow these instructions:

  • run support\build.cmd to build libCEC and cec-client
  • open project\libcec.sln with Visual Studio 2013.
  • build the project.

To develop for libCEC or cec-client in Visual Studio:

  • run support\visual-studio.cmd

To build an installer on Windows:

  • go to project and execute create-installer.bat to create the installer.
  • the installer is stored as build\libCEC-installer.exe

Developers

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 in src/cec-client/cec-client.cpp

C developers

  • the API can be found in include/cecc.h
  • an example implementation can be found in src/cecc-client/cecc-client.cpp

.NET developers

  • add a reference to LibCecSharp.dll
  • an example can be found in src\CecSharpTester\CecSharpClient.cs

Python developers

  • the API is exported to Python through Swig
  • an example can be found in src/pyCecClient

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.

libcec's People

Contributors

opdenkamp avatar p8-jenkins avatar bobo1on1 avatar malard avatar warped-rudi avatar mk01 avatar popcornmix avatar mark-kendall avatar robbiet480 avatar davilla avatar rbalint avatar ksooo avatar nhellfire avatar linuxstb avatar finson avatar jmarcet avatar obruni avatar jerome-benoit avatar memphiz avatar nedimlisica avatar ghuron avatar kingosticks avatar mrgreywater avatar wsnipex avatar

Watchers

Nathan Friedly avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.