Browse Source

initial package creation

Signed-off-by: Toshaan Bharvani <toshaan@powerel.org>
master
Toshaan Bharvani 2 years ago
commit
8bb6d4027c
  1. 14
      SOURCES/LICENSE
  2. 65
      SOURCES/README_07032010
  3. BIN
      SOURCES/bcm70012fw.bin
  4. BIN
      SOURCES/bcm70015fw.bin
  5. 1087
      SOURCES/crystalhd-gst-Port-to-GStreamer-1.0-API.patch
  6. BIN
      SOURCES/libcrystalhd-20120405.tar.bz2
  7. 105
      SOURCES/libcrystalhd-nosse2.patch
  8. 23
      SOURCES/libcrystalhd-snapshot.sh
  9. 250
      SPECS/libcrystalhd.spec

14
SOURCES/LICENSE

@ -0,0 +1,14 @@ @@ -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
SOURCES/README_07032010

@ -0,0 +1,65 @@ @@ -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
SOURCES/bcm70012fw.bin

Binary file not shown.

BIN
SOURCES/bcm70015fw.bin

Binary file not shown.

1087
SOURCES/crystalhd-gst-Port-to-GStreamer-1.0-API.patch

File diff suppressed because it is too large Load Diff

BIN
SOURCES/libcrystalhd-20120405.tar.bz2

Binary file not shown.

105
SOURCES/libcrystalhd-nosse2.patch

@ -0,0 +1,105 @@ @@ -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
SOURCES/libcrystalhd-snapshot.sh

@ -0,0 +1,23 @@ @@ -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

250
SPECS/libcrystalhd.spec

@ -0,0 +1,250 @@ @@ -0,0 +1,250 @@
%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: 27%{?dist}
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
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.10.0-27
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.10.0-26
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.10.0-25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.10.0-24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.10.0-23
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.10.0-22
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.10.0-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Tue Jul 17 2018 Nicolas Chauvet <kwizart@gmail.com> - 3.10.0-20
- Add missng cc

* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.10.0-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.10.0-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.10.0-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.10.0-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Mon Feb 13 2017 Nicolas Chauvet <kwizart@gmail.com> - 3.10.0-15
- Add cflags/ldflags - rhbz#1411018

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.10.0-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Wed Jul 20 2016 Nicolas Chauvet <kwizart@gmail.com> - 3.10.0-13
- Fix perm on firmware files - rhbz#1321530

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.10.0-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Mon Aug 03 2015 Nicolas Chauvet <kwizart@gmail.com> - 3.10.0-11
- Avoid to emit gstreamer1 provides - rhbz#1184975

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.10.0-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 3.10.0-9
- Rebuilt for GCC 5 C++11 ABI change

* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.10.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.10.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Mon Oct 07 2013 Nicolas Chauvet <kwizart@gmail.com> - 3.10.0-6
- Don't install udev rules in /etc/udev/rules.d - rhbz#979542

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.10.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Sun Apr 14 2013 Peter Robinson <pbrobinson@fedoraproject.org> 3.10.0-4
- Add patch to port to gstreamer 1.0 and update spec

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.10.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Fri Aug 03 2012 Nicolas Chauvet <kwizart@gmail.com> - 3.10.0-2
- Fix build on non-SSE2 arches
- Install CrystalHD udev rule
- Clean spec file

* Thu Apr 05 2012 Nicolas Chauvet <kwizart@gmail.com> - 3.10.0-1
- Update to 3.10.0

* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.5.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.5.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Sat Aug 28 2010 Jarod Wilson <jarod@redhat.com> - 3.5.1-1
- Update to v3.5.1, now with nv12 support

* Sun Jul 25 2010 Jarod Wilson <jarod@redhat.com> - 3.5.0-2
- Tarball had object files in it, clean them out before building

* Sat Jul 24 2010 Jarod Wilson <jarod@redhat.com> - 3.5.0-1
- Rebase to 07032010 crystalhd sources
- Large version-bump as driver and lib are now essentially 100%
in sync with the Windows driver and lib
- Ship firmware, now that Broadcom has posted a redistribution,
no modification license to cover it
- Build the gstreamer decoder plugin (will be moved to its own
package sooner or later)

* Sun Apr 04 2010 Jarod Wilson <jarod@redhat.com> - 0.9.25-4
- Fix segfault on firmware upload

* Fri Mar 26 2010 Jarod Wilson <jarod@redhat.com> - 0.9.25-3
- Update to pre-0.9.26 libcrystalhd, which contains support
for the new Broadcom BCM970015 Crystal HD decoder card

* Thu Mar 11 2010 Jarod Wilson <jarod@redhat.com> - 0.9.25-2
- Minor fixups to the as-yet-not-enabled firmware sub-package

* Wed Jan 06 2010 Jarod Wilson <jarod@redhat.com> - 0.9.25-1
- Initial package
Loading…
Cancel
Save