From patchwork Wed Jan 29 23:45:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 315243 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 1CB4F2C00CF for ; Thu, 30 Jan 2014 10:46:07 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 6472A338DD; Wed, 29 Jan 2014 23:46:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4n0XKhdPIVb9; Wed, 29 Jan 2014 23:46:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 1B9EB338E6; Wed, 29 Jan 2014 23:45:51 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 2181A1BFAB0 for ; Wed, 29 Jan 2014 23:45:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 1E08C90863 for ; Wed, 29 Jan 2014 23:45:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 81v11VGK58xs for ; Wed, 29 Jan 2014 23:45:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wg0-f53.google.com (mail-wg0-f53.google.com [74.125.82.53]) by whitealder.osuosl.org (Postfix) with ESMTPS id 6DE5B90877 for ; Wed, 29 Jan 2014 23:45:45 +0000 (UTC) Received: by mail-wg0-f53.google.com with SMTP id y10so4879078wgg.8 for ; Wed, 29 Jan 2014 15:45:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=vzW1KCOeIYSySVUE9hZ8b2Q92cuxelhlA9oB2gT83wY=; b=Bx5omn+/bvPbugML63QlcgyStyoTN91Ub0Q8D19TQLh3Pdy/28RafKqEs7cfznh0tn fWg5HG0dOXiluCjjGWGQm6QSgk+7YTqP7v5+qPTSR0avJ+RBzFZlK31kaZwz4aIq4k+H CyQYUQJDep+PHK87Mat0mkbRJ+jt2ktrtQrAkXpbRtYbuHgTxOgSJwQY0SwZKT/Exi9V kink599Y6CeYElXwhNofFDlHzveVz0WcckzrTPVzjOl5Gokz08wG4sVv9VFEhcP3k8FD IC/y6CJwIdHV1Qr4vzTrOMMmRUNYP1ZJ8qYB30nPVUyzCtRAP3e+DudSjedzXHWxIZ5Y aVvQ== X-Received: by 10.194.92.109 with SMTP id cl13mr6887005wjb.13.1391039143978; Wed, 29 Jan 2014 15:45:43 -0800 (PST) Received: from gourin.bzh.lan (ks3095497.kimsufi.com. [94.23.60.27]) by mx.google.com with ESMTPSA id q15sm8208407wjw.18.2014.01.29.15.45.42 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 Jan 2014 15:45:43 -0800 (PST) From: "Yann E. MORIN" To: buildroot@busybox.net Date: Thu, 30 Jan 2014 00:45:40 +0100 Message-Id: <95ec9cb38d2dc7f0fe3c796b17e39883101d3ac4.1391039071.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: References: Cc: "Yann E. MORIN" Subject: [Buildroot] [PATCH 2/2] package/omxplayer: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net From: "Yann E. MORIN" OMXplayer uses openMAX on the RPi to play videos with hardware acceleration. Compared to using a gstreamer pipe, OMXplayer uses a complete "tunnel-mode", in which the video is piped (after demuxing) into the hardware, all the way down to the display, whereas gstreamer composes the video using the eglgles sink, which uses mem-to-mem copies. So, when playing a locally-stored 1080p video, OMXplayer uses around 20% CPU, while gstreamer bursts up to 40+% when playing 720p and totally chokes on 1080p; all on an non-overclocked RPi. Signed-off-by: "Yann E. MORIN" Cc: Maxime Hadjinlian Cc: Samuel Martin Cc: Thomas De Schampheleire --- package/Config.in | 1 + package/omxplayer/Config.in | 31 +++++++++++++++ .../omxplayer-0000-clean-up-Makefile.include.patch | 38 +++++++++++++++++++ package/omxplayer/omxplayer.mk | 44 ++++++++++++++++++++++ 4 files changed, 114 insertions(+) create mode 100644 package/omxplayer/Config.in create mode 100644 package/omxplayer/omxplayer-0000-clean-up-Makefile.include.patch create mode 100644 package/omxplayer/omxplayer.mk diff --git a/package/Config.in b/package/Config.in index 37b19ab..68a2509 100644 --- a/package/Config.in +++ b/package/Config.in @@ -19,6 +19,7 @@ source "package/mpd/Config.in" source "package/mpg123/Config.in" source "package/mplayer/Config.in" source "package/musepack/Config.in" +source "package/omxplayer/Config.in" source "package/on2-8170-libs/Config.in" source "package/opus-tools/Config.in" source "package/pulseaudio/Config.in" diff --git a/package/omxplayer/Config.in b/package/omxplayer/Config.in new file mode 100644 index 0000000..419b0be --- /dev/null +++ b/package/omxplayer/Config.in @@ -0,0 +1,31 @@ +comment "omxplayer needs a toolchain w/ C++, threads, largefile, IPv6" + depends on !(BR2_INSTALL_LIBSTDCPP && BR2_TOOLCHAIN_HAS_THREADS && BR2_LARGEFILE && BR2_INET_IPV6) + depends on BR2_arm + +config BR2_PACKAGE_OMXPLAYER + bool "omxplayer" + depends on BR2_arm + depends on BR2_INSTALL_LIBSTDCPP # boost, rpi-userland + depends on BR2_TOOLCHAIN_HAS_THREADS # boost, dbus, libusb, rpi-userland + depends on BR2_LARGEFILE # boost, ffmpeg2, rpi-userland + depends on BR2_INET_IPV6 # ffmpeg2 + depends on !BR2_PACKAGE_FFMPEG # ffmpeg2 + depends on BR2_USE_MMU # dbus + select BR2_PACKAGE_BOOST + select BR2_PACKAGE_DBUS + select BR2_PACKAGE_FFMPEG2 + select BR2_PACKAGE_FFMPEG2_AVFILTER + select BR2_PACKAGE_FFMPEG2_SWRESAMPLE + select BR2_PACKAGE_FFMPEG2_SWSCALE + select BR2_PACKAGE_FREETYPE + select BR2_PACKAGE_LIBIDN + select BR2_PACKAGE_LIBUSB + select BR2_PACKAGE_PCRE + select BR2_PACKAGE_RPI_USERLAND + select BR2_PACKAGE_ZLIB + help + OMXPlayer is a commandline OMX player for the Raspberry Pi. It was + developed as a testbed for the XBMC Raspberry PI implementation + and is quite handy to use standalone. + + https://github.com/popcornmix/omxplayer diff --git a/package/omxplayer/omxplayer-0000-clean-up-Makefile.include.patch b/package/omxplayer/omxplayer-0000-clean-up-Makefile.include.patch new file mode 100644 index 0000000..598500d --- /dev/null +++ b/package/omxplayer/omxplayer-0000-clean-up-Makefile.include.patch @@ -0,0 +1,38 @@ +Makefile.include: clean up the cruft + +Most of the variables that Makefile.include tries to set (and fails to), +are already available from Buildroot's variables: + - AR, AS, CC, CXX, OBJDUMP... + - CFLAGS, CXXFLAGS, CPPFLAGS... + +This leaves us with a few select variables that defines (include and +library) paths local to the omxplayer package, plus a few optimisations. + +Signed-off-by: "Yann E. MORIN" +diff -durN omxplayer-37fd6fb.orig/Makefile.include omxplayer-37fd6fb/Makefile.include +--- omxplayer-37fd6fb.orig/Makefile.include 2013-10-16 14:21:05.000000000 +0200 ++++ omxplayer-37fd6fb/Makefile.include 2013-10-17 22:53:02.294062252 +0200 +@@ -20,21 +20,5 @@ + + JOBS=7 + +-CFLAGS := -isystem$(PREFIX)/include +-CXXFLAGS := $(CFLAGS) +-CPPFLAGS := $(CFLAGS) +-LDFLAGS := -L$(BUILDROOT)/lib +-LD := $(TOOLCHAIN)/bin/$(HOST)-ld --sysroot=$(SYSROOT) +-CC := $(TOOLCHAIN)/bin/$(HOST)-gcc --sysroot=$(SYSROOT) +-CXX := $(TOOLCHAIN)/bin/$(HOST)-g++ --sysroot=$(SYSROOT) +-OBJDUMP := $(TOOLCHAIN)/bin/$(HOST)-objdump +-RANLIB := $(TOOLCHAIN)/bin/$(HOST)-ranlib +-STRIP := $(TOOLCHAIN)/bin/$(HOST)-strip +-AR := $(TOOLCHAIN)/bin/$(HOST)-ar +-CXXCP := $(CXX) -E +-PATH := $(PREFIX)/bin:$(BUILDROOT)/output/host/usr/bin:$(PATH) +- +-CFLAGS += -pipe -mfloat-abi=$(FLOAT) -mcpu=arm1176jzf-s -fomit-frame-pointer -mabi=aapcs-linux -mtune=arm1176jzf-s -mfpu=vfp -Wno-psabi -mno-apcs-stack-check -g -mstructure-size-boundary=32 -mno-sched-prolog +-LDFLAGS += -L$(SDKSTAGE)/lib -L$(SDKSTAGE)/usr/lib -L$(SDKSTAGE)/opt/vc/lib/ -Lpcre/build +-#INCLUDES += -isystem$(SDKSTAGE)/usr/include -isystem$(SDKSTAGE)/opt/vc/include -isystem$(SYSROOT)/usr/include -isystem$(SDKSTAGE)/opt/vc/include/interface/vcos/pthreads -isystem$(SDKSTAGE)/usr/include/freetype2 +-INCLUDES += -isystem$(SDKSTAGE)/opt/vc/include -isystem$(SYSROOT)/usr/include -isystem$(SDKSTAGE)/opt/vc/include/interface/vcos/pthreads -Ipcre/build -Iboost-trunk -Ifreetype2/include ++CFLAGS += -fomit-frame-pointer -Wno-psabi -mno-apcs-stack-check \ ++ -mstructure-size-boundary=32 -mno-sched-prolog diff --git a/package/omxplayer/omxplayer.mk b/package/omxplayer/omxplayer.mk new file mode 100644 index 0000000..011866d --- /dev/null +++ b/package/omxplayer/omxplayer.mk @@ -0,0 +1,44 @@ +################################################################################ +# +# omxplayer +# +################################################################################ + +OMXPLAYER_VERSION = 1091db2c87b480fc074fb780e507db18798a2613 +OMXPLAYER_SITE = $(call github,popcornmix,omxplayer,$(OMXPLAYER_VERSION)) +OMXPLAYER_LICENSE = GPLv2+ +OMXPLAYER_LICENSE_FILES = COPYING + +OMXPLAYER_DEPENDENCIES = host-pkgconf boost dbus ffmpeg2 freetype libidn \ + libusb pcre rpi-userland zlib + +OMXPLAYER_EXTRA_CFLAGS = \ + -DTARGET_LINUX -DTARGET_POSIX \ + $(shell $(PKG_CONFIG_HOST_BINARY) --cflags bcm_host) \ + $(shell $(PKG_CONFIG_HOST_BINARY) --cflags freetype2) \ + $(shell $(PKG_CONFIG_HOST_BINARY) --cflags dbus-1) \ + +# OMXplayer has support for building in Buildroot, but that +# procedure is, well, tainted. Fix this by forcing the real, +# correct values. +OMXPLAYER_MAKE_ENV = \ + USE_BUILDROOT=1 \ + BUILDROOT=$(TOP_DIR) \ + SDKSTAGE=$(STAGING_DIR) \ + TARGETFS=$(TARGET_DIR) \ + TOOLCHAIN=$(HOST_DIR)/usr \ + HOST=$(GNU_TARGET_NAME) \ + SYSROOT=$(STAGING_DIR) \ + JOBS=$(PARALLEL_JOBS) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS) $(OMXPLAYER_EXTRA_CFLAGS)" + +define OMXPLAYER_BUILD_CMDS + $(OMXPLAYER_MAKE_ENV) $(MAKE) -C $(@D) +endef + +define OMXPLAYER_INSTALL_TARGET_CMDS + $(INSTALL) -m 0755 -D $(@D)/omxplayer.bin $(TARGET_DIR)/usr/bin/omxplayer +endef + +$(eval $(generic-package))