!1 初始化libcrystalhd仓库
From: @pei-jiankang Reviewed-by: @dou33 Signed-off-by: @dou33
This commit is contained in:
commit
a83845105f
14
LICENSE
Normal file
14
LICENSE
Normal file
@ -0,0 +1,14 @@
|
||||
Legal Disclaimer
|
||||
The Crystal HD video decoder open source software is provided under the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation ("LGPL"). This software is distributed in the hope that it will be useful, but WITHOUT ANY SUPPORT OR WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the LGPL for more details. A copy of the LGPL is available at http://www.broadcom.com/licenses/LGPLv2.1.php or by writing to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
The BCM70015 and BCM70012 device firmware (binary files bcm70015fw.bin and bcm70012fw.bin) is distributed under the following terms:
|
||||
|
||||
Copyright 2007-2010 Broadcom Corporation.
|
||||
|
||||
Redistribution and use in binary forms of this software, without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of Broadcom nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
65
README_07032010
Normal file
65
README_07032010
Normal file
@ -0,0 +1,65 @@
|
||||
Broadcom CrystalHD Linux Software Release 07032010
|
||||
|
||||
This is beta release of the Linux driver and application software with support for the BCM70012 and BCM70015
|
||||
|
||||
This is a pure source release with no distribution binary packages
|
||||
|
||||
FEATURES SUPPORTED -
|
||||
|
||||
Playback support for H.264 and other codecs using the default media players for Ubuntu and Meego. This includes support for GStreamer based applications.
|
||||
|
||||
Support both BCM70012 and BCM70015
|
||||
|
||||
FIXED ISSUES
|
||||
Kernel oops during driver load
|
||||
64-bit support
|
||||
Power management
|
||||
HW scaling
|
||||
|
||||
KNOWN ISSUES
|
||||
|
||||
Seeking hangs the player
|
||||
Playlist functionality does not work correctly
|
||||
VC-1 not functional
|
||||
|
||||
BUILD and INSTALL instructions
|
||||
|
||||
Required packages -
|
||||
|
||||
Under Ubuntu the following additional packages are required, install them using "sudo apt-get <package-name>"
|
||||
|
||||
build-essential
|
||||
g++
|
||||
automake
|
||||
autoconf
|
||||
libtool
|
||||
libgstreamer0.10-dev
|
||||
libgstreamer-plugins-base0.10-dev
|
||||
|
||||
In order to build and install the driver -
|
||||
|
||||
In the driver/linux folder, run the following commands -
|
||||
|
||||
autoconf
|
||||
./configure
|
||||
make
|
||||
sudo make install
|
||||
|
||||
In order to build and install the library -
|
||||
|
||||
In the linux_lib/libcrystalhd folder, run the following commands -
|
||||
|
||||
make
|
||||
sudo make install
|
||||
|
||||
In order to build and install the media player application library (gstreamer plugin) -
|
||||
|
||||
In the filters/gst/gst-plugin/, run the following commands -
|
||||
|
||||
./autogen.sh
|
||||
make
|
||||
sudo make install
|
||||
|
||||
Finally copy the firmware files from firmware/fwbin/70015 and firmware/fwbin/70012 directories to /lib/firmware
|
||||
|
||||
If HW scaling is necessary - in libcrystalhd_if.cpp in line 1240 uncomment the Ctx->EnableScaling line
|
||||
BIN
bcm70012fw.bin
Normal file
BIN
bcm70012fw.bin
Normal file
Binary file not shown.
BIN
bcm70015fw.bin
Normal file
BIN
bcm70015fw.bin
Normal file
Binary file not shown.
1087
crystalhd-gst-Port-to-GStreamer-1.0-API.patch
Normal file
1087
crystalhd-gst-Port-to-GStreamer-1.0-API.patch
Normal file
File diff suppressed because it is too large
Load Diff
BIN
libcrystalhd-20120405.tar.bz2
Normal file
BIN
libcrystalhd-20120405.tar.bz2
Normal file
Binary file not shown.
105
libcrystalhd-nosse2.patch
Normal file
105
libcrystalhd-nosse2.patch
Normal file
@ -0,0 +1,105 @@
|
||||
diff -up libcrystalhd-20120405/linux_lib/libcrystalhd/libcrystalhd_int_if.cpp.nosse2 libcrystalhd-20120405/linux_lib/libcrystalhd/libcrystalhd_int_if.cpp
|
||||
--- libcrystalhd-20120405/linux_lib/libcrystalhd/libcrystalhd_int_if.cpp.nosse2 2011-03-14 21:02:54.000000000 +0100
|
||||
+++ libcrystalhd-20120405/linux_lib/libcrystalhd/libcrystalhd_int_if.cpp 2012-08-03 20:04:23.700362339 +0200
|
||||
@@ -33,7 +33,9 @@
|
||||
#include "libcrystalhd_int_if.h"
|
||||
#include "libcrystalhd_fwcmds.h"
|
||||
|
||||
+#if __SSE2__ || !defined __GNUC__
|
||||
#include <emmintrin.h>
|
||||
+#endif
|
||||
|
||||
#define SV_MAX_LINE_SZ 128
|
||||
#define PCI_GLOBAL_CONTROL MISC2_GLOBAL_CTRL
|
||||
@@ -1425,11 +1427,14 @@ BC_STATUS DtsCopyNV12(DTS_LIB_CONTEXT *C
|
||||
}
|
||||
|
||||
// TODO: add sse2 detection
|
||||
+#if __SSE2__
|
||||
static bool gSSE2 = true; // most of the platforms will have it anyway:
|
||||
+#endif
|
||||
// 64 bits: no test necessary
|
||||
// mac: no test necessary
|
||||
// linux/windows: we might have to do the test.
|
||||
|
||||
+#if __SSE2__
|
||||
static void fast_memcpy(uint8_t *dst, const uint8_t *src, uint32_t count)
|
||||
{
|
||||
// tested
|
||||
@@ -1466,6 +1471,9 @@ static void fast_memcpy(uint8_t *dst, co
|
||||
while (count --)
|
||||
*dst++ = *src++;
|
||||
}
|
||||
+#else
|
||||
+#define fast_memcpy(a,b,c) memcpy(a,b,c)
|
||||
+#endif
|
||||
|
||||
// this is not good.
|
||||
// if we have 3 buffers, we cannot assume V is after U
|
||||
@@ -1504,6 +1512,7 @@ static BC_STATUS DtsCopy422ToUYVY(uint8_
|
||||
|
||||
for (__y = 0; __y < height; __y++)
|
||||
{
|
||||
+#if __SSE2__
|
||||
if (gSSE2)
|
||||
{
|
||||
if (((((uintptr_t) dstY) & 0xf) == 0) && ((((uintptr_t) srcY) & 0xf) == 0))
|
||||
@@ -1529,6 +1538,7 @@ static BC_STATUS DtsCopy422ToUYVY(uint8_
|
||||
}
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
while (x < srcWidth-1)
|
||||
{
|
||||
@@ -1548,6 +1558,7 @@ static BC_STATUS DtsCopy422ToUYVY(uint8_
|
||||
// convert to NV12
|
||||
static BC_STATUS DtsCopy422ToNV12(uint8_t *dstY, uint8_t *dstUV, const uint8_t *srcY, uint32_t srcWidth, uint32_t dstWidth, uint32_t height, uint32_t strideY, uint32_t strideUV)
|
||||
{
|
||||
+#if __SSE2__
|
||||
// tested
|
||||
uint32_t x, __y;
|
||||
|
||||
@@ -1667,6 +1678,9 @@ static BC_STATUS DtsCopy422ToNV12(uint8_
|
||||
dstY += strideY;
|
||||
}
|
||||
return BC_STS_SUCCESS;
|
||||
+#else
|
||||
+ return BC_STS_INV_ARG;
|
||||
+#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1681,6 +1695,7 @@ static BC_STATUS DtsCopy420ToYV12(uint8_
|
||||
|
||||
static BC_STATUS DtsCopy420ToYUY2(uint8_t *dstY, uint8_t *dstUV, const uint8_t *srcY, const uint8_t *srcUV, uint32_t srcWidth, uint32_t dstWidth, uint32_t height, uint32_t strideY, uint32_t strideUV)
|
||||
{
|
||||
+#if __SSE2__
|
||||
// TODO, test this
|
||||
uint32_t x, __y;
|
||||
|
||||
@@ -1836,10 +1851,14 @@ static BC_STATUS DtsCopy420ToYUY2(uint8_
|
||||
}
|
||||
|
||||
return BC_STS_SUCCESS;
|
||||
+#else
|
||||
+ return BC_STS_INV_ARG;
|
||||
+#endif
|
||||
}
|
||||
|
||||
static BC_STATUS DtsCopy420ToUYVY(uint8_t *dstY, uint8_t *dstUV, const uint8_t *srcY, const uint8_t *srcUV, uint32_t srcWidth, uint32_t dstWidth, uint32_t height, uint32_t strideY, uint32_t strideUV)
|
||||
{
|
||||
+#if __SSE2__
|
||||
// TODO, test this
|
||||
uint32_t x, __y;
|
||||
|
||||
@@ -1993,6 +2012,9 @@ static BC_STATUS DtsCopy420ToUYVY(uint8_
|
||||
}
|
||||
|
||||
return BC_STS_SUCCESS;
|
||||
+#else
|
||||
+ return BC_STS_INV_ARG;
|
||||
+#endif
|
||||
}
|
||||
|
||||
static BC_STATUS DtsCopy420ToNV12(uint8_t *dstY, uint8_t *dstUV, const uint8_t *srcY, const uint8_t *srcUV, uint32_t srcWidth, uint32_t dstWidth, uint32_t height, uint32_t strideY, uint32_t strideUV)
|
||||
23
libcrystalhd-snapshot.sh
Executable file
23
libcrystalhd-snapshot.sh
Executable file
@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
tmp=$(mktemp -d)
|
||||
|
||||
trap cleanup EXIT
|
||||
cleanup() {
|
||||
set +e
|
||||
[ -z "$tmp" -o ! -d "$tmp" ] || rm -rf "$tmp"
|
||||
}
|
||||
|
||||
unset CDPATH
|
||||
pwd=$(pwd)
|
||||
date=$(date +%Y%m%d)
|
||||
package=libcrystalhd
|
||||
svn={$date}
|
||||
svn=HEAD
|
||||
|
||||
cd "$tmp"
|
||||
svn export --force https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk/lib/libcrystalhd/ ${package}-${date}
|
||||
tar cJf "$pwd"/${package}-${date}.tar.xz ${package}-${date}
|
||||
cd - >/dev/null
|
||||
136
libcrystalhd.spec
Normal file
136
libcrystalhd.spec
Normal file
@ -0,0 +1,136 @@
|
||||
%global majorminor 1.0
|
||||
%global date 20120405
|
||||
# Avoid to emit gstreamer provides - rhbz#1184975
|
||||
%undefine __gstreamer1_provides
|
||||
|
||||
Summary: Broadcom Crystal HD device interface library
|
||||
Name: libcrystalhd
|
||||
Version: 3.10.0
|
||||
Release: 1
|
||||
License: LGPLv2
|
||||
URL: http://www.broadcom.com/support/crystal-hd/
|
||||
ExcludeArch: s390 s390x
|
||||
|
||||
#Source: http://www.broadcom.com/docs/support/crystalhd/crystalhd_linux_20100703.zip
|
||||
# This tarball and README are inside the above zip file...
|
||||
# Patch generated from http://git.linuxtv.org/jarod/crystalhd.git
|
||||
Source0: libcrystalhd-%{date}.tar.bz2
|
||||
Source1: README_07032010
|
||||
# We're going to use even newer firmware for now
|
||||
Source2: bcm70012fw.bin
|
||||
Source3: bcm70015fw.bin
|
||||
# LICENSE file is copy-n-pasted from http://www.broadcom.com/support/crystal_hd/
|
||||
Source4: LICENSE
|
||||
Source5: libcrystalhd-snapshot.sh
|
||||
Patch0: libcrystalhd-nosse2.patch
|
||||
# https://patchwork2.kernel.org/patch/2247431/
|
||||
Patch1: crystalhd-gst-Port-to-GStreamer-1.0-API.patch
|
||||
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: autoconf automake libtool
|
||||
BuildRequires: gstreamer1-devel >= %{majorminor}
|
||||
BuildRequires: gstreamer1-plugins-base-devel >= %{majorminor}
|
||||
BuildRequires: make
|
||||
Requires: crystalhd-firmware
|
||||
|
||||
%description
|
||||
The libcrystalhd library provides userspace access to Broadcom Crystal HD
|
||||
video decoder devices. The device supports hardware decoding of MPEG-2,
|
||||
h.264 and VC1 video codecs, up to 1080p at 40fps for the first-generation
|
||||
bcm970012 hardware, and up to 1080p at 60fps for the second-generation
|
||||
bcm970015 hardware.
|
||||
|
||||
%package devel
|
||||
Summary: Development libs for libcrystalhd
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
|
||||
%description devel
|
||||
Development libraries needed to build applications against libcrystalhd.
|
||||
|
||||
%package -n crystalhd-firmware
|
||||
Summary: Firmware for the Broadcom Crystal HD video decoder
|
||||
License: Redistributable, no modification permitted
|
||||
BuildArch: noarch
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
|
||||
%description -n crystalhd-firmware
|
||||
Firmwares for the Broadcom Crystal HD (bcm970012 and bcm970015)
|
||||
video decoders.
|
||||
|
||||
%package -n gstreamer-plugin-crystalhd
|
||||
Summary: Gstreamer crystalhd decoder plugin
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: gstreamer1-plugins-base
|
||||
|
||||
%description -n gstreamer-plugin-crystalhd
|
||||
Gstreamer crystalhd decoder plugin
|
||||
|
||||
%prep
|
||||
%setup -q -n libcrystalhd-%{date}
|
||||
cp %{SOURCE1} %{SOURCE4} .
|
||||
%ifnarch %{ix86} ia64 x86_64
|
||||
%patch0 -p1 -b .nosse2
|
||||
sed -i -e 's|-msse2||' linux_lib/libcrystalhd/Makefile
|
||||
%endif
|
||||
%patch1 -p1 -b .gst1
|
||||
|
||||
%build
|
||||
pushd linux_lib/libcrystalhd/ > /dev/null 2>&1
|
||||
sed -i -e 's|-D__LINUX_USER__|-D__LINUX_USER__ %{optflags}|' Makefile
|
||||
%{make_build}
|
||||
popd > /dev/null 2>&1
|
||||
|
||||
pushd filters/gst/gst-plugin/ > /dev/null 2>&1
|
||||
sh autogen.sh || :
|
||||
|
||||
%configure
|
||||
make %{?_smp_mflags} \
|
||||
CFLAGS="%{optflags} -I%{_builddir}/%{buildsubdir}/include -I%{_builddir}/%{buildsubdir}/linux_lib/libcrystalhd" \
|
||||
BCMDEC_LDFLAGS="%{?__global_ldflags} -L%{_builddir}/%{buildsubdir}/linux_lib/libcrystalhd -lcrystalhd"
|
||||
popd > /dev/null 2>&1
|
||||
|
||||
%install
|
||||
pushd linux_lib/libcrystalhd/ > /dev/null 2>&1
|
||||
make install LIBDIR=%{_libdir} DESTDIR=$RPM_BUILD_ROOT
|
||||
popd > /dev/null 2>&1
|
||||
|
||||
pushd filters/gst/gst-plugin/ > /dev/null 2>&1
|
||||
make install DESTDIR=$RPM_BUILD_ROOT
|
||||
rm -f $RPM_BUILD_ROOT%{_libdir}/gstreamer-1.0/libgstbcmdec.{a,la}
|
||||
popd > /dev/null 2>&1
|
||||
|
||||
rm -rf $RPM_BUILD_ROOT/lib/firmware/
|
||||
mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/firmware/
|
||||
install -pm 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_prefix}/lib/firmware/
|
||||
install -pm 0644 %{SOURCE3} $RPM_BUILD_ROOT%{_prefix}/lib/firmware/
|
||||
|
||||
#Install udev rule
|
||||
mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/udev/rules.d
|
||||
install -pm 0644 driver/linux/20-crystalhd.rules \
|
||||
$RPM_BUILD_ROOT%{_prefix}/lib/udev/rules.d
|
||||
|
||||
|
||||
%ldconfig_scriptlets
|
||||
|
||||
%files
|
||||
%doc README_07032010 LICENSE
|
||||
%{_libdir}/libcrystalhd.so.*
|
||||
|
||||
%files devel
|
||||
%dir %{_includedir}/libcrystalhd
|
||||
%{_includedir}/libcrystalhd/*
|
||||
%{_libdir}/libcrystalhd.so
|
||||
|
||||
%files -n crystalhd-firmware
|
||||
%doc LICENSE
|
||||
%{_prefix}/lib/udev/rules.d/20-crystalhd.rules
|
||||
%{_prefix}/lib/firmware/bcm70012fw.bin
|
||||
%{_prefix}/lib/firmware/bcm70015fw.bin
|
||||
|
||||
%files -n gstreamer-plugin-crystalhd
|
||||
%{_libdir}/gstreamer-%{majorminor}/*.so
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Aug 23 2021 peijiankang <peijiankang@kylinos.cn> - 3.10.0-1
|
||||
- Init libcrystalhd for openeular
|
||||
Loading…
x
Reference in New Issue
Block a user