Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -b -u -r -N '--exclude=.git' xbmc_orig/configure.in xbmc_rellla/configure.in
- --- xbmc_orig/configure.in 2013-06-12 17:20:24.000000000 +0200
- +++ xbmc_rellla/configure.in 2013-06-12 17:13:23.000000000 +0200
- @@ -2854,6 +2854,8 @@
- CXXFLAGS="$CXXFLAGS"
- ], [$DISABLE_PVR_ADDON_CONFIG])
- +LIBS="$LIBS $CEDARLIBS"
- +
- AC_OUTPUT
- final_message="$final_message\n prefix:\t$prefix\n$dashes"
- diff -b -u -r -N '--exclude=.git' xbmc_orig/fix.sh xbmc_rellla/fix.sh
- --- xbmc_orig/fix.sh 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/fix.sh 2013-06-12 17:13:23.000000000 +0200
- @@ -0,0 +1,9 @@
- +cd /allwinner/xbmc-pvr-bin/lib/xbmc/addons
- +cd library.xbmc.addon
- +mv libXBMC_addon-arm.so libXBMC_addon-arm-linux.so
- +cd ..
- +cd library.xbmc.gui
- +mv libXBMC_gui-arm.so libXBMC_gui-arm-linux.so
- +cd ..
- +cd library.xbmc.pvr
- +mv libXBMC_pvr-arm.so libXBMC_pvr-arm-linux.so
- diff -b -u -r -N '--exclude=.git' xbmc_orig/.gitattributes xbmc_rellla/.gitattributes
- --- xbmc_orig/.gitattributes 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/.gitattributes 2013-06-12 17:13:13.000000000 +0200
- @@ -0,0 +1 @@
- +*.pbxproj -crlf -diff
- diff -b -u -r -N '--exclude=.git' xbmc_orig/.gitmodules xbmc_rellla/.gitmodules
- --- xbmc_orig/.gitmodules 2013-06-12 16:20:21.000000000 +0200
- +++ xbmc_rellla/.gitmodules 2013-06-12 17:13:13.000000000 +0200
- @@ -2,3 +2,8 @@
- path = addons/skin.touched
- url = git://github.com/xbmc/skin.touched.git
- ignore = all
- +
- +[submodule "pvr-addons"]
- + path = pvr-addons
- + url = git@github.com:rellla/xbmc-pvr-addons.git
- + ignore = all
- diff -b -u -r -N '--exclude=.git' xbmc_orig/Makefile.in xbmc_rellla/Makefile.in
- --- xbmc_orig/Makefile.in 2013-06-12 17:20:23.000000000 +0200
- +++ xbmc_rellla/Makefile.in 2013-06-12 17:13:13.000000000 +0200
- @@ -1,4 +1,5 @@
- include bootstrap.mk
- +include tools/a10/depends/depends.mk
- AUTOGENERATED_MAKEFILES=@OUTPUT_FILES@
- diff -b -u -r -N '--exclude=.git' xbmc_orig/tools/a10/depends/cedarv/.gitignore xbmc_rellla/tools/a10/depends/cedarv/.gitignore
- --- xbmc_orig/tools/a10/depends/cedarv/.gitignore 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/tools/a10/depends/cedarv/.gitignore 2013-06-12 17:13:39.000000000 +0200
- @@ -0,0 +1,10 @@
- +/adapter
- +/libcedarv
- +/libvecore
- +/vbv
- +/fbm
- +.installed
- +.extracted
- +cedardev_api.h
- +drv_display_sun4i.h
- +
- diff -b -u -r -N '--exclude=.git' xbmc_orig/tools/a10/depends/cedarv/Makefile xbmc_rellla/tools/a10/depends/cedarv/Makefile
- --- xbmc_orig/tools/a10/depends/cedarv/Makefile 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/tools/a10/depends/cedarv/Makefile 2013-06-12 17:13:39.000000000 +0200
- @@ -0,0 +1,63 @@
- +include ../depends.mk
- +
- +TARBALL=cedarx-libs.tar.gz
- +URL=https://github.com/linux-sunxi/cedarx-libs/tarball/master
- +
- +ifeq ($(USEARMHF), 1)
- +LIBVERSION=linux-armhf
- +else
- +LIBVERSION=linux-armel
- +endif
- +
- +SRCS = \
- + libcedarv/vdecoder.c \
- + libcedarv/awprintf.c \
- + fbm/fbm.c \
- + vbv/vbv.c \
- + adapter/libve_adapter.c \
- + adapter/os_adapter.c
- +
- +ifeq ($(USEARMHF), 1)
- +SRCS += adapter/avheap/avheap.c
- +endif
- +
- +OBJS = $(SRCS:%.c=%.o)
- +
- +TARGET=libcedarv.a
- +
- +all: .installed
- +
- +.installed: $(TARGET)
- + install -d $(XBMCPREFIX)/lib
- +ifneq ($(USEARMHF), 1)
- + cp adapter/cdxalloc/libcedarxalloc.so $(XBMCPREFIX)/lib
- +endif
- + cp libvecore/libvecore.so $(XBMCPREFIX)/lib
- + touch $@
- +
- +$(TARGET) : .extracted $(OBJS)
- + rm -f $(TARGET)
- + $(AR) cq $(TARGET) $(OBJS)
- +
- +.extracted: $(TARBALLS)/$(TARBALL)
- + rm -rf tmp
- + mkdir tmp
- + ( cd tmp &&\
- + tar xvfz $(TARBALLS)/$(TARBALL) &&\
- + cd linux-sunxi-*/libcedarv/$(LIBVERSION) &&\
- + rm Makefile .gitignore cedardefs.mk &&\
- + rm -rf sample &&\
- + mv * ../../../../ \
- + )
- + rm -rf tmp $(OBJS)
- + touch $@
- +
- +$(TARBALLS)/$(TARBALL):
- + install -d $(TARBALLS)
- + wget $(URL) -O $(TARBALLS)/$(TARBALL)
- +
- +clean:
- + rm -f $(TARGET) $(OBJS)
- + rm -rf adapter fbm libcedarv libvecore vbv
- + rm -f .installed .extracted cedardev_api.h drv_display_sun4i.h
- +
- diff -b -u -r -N '--exclude=.git' xbmc_orig/tools/a10/depends/depends.mk xbmc_rellla/tools/a10/depends/depends.mk
- --- xbmc_orig/tools/a10/depends/depends.mk 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/tools/a10/depends/depends.mk 2013-06-12 17:13:39.000000000 +0200
- @@ -0,0 +1,137 @@
- +# I used miniand lubuntu (kernel 3.0.36) on mk802.
- +#
- +# On a10 lubuntu run apt-get build-dep xbmc in it to get all dependencies.
- +# SDKSTAGE: rootfs from lubuntu/armel if cross-compiling.
- +# On x86 Ubuntu 12.04: I had to make symlinks for
- +# /lib/arm-linux-gnueabi, /usr/lib/arm-linux-gnueabi
- +# and /usr/include/arm-linux-gnueabi to their path in ${SDKSTAGE}
- +#
- +
- +#your home dir
- +#HOME=$(shell echo ~)
- +HOME=/opt/a10hacking
- +#where your tarballs go
- +TARBALLS=$(HOME)/xbmctmp/tarballs
- +#whether to compile for armhf
- +USEARMHF=1
- +
- +#wget-command to download files
- +WGET=wget --no-check-certificate
- +
- +#
- +# armhf notes:
- +#
- +# I used linaro alip together with wip/linux-sunxi-3.0/next_mali kernel.
- +#
- +
- +ifeq ($(USEARMHF), 1)
- +HF=hf
- +else
- +HF=
- +endif
- +
- +ifeq ($(shell uname -m),armv7l)
- +#
- +#native compile
- +#
- +
- +#where is your arm rootfs
- +SDKSTAGE=/
- +#where is your xbmc install root
- +XBMCPREFIX=/allwinner/xbmc-pvr-bin$(HF)
- +#where is your toolchain
- +TOOLCHAIN=/usr
- +
- +JOBS=1
- +export HOST=arm-linux-gnueabi$(HF)
- +export BUILD=arm-linux-gnueabi$(HF)
- +export CROSS_COMPILE=
- +
- +else
- +#
- +#cross compile
- +#
- +
- +#where is your arm rootfs
- +SDKSTAGE=$(HOME)/rootfs/debrootfs
- +#where is your xbmc install root
- +XBMCPREFIX=/allwinner/xbmc-pvr-bin$(HF)
- +#where is your toolchain
- +TOOLCHAIN=/usr/arm-linux-gnueabi$(HF)
- +
- +JOBS=4
- +export HOST=arm-linux-gnueabi$(HF)
- +export BUILD=i686-linux
- +export CROSS_COMPILE=${HOST}-
- +
- +endif
- +
- +
- +export PREFIX=${XBMCPREFIX}
- +
- +GLESDIR=$(shell cd ..;pwd)/opengles
- +
- +export GLESINCLUDES=-I$(GLESDIR)/include
- +
- +CEDARDIR=$(shell cd ..;pwd)/cedarv
- +
- +export CEDARINCLUDES=\
- + -I$(CEDARDIR) \
- + -I$(CEDARDIR)/adapter \
- + -I$(CEDARDIR)/adapter/cdxalloc \
- + -I$(CEDARDIR)/adapter/avheap \
- + -I$(CEDARDIR)/fbm \
- + -I$(CEDARDIR)/libcedarv \
- + -I$(CEDARDIR)/libvecore \
- + -I$(CEDARDIR)/vbv
- +
- +#vecore,cedarxalloc taken from $(XBMCPREFIX)/lib
- +ifeq ($(USEARMHF), 1)
- +export CEDARLIBS=-L$(CEDARDIR) -lcedarv -lvecore
- +else
- +export CEDARLIBS=-L$(CEDARDIR) -lcedarv -lvecore -lcedarxalloc
- +endif
- +
- +export RLINK_PATH=-Wl,-rpath,$(XBMCPREFIX)/lib -Wl,-rpath-link,${XBMCPREFIX}/lib:$(SDKSTAGE)/usr/local/lib:${SDKSTAGE}/lib:${SDKSTAGE}/lib/arm-linux-gnueabi$(HF):${SDKSTAGE}/usr/lib:${SDKSTAGE}/usr/lib/arm-linux-gnueabi$(HF)
- +export LDFLAGS=\
- +${RLINK_PATH} \
- +-L${XBMCPREFIX}/lib \
- +-L$(SDKSTAGE)/usr/local/lib \
- +-L${SDKSTAGE}/lib \
- +-L${SDKSTAGE}/lib/arm-linux-gnueabi$(HF) \
- +-L${SDKSTAGE}/usr/lib \
- +-L${SDKSTAGE}/usr/lib/arm-linux-gnueabi$(HF)
- +
- +ifeq ($(USEARMHF), 1)
- +export CFLAGS=-pipe -O3 -mfloat-abi=hard -mtune=cortex-a8 -mcpu=cortex-a8 -D__ARM_NEON__ -DALLWINNERA10
- +else
- +export CFLAGS=-pipe -O3 -mfloat-abi=softfp -mtune=cortex-a8 -mcpu=cortex-a8 -D__ARM_NEON__ -DALLWINNERA10
- +endif
- +export CFLAGS+=$(CEDARINCLUDES) $(GLESINCLUDES)
- +export CFLAGS+=\
- +-isystem${XBMCPREFIX}/include \
- +-isystem$(SDKSTAGE)/usr/local/include \
- +-isystem${SDKSTAGE}/usr/include \
- +-isystem${SDKSTAGE}/usr/include/arm-linux-gnueabi$(HF)
- +export CFLAGS+=${LDFLAGS}
- +
- +export CXXFLAGS=${CFLAGS}
- +export CPPFLAGS=${CFLAGS}
- +export LD=${CROSS_COMPILE}ld
- +export AR=${CROSS_COMPILE}ar
- +export CC=${CROSS_COMPILE}gcc
- +export CXX=${CROSS_COMPILE}g++
- +export CXXCPP=${CXX} -E
- +export RANLIB=${CROSS_COMPILE}ranlib
- +export STRIP=${CROSS_COMPILE}strip
- +export OBJDUMP=${CROSS_COMPILE}objdump
- +export PKG_CONFIG_SYSROOT_DIR=${SDKSTAGE}
- +export PKG_CONFIG_LIBDIR=${PREFIX}/lib/pkgconfig:${SDKSTAGE}/lib/pkgconfig:${SDKSTAGE}/usr/lib/pkgconfig:${SDKSTAGE}/usr/lib/arm-linux-gnueabi$(HF)/pkgconfig:${SDKSTAGE}/usr/share/pkgconfig:${SDKSTAGE}/usr/local/lib/pkgconfig
- +export PKG_CONFIG_PATH=${PREFIX}/bin/pkg-config
- +export PYTHON_VERSION=2.7
- +export PATH:=${PREFIX}/bin:${TOOLCHAIN}/bin:$(PATH)
- +export TEXTUREPACKER_NATIVE_ROOT=/usr
- +export PYTHON_LDFLAGS=-L${SDKSTAGE}/usr/lib -lpython$(PYTHON_VERSION)
- +export PYTHON_CPPFLAGS=-I${SDKSTAGE}/usr/include/python$(PYTHON_VERSION)
- +export PYTHON_SITE_PKG=${SDKSTAGE}/usr/lib/python$(PYTHON_VERSION)/site-packages
- +export PYTHON_NOVERSIONCHECK=no-check
- diff -b -u -r -N '--exclude=.git' xbmc_orig/tools/a10/depends/libmad/.gitignore xbmc_rellla/tools/a10/depends/libmad/.gitignore
- --- xbmc_orig/tools/a10/depends/libmad/.gitignore 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/tools/a10/depends/libmad/.gitignore 2013-06-12 17:13:39.000000000 +0200
- @@ -0,0 +1,5 @@
- +.installed
- +.builded
- +.configured
- +.extracted
- +/libmad*
- diff -b -u -r -N '--exclude=.git' xbmc_orig/tools/a10/depends/libmad/Makefile xbmc_rellla/tools/a10/depends/libmad/Makefile
- --- xbmc_orig/tools/a10/depends/libmad/Makefile 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/tools/a10/depends/libmad/Makefile 2013-06-12 17:13:39.000000000 +0200
- @@ -0,0 +1,36 @@
- +include ../depends.mk
- +
- +export CFLAGS+=-marm
- +
- +LOCATION=ftp://ftp.mars.org/pub/mpeg
- +TARBALL=libmad-0.15.1b.tar.gz
- +
- +all: .installed
- +
- +.installed: .builded
- + (cd libmad*; sudo make install)
- + touch $@
- +
- +.builded: .configured
- + (cd libmad*; make)
- + touch $@
- +
- +.configured: .extracted
- + ( cd libmad* &&\
- + ./configure \
- + --host=$(HOST) \
- + --build=$(BUILD) \
- + --prefix=$(SDKSTAGE)/usr \
- + --libdir=$(SDKSTAGE)/usr/lib/arm-linux-gnueabi$(HF) \
- + )
- + touch $@
- +
- +.extracted: $(TARBALLS)/$(TARBALL)
- + tar xvfz $(TARBALLS)/$(TARBALL)
- + touch .extracted
- +
- +$(TARBALLS)/$(TARBALL):
- + $(WGET) $(LOCATION)/$(TARBALL) -O $(TARBALLS)/$(TARBALL)
- +
- +clean:
- + rm -rf .installed .builded .configured .extracted libmad*
- diff -b -u -r -N '--exclude=.git' xbmc_orig/tools/a10/depends/libmad/README xbmc_rellla/tools/a10/depends/libmad/README
- --- xbmc_orig/tools/a10/depends/libmad/README 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/tools/a10/depends/libmad/README 2013-06-12 17:13:39.000000000 +0200
- @@ -0,0 +1 @@
- +If you encounter crashes playing mp3 please replace libmad with this build.
- diff -b -u -r -N '--exclude=.git' xbmc_orig/tools/a10/depends/Makefile xbmc_rellla/tools/a10/depends/Makefile
- --- xbmc_orig/tools/a10/depends/Makefile 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/tools/a10/depends/Makefile 2013-06-12 17:13:39.000000000 +0200
- @@ -0,0 +1,9 @@
- +include depends.mk
- +
- +all clean:
- + if [ ! -e $(TARBALLS) ]; then mkdir $(TARBALLS); fi
- + (cd opengles; $(MAKE) $@)
- + (cd cedarv; $(MAKE) $@)
- + (cd taglib; $(MAKE) $@)
- + @echo "\nmake $@ for dependencies done.\n"
- +
- diff -b -u -r -N '--exclude=.git' xbmc_orig/tools/a10/depends/opengles/.gitignore xbmc_rellla/tools/a10/depends/opengles/.gitignore
- --- xbmc_orig/tools/a10/depends/opengles/.gitignore 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/tools/a10/depends/opengles/.gitignore 2013-06-12 17:13:39.000000000 +0200
- @@ -0,0 +1,4 @@
- +/sunxi-mali
- +.git
- +.installed
- +
- diff -b -u -r -N '--exclude=.git' xbmc_orig/tools/a10/depends/opengles/Makefile xbmc_rellla/tools/a10/depends/opengles/Makefile
- --- xbmc_orig/tools/a10/depends/opengles/Makefile 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/tools/a10/depends/opengles/Makefile 2013-06-12 17:13:39.000000000 +0200
- @@ -0,0 +1,31 @@
- +include ../depends.mk
- +
- +MALIGIT=https://github.com/linux-sunxi/sunxi-mali.git
- +SUNXI-MALI=sunxi-mali
- +VERSION=r3p0
- +ABI=armhf
- +EGL_TYPE=framebuffer
- +
- +all: .installed
- +
- +.installed: .git
- + ( cd $(SUNXI-MALI) &&\
- + make config VERSION=$(VERSION) ABI=$(ABI) EGL_TYPE=$(EGL_TYPE) &&\
- + echo "prefix = $(XBMCPREFIX)/" >> Makefile.setup &&\
- + rm -rf $(XBMCPREFIX) &&\
- + mkdir -p $(XBMCPREFIX)/lib &&\
- + mkdir -p $(XBMCPREFIX)/include &&\
- + make && make install \
- + )
- + touch $@
- +
- +.git:
- + git clone $(MALIGIT)
- + ( cd $(SUNXI-MALI) &&\
- + git submodule init &&\
- + git submodule update \
- + )
- + touch $@
- +
- +clean:
- + rm -rf .installed .git $(SUNXI-MALI)
- \ Kein Zeilenumbruch am Dateiende.
- diff -b -u -r -N '--exclude=.git' xbmc_orig/tools/a10/depends/opengles/README xbmc_rellla/tools/a10/depends/opengles/README
- --- xbmc_orig/tools/a10/depends/opengles/README 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/tools/a10/depends/opengles/README 2013-06-12 17:13:39.000000000 +0200
- @@ -0,0 +1,3 @@
- +I used armel libraries from https://github.com/cnxsoft/a10-bin
- +and includes from http://malideveloper.com/files/Mali_OpenGL_ES_2.0_SDK_for_Linux_On_ARM_v1.2.0.9310_Linux.tar.gz
- +
- diff -b -u -r -N '--exclude=.git' xbmc_orig/tools/a10/depends/package/.gitignore xbmc_rellla/tools/a10/depends/package/.gitignore
- --- xbmc_orig/tools/a10/depends/package/.gitignore 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/tools/a10/depends/package/.gitignore 2013-06-12 17:13:39.000000000 +0200
- @@ -0,0 +1,3 @@
- +*.deb
- +*.tar.gz
- +/tmp
- diff -b -u -r -N '--exclude=.git' xbmc_orig/tools/a10/depends/package/Makefile xbmc_rellla/tools/a10/depends/package/Makefile
- --- xbmc_orig/tools/a10/depends/package/Makefile 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/tools/a10/depends/package/Makefile 2013-06-12 17:13:39.000000000 +0200
- @@ -0,0 +1,42 @@
- +include ../depends.mk
- +
- +LCLPREFIX=$(shell echo $(XBMCPREFIX) | sed 's/^\///g')
- +
- +DEB=xbmca10.deb
- +TARBALL1=xbmca10deb.tar.gz
- +TARBALL2=xbmca10.tar.gz
- +
- +all: $(TARBALL1)
- +
- +$(TARBALL1): root/DEBIAN/control $(XBMCPREFIX)/lib/xbmc/xbmc.bin README
- + ( rm -rf tmp &&\
- + cp -r root tmp &&\
- + cd tmp &&\
- + tar cf - $(XBMCPREFIX) | tar xf - &&\
- + rm -rf $(LCLPREFIX)/include &&\
- + rm -rf $(LCLPREFIX)/lib/pkgconfig &&\
- + rm -f $(LCLPREFIX)/lib/*.a &&\
- + $(STRIP) --strip-unneeded `find . -name xbmc.bin -print` &&\
- + $(STRIP) --strip-unneeded `find . -name *.so -print` \
- + )
- + dpkg -b tmp $(DEB)
- + tar cvzf $(TARBALL1) README $(DEB)
- + rm -r tmp $(DEB)
- +
- +tarball: $(XBMCPREFIX)/lib/xbmc/xbmc.bin
- + ( rm -rf tmp &&\
- + mkdir tmp &&\
- + cd tmp &&\
- + tar cf - $(XBMCPREFIX) | tar xf - &&\
- + rm -rf $(LCLPREFIX)/include &&\
- + rm -rf $(LCLPREFIX)/lib/pkgconfig &&\
- + rm -f $(LCLPREFIX)/lib/*.a &&\
- + $(STRIP) --strip-unneeded `find . -name xbmc.bin -print` &&\
- + $(STRIP) --strip-unneeded `find . -name *.so -print` \
- + )
- + tar -czvf $(TARBALL2) -C tmp .
- +
- +clean:
- + rm -rf tmp
- + rm -f $(TARBALL1) $(DEB)
- + rm -f $(TARBALL2)
- diff -b -u -r -N '--exclude=.git' xbmc_orig/tools/a10/depends/package/README xbmc_rellla/tools/a10/depends/package/README
- --- xbmc_orig/tools/a10/depends/package/README 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/tools/a10/depends/package/README 2013-06-12 17:13:39.000000000 +0200
- @@ -0,0 +1,22 @@
- +**WARNING: alpha version - use at your own risk.**
- +
- +I tested on 1GB mk802 with miniand lubuntu.
- +Resolution is fixed to 1280x720.
- +
- +Installation:
- +
- +Get miniand lubuntu with 720p resolution for your device from here:
- +
- +https://www.miniand.com/forums/forums/development/topics/mk802-guides-and-images
- +
- +After that install xbmca10.deb with the following command:
- +
- +sudo gdebi xbmca10.deb
- +
- +Starting:
- +
- +sudo start xbmc
- +
- +(Attention: this stops lightdm/x11-session, so it is a good idea to have ssh server running)
- +
- +First start takes some time since xbmc creates the database and starts downloading plugins.
- diff -b -u -r -N '--exclude=.git' xbmc_orig/tools/a10/depends/package/root/DEBIAN/control xbmc_rellla/tools/a10/depends/package/root/DEBIAN/control
- --- xbmc_orig/tools/a10/depends/package/root/DEBIAN/control 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/tools/a10/depends/package/root/DEBIAN/control 2013-06-12 17:13:39.000000000 +0200
- @@ -0,0 +1,79 @@
- +Section: video
- +Priority: optional
- +Maintainer: empat zero
- +Package: xbmca10
- +Architecture: armel
- +Version: 0.0.1-alpha
- +Depends: mesa-utils,
- + x11-utils,
- + ttf-liberation,
- + ttf-dejavu-core,
- + python-imaging,
- + python,
- + python-support (>= 0.90.0),
- + libasound2 (>= 1.0.23),
- + libavahi-client3 (>= 0.6.16),
- + libavahi-common3 (>= 0.6.16),
- + libbluetooth3 (>= 4.91),
- + libbz2-1.0,
- + libc6 (>= 2.15),
- + libcdio13,
- + libdbus-1-3 (>= 1.0.2),
- + libexpat1 (>= 1.95.8),
- + libfreetype6 (>= 2.2.1),
- + libfribidi0 (>= 0.19.2),
- + libgcc1 (>= 1:4.1.1),
- + libgcrypt11 (>= 1.4.5),
- + libgl1-mesa-glx | libgl1,
- + libglew1.6 (>= 1.6.0),
- + libglu1-mesa | libglu1,
- + libhal-storage1 (>= 0.5.8.1),
- + libhal1 (>= 0.5.8.1),
- + libjpeg8 (>= 8c),
- + liblzo2-2,
- + libmicrohttpd5,
- + libmysqlclient18 (>= 5.5.13-1),
- + libpcre3 (>= 8.10),
- + libpcrecpp0 (>= 7.7),
- + libpng12-0 (>= 1.2.13-4),
- + libpulse0 (>= 1:1.0),
- + libpython2.7 (>= 2.7),
- + libsamplerate0 (>= 0.1.7),
- + libsdl-mixer1.2,
- + libsdl1.2debian (>= 1.2.10-1),
- + libsmbclient (>= 2:3.2.0),
- + libsqlite3-0 (>= 3.6.11),
- + libssl1.0.0 (>= 1.0.0),
- + libstdc++6 (>= 4.6),
- + libtiff4,
- + libudev0 (>= 147),
- + libva-glx1,
- + libva1 (>> 1.0.15~),
- + libvorbis0a (>= 1.1.2),
- + libvorbisenc2 (>= 1.1.2),
- + libx11-6,
- + libxext6,
- + libxmu6,
- + libxrandr2 (>= 2:1.2.0),
- + libyajl1 (>= 1.0.5),
- + zlib1g (>= 1:1.1.4),
- + libcurl3-gnutls (>= 7.16.2-1),
- + libtinyxml2.6.2,
- + libssh-4
- +Recommends: libass4 (>= 0.9.7),
- + libbluray1,
- + libcec1,
- + libflac8 (>= 1.2.1),
- + libmad0 (>= 0.15.1b-3),
- + libmodplug1,
- + libmp3lame0,
- + libmpeg2-4,
- + libnfs1,
- + libogg0 (>= 1.0rc3),
- + libplist1 (>= 0.13),
- + librtmp0 (>= 2.3),
- + libshairport1,
- + libvdpau1 (>= 0.2),
- + libvorbisfile3 (>= 1.1.2)
- +Description: Allwinner A10 test version of XBMC. Strictly alpha, use at your own risk.
- +
- diff -b -u -r -N '--exclude=.git' xbmc_orig/tools/a10/depends/package/root/etc/init/xbmc.conf xbmc_rellla/tools/a10/depends/package/root/etc/init/xbmc.conf
- --- xbmc_orig/tools/a10/depends/package/root/etc/init/xbmc.conf 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/tools/a10/depends/package/root/etc/init/xbmc.conf 2013-06-12 17:13:39.000000000 +0200
- @@ -0,0 +1,23 @@
- +# XBMC Daemon
- +#
- +
- +#thanks, Sam Nazarko
- +
- +description "xbmc daemon"
- +author "None"
- +
- +#you can enable autostart by uncommenting next line
- +#start on (started dbus and started mountall and stopped lightdm)
- +stop on (xbmc-do-stop or runlevel [!2345])
- +
- +respawn
- +
- +pre-start script
- +test -x /etc/xbmc-watchdog.sh || { stop; logger -t xbmc "cannot execute /allwinner/xbmc-watchdog.sh, exiting" ; exit 1; }
- +end script
- +
- +pre-stop script
- +test "x" == x`pidof xbmc.bin` || kill `pidof xbmc.bin`
- +end script
- +
- +exec /etc/xbmc-watchdog.sh
- diff -b -u -r -N '--exclude=.git' xbmc_orig/tools/a10/depends/package/root/etc/xbmc-watchdog.sh xbmc_rellla/tools/a10/depends/package/root/etc/xbmc-watchdog.sh
- --- xbmc_orig/tools/a10/depends/package/root/etc/xbmc-watchdog.sh 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/tools/a10/depends/package/root/etc/xbmc-watchdog.sh 2013-06-12 17:13:39.000000000 +0200
- @@ -0,0 +1,49 @@
- +#!/bin/sh
- +
- +#USEHWR="A10HWR=1"
- +
- +if [ -d /lib/arm-linux-gnueabihf ]
- +then
- + #assume linaro rootfs
- + USER=linaro
- + XBMC=/allwinner/xbmc-pvr-binhf/lib/xbmc/xbmc.bin
- +else
- + #assume miniand rootfs
- + USER=miniand
- + XBMC=/allwinner/xbmc-pvr-bin/lib/xbmc/xbmc.bin
- +fi
- +
- +#
- +#some q&d to avoid editing system config files.
- +#
- +depmod -a `uname -r`
- +modprobe lcd
- +modprobe hdmi
- +modprobe ump
- +modprobe disp
- +modprobe mali
- +modprobe mali_drm
- +chmod 666 /dev/mali /dev/ump /dev/cedar_dev /dev/disp
- +chmod -R 666 /dev/input/*
- +chmod -R 666 /dev/snd/*
- +
- +stop lightdm
- +
- +#thanks, Sam Nazarko
- +
- +while true
- +do
- + su - $USER -c "$USEHWR $XBMC --standalone -fs --lircdev /var/run/lirc/lircd 2>&1 | logger -t xbmc"
- + case "$?" in
- + 0) # user quit.
- + sleep 2 ;;
- + 64) # shutdown system.
- + poweroff;;
- + 65) # warm Restart xbmc
- + sleep 2 ;;
- + 66) # Reboot System
- + reboot;;
- + *) # this should not happen
- + sleep 30 ;;
- + esac
- +done
- diff -b -u -r -N '--exclude=.git' xbmc_orig/tools/a10/depends/package/root/.gitignore xbmc_rellla/tools/a10/depends/package/root/.gitignore
- --- xbmc_orig/tools/a10/depends/package/root/.gitignore 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/tools/a10/depends/package/root/.gitignore 2013-06-12 17:13:39.000000000 +0200
- @@ -0,0 +1 @@
- +/allwinner
- diff -b -u -r -N '--exclude=.git' xbmc_orig/tools/a10/depends/README xbmc_rellla/tools/a10/depends/README
- --- xbmc_orig/tools/a10/depends/README 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/tools/a10/depends/README 2013-06-12 17:13:39.000000000 +0200
- @@ -0,0 +1,25 @@
- +Please look at depends.mk.
- +After adjusting run make && make -C xbmc.
- +If configure is done you can compile from the source root directory.
- +
- +KNOWN PROBLEMS WITH HARDWARE RENDERING:
- +=======================================
- +
- +- To enable hardware layer rendering you have to set environment A10HWR=1.
- +
- +- Sometimes the display engine does not initialize correctly and not all
- + colors get rendered or you get pixel noise. After some video startups this
- + disappears.
- +
- +- Using 1080p and alpha video blending there is a horrible screen tearing,
- + for this reason alpha blending is disabled at 1080p for video at the moment.
- + You can enable it (e.g. for tracking down the problem at kernel level)
- + by setting the environment variable A10AB=1.
- +
- +KNOWN PROBLEMS WITH PVR:
- +========================
- +
- +- only SD-TV tested (since i do not have DVB-S2 hardware)
- +
- +PLEASE REMEMBER: This is poc.
- +
- diff -b -u -r -N '--exclude=.git' xbmc_orig/tools/a10/depends/taglib/.gitignore xbmc_rellla/tools/a10/depends/taglib/.gitignore
- --- xbmc_orig/tools/a10/depends/taglib/.gitignore 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/tools/a10/depends/taglib/.gitignore 2013-06-12 17:13:39.000000000 +0200
- @@ -0,0 +1,4 @@
- +.installed
- +.builded
- +.extracted
- +/taglib*
- diff -b -u -r -N '--exclude=.git' xbmc_orig/tools/a10/depends/taglib/Makefile xbmc_rellla/tools/a10/depends/taglib/Makefile
- --- xbmc_orig/tools/a10/depends/taglib/Makefile 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/tools/a10/depends/taglib/Makefile 2013-06-12 17:13:39.000000000 +0200
- @@ -0,0 +1,34 @@
- +include ../depends.mk
- +
- +LOCATION=https://github.com/downloads/taglib/taglib
- +TARBALL=taglib-1.8.tar.gz
- +
- +all: .installed
- +
- +.installed: .builded
- + $(MAKE) -C taglib*/build install
- + touch $@
- +
- +.builded: .extracted
- + ( cd taglib* && rm -rf build && mkdir build && cd build &&\
- + CC=$(CC) CXX=$(CXX) cmake \
- + -DENABLE_STATIC=1 \
- + -DCMAKE_C_FLAGS:STRING="$(CPPFLAGS) $(CFLAGS)" \
- + -DCMAKE_CXX_FLAGS:STRING="$(CPPFLAGS) $(CXXFLAGS)" \
- + -DCMAKE_INCLUDE_PATH=$(PREFIX)/include \
- + -DCMAKE_LIBRARY_PATH=$(PREFIX)/lib \
- + -DCMAKE_INSTALL_NAME_DIR=$(PREFIX)/lib \
- + -DCMAKE_INSTALL_PREFIX=$(PREFIX) \
- + -DCMAKE_FIND_ROOT_PATH="$(SDKSTAGE):/" .. \
- + )
- + touch $@
- +
- +.extracted: $(TARBALLS)/$(TARBALL)
- + tar xvfz $(TARBALLS)/$(TARBALL)
- + touch .extracted
- +
- +$(TARBALLS)/$(TARBALL):
- + $(WGET) $(LOCATION)/$(TARBALL) -O $(TARBALLS)/$(TARBALL)
- +
- +clean:
- + rm -rf .installed .builded .configured .extracted taglib*
- diff -b -u -r -N '--exclude=.git' xbmc_orig/tools/a10/depends/taglib/README xbmc_rellla/tools/a10/depends/taglib/README
- --- xbmc_orig/tools/a10/depends/taglib/README 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/tools/a10/depends/taglib/README 2013-06-12 17:13:39.000000000 +0200
- @@ -0,0 +1,3 @@
- +TODO:
- +
- +(Build at your own in lib/taglib. Use native compile and copy to rootfs.)
- diff -b -u -r -N '--exclude=.git' xbmc_orig/tools/a10/depends/xbmc/Makefile xbmc_rellla/tools/a10/depends/xbmc/Makefile
- --- xbmc_orig/tools/a10/depends/xbmc/Makefile 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/tools/a10/depends/xbmc/Makefile 2013-06-12 17:13:40.000000000 +0200
- @@ -0,0 +1,36 @@
- +include ../depends.mk
- +
- +CONFIGURE=./configure \
- + --prefix=$(PREFIX) \
- + --build=$(BUILD) \
- + --host=$(HOST) \
- + --disable-x11 \
- + --disable-sdl \
- + --disable-xrandr \
- + --disable-joystick \
- + --disable-gl \
- + --disable-vdpau \
- + --disable-vaapi \
- + --disable-openmax \
- + --enable-neon \
- + --enable-gles \
- + --disable-mysql \
- +
- +SRC=../../../../
- +
- +all: dep
- + (cd $(SRC); make -j$(JOBS))
- +
- +install-only:
- + (cd $(SRC); make -j$(JOBS) install)
- +
- +bin-only:
- + (cd $(SRC); make -j$(JOBS))
- +
- +dep: bootstrap configure
- +
- +bootstrap:
- + (cd $(SRC); ./bootstrap)
- +
- +configure:
- + (cd $(SRC); $(CONFIGURE))
- \ Kein Zeilenumbruch am Dateiende.
- diff -b -u -r -N '--exclude=.git' xbmc_orig/tools/android/depends/cedarv/Makefile xbmc_rellla/tools/android/depends/cedarv/Makefile
- --- xbmc_orig/tools/android/depends/cedarv/Makefile 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/tools/android/depends/cedarv/Makefile 2013-06-12 17:13:40.000000000 +0200
- @@ -0,0 +1,44 @@
- +include ../Makefile.include
- +
- +TARBALL=cedarx-libs.tar.gz
- +URL=https://github.com/linux-sunxi/cedarx-libs/tarball/master
- +
- +SRCS = \
- + libcedarv/vdecoder.c \
- + libcedarv/awprintf.c \
- + fbm/fbm.c \
- + vbv/vbv.c \
- + adapter/libve_adapter.c \
- + adapter/os_adapter.c
- +
- +OBJS = $(SRCS:%.c=%.o)
- +
- +TARGET=libcedarv.a
- +
- +all: $(TARGET)
- +
- +$(TARGET) : .extracted $(OBJS)
- + rm -f $(TARGET)
- + $(AR) cq $(TARGET) $(OBJS)
- +
- +.extracted: $(TARBALLS_LOCATION)/$(TARBALL)
- + rm -rf tmp
- + mkdir tmp
- + ( cd tmp &&\
- + tar xvfz $(TARBALLS_LOCATION)/$(TARBALL) &&\
- + cd linux-sunxi-*/libcedarv/android &&\
- + rm Makefile .gitignore cedardefs.mk &&\
- + mv * ../../../../ \
- + )
- + rm -rf tmp $(OBJS)
- + touch $@
- +
- +$(TARBALLS_LOCATION)/$(TARBALL):
- + install -d $(TARBALLS_LOCATION)
- + wget $(URL) -O $(TARBALLS)/$(TARBALL)
- +
- +clean:
- + rm -f $(TARGET) $(OBJS)
- + rm -rf tmp adapter fbm libcedarv libvecore vbv
- + rm -f .installed .extracted cedardev_api.h drv_display_sun4i.h
- +
- diff -b -u -r -N '--exclude=.git' xbmc_orig/tools/Linux/xbmc.sh.in xbmc_rellla/tools/Linux/xbmc.sh.in
- --- xbmc_orig/tools/Linux/xbmc.sh.in 2013-06-12 16:20:59.000000000 +0200
- +++ xbmc_rellla/tools/Linux/xbmc.sh.in 2013-06-12 17:13:38.000000000 +0200
- @@ -107,11 +107,12 @@
- echo "Crash report available at $FILE"
- }
- -python @datadir@/xbmc/FEH.py $SAVED_ARGS
- -RET=$?
- -if [ $RET -ne 0 ]; then
- - exit $RET
- -fi
- +# disable glxinfo check
- +# python @datadir@/xbmc/FEH.py $SAVED_ARGS
- +# RET=$?
- +# if [ $RET -ne 0 ]; then
- +# exit $RET
- +# fi
- if which gdb >/dev/null 2>&1; then
- # Output warning in case ulimit is unsupported by shell
- diff -b -u -r -N '--exclude=.git' xbmc_orig/xbmc/Application.cpp xbmc_rellla/xbmc/Application.cpp
- --- xbmc_orig/xbmc/Application.cpp 2013-06-12 17:20:26.000000000 +0200
- +++ xbmc_rellla/xbmc/Application.cpp 2013-06-12 17:13:42.000000000 +0200
- @@ -2130,6 +2130,15 @@
- singleFrameTime = 200; // 5 fps, <=200 ms latency to wake up
- }
- +#ifdef ALLWINNERA10
- + if (IsInScreenSaver())
- + {
- + //so the mk802 does not burn down the house when i'm sleeping :)
- + limitFrames = true;
- + singleFrameTime = 100;
- + }
- +#endif
- +
- decrement = true;
- }
- }
- diff -b -u -r -N '--exclude=.git' xbmc_orig/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp xbmc_rellla/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
- --- xbmc_orig/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp 2013-06-12 17:20:26.000000000 +0200
- +++ xbmc_rellla/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp 2013-06-12 17:13:43.000000000 +0200
- @@ -775,6 +775,15 @@
- {
- EnumerateDevice(list, name, desc ? desc : name, config);
- }
- + else
- + {
- + /* sun4i whilelist */
- + std::string strDevice = std::string(name);
- + size_t found = strDevice.find("sun4i");
- +
- + if(found != std::string::npos)
- + EnumerateDevice(list, name, desc ? desc : name, config);
- + }
- }
- free(io);
- free(name);
- @@ -876,6 +885,10 @@
- else if (name.substr(0, 6) == "iec958" || name.substr(0, 5) == "spdif")
- return AE_DEVTYPE_IEC958;
- + /* sun4i hdmi device */
- + if(name.find("sun4isndhdmi") != std::string::npos)
- + return AE_DEVTYPE_HDMI;
- +
- return AE_DEVTYPE_PCM;
- }
- diff -b -u -r -N '--exclude=.git' xbmc_orig/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp xbmc_rellla/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
- --- xbmc_orig/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp 2013-06-12 17:20:26.000000000 +0200
- +++ xbmc_rellla/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp 2013-06-12 17:13:43.000000000 +0200
- @@ -41,6 +41,9 @@
- #if defined(HAS_LIBAMCODEC)
- #include "Video/DVDVideoCodecAmlogic.h"
- #endif
- +#ifdef ALLWINNERA10
- +#include "Video/DVDVideoCodecA10.h"
- +#endif
- #include "Audio/DVDAudioCodecFFmpeg.h"
- #include "Audio/DVDAudioCodecLibMad.h"
- #include "Audio/DVDAudioCodecPcm.h"
- @@ -263,6 +266,10 @@
- }
- #endif
- +#ifdef ALLWINNERA10
- + if ( (pCodec = OpenCodec(new CDVDVideoCodecA10(), hint, options)) ) return pCodec;
- +#endif
- +
- // try to decide if we want to try halfres decoding
- #if !defined(_LINUX) && !defined(_WIN32)
- float pixelrate = (float)hint.width*hint.height*hint.fpsrate/hint.fpsscale;
- diff -b -u -r -N '--exclude=.git' xbmc_orig/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecA10.cpp xbmc_rellla/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecA10.cpp
- --- xbmc_orig/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecA10.cpp 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecA10.cpp 2013-06-12 17:13:43.000000000 +0200
- @@ -0,0 +1,551 @@
- +#include "DVDVideoCodecA10.h"
- +#include "DVDClock.h"
- +#include "utils/log.h"
- +#include "threads/Atomics.h"
- +#include "../VideoRenderers/LinuxRendererA10.h"
- +//check for eden
- +#include "../VideoRenderers/RenderFlags.h"
- +#ifdef CONF_FLAGS_FORMAT_A10BUF
- +#define RENDER_FMT_YUV420P DVDVideoPicture::FMT_YUV420P
- +#define RENDER_FMT_A10BUF DVDVideoPicture::FMT_A10BUF
- +#endif
- +
- +#include <sys/ioctl.h>
- +#include <math.h>
- +
- +static long g_cedaropen = 0;
- +
- +#define PREFRAMES 10 //no. of stream frames to buffer
- +
- +#define A10DEBUG
- +#define MEDIAINFO
- +
- +#define CODEC_OK 1
- +#define CODEC_BAD 0
- +
- +/*Cedar Decoder*/
- +#define A10ENABLE_MPEG1 CODEC_OK
- +#define A10ENABLE_MPEG2 CODEC_OK
- +#define A10ENABLE_H264 CODEC_OK
- +#define A10ENABLE_H263 CODEC_BAD //fails completely
- +#define A10ENABLE_VC1_WVC1 CODEC_OK
- +#define A10ENABLE_VP6 CODEC_OK
- +#define A10ENABLE_VP8 CODEC_OK
- +#define A10ENABLE_FLV1 CODEC_OK
- +#define A10ENABLE_MJPEG CODEC_OK
- +#define A10ENABLE_WMV1 CODEC_OK
- +#define A10ENABLE_WMV2 CODEC_OK
- +#define A10ENABLE_WMV3 CODEC_OK
- +#define A10ENABLE_MPEG4V1 CODEC_BAD //??
- +#define A10ENABLE_MPEG4V2 CODEC_BAD //fails completely
- +#define A10ENABLE_MPEG4V3 CODEC_OK
- +#define A10ENABLE_DIVX4 CODEC_OK
- +#define A10ENABLE_DIVX5 CODEC_OK
- +#define A10ENABLE_XVID CODEC_OK
- +
- +/*
- +TODO:- Finish adding MPEG4 codecs tags
- + - Find out whats causing problems with several codecs, something is wrong or missing in the maping.
- + - Add RealVideo once .rm files can be opened.
- + - AVS and RMG2 codec support.
- +
- +Note: AllWinner doc says to add FLV container type to VP6 and FLV1, but if i do so they stop working.
- +*/
- +
- +#define _4CC(c1,c2,c3,c4) (((u32)(c4)<<24)|((u32)(c3)<<16)|((u32)(c2)<<8)|(u32)(c1))
- +
- +static void freecallback(void *callbackpriv, void *pictpriv, cedarv_picture_t &pict)
- +{
- + ((CDVDVideoCodecA10*)callbackpriv)->FreePicture(pictpriv, pict);
- +}
- +
- +CDVDVideoCodecA10::CDVDVideoCodecA10()
- +{
- + m_hcedarv = NULL;
- + memset(&m_picture, 0, sizeof(m_picture));
- +}
- +
- +CDVDVideoCodecA10::~CDVDVideoCodecA10()
- +{
- + Dispose();
- +}
- +
- +/*
- + * Open the decoder, returns true on success
- + */
- +bool CDVDVideoCodecA10::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options)
- +{
- + if (getenv("NOA10"))
- + {
- + CLog::Log(LOGNOTICE, "A10: disabled.\n");
- + return false;
- + }
- +
- + if (hints.software)
- + {
- + CLog::Log(LOGNOTICE, "A10: software decoding requested.\n");
- + return false;
- + }
- +
- + CLog::Log(LOGNOTICE, "A10: using hardware rendering.\n");
- +
- + m_hints = hints;
- + m_aspect = m_hints.aspect;
- +
- + memset(&m_info, 0, sizeof(m_info));
- + if (m_hints.fpsscale)
- + {
- + m_info.frame_rate = (double)m_hints.fpsrate / m_hints.fpsscale * 1000;
- + }
- + if (m_info.frame_rate)
- + {
- + m_info.frame_duration = 1000000000.0 / m_info.frame_rate;
- + }
- + m_info.video_width = m_hints.width;
- + m_info.video_height = m_hints.height;
- + m_info.aspect_ratio = 1000;
- + m_info.is_pts_correct = !m_hints.ptsinvalid;
- + m_info.sub_format = CEDARV_SUB_FORMAT_UNKNOW;
- + m_info.container_format = CEDARV_CONTAINER_FORMAT_UNKNOW;
- + m_info.init_data_len = 0;
- + m_info.init_data = NULL;
- +
- +#ifdef MEDIAINFO
- + CLog::Log(LOGDEBUG, "A10: MEDIAINFO: fpsrate %d / fpsscale %d\n", m_hints.fpsrate, m_hints.fpsscale);
- + CLog::Log(LOGDEBUG, "A10: MEDIAINFO: CodecID %d \n", m_hints.codec);
- + CLog::Log(LOGDEBUG, "A10: MEDIAINFO: StreamType %d \n", m_hints.type);
- + CLog::Log(LOGDEBUG, "A10: MEDIAINFO: Level %d \n", m_hints.level);
- + CLog::Log(LOGDEBUG, "A10: MEDIAINFO: Profile %d \n", m_hints.profile);
- + CLog::Log(LOGDEBUG, "A10: MEDIAINFO: PTS_invalid %d \n", m_hints.ptsinvalid);
- + CLog::Log(LOGDEBUG, "A10: MEDIAINFO: Tag %d \n", m_hints.codec_tag);
- + { u8 *pb = (u8*)&m_hints.codec_tag;
- + if (isalnum(pb[0]) && isalnum(pb[1]) && isalnum(pb[2]) && isalnum(pb[3]))
- + CLog::Log(LOGDEBUG, "A10: MEDIAINFO: Tag fourcc %c%c%c%c\n", pb[0], pb[1], pb[2], pb[3]);
- + }
- + if (m_hints.extrasize)
- + {
- + int i;
- + char buf[4096];
- +
- + for (i = 0; i < m_hints.extrasize; i++)
- + sprintf(buf+i*2, "%02x", ((u8*)m_hints.extradata)[i]);
- + CLog::Log(LOGDEBUG, "A10: MEDIAINFO: extradata %d %s\n", m_hints.extrasize, buf);
- + }
- +#endif
- +
- + m_info.init_data_len = m_hints.extrasize;
- + m_info.init_data = (u8*)m_hints.extradata;
- +
- + switch(m_hints.codec)
- + {
- + //MPEG1
- +#if A10ENABLE_MPEG1
- + case CODEC_ID_MPEG1VIDEO:
- + m_info.format = CEDARV_STREAM_FORMAT_MPEG2;
- + m_info.sub_format = CEDARV_MPEG2_SUB_FORMAT_MPEG1;
- + break;
- +#endif
- + //MPEG2
- +#ifdef A10ENABLE_MPEG2
- + case CODEC_ID_MPEG2VIDEO:
- + m_info.format = CEDARV_STREAM_FORMAT_MPEG2;
- + m_info.sub_format = CEDARV_MPEG2_SUB_FORMAT_MPEG2;
- + //if passing init_data it fails..
- + m_info.init_data_len = 0;
- + m_info.init_data = NULL;
- + break;
- +#endif
- + //H263
- +#if A10ENABLE_H263
- + case CODEC_ID_H263:
- + m_info.format = CEDARV_STREAM_FORMAT_MPEG4;
- + m_info.sub_format = CEDARV_MPEG4_SUB_FORMAT_H263;
- + break;
- +#endif
- + //H264
- +#if A10ENABLE_H264
- + case CODEC_ID_H264:
- + m_info.format = CEDARV_STREAM_FORMAT_H264;
- + if(m_hints.codec_tag==27) //M2TS and TS
- + m_info.container_format = CEDARV_CONTAINER_FORMAT_TS;
- + break;
- +#endif
- + //VP6
- +#if A10ENABLE_VP6
- + case CODEC_ID_VP6F:
- + m_info.format = CEDARV_STREAM_FORMAT_MPEG4;
- + m_info.sub_format = CEDARV_MPEG4_SUB_FORMAT_VP6;
- + break;
- +#endif
- + //WMV1
- +#if A10ENABLE_WMV1
- + case CODEC_ID_WMV1:
- + m_info.format = CEDARV_STREAM_FORMAT_MPEG4;
- + m_info.sub_format = CEDARV_MPEG4_SUB_FORMAT_WMV1;
- + break;
- +#endif
- + //WMV2
- +#if A10ENABLE_WMV2
- + case CODEC_ID_WMV2:
- + m_info.format = CEDARV_STREAM_FORMAT_MPEG4;
- + m_info.sub_format = CEDARV_MPEG4_SUB_FORMAT_WMV2;
- + break;
- +#endif
- + //WMV3
- +#if A10ENABLE_WMV3
- + case CODEC_ID_WMV3:
- + m_info.format = CEDARV_STREAM_FORMAT_VC1;
- + break;
- +#endif
- + //VC1 and WVC1
- +#if A10ENABLE_VC1_WVC1
- + case CODEC_ID_VC1:
- + m_info.format = CEDARV_STREAM_FORMAT_VC1;
- + break;
- +#endif
- + //MJPEG
- +#if A10ENABLE_MJPEG
- + case CODEC_ID_MJPEG:
- + m_info.format = CEDARV_STREAM_FORMAT_MJPEG;
- + break;
- +#endif
- + //VP8
- +#if A10ENABLE_VP8
- + case CODEC_ID_VP8:
- + m_info.format = CEDARV_STREAM_FORMAT_VP8;
- + break;
- +#endif
- + //MSMPEG4V1
- +#if A10ENABLE_MPEG4V1
- + case CODEC_ID_MSMPEG4V1:
- + m_info.format = CEDARV_STREAM_FORMAT_MPEG4;
- + m_info.sub_format = CEDARV_MPEG4_SUB_FORMAT_DIVX1;
- + break;
- +#endif
- + //MSMPEG4V2
- +#if A10ENABLE_MPEG4V2
- + case CODEC_ID_MSMPEG4V2:
- + m_info.format = CEDARV_STREAM_FORMAT_MPEG4;
- + m_info.sub_format = CEDARV_MPEG4_SUB_FORMAT_DIVX2;
- + break;
- +#endif
- + //MSMPEG4V3
- +#if A10ENABLE_MPEG4V3
- + case CODEC_ID_MSMPEG4V3:
- + m_info.format = CEDARV_STREAM_FORMAT_MPEG4;
- + m_info.sub_format = CEDARV_MPEG4_SUB_FORMAT_DIVX3;
- + break;
- +#endif
- + //Sorensson Spark (FLV1)
- +#if A10ENABLE_FLV1
- + case CODEC_ID_FLV1:
- + m_info.format = CEDARV_STREAM_FORMAT_MPEG4;
- + m_info.sub_format = CEDARV_MPEG4_SUB_FORMAT_SORENSSON_H263;
- + break;
- +#endif
- + //Detected as MPEG4 (ID 13)
- + case CODEC_ID_MPEG4:
- + m_info.format = CEDARV_STREAM_FORMAT_MPEG4;
- + switch(m_hints.codec_tag)
- + {
- + //DX40/DIVX4, divx
- +#if A10ENABLE_DIVX4
- + case _4CC('D','I','V','X'):
- + case _4CC('d','i','v','x'):
- + m_info.sub_format = CEDARV_MPEG4_SUB_FORMAT_DIVX4;
- + break;
- +#endif
- + //DX50/DIVX5
- +#if A10ENABLE_DIVX5
- + case _4CC('D','X','5','0'):
- + case _4CC('d','x','5','0'):
- + case _4CC('D','I','V','5'):
- + case _4CC('d','i','v','5'):
- + m_info.sub_format = CEDARV_MPEG4_SUB_FORMAT_DIVX5;
- + break;
- +#endif
- + //XVID
- +#if A10ENABLE_XVID
- + case _4CC('X','V','I','D'):
- + case _4CC('x','v','i','d'):
- + case _4CC('X','v','i','D'):
- + case _4CC('M','P','4','V'):
- + case _4CC('m','p','4','v'):
- + case _4CC('M','P','4','S'):
- + case _4CC('m','p','4','s'):
- + case _4CC('P','M','P','4'):
- + case _4CC('p','m','p','4'):
- + case _4CC('F','M','P','4'):
- + case _4CC('f','m','p','4'):
- + case _4CC('X','V','I','X'):
- + case _4CC('x','v','i','x'):
- + m_info.sub_format = CEDARV_MPEG4_SUB_FORMAT_XVID;
- + break;
- +#endif
- + default:
- + CLog::Log(LOGERROR, "A10: MPEG4 codec tag %d is unknown.\n", m_hints.codec_tag);
- + return false;
- + }
- + break;
- +
- + default:
- + CLog::Log(LOGERROR, "A10: codecid %d is unknown.\n", m_hints.codec);
- + return false;
- + }
- +
- + return DoOpen();
- +}
- +
- +bool CDVDVideoCodecA10::DoOpen()
- +{
- + s32 ret;
- +
- + if (cas(&g_cedaropen, 0, 1) != 0)
- + {
- + CLog::Log(LOGERROR, "A10: cedar already in use");
- + return false;
- + }
- +
- + m_hcedarv = libcedarv_init(&ret);
- + if (ret < 0)
- + {
- + CLog::Log(LOGERROR, "A10: libcedarv_init failed. (%d)\n", ret);
- + goto Error;
- + }
- +
- + ret = m_hcedarv->set_vstream_info(m_hcedarv, &m_info);
- + if (ret < 0)
- + {
- + CLog::Log(LOGERROR, "A10: set_vstream_info failed. (%d)\n", ret);
- + goto Error;
- + }
- +
- + ret = m_hcedarv->open(m_hcedarv);
- + if (ret < 0)
- + {
- + CLog::Log(LOGERROR, "A10: open failed. (%d)\n", ret);
- + goto Error;
- + }
- +
- + m_hcedarv->ioctrl(m_hcedarv, CEDARV_COMMAND_RESET, 0);
- +
- + ret = m_hcedarv->ioctrl(m_hcedarv, CEDARV_COMMAND_PLAY, 0);
- + if (ret < 0)
- + {
- + CLog::Log(LOGERROR, "A10: CEDARV_COMMAND_PLAY failed. (%d)\n", ret);
- + goto Error;
- + }
- +
- + m_prebuffer = true;
- + m_nframes = 0;
- +
- + CLog::Log(LOGDEBUG, "A10: cedar open.");
- + return true;
- +
- +Error:
- +
- + Dispose();
- + return false;
- +}
- +
- +/*
- + * Dispose, Free all resources
- + */
- +void CDVDVideoCodecA10::Dispose()
- +{
- + A10VLFreeQueue();
- + if (m_hcedarv)
- + {
- + m_hcedarv->ioctrl(m_hcedarv, CEDARV_COMMAND_STOP, 0);
- + m_hcedarv->close(m_hcedarv);
- + libcedarv_exit(m_hcedarv);
- + m_hcedarv = NULL;
- + cas(&g_cedaropen, 1, 0);
- + CLog::Log(LOGDEBUG, "A10: cedar dispose.");
- + }
- +}
- +
- +/*
- + * returns one or a combination of VC_ messages
- + * pData and iSize can be NULL, this means we should flush the rest of the data.
- + */
- +int CDVDVideoCodecA10::Decode(BYTE* pData, int iSize, double dts, double pts)
- +{
- + int status = 0;
- + s32 ret = 0;
- + u8 *buf0, *buf1;
- + u32 bufsize0, bufsize1;
- + cedarv_stream_data_info_t dinf;
- + cedarv_picture_t picture;
- +
- + if (!m_hcedarv)
- + return VC_ERROR;
- +
- + if (m_nframes == 0)
- + {
- + m_hcedarv->decode(m_hcedarv);
- + m_hcedarv->decode(m_hcedarv);
- + }
- +
- + if (pData && iSize)
- + {
- + ret = m_hcedarv->request_write(m_hcedarv, iSize, &buf0, &bufsize0, &buf1, &bufsize1);
- + if(ret < 0)
- + {
- + CLog::Log(LOGERROR, "A10: request_write failed.\n");
- + return VC_ERROR;
- + }
- + if (bufsize1)
- + {
- + memcpy(buf0, pData, bufsize0);
- + memcpy(buf1, pData+bufsize0, bufsize1);
- + }
- + else
- + {
- + memcpy(buf0, pData, iSize);
- + }
- +
- + memset(&dinf, 0, sizeof(dinf));
- + dinf.lengh = iSize;
- +#ifdef CEDARV_FLAG_DECODE_NO_DELAY
- + dinf.flags = CEDARV_FLAG_FIRST_PART | CEDARV_FLAG_LAST_PART | CEDARV_FLAG_DECODE_NO_DELAY;
- +#else
- + dinf.flags = CEDARV_FLAG_FIRST_PART | CEDARV_FLAG_LAST_PART;
- +#endif
- + if (pts != DVD_NOPTS_VALUE)
- + {
- + dinf.flags |= CEDARV_FLAG_PTS_VALID;
- + dinf.pts = pts;
- + }
- + else if (dts != DVD_NOPTS_VALUE)
- + {
- + dinf.flags |= CEDARV_FLAG_PTS_VALID;
- + dinf.pts = dts;
- + }
- +
- + ret = m_hcedarv->update_data(m_hcedarv, &dinf);
- + if (ret)
- + {
- + CLog::Log(LOGERROR, "A10: update_data(): %d\n", ret);
- + }
- +
- + if (m_prebuffer)
- + {
- + m_nframes++;
- + status |= VC_BUFFER;
- + if (m_nframes >= PREFRAMES)
- + m_prebuffer = false;
- + }
- + }
- +
- + if (!m_prebuffer)
- + {
- + ret = m_hcedarv->decode(m_hcedarv);
- + switch(ret)
- + {
- + case CEDARV_RESULT_OK:
- + case CEDARV_RESULT_FRAME_DECODED:
- + case CEDARV_RESULT_KEYFRAME_DECODED:
- + case CEDARV_RESULT_NO_BITSTREAM:
- + status |= VC_BUFFER;
- + break;
- + case CEDARV_RESULT_NO_FRAME_BUFFER:
- + CLog::Log(LOGNOTICE, "A10: no frames. free queue.");
- + A10VLFreeQueue();
- + //ret = m_hcedarv->decode(m_hcedarv);
- + break;
- +
- + default:
- + CLog::Log(LOGERROR, "A10: decode(%d): %d\n", iSize, ret);
- + break;
- + }
- +
- + ret = m_hcedarv->display_request(m_hcedarv, &picture);
- + if (ret > 3 || ret < -1)
- + {
- + CLog::Log(LOGERROR, "A10: display_request(): %d\n", ret);
- + }
- + else if (ret == 0)
- + {
- + float aspect_ratio = m_aspect;
- +
- + m_picture.dts = DVD_NOPTS_VALUE;
- + m_picture.pts = picture.pts > 0 ? (double)picture.pts : DVD_NOPTS_VALUE;
- + m_picture.iWidth = picture.display_width;
- + m_picture.iHeight = picture.display_height;
- +
- + if (picture.is_progressive) m_picture.iFlags &= ~DVP_FLAG_INTERLACED;
- + else m_picture.iFlags |= DVP_FLAG_INTERLACED;
- +
- + /* XXX: we suppose the screen has a 1.0 pixel ratio */ // CDVDVideo will compensate it.
- + if (aspect_ratio <= 0.0)
- + aspect_ratio = (float)m_picture.iWidth / (float)m_picture.iHeight;
- +
- + m_picture.iDisplayHeight = m_picture.iHeight;
- + m_picture.iDisplayWidth = ((int)lrint(m_picture.iHeight * aspect_ratio)) & -3;
- + if (m_picture.iDisplayWidth > m_picture.iWidth)
- + {
- + m_picture.iDisplayWidth = m_picture.iWidth;
- + m_picture.iDisplayHeight = ((int)lrint(m_picture.iWidth / aspect_ratio)) & -3;
- + }
- +
- + m_picture.format = RENDER_FMT_A10BUF;
- + m_picture.a10buffer = A10VLPutQueue(freecallback, (void*)this, NULL, picture);
- + m_picture.iFlags |= DVP_FLAG_ALLOCATED;
- +
- + //CLog::Log(LOGDEBUG, "A10: decode %d\n", buffer->picture.id);
- +
- + status |= VC_PICTURE;
- + }
- + }
- +
- + return status;
- +}
- +
- +/*
- + * Reset the decoder.
- + * Should be the same as calling Dispose and Open after each other
- + */
- +void CDVDVideoCodecA10::Reset()
- +{
- + cedarv_picture_t pict;
- +
- + CLog::Log(LOGDEBUG, "A10: reset requested");
- + m_hcedarv->ioctrl(m_hcedarv, CEDARV_COMMAND_FLUSH, 0);
- + while(m_hcedarv->display_request(m_hcedarv, &pict) == 0)
- + m_hcedarv->display_release(m_hcedarv, pict.id);
- + A10VLFreeQueue();
- +}
- +
- +/*
- + * returns true if successfull
- + * the data is valid until the next Decode call
- + */
- +bool CDVDVideoCodecA10::GetPicture(DVDVideoPicture* pDvdVideoPicture)
- +{
- + if (m_picture.iFlags & DVP_FLAG_ALLOCATED)
- + {
- + *pDvdVideoPicture = m_picture;
- + return true;
- + }
- + return false;
- +}
- +
- +bool CDVDVideoCodecA10::ClearPicture(DVDVideoPicture* pDvdVideoPicture)
- +{
- + return CDVDVideoCodec::ClearPicture(pDvdVideoPicture);
- +}
- +
- +void CDVDVideoCodecA10::SetDropState(bool bDrop)
- +{
- +}
- +
- +const char* CDVDVideoCodecA10::GetName()
- +{
- + return "A10";
- +}
- +
- +void CDVDVideoCodecA10::FreePicture(void *pictpriv, cedarv_picture_t &pict)
- +{
- + m_hcedarv->display_release(m_hcedarv, pict.id);
- +}
- diff -b -u -r -N '--exclude=.git' xbmc_orig/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecA10.h xbmc_rellla/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecA10.h
- --- xbmc_orig/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecA10.h 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecA10.h 2013-06-12 17:13:43.000000000 +0200
- @@ -0,0 +1,140 @@
- +#pragma once
- +
- +/*
- + * Copyright (C) 2005-2008 Team XBMC
- + * http://www.xbmc.org
- + *
- + * This Program is free software; you can redistribute it and/or modify
- + * it under the terms of the GNU General Public License as published by
- + * the Free Software Foundation; either version 2, or (at your option)
- + * any later version.
- + *
- + * This Program is distributed in the hope that it will be useful,
- + * but WITHOUT ANY WARRANTY; without even the implied warranty of
- + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + * GNU General Public License for more details.
- + *
- + * You should have received a copy of the GNU General Public License
- + * along with XBMC; see the file COPYING. If not, write to
- + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- + * http://www.gnu.org/copyleft/gpl.html
- + *
- + */
- +
- +#include "guilib/Geometry.h"
- +#include "DVDVideoCodec.h"
- +#include "DVDStreamInfo.h"
- +
- +extern "C" {
- +#include <libcedarv.h>
- +};
- +
- +class CDVDVideoCodecA10 : public CDVDVideoCodec
- +{
- +public:
- +
- + CDVDVideoCodecA10();
- + virtual ~CDVDVideoCodecA10();
- +
- + /*
- + * Open the decoder, returns true on success
- + */
- + bool Open(CDVDStreamInfo &hints, CDVDCodecOptions &options);
- +
- + /*
- + * Dispose, Free all resources
- + */
- + void Dispose();
- +
- + /*
- + * returns one or a combination of VC_ messages
- + * pData and iSize can be NULL, this means we should flush the rest of the data.
- + */
- + int Decode(BYTE* pData, int iSize, double dts, double pts);
- +
- + /*
- + * Reset the decoder.
- + * Should be the same as calling Dispose and Open after each other
- + */
- + void Reset();
- +
- + /*
- + * returns true if successfull
- + * the data is valid until the next Decode call
- + */
- + bool GetPicture(DVDVideoPicture* pDvdVideoPicture);
- +
- +
- + /*
- + * returns true if successfull
- + * the data is cleared to zero
- + */
- + bool ClearPicture(DVDVideoPicture* pDvdVideoPicture);
- +
- + /*
- + * returns true if successfull
- + * the data is valid until the next Decode call
- + * userdata can be anything, for now we use it for closed captioning
- + */
- + /*-->super
- + bool GetUserData(DVDVideoUserData* pDvdVideoUserData);
- + */
- +
- + /*
- + * will be called by video player indicating if a frame will eventually be dropped
- + * codec can then skip actually decoding the data, just consume the data set picture headers
- + */
- + void SetDropState(bool bDrop);
- +
- + /*
- + * returns the number of demuxer bytes in any internal buffers
- + */
- + /*-->super
- + int GetDataSize(void);
- + */
- +
- + /*
- + * returns the time in seconds for demuxer bytes in any internal buffers
- + */
- + /*-->super
- + virtual double GetTimeSize(void);
- + */
- +
- + /*
- + * set the type of filters that should be applied at decoding stage if possible
- + */
- + /*-->super
- + unsigned int SetFilters(unsigned int filters);
- + */
- +
- + /*
- + *
- + * should return codecs name
- + */
- + const char* GetName();
- +
- + /*
- + *
- + * How many packets should player remember, so codec
- + * can recover should something cause it to flush
- + * outside of players control
- + */
- + /*-->super
- + virtual unsigned GetConvergeCount();
- + */
- +
- + void FreePicture(void *pictpriv, cedarv_picture_t &pict);
- +
- +private:
- +
- + bool DoOpen();
- +
- + //decoding
- + cedarv_stream_info_t m_info;
- + float m_aspect;
- + CDVDStreamInfo m_hints;
- + cedarv_decoder_t *m_hcedarv;
- + DVDVideoPicture m_picture;
- + bool m_prebuffer;
- + int m_nframes;
- +};
- diff -b -u -r -N '--exclude=.git' xbmc_orig/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h xbmc_rellla/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h
- --- xbmc_orig/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h 2013-06-12 16:46:43.000000000 +0200
- +++ xbmc_rellla/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h 2013-06-12 17:13:43.000000000 +0200
- @@ -38,6 +38,7 @@
- class COpenMax;
- class COpenMaxVideo;
- struct OpenMaxVideoBuffer;
- +struct A10VLQueueItem;
- // should be entirely filled by all codecs
- struct DVDVideoPicture
- @@ -69,6 +70,10 @@
- struct {
- struct __CVBuffer *cvBufferRef;
- };
- +
- + struct {
- + A10VLQueueItem *a10buffer;
- + };
- };
- unsigned int iFlags;
- diff -b -u -r -N '--exclude=.git' xbmc_orig/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in xbmc_rellla/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in
- --- xbmc_orig/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in 2013-06-12 17:20:26.000000000 +0200
- +++ xbmc_rellla/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in 2013-06-12 17:13:43.000000000 +0200
- @@ -28,6 +28,7 @@
- SRCS += DVDVideoCodecAmlogic.cpp
- INCLUDES += -I$(prefix)/include/amlplayer
- endif
- +SRCS += DVDVideoCodecA10.cpp
- LIB=Video.a
- diff -b -u -r -N '--exclude=.git' xbmc_orig/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp xbmc_rellla/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
- --- xbmc_orig/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp 2013-06-12 17:20:26.000000000 +0200
- +++ xbmc_rellla/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp 2013-06-12 17:13:43.000000000 +0200
- @@ -196,6 +196,11 @@
- #endif
- +#ifdef ALLWINNERA10
- + if (m_pVideoCodec && (strcmp(m_pVideoCodec->GetName(), "A10") == 0))
- + m_pVideoCodec->Dispose();
- +#endif
- +
- CLog::Log(LOGNOTICE, "Creating video codec with codec id: %i", hint.codec);
- CDVDVideoCodec* codec = CDVDFactoryCodec::CreateVideoCodec(hint, surfaces, formats);
- if(!codec)
- @@ -1138,6 +1143,11 @@
- case RENDER_FMT_CVBREF:
- formatstr = "BGRA";
- break;
- +#ifdef ALLWINNERA10
- + case RENDER_FMT_A10BUF:
- + formatstr = "A10BUF";
- + break;
- +#endif
- case RENDER_FMT_BYPASS:
- formatstr = "BYPASS";
- break;
- diff -b -u -r -N '--exclude=.git' xbmc_orig/xbmc/cores/omxplayer/OMXPlayer.cpp xbmc_rellla/xbmc/cores/omxplayer/OMXPlayer.cpp
- --- xbmc_orig/xbmc/cores/omxplayer/OMXPlayer.cpp 2013-06-12 17:20:26.000000000 +0200
- +++ xbmc_rellla/xbmc/cores/omxplayer/OMXPlayer.cpp 2013-06-12 17:13:43.000000000 +0200
- @@ -4288,6 +4288,12 @@
- m_change_volume = true;
- }
- +void COMXPlayer::SetMute(bool bOnOff)
- +{
- + m_current_mute = bOnOff;
- + m_change_volume = true;
- +}
- +
- void COMXPlayer::SetVolume(float fVolume)
- {
- m_current_volume = fVolume;
- diff -b -u -r -N '--exclude=.git' xbmc_orig/xbmc/cores/VideoRenderers/LinuxRendererA10.cpp xbmc_rellla/xbmc/cores/VideoRenderers/LinuxRendererA10.cpp
- --- xbmc_orig/xbmc/cores/VideoRenderers/LinuxRendererA10.cpp 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/xbmc/cores/VideoRenderers/LinuxRendererA10.cpp 2013-06-12 17:13:43.000000000 +0200
- @@ -0,0 +1,1998 @@
- +/*
- + * Copyright (C) 2010-2012 Team XBMC
- + * http://www.xbmc.org
- + *
- + * This Program is free software; you can redistribute it and/or modify
- + * it under the terms of the GNU General Public License as published by
- + * the Free Software Foundation; either version 2, or (at your option)
- + * any later version.
- + *
- + * This Program is distributed in the hope that it will be useful,
- + * but WITHOUT ANY WARRANTY; without even the implied warranty of
- + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + * GNU General Public License for more details.
- + *
- + * You should have received a copy of the GNU General Public License
- + * along with XBMC; see the file COPYING. If not, see
- + * <http://www.gnu.org/licenses/>.
- + *
- + */
- +
- +#include "system.h"
- +#if (defined HAVE_CONFIG_H) && (!defined WIN32)
- + #include "config.h"
- +#endif
- +
- +#if HAS_GLES == 2
- +#include "system_gl.h"
- +
- +#include <locale.h>
- +#include <sys/ioctl.h>
- +#include "guilib/MatrixGLES.h"
- +#include "LinuxRendererA10.h"
- +#include "utils/log.h"
- +#include "utils/fastmemcpy.h"
- +#include "utils/MathUtils.h"
- +#include "utils/GLUtils.h"
- +#include "settings/Settings.h"
- +#include "settings/AdvancedSettings.h"
- +#include "settings/DisplaySettings.h"
- +#include "settings/MediaSettings.h"
- +#include "guilib/FrameBufferObject.h"
- +#include "VideoShaders/YUV2RGBShader.h"
- +#include "VideoShaders/VideoFilterShader.h"
- +#include "windowing/WindowingFactory.h"
- +#include "dialogs/GUIDialogKaiToast.h"
- +#include "guilib/Texture.h"
- +#include "threads/SingleLock.h"
- +#include "RenderCapture.h"
- +#include "RenderFormats.h"
- +#include "xbmc/Application.h"
- +#include "cores/IPlayer.h"
- +
- +using namespace Shaders;
- +
- +CLinuxRendererA10::CLinuxRendererA10()
- +{
- + m_textureTarget = GL_TEXTURE_2D;
- +
- + for (int i = 0; i < NUM_BUFFERS; i++)
- + {
- + m_eventTexturesDone[i] = new CEvent(false,true);
- + memset(&m_buffers, 0, sizeof(m_buffers));
- + }
- +
- + m_renderMethod = RENDER_GLSL;
- + m_oldRenderMethod = m_renderMethod;
- + m_renderQuality = RQ_SINGLEPASS;
- + m_iFlags = 0;
- + m_format = RENDER_FMT_NONE;
- +
- + m_iYV12RenderBuffer = 0;
- + m_flipindex = 0;
- + m_currentField = FIELD_FULL;
- + m_reloadShaders = 0;
- + m_pYUVShader = NULL;
- + m_pVideoFilterShader = NULL;
- + m_scalingMethod = VS_SCALINGMETHOD_LINEAR;
- + m_scalingMethodGui = (ESCALINGMETHOD)-1;
- +
- + // default texture handlers to YUV
- + m_textureUpload = &CLinuxRendererA10::UploadYV12Texture;
- + m_textureCreate = &CLinuxRendererA10::CreateYV12Texture;
- + m_textureDelete = &CLinuxRendererA10::DeleteYV12Texture;
- +
- +/* check if needed (import from LinuxRendererGLES.cpp) - rellla
- + m_NumYV12Buffers = 0;
- + m_StrictBinding = false;
- +*/
- + m_iLastRenderBuffer = 0;
- + m_bConfigured = false;
- + m_bValidated = false;
- + m_bImageReady = false;
- + m_clearColour = 0.0f;
- +/*
- + m_fbo.width = 0.0;
- + m_fbo.height = 0.0;
- + m_pboSupported = false;
- + m_pboUsed = false;
- + m_nonLinStretch = false;
- + m_nonLinStretchGui = false;
- + m_pixelRatio = 0.0f;
- +*/
- +
- +
- +}
- +
- +CLinuxRendererA10::~CLinuxRendererA10()
- +{
- + UnInit();
- + for (int i = 0; i < NUM_BUFFERS; i++)
- + delete m_eventTexturesDone[i];
- +
- + if (m_pYUVShader)
- + {
- + m_pYUVShader->Free();
- + delete m_pYUVShader;
- + m_pYUVShader = NULL;
- + }
- +}
- +
- +void CLinuxRendererA10::ManageTextures()
- +{
- + //m_iYV12RenderBuffer = 0;
- + return;
- +}
- +
- +bool CLinuxRendererA10::ValidateRenderTarget()
- +{
- + if (!m_bValidated)
- + {
- + CLog::Log(LOGNOTICE,"Using GL_TEXTURE_2D");
- +
- + // create the yuv textures
- + LoadShaders();
- +
- + for (int i = 0 ; i < NUM_BUFFERS ; i++)
- + (this->*m_textureCreate)(i);
- +
- + m_bValidated = true;
- + return true;
- + }
- + return false;
- +}
- +
- +bool CLinuxRendererA10::Configure(unsigned int width, unsigned int height, unsigned int d_width, unsigned int d_height, float fps, unsigned flags, ERenderFormat format, unsigned extended_format, unsigned int orientation)
- +{
- + m_sourceWidth = width;
- + m_sourceHeight = height;
- + m_renderOrientation = orientation;
- +
- + // Save the flags.
- + m_iFlags = flags;
- + m_format = format;
- +
- + // Calculate the input frame aspect ratio.
- + CalculateFrameAspectRatio(d_width, d_height);
- + ChooseBestResolution(fps);
- + SetViewMode(CMediaSettings::Get().GetCurrentVideoSettings().m_ViewMode);
- + ManageDisplay();
- +
- + m_bConfigured = true;
- + m_bImageReady = false;
- + m_scalingMethodGui = (ESCALINGMETHOD)-1;
- +
- + // Ensure that textures are recreated and rendering starts only after the 1st
- + // frame is loaded after every call to Configure().
- + m_bValidated = false;
- +
- + for (int i = 0 ; i< NUM_BUFFERS; i++)
- + m_buffers[i].image.flags = 0;
- +
- + m_iLastRenderBuffer = -1;
- +
- + m_RenderUpdateCallBackFn = NULL;
- + m_RenderUpdateCallBackCtx = NULL;
- + if ((m_format == RENDER_FMT_BYPASS) && g_application.GetCurrentPlayer())
- + {
- + m_renderFeatures.clear();
- + m_scalingMethods.clear();
- + m_deinterlaceModes.clear();
- + m_deinterlaceMethods.clear();
- +
- + if (m_RenderFeaturesCallBackFn)
- + {
- + (*m_RenderFeaturesCallBackFn)(m_RenderFeaturesCallBackCtx, m_renderFeatures);
- + // after setting up m_RenderFeatures, we are done with the callback
- + m_RenderFeaturesCallBackFn = NULL;
- + m_RenderFeaturesCallBackCtx = NULL;
- + }
- + g_application.m_pPlayer->GetRenderFeatures(m_renderFeatures);
- + g_application.m_pPlayer->GetDeinterlaceMethods(m_deinterlaceMethods);
- + g_application.m_pPlayer->GetDeinterlaceModes(m_deinterlaceModes);
- + g_application.m_pPlayer->GetScalingMethods(m_scalingMethods);
- + }
- +
- + return true;
- +}
- +
- +int CLinuxRendererA10::NextYV12Texture()
- +{
- + return (m_iYV12RenderBuffer + 1) % NUM_BUFFERS;
- +}
- +
- +int CLinuxRendererA10::GetImage(YV12Image *image, int source, bool readonly)
- +{
- + if (!image) return -1;
- + if (!m_bValidated) return -1;
- +
- + /* take next available buffer */
- + if( source == AUTOSOURCE )
- + source = NextYV12Texture();
- +
- + if (m_renderMethod & RENDER_A10BUF )
- + {
- + return source;
- + }
- +
- + YV12Image &im = m_buffers[source].image;
- +
- + if ((im.flags&(~IMAGE_FLAG_READY)) != 0)
- + {
- + CLog::Log(LOGDEBUG, "CLinuxRenderer::GetImage - request image but none to give");
- + return -1;
- + }
- +
- + if( readonly )
- + im.flags |= IMAGE_FLAG_READING;
- + else
- + {
- + if( !m_eventTexturesDone[source]->WaitMSec(500) )
- + CLog::Log(LOGWARNING, "%s - Timeout waiting for texture %d", __FUNCTION__, source);
- +
- + im.flags |= IMAGE_FLAG_WRITING;
- + }
- +
- + // copy the image - should be operator of YV12Image
- + for (int p=0;p<MAX_PLANES;p++)
- + {
- + image->plane[p] = im.plane[p];
- + image->stride[p] = im.stride[p];
- + }
- + image->width = im.width;
- + image->height = im.height;
- + image->flags = im.flags;
- + image->cshift_x = im.cshift_x;
- + image->cshift_y = im.cshift_y;
- + image->bpp = 1;
- +
- + return source;
- +
- + return -1;
- +}
- +
- +void CLinuxRendererA10::ReleaseImage(int source, bool preserve)
- +{
- + YV12Image &im = m_buffers[source].image;
- +
- + if( im.flags & IMAGE_FLAG_WRITING )
- + m_eventTexturesDone[source]->Set();
- +
- + im.flags &= ~IMAGE_FLAG_INUSE;
- + im.flags |= IMAGE_FLAG_READY;
- + /* if image should be preserved reserve it so it's not auto seleceted */
- +
- + if( preserve )
- + im.flags |= IMAGE_FLAG_RESERVED;
- +
- + m_bImageReady = true;
- +}
- +
- +void CLinuxRendererA10::CalculateTextureSourceRects(int source, int num_planes)
- +{
- + YUVBUFFER& buf = m_buffers[source];
- + YV12Image* im = &buf.image;
- + YUVFIELDS& fields = buf.fields;
- +
- + // calculate the source rectangle
- + for(int field = 0; field < 3; field++)
- + {
- + for(int plane = 0; plane < num_planes; plane++)
- + {
- + YUVPLANE& p = fields[field][plane];
- +
- + p.rect = m_sourceRect;
- + p.width = im->width;
- + p.height = im->height;
- +
- + if(field != FIELD_FULL)
- + {
- + /* correct for field offsets and chroma offsets */
- + float offset_y = 0.5;
- + if(plane != 0)
- + offset_y += 0.5;
- + if(field == FIELD_BOT)
- + offset_y *= -1;
- +
- + p.rect.y1 += offset_y;
- + p.rect.y2 += offset_y;
- +
- + /* half the height if this is a field */
- + p.height *= 0.5f;
- + p.rect.y1 *= 0.5f;
- + p.rect.y2 *= 0.5f;
- + }
- +
- + if(plane != 0)
- + {
- + p.width /= 1 << im->cshift_x;
- + p.height /= 1 << im->cshift_y;
- +
- + p.rect.x1 /= 1 << im->cshift_x;
- + p.rect.x2 /= 1 << im->cshift_x;
- + p.rect.y1 /= 1 << im->cshift_y;
- + p.rect.y2 /= 1 << im->cshift_y;
- + }
- +
- + if (m_textureTarget == GL_TEXTURE_2D)
- + {
- + p.height /= p.texheight;
- + p.rect.y1 /= p.texheight;
- + p.rect.y2 /= p.texheight;
- + p.width /= p.texwidth;
- + p.rect.x1 /= p.texwidth;
- + p.rect.x2 /= p.texwidth;
- + }
- + }
- + }
- +}
- +
- +void CLinuxRendererA10::LoadPlane( YUVPLANE& plane, int type, unsigned flipindex
- + , unsigned width, unsigned height
- + , int stride, void* data )
- +{
- + if(plane.flipindex == flipindex)
- + return;
- +
- + const GLvoid *pixelData = data;
- +
- + int bps = glFormatElementByteCount(type);
- +
- + glBindTexture(m_textureTarget, plane.id);
- +
- + // OpenGL ES does not support strided texture input.
- + if(stride != width * bps)
- + {
- + unsigned char* src = (unsigned char*)data;
- + for (int y = 0; y < height;++y, src += stride)
- + glTexSubImage2D(m_textureTarget, 0, 0, y, width, 1, type, GL_UNSIGNED_BYTE, src);
- + } else {
- + glTexSubImage2D(m_textureTarget, 0, 0, 0, width, height, type, GL_UNSIGNED_BYTE, pixelData);
- + }
- +
- + /* check if we need to load any border pixels */
- + if(height < plane.texheight)
- + glTexSubImage2D( m_textureTarget, 0
- + , 0, height, width, 1
- + , type, GL_UNSIGNED_BYTE
- + , (unsigned char*)pixelData + stride * (height-1));
- +
- + if(width < plane.texwidth)
- + glTexSubImage2D( m_textureTarget, 0
- + , width, 0, 1, height
- + , type, GL_UNSIGNED_BYTE
- + , (unsigned char*)pixelData + bps * (width-1));
- +
- + glBindTexture(m_textureTarget, 0);
- +
- + plane.flipindex = flipindex;
- +}
- +
- +void CLinuxRendererA10::Reset()
- +{
- + for(int i=0; i<NUM_BUFFERS; i++)
- + {
- + /* reset all image flags, this will cleanup textures later */
- + m_buffers[i].image.flags = 0;
- + /* reset texture locks, a bit ugly, could result in tearing */
- + m_eventTexturesDone[i]->Set();
- + }
- +}
- +
- +void CLinuxRendererA10::Update(bool bPauseDrawing)
- +{
- + if (!m_bConfigured) return;
- + ManageDisplay();
- + ManageTextures();
- + m_scalingMethodGui = (ESCALINGMETHOD)-1;
- +}
- +
- +void CLinuxRendererA10::RenderUpdate(bool clear, DWORD flags, DWORD alpha)
- +{
- + if (!m_bConfigured) return;
- +
- + // if its first pass, just init textures and return
- + if (ValidateRenderTarget())
- + return;
- +
- + if (m_renderMethod & RENDER_BYPASS)
- + {
- + ManageDisplay();
- + ManageTextures();
- + // if running bypass, then the player might need the src/dst rects
- + // for sizing video playback on a layer other than the gles layer.
- + if (m_RenderUpdateCallBackFn)
- + (*m_RenderUpdateCallBackFn)(m_RenderUpdateCallBackCtx, m_sourceRect, m_destRect);
- +
- + RESOLUTION res = GetResolution();
- + int iWidth = CDisplaySettings::Get().GetResolutionInfo(res).iWidth;
- + int iHeight = CDisplaySettings::Get().GetResolutionInfo(res).iHeight;
- +
- + g_graphicsContext.BeginPaint();
- +
- + glScissor(m_destRect.x1,
- + iHeight - m_destRect.y2,
- + m_destRect.x2 - m_destRect.x1,
- + m_destRect.y2 - m_destRect.y1);
- + glEnable(GL_BLEND);
- + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- + glClearColor(0, 0, 0, 0);
- + glClear(GL_COLOR_BUFFER_BIT);
- + glScissor(0, 0, iWidth, iHeight);
- +
- + g_graphicsContext.EndPaint();
- + return;
- + }
- + else if (m_renderMethod & RENDER_A10BUF)
- + {
- + ManageDisplay();
- + ManageTextures();
- +
- + if (m_RenderUpdateCallBackFn)
- + (*m_RenderUpdateCallBackFn)(m_RenderUpdateCallBackCtx, m_sourceRect, m_destRect);
- +
- + A10VLWaitVSYNC();
- +
- + g_graphicsContext.BeginPaint();
- +
- + glEnable(GL_BLEND);
- + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- + glClearColor(1.0/255, 2.0/255, 3.0/255, 0);
- + glClear(GL_COLOR_BUFFER_BIT);
- + glClearColor(0, 0, 0, 0);
- +
- + g_graphicsContext.EndPaint();
- + }
- +
- + // this needs to be checked after texture validation
- + if (!m_bImageReady) return;
- +
- + int index = m_iYV12RenderBuffer;
- + YUVBUFFER& buf = m_buffers[index];
- +
- + if (m_renderMethod & RENDER_A10BUF)
- + {
- + A10VLDisplayQueueItem(buf.a10buffer, m_sourceRect, m_destRect);
- + m_iLastRenderBuffer = index;
- + VerifyGLState();
- + return;
- + }
- +
- + if (!buf.fields[FIELD_FULL][0].id || !buf.image.flags) return;
- +
- + ManageDisplay();
- + ManageTextures();
- +
- + g_graphicsContext.BeginPaint();
- +
- + if( !m_eventTexturesDone[index]->WaitMSec(500))
- + {
- + CLog::Log(LOGWARNING, "%s - Timeout waiting for texture %d", __FUNCTION__, index);
- +
- + // render the previous frame if this one isn't ready yet
- + if (m_iLastRenderBuffer > -1)
- + {
- + m_iYV12RenderBuffer = m_iLastRenderBuffer;
- + index = m_iYV12RenderBuffer;
- + }
- + }
- + else
- + m_iLastRenderBuffer = index;
- +
- + if (clear)
- + {
- + glClearColor(m_clearColour, m_clearColour, m_clearColour, 0);
- + glClear(GL_COLOR_BUFFER_BIT);
- + glClearColor(0,0,0,0);
- + }
- +
- + if (alpha<255)
- + {
- + glEnable(GL_BLEND);
- + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- + if (m_pYUVShader)
- + m_pYUVShader->SetAlpha(alpha / 255.0f);
- + }
- + else
- + {
- + glDisable(GL_BLEND);
- + if (m_pYUVShader)
- + m_pYUVShader->SetAlpha(1.0f);
- + }
- +
- + if ((flags & RENDER_FLAG_TOP) && (flags & RENDER_FLAG_BOT))
- + CLog::Log(LOGERROR, "GLES: Cannot render stipple!");
- + else
- + Render(flags, index);
- +
- + VerifyGLState();
- + glEnable(GL_BLEND);
- +
- + g_graphicsContext.EndPaint();
- +}
- +
- +void CLinuxRendererA10::FlipPage(int source)
- +{
- + if( source >= 0 && source < NUM_BUFFERS )
- + m_iYV12RenderBuffer = source;
- + else
- + m_iYV12RenderBuffer = NextYV12Texture();
- +
- + m_buffers[m_iYV12RenderBuffer].flipindex = ++m_flipindex;
- +
- + return;
- +}
- +
- +unsigned int CLinuxRendererA10::PreInit()
- +{
- + CSingleLock lock(g_graphicsContext);
- + m_bConfigured = false;
- + m_bValidated = false;
- + UnInit();
- + m_resolution = CDisplaySettings::Get().GetCurrentResolution();
- + if ( m_resolution == RES_WINDOW )
- + m_resolution = RES_DESKTOP;
- +
- + m_iYV12RenderBuffer = 0;
- +
- + m_formats.push_back(RENDER_FMT_YUV420P);
- + m_formats.push_back(RENDER_FMT_BYPASS);
- + m_formats.push_back(RENDER_FMT_A10BUF);
- +
- + // setup the background colour
- + m_clearColour = (float)(g_advancedSettings.m_videoBlackBarColour & 0xff) / 0xff;
- +
- + return true;
- +}
- +
- +void CLinuxRendererA10::UpdateVideoFilter()
- +{
- + if (m_scalingMethodGui == CMediaSettings::Get().GetCurrentVideoSettings().m_ScalingMethod)
- + return;
- + m_scalingMethodGui = CMediaSettings::Get().GetCurrentVideoSettings().m_ScalingMethod;
- + m_scalingMethod = m_scalingMethodGui;
- +
- + if(!Supports(m_scalingMethod))
- + {
- + CLog::Log(LOGWARNING, "CLinuxRendererA10::UpdateVideoFilter - choosen scaling method %d, is not supported by renderer", (int)m_scalingMethod);
- + m_scalingMethod = VS_SCALINGMETHOD_LINEAR;
- + }
- +
- + if (m_pVideoFilterShader)
- + {
- + m_pVideoFilterShader->Free();
- + delete m_pVideoFilterShader;
- + m_pVideoFilterShader = NULL;
- + }
- + m_fbo.Cleanup();
- +
- + VerifyGLState();
- +
- + switch (m_scalingMethod)
- + {
- + case VS_SCALINGMETHOD_NEAREST:
- + SetTextureFilter(GL_NEAREST);
- + m_renderQuality = RQ_SINGLEPASS;
- + return;
- +
- + case VS_SCALINGMETHOD_LINEAR:
- + SetTextureFilter(GL_LINEAR);
- + m_renderQuality = RQ_SINGLEPASS;
- + return;
- +
- + case VS_SCALINGMETHOD_CUBIC:
- + CLog::Log(LOGERROR, "GLES: CUBIC not supported!");
- + break;
- +
- + case VS_SCALINGMETHOD_LANCZOS2:
- + case VS_SCALINGMETHOD_LANCZOS3:
- + case VS_SCALINGMETHOD_SINC8:
- + case VS_SCALINGMETHOD_NEDI:
- + CLog::Log(LOGERROR, "GL: TODO: This scaler has not yet been implemented");
- + break;
- +
- + default:
- + break;
- + }
- +
- + CGUIDialogKaiToast::QueueNotification("Video Renderering", "Failed to init video filters/scalers, falling back to bilinear scaling");
- + CLog::Log(LOGERROR, "GL: Falling back to bilinear due to failure to init scaler");
- + if (m_pVideoFilterShader)
- + {
- + m_pVideoFilterShader->Free();
- + delete m_pVideoFilterShader;
- + m_pVideoFilterShader = NULL;
- + }
- + m_fbo.Cleanup();
- +
- + SetTextureFilter(GL_LINEAR);
- + m_renderQuality = RQ_SINGLEPASS;
- +}
- +
- +void CLinuxRendererA10::LoadShaders(int field)
- +{
- + int requestedMethod = CSettings::Get().GetInt("videoplayer.rendermethod");
- + CLog::Log(LOGDEBUG, "GL: Requested render method: %d", requestedMethod);
- +
- + if (m_pYUVShader)
- + {
- + m_pYUVShader->Free();
- + delete m_pYUVShader;
- + m_pYUVShader = NULL;
- + }
- +
- + switch(requestedMethod)
- + {
- + case RENDER_METHOD_AUTO:
- + case RENDER_METHOD_GLSL:
- + if (m_format == RENDER_FMT_A10BUF)
- + {
- + CLog::Log(LOGNOTICE, "using A10 render method");
- + m_renderMethod = RENDER_A10BUF;
- + break;
- + }
- + // Try GLSL shaders if supported and user requested auto or GLSL.
- + // create regular progressive scan shader
- + m_pYUVShader = new YUV2RGBProgressiveShader(false, m_iFlags, m_format);
- + CLog::Log(LOGNOTICE, "GL: Selecting Single Pass YUV 2 RGB shader");
- +
- + if (m_pYUVShader && m_pYUVShader->CompileAndLink())
- + {
- + m_renderMethod = RENDER_GLSL;
- + UpdateVideoFilter();
- + break;
- + }
- + else if (m_pYUVShader)
- + {
- + m_pYUVShader->Free();
- + delete m_pYUVShader;
- + m_pYUVShader = NULL;
- + CLog::Log(LOGERROR, "GL: Error enabling YUV2RGB GLSL shader");
- + }
- + break;
- + default:
- + // Use software YUV 2 RGB conversion if user requested it or GLSL failed
- + CLog::Log(LOGERROR, "no software rendering.");
- + break;
- + }
- +
- + // Now that we now the render method, setup texture function handlers
- + if (m_format == RENDER_FMT_BYPASS || m_format == RENDER_FMT_A10BUF)
- + {
- + m_textureUpload = &CLinuxRendererA10::UploadBYPASSTexture;
- + m_textureCreate = &CLinuxRendererA10::CreateBYPASSTexture;
- + m_textureDelete = &CLinuxRendererA10::DeleteBYPASSTexture;
- + }
- + else
- + {
- + // default to YV12 texture handlers
- + m_textureUpload = &CLinuxRendererA10::UploadYV12Texture;
- + m_textureCreate = &CLinuxRendererA10::CreateYV12Texture;
- + m_textureDelete = &CLinuxRendererA10::DeleteYV12Texture;
- + }
- +
- + if (m_oldRenderMethod != m_renderMethod)
- + {
- + CLog::Log(LOGDEBUG, "CLinuxRendererA10: Reorder drawpoints due to method change from %i to %i", m_oldRenderMethod, m_renderMethod);
- + ReorderDrawPoints();
- + m_oldRenderMethod = m_renderMethod;
- + }
- +}
- +
- +void CLinuxRendererA10::UnInit()
- +{
- + CLog::Log(LOGDEBUG, "LinuxRendererGL: Cleaning up GL resources");
- + CSingleLock lock(g_graphicsContext);
- +
- + A10VLHide();
- +
- + // YV12 textures
- + for (int i = 0; i < NUM_BUFFERS; ++i)
- + (this->*m_textureDelete)(i);
- +
- + // cleanup framebuffer object if it was in use
- + m_fbo.Cleanup();
- + m_bValidated = false;
- + m_bImageReady = false;
- + m_bConfigured = false;
- + m_RenderUpdateCallBackFn = NULL;
- + m_RenderUpdateCallBackCtx = NULL;
- + m_RenderFeaturesCallBackFn = NULL;
- + m_RenderFeaturesCallBackCtx = NULL;
- +}
- +
- +inline void CLinuxRendererA10::ReorderDrawPoints()
- +{
- +
- + CBaseRenderer::ReorderDrawPoints();//call base impl. for rotating the points
- +}
- +
- +void CLinuxRendererA10::Render(DWORD flags, int index)
- +{
- + // If rendered directly by the hardware
- + if (m_renderMethod & RENDER_BYPASS)
- + return;
- +
- + // obtain current field, if interlaced
- + if( flags & RENDER_FLAG_TOP)
- + m_currentField = FIELD_TOP;
- +
- + else if (flags & RENDER_FLAG_BOT)
- + m_currentField = FIELD_BOT;
- +
- + else
- + m_currentField = FIELD_FULL;
- +
- + (this->*m_textureUpload)(index);
- +
- + if (m_renderMethod & RENDER_GLSL)
- + {
- + UpdateVideoFilter();
- + switch(m_renderQuality)
- + {
- + case RQ_LOW:
- + case RQ_SINGLEPASS:
- + RenderSinglePass(index, m_currentField);
- + VerifyGLState();
- + break;
- +
- + case RQ_MULTIPASS:
- + RenderMultiPass(index, m_currentField);
- + VerifyGLState();
- + break;
- + }
- + }
- +}
- +
- +void CLinuxRendererA10::RenderSinglePass(int index, int field)
- +{
- + YV12Image &im = m_buffers[index].image;
- + YUVFIELDS &fields = m_buffers[index].fields;
- + YUVPLANES &planes = fields[field];
- +
- + if (m_reloadShaders)
- + {
- + m_reloadShaders = 0;
- + LoadShaders(field);
- + }
- +
- + glDisable(GL_DEPTH_TEST);
- +
- + // Y
- + glActiveTexture(GL_TEXTURE0);
- + glEnable(m_textureTarget);
- + glBindTexture(m_textureTarget, planes[0].id);
- +
- + // U
- + glActiveTexture(GL_TEXTURE1);
- + glEnable(m_textureTarget);
- + glBindTexture(m_textureTarget, planes[1].id);
- +
- + // V
- + glActiveTexture(GL_TEXTURE2);
- + glEnable(m_textureTarget);
- + glBindTexture(m_textureTarget, planes[2].id);
- +
- + glActiveTexture(GL_TEXTURE0);
- + VerifyGLState();
- +
- + m_pYUVShader->SetBlack(CMediaSettings::Get().GetCurrentVideoSettings().m_Brightness * 0.01f - 0.5f);
- + m_pYUVShader->SetContrast(CMediaSettings::Get().GetCurrentVideoSettings().m_Contrast * 0.02f);
- + m_pYUVShader->SetWidth(im.width);
- + m_pYUVShader->SetHeight(im.height);
- + if (field == FIELD_TOP)
- + m_pYUVShader->SetField(1);
- + else if(field == FIELD_BOT)
- + m_pYUVShader->SetField(0);
- +
- + m_pYUVShader->SetMatrices(g_matrices.GetMatrix(MM_PROJECTION), g_matrices.GetMatrix(MM_MODELVIEW));
- + m_pYUVShader->Enable();
- +
- + GLubyte idx[4] = {0, 1, 3, 2}; //determines order of triangle strip
- + GLfloat m_vert[4][3];
- + GLfloat m_tex[3][4][2];
- +
- + GLint vertLoc = m_pYUVShader->GetVertexLoc();
- + GLint Yloc = m_pYUVShader->GetYcoordLoc();
- + GLint Uloc = m_pYUVShader->GetUcoordLoc();
- + GLint Vloc = m_pYUVShader->GetVcoordLoc();
- +
- + glVertexAttribPointer(vertLoc, 3, GL_FLOAT, 0, 0, m_vert);
- + glVertexAttribPointer(Yloc, 2, GL_FLOAT, 0, 0, m_tex[0]);
- + glVertexAttribPointer(Uloc, 2, GL_FLOAT, 0, 0, m_tex[1]);
- + glVertexAttribPointer(Vloc, 2, GL_FLOAT, 0, 0, m_tex[2]);
- +
- + glEnableVertexAttribArray(vertLoc);
- + glEnableVertexAttribArray(Yloc);
- + glEnableVertexAttribArray(Uloc);
- + glEnableVertexAttribArray(Vloc);
- +
- + // Setup vertex position values
- + for(int i = 0; i < 4; i++)
- + {
- + m_vert[i][0] = m_rotatedDestCoords[i].x;
- + m_vert[i][1] = m_rotatedDestCoords[i].y;
- + m_vert[i][2] = 0.0f;// set z to 0
- + }
- +
- + // Setup texture coordinates
- + for (int i=0; i<3; i++)
- + {
- + m_tex[i][0][0] = m_tex[i][3][0] = planes[i].rect.x1;
- + m_tex[i][0][1] = m_tex[i][1][1] = planes[i].rect.y1;
- + m_tex[i][1][0] = m_tex[i][2][0] = planes[i].rect.x2;
- + m_tex[i][2][1] = m_tex[i][3][1] = planes[i].rect.y2;
- + }
- +
- + glDrawElements(GL_TRIANGLE_STRIP, 4, GL_UNSIGNED_BYTE, idx);
- +
- + VerifyGLState();
- +
- + m_pYUVShader->Disable();
- + VerifyGLState();
- +
- + glDisableVertexAttribArray(vertLoc);
- + glDisableVertexAttribArray(Yloc);
- + glDisableVertexAttribArray(Uloc);
- + glDisableVertexAttribArray(Vloc);
- +
- + glActiveTexture(GL_TEXTURE1);
- + glDisable(m_textureTarget);
- +
- + glActiveTexture(GL_TEXTURE2);
- + glDisable(m_textureTarget);
- +
- + glActiveTexture(GL_TEXTURE0);
- + glDisable(m_textureTarget);
- +
- + g_matrices.MatrixMode(MM_MODELVIEW);
- +
- + VerifyGLState();
- +}
- +
- +void CLinuxRendererA10::RenderMultiPass(int index, int field)
- +{
- + // TODO: Multipass rendering does not currently work! FIX!
- + CLog::Log(LOGERROR, "GLES: MULTIPASS rendering was called! But it doesnt work!!!");
- + return;
- +
- + YV12Image &im = m_buffers[index].image;
- + YUVPLANES &planes = m_buffers[index].fields[field];
- +
- + if (m_reloadShaders)
- + {
- + m_reloadShaders = 0;
- + LoadShaders(m_currentField);
- + }
- +
- + glDisable(GL_DEPTH_TEST);
- +
- + // Y
- + glEnable(m_textureTarget);
- + glActiveTexture(GL_TEXTURE0);
- + glBindTexture(m_textureTarget, planes[0].id);
- + VerifyGLState();
- +
- + // U
- + glActiveTexture(GL_TEXTURE1);
- + glEnable(m_textureTarget);
- + glBindTexture(m_textureTarget, planes[1].id);
- + VerifyGLState();
- +
- + // V
- + glActiveTexture(GL_TEXTURE2);
- + glEnable(m_textureTarget);
- + glBindTexture(m_textureTarget, planes[2].id);
- + VerifyGLState();
- +
- + glActiveTexture(GL_TEXTURE0);
- + VerifyGLState();
- +
- + // make sure the yuv shader is loaded and ready to go
- + if (!m_pYUVShader || (!m_pYUVShader->OK()))
- + {
- + CLog::Log(LOGERROR, "GL: YUV shader not active, cannot do multipass render");
- + return;
- + }
- +
- + m_fbo.BeginRender();
- + VerifyGLState();
- +
- + m_pYUVShader->SetBlack(CMediaSettings::Get().GetCurrentVideoSettings().m_Brightness * 0.01f - 0.5f);
- + m_pYUVShader->SetContrast(CMediaSettings::Get().GetCurrentVideoSettings().m_Contrast * 0.02f);
- + m_pYUVShader->SetWidth(im.width);
- + m_pYUVShader->SetHeight(im.height);
- + if (field == FIELD_TOP)
- + m_pYUVShader->SetField(1);
- + else if(field == FIELD_BOT)
- + m_pYUVShader->SetField(0);
- +
- + VerifyGLState();
- +//TODO
- +// glPushAttrib(GL_VIEWPORT_BIT);
- +// glPushAttrib(GL_SCISSOR_BIT);
- + g_matrices.MatrixMode(MM_MODELVIEW);
- + g_matrices.PushMatrix();
- + g_matrices.LoadIdentity();
- + VerifyGLState();
- +
- + g_matrices.MatrixMode(MM_PROJECTION);
- + g_matrices.PushMatrix();
- + g_matrices.LoadIdentity();
- + VerifyGLState();
- + g_matrices.Ortho2D(0, m_sourceWidth, 0, m_sourceHeight);
- + glViewport(0, 0, m_sourceWidth, m_sourceHeight);
- + glScissor(0, 0, m_sourceWidth, m_sourceHeight);
- + g_matrices.MatrixMode(MM_MODELVIEW);
- + VerifyGLState();
- +
- +
- + if (!m_pYUVShader->Enable())
- + {
- + CLog::Log(LOGERROR, "GL: Error enabling YUV shader");
- + }
- +
- +// 1st Pass to video frame size
- +//TODO
- +// float imgwidth = planes[0].rect.x2 - planes[0].rect.x1;
- +// float imgheight = planes[0].rect.y2 - planes[0].rect.y1;
- +// if (m_textureTarget == GL_TEXTURE_2D)
- +// {
- +// imgwidth *= planes[0].texwidth;
- +// imgheight *= planes[0].texheight;
- +// }
- +
- +
- +// glBegin(GL_QUADS);
- +//
- +// glMultiTexCoord2fARB(GL_TEXTURE0, planes[0].rect.x1, planes[0].rect.y1);
- +// glMultiTexCoord2fARB(GL_TEXTURE1, planes[1].rect.x1, planes[1].rect.y1);
- +// glMultiTexCoord2fARB(GL_TEXTURE2, planes[2].rect.x1, planes[2].rect.y1);
- +// glVertex2f(0.0f , 0.0f);
- +//
- +// glMultiTexCoord2fARB(GL_TEXTURE0, planes[0].rect.x2, planes[0].rect.y1);
- +// glMultiTexCoord2fARB(GL_TEXTURE1, planes[1].rect.x2, planes[1].rect.y1);
- +// glMultiTexCoord2fARB(GL_TEXTURE2, planes[2].rect.x2, planes[2].rect.y1);
- +// glVertex2f(imgwidth, 0.0f);
- +//
- +// glMultiTexCoord2fARB(GL_TEXTURE0, planes[0].rect.x2, planes[0].rect.y2);
- +// glMultiTexCoord2fARB(GL_TEXTURE1, planes[1].rect.x2, planes[1].rect.y2);
- +// glMultiTexCoord2fARB(GL_TEXTURE2, planes[2].rect.x2, planes[2].rect.y2);
- +// glVertex2f(imgwidth, imgheight);
- +//
- +// glMultiTexCoord2fARB(GL_TEXTURE0, planes[0].rect.x1, planes[0].rect.y2);
- +// glMultiTexCoord2fARB(GL_TEXTURE1, planes[1].rect.x1, planes[1].rect.y2);
- +// glMultiTexCoord2fARB(GL_TEXTURE2, planes[2].rect.x1, planes[2].rect.y2);
- +// glVertex2f(0.0f , imgheight);
- +//
- +// glEnd();
- +// VerifyGLState();
- +
- + m_pYUVShader->Disable();
- +
- + g_matrices.MatrixMode(MM_MODELVIEW);
- + g_matrices.PopMatrix(); // pop modelview
- + g_matrices.MatrixMode(MM_PROJECTION);
- + g_matrices.PopMatrix(); // pop projection
- +//TODO
- +// glPopAttrib(); // pop scissor
- +// glPopAttrib(); // pop viewport
- + g_matrices.MatrixMode(MM_MODELVIEW);
- + VerifyGLState();
- +
- + m_fbo.EndRender();
- +
- + glActiveTexture(GL_TEXTURE1);
- + glDisable(m_textureTarget);
- + glActiveTexture(GL_TEXTURE2);
- + glDisable(m_textureTarget);
- + glActiveTexture(GL_TEXTURE0);
- + glDisable(m_textureTarget);
- +
- + glEnable(GL_TEXTURE_2D);
- + glBindTexture(GL_TEXTURE_2D, m_fbo.Texture());
- + VerifyGLState();
- +
- + // Use regular normalized texture coordinates
- +
- + // 2nd Pass to screen size with optional video filter
- +
- + if (m_pVideoFilterShader)
- + {
- + m_fbo.SetFiltering(GL_TEXTURE_2D, GL_NEAREST);
- + m_pVideoFilterShader->SetSourceTexture(0);
- + m_pVideoFilterShader->SetWidth(m_sourceWidth);
- + m_pVideoFilterShader->SetHeight(m_sourceHeight);
- + m_pVideoFilterShader->Enable();
- + }
- + else
- + m_fbo.SetFiltering(GL_TEXTURE_2D, GL_LINEAR);
- +
- + VerifyGLState();
- +
- +//TODO
- +// imgwidth /= m_sourceWidth;
- +// imgheight /= m_sourceHeight;
- +//
- +// glBegin(GL_QUADS);
- +//
- +// glMultiTexCoord2fARB(GL_TEXTURE0, 0.0f , 0.0f);
- +// glVertex4f(m_destRect.x1, m_destRect.y1, 0, 1.0f );
- +//
- +// glMultiTexCoord2fARB(GL_TEXTURE0, imgwidth, 0.0f);
- +// glVertex4f(m_destRect.x2, m_destRect.y1, 0, 1.0f);
- +//
- +// glMultiTexCoord2fARB(GL_TEXTURE0, imgwidth, imgheight);
- +// glVertex4f(m_destRect.x2, m_destRect.y2, 0, 1.0f);
- +//
- +// glMultiTexCoord2fARB(GL_TEXTURE0, 0.0f , imgheight);
- +// glVertex4f(m_destRect.x1, m_destRect.y2, 0, 1.0f);
- +//
- +// glEnd();
- +
- + VerifyGLState();
- +
- + if (m_pVideoFilterShader)
- + m_pVideoFilterShader->Disable();
- +
- + VerifyGLState();
- +
- + glDisable(m_textureTarget);
- + VerifyGLState();
- +}
- +
- +bool CLinuxRendererA10::RenderCapture(CRenderCapture* capture)
- +{
- + if (!m_bValidated)
- + return false;
- +
- + // save current video rect
- + CRect saveSize = m_destRect;
- + saveRotatedCoords();//backup current m_rotatedDestCoords
- +
- + // new video rect is thumbnail size
- + m_destRect.SetRect(0, 0, (float)capture->GetWidth(), (float)capture->GetHeight());
- + MarkDirty();
- + syncDestRectToRotatedPoints();//syncs the changed destRect to m_rotatedDestCoords
- + // clear framebuffer and invert Y axis to get non-inverted image
- + glDisable(GL_BLEND);
- +
- + g_matrices.MatrixMode(MM_MODELVIEW);
- + g_matrices.PushMatrix();
- + g_matrices.Translatef(0.0f, capture->GetHeight(), 0.0f);
- + g_matrices.Scalef(1.0f, -1.0f, 1.0f);
- +
- + capture->BeginRender();
- +
- + Render(RENDER_FLAG_NOOSD, m_iYV12RenderBuffer);
- + // read pixels
- + glReadPixels(0, g_graphicsContext.GetHeight() - capture->GetHeight(), capture->GetWidth(), capture->GetHeight(),
- + GL_RGBA, GL_UNSIGNED_BYTE, capture->GetRenderBuffer());
- +
- + // OpenGLES returns in RGBA order but CRenderCapture needs BGRA order
- + // XOR Swap RGBA -> BGRA
- + unsigned char* pixels = (unsigned char*)capture->GetRenderBuffer();
- + for (unsigned int i = 0; i < capture->GetWidth() * capture->GetHeight(); i++, pixels+=4)
- + {
- + std::swap(pixels[0], pixels[2]);
- + }
- +
- + capture->EndRender();
- +
- + // revert model view matrix
- + g_matrices.MatrixMode(MM_MODELVIEW);
- + g_matrices.PopMatrix();
- +
- + // restore original video rect
- + m_destRect = saveSize;
- + restoreRotatedCoords();//restores the previous state of the rotated dest coords
- +
- + return true;
- +}
- +
- +//********************************************************************************************************
- +// YV12 Texture creation, deletion, copying + clearing
- +//********************************************************************************************************
- +void CLinuxRendererA10::UploadYV12Texture(int source)
- +{
- + YUVBUFFER& buf = m_buffers[source];
- + YV12Image* im = &buf.image;
- + YUVFIELDS& fields = buf.fields;
- +
- +
- + if (!(im->flags&IMAGE_FLAG_READY))
- + {
- + m_eventTexturesDone[source]->Set();
- + return;
- + }
- +
- + bool deinterlacing;
- + if (m_currentField == FIELD_FULL)
- + deinterlacing = false;
- + else
- + deinterlacing = true;
- +
- + glEnable(m_textureTarget);
- + VerifyGLState();
- +
- + glPixelStorei(GL_UNPACK_ALIGNMENT,1);
- +
- + if (deinterlacing)
- + {
- + // Load Y fields
- + LoadPlane( fields[FIELD_TOP][0] , GL_LUMINANCE, buf.flipindex
- + , im->width, im->height >> 1
- + , im->stride[0]*2, im->plane[0] );
- +
- + LoadPlane( fields[FIELD_BOT][0], GL_LUMINANCE, buf.flipindex
- + , im->width, im->height >> 1
- + , im->stride[0]*2, im->plane[0] + im->stride[0]) ;
- + }
- + else
- + {
- + // Load Y plane
- + LoadPlane( fields[FIELD_FULL][0], GL_LUMINANCE, buf.flipindex
- + , im->width, im->height
- + , im->stride[0], im->plane[0] );
- + }
- +
- + VerifyGLState();
- +
- + glPixelStorei(GL_UNPACK_ALIGNMENT,1);
- +
- + if (deinterlacing)
- + {
- + // Load Even U & V Fields
- + LoadPlane( fields[FIELD_TOP][1], GL_LUMINANCE, buf.flipindex
- + , im->width >> im->cshift_x, im->height >> (im->cshift_y + 1)
- + , im->stride[1]*2, im->plane[1] );
- +
- + LoadPlane( fields[FIELD_TOP][2], GL_LUMINANCE, buf.flipindex
- + , im->width >> im->cshift_x, im->height >> (im->cshift_y + 1)
- + , im->stride[2]*2, im->plane[2] );
- +
- + // Load Odd U & V Fields
- + LoadPlane( fields[FIELD_BOT][1], GL_LUMINANCE, buf.flipindex
- + , im->width >> im->cshift_x, im->height >> (im->cshift_y + 1)
- + , im->stride[1]*2, im->plane[1] + im->stride[1] );
- +
- + LoadPlane( fields[FIELD_BOT][2], GL_LUMINANCE, buf.flipindex
- + , im->width >> im->cshift_x, im->height >> (im->cshift_y + 1)
- + , im->stride[2]*2, im->plane[2] + im->stride[2] );
- +
- + }
- + else
- + {
- + LoadPlane( fields[FIELD_FULL][1], GL_LUMINANCE, buf.flipindex
- + , im->width >> im->cshift_x, im->height >> im->cshift_y
- + , im->stride[1], im->plane[1] );
- +
- + LoadPlane( fields[FIELD_FULL][2], GL_LUMINANCE, buf.flipindex
- + , im->width >> im->cshift_x, im->height >> im->cshift_y
- + , im->stride[2], im->plane[2] );
- + }
- +
- + m_eventTexturesDone[source]->Set();
- +
- + CalculateTextureSourceRects(source, 3);
- +
- + glDisable(m_textureTarget);
- +}
- +
- +void CLinuxRendererA10::DeleteYV12Texture(int index)
- +{
- + YV12Image &im = m_buffers[index].image;
- + YUVFIELDS &fields = m_buffers[index].fields;
- +
- + if( fields[FIELD_FULL][0].id == 0 ) return;
- +
- + /* finish up all textures, and delete them */
- + g_graphicsContext.BeginPaint(); //FIXME
- + for(int f = 0;f<MAX_FIELDS;f++)
- + {
- + for(int p = 0;p<MAX_PLANES;p++)
- + {
- + if( fields[f][p].id )
- + {
- + if (glIsTexture(fields[f][p].id))
- + glDeleteTextures(1, &fields[f][p].id);
- + fields[f][p].id = 0;
- + }
- + }
- + }
- + g_graphicsContext.EndPaint();
- +
- + for(int p = 0;p<MAX_PLANES;p++)
- + {
- + if (im.plane[p])
- + {
- + delete [] im.plane[p];
- + im.plane[p] = NULL;
- + }
- + }
- +}
- +
- +bool CLinuxRendererA10::CreateYV12Texture(int index)
- +{
- + /* since we also want the field textures, pitch must be texture aligned */
- + YV12Image &im = m_buffers[index].image;
- + YUVFIELDS &fields = m_buffers[index].fields;
- +
- + DeleteYV12Texture(index);
- +
- + im.height = m_sourceHeight;
- + im.width = m_sourceWidth;
- + im.cshift_x = 1;
- + im.cshift_y = 1;
- +
- + im.stride[0] = im.width;
- + im.stride[1] = im.width >> im.cshift_x;
- + im.stride[2] = im.width >> im.cshift_x;
- +
- + im.planesize[0] = im.stride[0] * im.height;
- + im.planesize[1] = im.stride[1] * ( im.height >> im.cshift_y );
- + im.planesize[2] = im.stride[2] * ( im.height >> im.cshift_y );
- +
- + for (int i = 0; i < MAX_PLANES; i++)
- + im.plane[i] = new BYTE[im.planesize[i]];
- +
- + glEnable(m_textureTarget);
- + for(int f = 0;f<MAX_FIELDS;f++)
- + {
- + for(int p = 0;p<MAX_PLANES;p++)
- + {
- + if (!glIsTexture(fields[f][p].id))
- + {
- + glGenTextures(1, &fields[f][p].id);
- + VerifyGLState();
- + }
- + }
- + }
- +
- + // YUV
- + for (int f = FIELD_FULL; f<=FIELD_BOT ; f++)
- + {
- + int fieldshift = (f==FIELD_FULL) ? 0 : 1;
- + YUVPLANES &planes = fields[f];
- +
- + planes[0].texwidth = im.width;
- + planes[0].texheight = im.height >> fieldshift;
- +
- + planes[1].texwidth = planes[0].texwidth >> im.cshift_x;
- + planes[1].texheight = planes[0].texheight >> im.cshift_y;
- + planes[2].texwidth = planes[0].texwidth >> im.cshift_x;
- + planes[2].texheight = planes[0].texheight >> im.cshift_y;
- +
- + for(int p = 0; p < 3; p++)
- + {
- + YUVPLANE &plane = planes[p];
- + if (plane.texwidth * plane.texheight == 0)
- + continue;
- +
- + glBindTexture(m_textureTarget, plane.id);
- + CLog::Log(LOGDEBUG, "GL: Creating YUV NPOT texture of size %d x %d", plane.texwidth, plane.texheight);
- +
- + glTexImage2D(m_textureTarget, 0, GL_LUMINANCE, plane.texwidth, plane.texheight, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, NULL);
- +
- + glTexParameteri(m_textureTarget, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- + glTexParameteri(m_textureTarget, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- + glTexParameteri(m_textureTarget, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- + glTexParameteri(m_textureTarget, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- + VerifyGLState();
- + }
- + }
- + glDisable(m_textureTarget);
- + m_eventTexturesDone[index]->Set();
- + return true;
- +}
- +
- +//********************************************************************************************************
- +// BYPASS creation, deletion, copying + clearing
- +//********************************************************************************************************
- +void CLinuxRendererA10::UploadBYPASSTexture(int index)
- +{
- + m_eventTexturesDone[index]->Set();
- +}
- +
- +void CLinuxRendererA10::DeleteBYPASSTexture(int index)
- +{
- +}
- +
- +bool CLinuxRendererA10::CreateBYPASSTexture(int index)
- +{
- + m_eventTexturesDone[index]->Set();
- + return true;
- +}
- +
- +void CLinuxRendererA10::SetTextureFilter(GLenum method)
- +{
- + for (int i = 0 ; i<NUM_BUFFERS ; i++)
- + {
- + YUVFIELDS &fields = m_buffers[i].fields;
- +
- + for (int f = FIELD_FULL; f<=FIELD_BOT ; f++)
- + {
- + glBindTexture(m_textureTarget, fields[f][0].id);
- + glTexParameteri(m_textureTarget, GL_TEXTURE_MIN_FILTER, method);
- + glTexParameteri(m_textureTarget, GL_TEXTURE_MAG_FILTER, method);
- + VerifyGLState();
- +
- + glBindTexture(m_textureTarget, fields[f][1].id);
- + glTexParameteri(m_textureTarget, GL_TEXTURE_MIN_FILTER, method);
- + glTexParameteri(m_textureTarget, GL_TEXTURE_MAG_FILTER, method);
- + VerifyGLState();
- +
- + glBindTexture(m_textureTarget, fields[f][2].id);
- + glTexParameteri(m_textureTarget, GL_TEXTURE_MIN_FILTER, method);
- + glTexParameteri(m_textureTarget, GL_TEXTURE_MAG_FILTER, method);
- + VerifyGLState();
- + }
- + }
- +}
- +
- +bool CLinuxRendererA10::Supports(ERENDERFEATURE feature)
- +{
- + // Player controls render, let it dictate available render features
- + if((m_renderMethod & RENDER_BYPASS))
- + {
- + Features::iterator itr = std::find(m_renderFeatures.begin(),m_renderFeatures.end(), feature);
- + return itr != m_renderFeatures.end();
- + }
- +
- + if(feature == RENDERFEATURE_BRIGHTNESS)
- + return false;
- +
- + if(feature == RENDERFEATURE_CONTRAST)
- + return false;
- +
- + if(feature == RENDERFEATURE_GAMMA)
- + return false;
- +
- + if(feature == RENDERFEATURE_NOISE)
- + return false;
- +
- + if(feature == RENDERFEATURE_SHARPNESS)
- + return false;
- +
- + if (feature == RENDERFEATURE_NONLINSTRETCH)
- + return false;
- +
- + if (feature == RENDERFEATURE_STRETCH ||
- + feature == RENDERFEATURE_CROP ||
- + feature == RENDERFEATURE_ZOOM ||
- + feature == RENDERFEATURE_VERTICAL_SHIFT ||
- + feature == RENDERFEATURE_PIXEL_RATIO ||
- + feature == RENDERFEATURE_POSTPROCESS ||
- + feature == RENDERFEATURE_ROTATION)
- + return true;
- +
- +
- + return false;
- +}
- +
- +bool CLinuxRendererA10::SupportsMultiPassRendering()
- +{
- + return false;
- +}
- +
- +bool CLinuxRendererA10::Supports(EDEINTERLACEMODE mode)
- +{
- + // Player controls render, let it dictate available deinterlace modes
- + if((m_renderMethod & RENDER_BYPASS))
- + {
- + Features::iterator itr = std::find(m_deinterlaceModes.begin(),m_deinterlaceModes.end(), mode);
- + return itr != m_deinterlaceModes.end();
- + }
- +
- + if (mode == VS_DEINTERLACEMODE_OFF)
- + return true;
- +
- + if(mode == VS_DEINTERLACEMODE_AUTO || mode == VS_DEINTERLACEMODE_FORCE)
- + return true;
- +
- + return false;
- +}
- +
- +bool CLinuxRendererA10::Supports(EINTERLACEMETHOD method)
- +{
- + // Player controls render, let it dictate available deinterlace methods
- + if((m_renderMethod & RENDER_BYPASS))
- + {
- + Features::iterator itr = std::find(m_deinterlaceMethods.begin(),m_deinterlaceMethods.end(), method);
- + return itr != m_deinterlaceMethods.end();
- + }
- +
- + if(method == VS_INTERLACEMETHOD_AUTO)
- + return true;
- +
- +#if defined(__i386__) || defined(__x86_64__)
- + if(method == VS_INTERLACEMETHOD_DEINTERLACE
- + || method == VS_INTERLACEMETHOD_DEINTERLACE_HALF
- + || method == VS_INTERLACEMETHOD_SW_BLEND)
- +#else
- + if(method == VS_INTERLACEMETHOD_SW_BLEND)
- +#endif
- + return true;
- +
- + return false;
- +}
- +
- +bool CLinuxRendererA10::Supports(ESCALINGMETHOD method)
- +{
- + // Player controls render, let it dictate available scaling methods
- + if((m_renderMethod & RENDER_BYPASS))
- + {
- + Features::iterator itr = std::find(m_scalingMethods.begin(),m_scalingMethods.end(), method);
- + return itr != m_scalingMethods.end();
- + }
- +
- + if(method == VS_SCALINGMETHOD_NEAREST
- + || method == VS_SCALINGMETHOD_LINEAR)
- + return true;
- +
- + return false;
- +}
- +
- +EINTERLACEMETHOD CLinuxRendererA10::AutoInterlaceMethod()
- +{
- + // Player controls render, let it pick the auto-deinterlace method
- + if((m_renderMethod & RENDER_BYPASS))
- + {
- + if (m_deinterlaceMethods.empty())
- + return ((EINTERLACEMETHOD)m_deinterlaceMethods[0]);
- + else
- + return VS_INTERLACEMETHOD_NONE;
- + }
- +
- +#if defined(__i386__) || defined(__x86_64__)
- + return VS_INTERLACEMETHOD_DEINTERLACE_HALF;
- +#else
- + return VS_INTERLACEMETHOD_SW_BLEND;
- +#endif
- +}
- +
- +void CLinuxRendererA10::AddProcessor(struct A10VLQueueItem *buffer)
- +{
- + YUVBUFFER &buf = m_buffers[NextYV12Texture()];
- +
- + buf.a10buffer = buffer;
- +}
- +
- +/*
- + * Video layer functions
- + */
- +
- +static int g_hfb = -1;
- +static int g_hdisp = -1;
- +static int g_screenid = 0;
- +static int g_syslayer = 0x64;
- +static int g_hlayer = 0;
- +static int g_width;
- +static int g_height;
- +static CRect g_srcRect;
- +static CRect g_dstRect;
- +static int g_lastnr;
- +static int g_decnr;
- +static int g_wridx;
- +static int g_rdidx;
- +static A10VLQueueItem g_dispq[DISPQS];
- +static pthread_mutex_t g_dispq_mutex;
- +
- +bool A10VLInit(int &width, int &height, double &refreshRate)
- +{
- + unsigned long args[4];
- + __disp_layer_info_t layera;
- + unsigned int i;
- +
- + pthread_mutex_init(&g_dispq_mutex, NULL);
- +
- + g_hfb = open("/dev/fb0", O_RDWR);
- +
- + g_hdisp = open("/dev/disp", O_RDWR);
- + if (g_hdisp == -1)
- + {
- + CLog::Log(LOGERROR, "A10: open /dev/disp failed. (%d)", errno);
- + return false;
- + }
- +
- + args[0] = g_screenid;
- + args[1] = 0;
- + args[2] = 0;
- + args[3] = 0;
- + width = g_width = ioctl(g_hdisp, DISP_CMD_SCN_GET_WIDTH , args);
- + height = g_height = ioctl(g_hdisp, DISP_CMD_SCN_GET_HEIGHT, args);
- +
- + i = ioctl(g_hdisp, DISP_CMD_HDMI_GET_MODE, args);
- +
- + switch(i)
- + {
- + case DISP_TV_MOD_720P_50HZ:
- + case DISP_TV_MOD_1080I_50HZ:
- + case DISP_TV_MOD_1080P_50HZ:
- + refreshRate = 50.0;
- + break;
- + case DISP_TV_MOD_720P_60HZ:
- + case DISP_TV_MOD_1080I_60HZ:
- + case DISP_TV_MOD_1080P_60HZ:
- + refreshRate = 60.0;
- + break;
- + case DISP_TV_MOD_1080P_24HZ:
- + refreshRate = 24.0;
- + break;
- + default:
- + CLog::Log(LOGERROR, "A10: display mode %d is unknown. Assume refreh rate 60Hz\n", i);
- + refreshRate = 60.0;
- + break;
- + }
- +
- + if ((g_height > 720) && (getenv("A10AB") == NULL))
- + {
- + //set workmode scaler (system layer)
- + args[0] = g_screenid;
- + args[1] = g_syslayer;
- + args[2] = (unsigned long) (&layera);
- + args[3] = 0;
- + ioctl(g_hdisp, DISP_CMD_LAYER_GET_PARA, args);
- + layera.mode = DISP_LAYER_WORK_MODE_SCALER;
- + args[0] = g_screenid;
- + args[1] = g_syslayer;
- + args[2] = (unsigned long) (&layera);
- + args[3] = 0;
- + ioctl(g_hdisp, DISP_CMD_LAYER_SET_PARA, args);
- + }
- + else
- + {
- + //set workmode normal (system layer)
- + args[0] = g_screenid;
- + args[1] = g_syslayer;
- + args[2] = (unsigned long) (&layera);
- + args[3] = 0;
- + ioctl(g_hdisp, DISP_CMD_LAYER_GET_PARA, args);
- + //source window information
- + layera.src_win.x = 0;
- + layera.src_win.y = 0;
- + layera.src_win.width = g_width;
- + layera.src_win.height = g_height;
- + //screen window information
- + layera.scn_win.x = 0;
- + layera.scn_win.y = 0;
- + layera.scn_win.width = g_width;
- + layera.scn_win.height = g_height;
- + layera.mode = DISP_LAYER_WORK_MODE_NORMAL;
- + args[0] = g_screenid;
- + args[1] = g_syslayer;
- + args[2] = (unsigned long) (&layera);
- + args[3] = 0;
- + ioctl(g_hdisp, DISP_CMD_LAYER_SET_PARA, args);
- +
- + }
- +
- + for (i = 0x65; i <= 0x67; i++)
- + {
- + //release possibly lost allocated layers
- + args[0] = g_screenid;
- + args[1] = i;
- + args[2] = 0;
- + args[3] = 0;
- + ioctl(g_hdisp, DISP_CMD_LAYER_RELEASE, args);
- + }
- +
- + args[0] = g_screenid;
- + args[1] = DISP_LAYER_WORK_MODE_SCALER;
- + args[2] = 0;
- + args[3] = 0;
- + g_hlayer = ioctl(g_hdisp, DISP_CMD_LAYER_REQUEST, args);
- + if (g_hlayer <= 0)
- + {
- + g_hlayer = 0;
- + CLog::Log(LOGERROR, "A10: DISP_CMD_LAYER_REQUEST failed.\n");
- + return false;
- + }
- +
- + memset(&g_srcRect, 0, sizeof(g_srcRect));
- + memset(&g_dstRect, 0, sizeof(g_dstRect));
- +
- + g_lastnr = -1;
- + g_decnr = 0;
- + g_rdidx = 0;
- + g_wridx = 0;
- +
- + for (i = 0; i < DISPQS; i++)
- + g_dispq[i].pict.id = -1;
- +
- + return true;
- +}
- +
- +void A10VLExit()
- +{
- + unsigned long args[4];
- +
- + if (g_hlayer)
- + {
- + //stop video
- + args[0] = g_screenid;
- + args[1] = g_hlayer;
- + args[2] = 0;
- + args[3] = 0;
- + ioctl(g_hdisp, DISP_CMD_VIDEO_STOP, args);
- +
- + //close layer
- + args[0] = g_screenid;
- + args[1] = g_hlayer;
- + args[2] = 0;
- + args[3] = 0;
- + ioctl(g_hdisp, DISP_CMD_LAYER_CLOSE, args);
- +
- + //release layer
- + args[0] = g_screenid;
- + args[1] = g_hlayer;
- + args[2] = 0;
- + args[3] = 0;
- + ioctl(g_hdisp, DISP_CMD_LAYER_RELEASE, args);
- + g_hlayer = 0;
- + }
- + if (g_hdisp != -1)
- + {
- + close(g_hdisp);
- + g_hdisp = -1;
- + }
- + if (g_hfb != -1)
- + {
- + close(g_hfb);
- + g_hfb = -1;
- + }
- +}
- +
- +void A10VLHide()
- +{
- + unsigned long args[4];
- +
- + if (g_hlayer)
- + {
- + //stop video
- + args[0] = g_screenid;
- + args[1] = g_hlayer;
- + args[2] = 0;
- + args[3] = 0;
- + ioctl(g_hdisp, DISP_CMD_VIDEO_STOP, args);
- +
- + //close layer
- + args[0] = g_screenid;
- + args[1] = g_hlayer;
- + args[2] = 0;
- + args[3] = 0;
- + ioctl(g_hdisp, DISP_CMD_LAYER_CLOSE, args);
- + }
- +
- + memset(&g_srcRect, 0, sizeof(g_srcRect));
- + memset(&g_dstRect, 0, sizeof(g_dstRect));
- +}
- +
- +#define FBIO_WAITFORVSYNC _IOW('F', 0x20, u32)
- +
- +void A10VLWaitVSYNC()
- +{
- + //ioctl(g_hfb, FBIO_WAITFORVSYNC, NULL);
- +}
- +
- +A10VLQueueItem *A10VLPutQueue(A10VLCALLBACK callback,
- + void *callbackpriv,
- + void *pictpriv,
- + cedarv_picture_t &pict)
- +{
- + A10VLQueueItem *pRet;
- +
- + pthread_mutex_lock(&g_dispq_mutex);
- +
- + pRet = &g_dispq[g_wridx];
- +
- + pRet->decnr = g_decnr++;
- + pRet->callback = callback;
- + pRet->callbackpriv = callbackpriv;
- + pRet->pictpriv = pictpriv;
- + pRet->pict = pict;
- +
- + g_wridx++;
- + if (g_wridx >= DISPQS)
- + g_wridx = 0;
- +
- + pthread_mutex_unlock(&g_dispq_mutex);
- +
- + return pRet;
- +}
- +
- +static void A10VLFreeQueueItem(A10VLQueueItem *pItem)
- +{
- + if ((int)pItem->pict.id != -1)
- + {
- + if (pItem->callback)
- + pItem->callback(pItem->callbackpriv, pItem->pictpriv, pItem->pict);
- + pItem->pict.id = -1;
- + }
- +}
- +
- +void A10VLFreeQueue()
- +{
- + int i;
- +
- + pthread_mutex_lock(&g_dispq_mutex);
- +
- + for (i = 0; i < DISPQS; i++)
- + A10VLFreeQueueItem(&g_dispq[i]);
- +
- + pthread_mutex_unlock(&g_dispq_mutex);
- +}
- +
- +void A10VLDisplayQueueItem(A10VLQueueItem *pItem, CRect &srcRect, CRect &dstRect)
- +{
- + int i;
- + int curnr;
- +
- + pthread_mutex_lock(&g_dispq_mutex);
- +
- + if (!pItem || (pItem->pict.id == -1) || (g_lastnr == pItem->decnr))
- + {
- + pthread_mutex_unlock(&g_dispq_mutex);
- + return;
- + }
- +
- + curnr = A10VLDisplayPicture(pItem->pict, pItem->decnr, srcRect, dstRect);
- +
- + if (curnr != g_lastnr)
- + {
- + //free older frames, displayed or not
- + for (i = 0; i < DISPQS; i++)
- + {
- + if(g_dispq[g_rdidx].decnr < curnr)
- + {
- + A10VLFreeQueueItem(&g_dispq[g_rdidx]);
- +
- + g_rdidx++;
- + if (g_rdidx >= DISPQS)
- + g_rdidx = 0;
- +
- + } else break;
- + }
- +
- + }
- +
- + g_lastnr = curnr;
- +
- + pthread_mutex_unlock(&g_dispq_mutex);
- +}
- +
- +int A10VLDisplayPicture(cedarv_picture_t &picture,
- + int refnr,
- + CRect &srcRect,
- + CRect &dstRect)
- +{
- + unsigned long args[4];
- + __disp_layer_info_t layera;
- + __disp_video_fb_t frmbuf;
- + __disp_colorkey_t colorkey;
- +
- + memset(&frmbuf, 0, sizeof(__disp_video_fb_t));
- + frmbuf.id = refnr;
- + frmbuf.interlace = picture.is_progressive? 0 : 1;
- + frmbuf.top_field_first = picture.top_field_first;
- + //frmbuf.frame_rate = picture.frame_rate;
- +#ifdef CEDARV_FRAME_HAS_PHY_ADDR
- + frmbuf.addr[0] = (u32)picture.y;
- + frmbuf.addr[1] = (u32)picture.u;
- +#else
- + frmbuf.addr[0] = mem_get_phy_addr((u32)picture.y);
- + frmbuf.addr[1] = mem_get_phy_addr((u32)picture.u);
- +#endif
- +
- + if ((g_srcRect != srcRect) || (g_dstRect != dstRect))
- + {
- + args[0] = g_screenid;
- + args[1] = g_hlayer;
- + args[2] = (unsigned long) (&layera);
- + args[3] = 0;
- + ioctl(g_hdisp, DISP_CMD_LAYER_GET_PARA, args);
- + //set video layer attribute
- + layera.mode = DISP_LAYER_WORK_MODE_SCALER;
- + layera.b_from_screen = 0; //what is this? if enabled all is black
- + layera.pipe = 1;
- + //use alpha blend
- + layera.alpha_en = 0;
- + layera.alpha_val = 0xff;
- + layera.ck_enable = 0;
- + layera.b_trd_out = 0;
- + layera.out_trd_mode = (__disp_3d_out_mode_t)0;
- + //frame buffer pst and size information
- + if (picture.display_height < 720)
- + {
- + layera.fb.cs_mode = DISP_BT601;
- + }
- + else
- + {
- + layera.fb.cs_mode = DISP_BT709;
- + }
- + layera.fb.mode = DISP_MOD_MB_UV_COMBINED;
- + layera.fb.format = picture.pixel_format == CEDARV_PIXEL_FORMAT_AW_YUV422 ? DISP_FORMAT_YUV422 : DISP_FORMAT_YUV420;
- + layera.fb.br_swap = 0;
- + layera.fb.seq = DISP_SEQ_UVUV;
- + layera.fb.addr[0] = frmbuf.addr[0];
- + layera.fb.addr[1] = frmbuf.addr[1];
- + layera.fb.b_trd_src = 0;
- + layera.fb.trd_mode = (__disp_3d_src_mode_t)0;
- + layera.fb.size.width = picture.display_width;
- + layera.fb.size.height = picture.display_height;
- + //source window information
- + layera.src_win.x = lrint(srcRect.x1);
- + layera.src_win.y = lrint(srcRect.y1);
- + layera.src_win.width = lrint(srcRect.x2-srcRect.x1);
- + layera.src_win.height = lrint(srcRect.y2-srcRect.y1);
- + //screen window information
- + layera.scn_win.x = lrint(dstRect.x1);
- + layera.scn_win.y = lrint(dstRect.y1);
- + layera.scn_win.width = lrint(dstRect.x2-dstRect.x1);
- + layera.scn_win.height = lrint(dstRect.y2-dstRect.y1);
- +
- + CLog::Log(LOGDEBUG, "A10: srcRect=(%lf,%lf)-(%lf,%lf)\n", srcRect.x1, srcRect.y1, srcRect.x2, srcRect.y2);
- + CLog::Log(LOGDEBUG, "A10: dstRect=(%lf,%lf)-(%lf,%lf)\n", dstRect.x1, dstRect.y1, dstRect.x2, dstRect.y2);
- +
- + if ( (layera.scn_win.x < 0)
- + || (layera.scn_win.y < 0)
- + || (layera.scn_win.width > g_width)
- + || (layera.scn_win.height > g_height) )
- + {
- + double xzoom, yzoom;
- +
- + //TODO: this calculation is against the display fullscreen dimensions,
- + //but should be against the fullscreen area of xbmc
- +
- + xzoom = (dstRect.x2 - dstRect.x1) / (srcRect.x2 - srcRect.x1);
- + yzoom = (dstRect.y2 - dstRect.y1) / (srcRect.y2 - srcRect.x1);
- +
- + if (layera.scn_win.x < 0)
- + {
- + layera.src_win.x -= layera.scn_win.x / xzoom;
- + layera.scn_win.x = 0;
- + }
- + if (layera.scn_win.width > g_width)
- + {
- + layera.src_win.width -= (layera.scn_win.width - g_width) / xzoom;
- + layera.scn_win.width = g_width;
- + }
- +
- + if (layera.scn_win.y < 0)
- + {
- + layera.src_win.y -= layera.scn_win.y / yzoom;
- + layera.scn_win.y = 0;
- + }
- + if (layera.scn_win.height > g_height)
- + {
- + layera.src_win.height -= (layera.scn_win.height - g_height) / yzoom;
- + layera.scn_win.height = g_height;
- + }
- + }
- +
- + args[0] = g_screenid;
- + args[1] = g_hlayer;
- + args[2] = (unsigned long)&layera;
- + args[3] = 0;
- + if(ioctl(g_hdisp, DISP_CMD_LAYER_SET_PARA, args))
- + CLog::Log(LOGERROR, "A10: DISP_CMD_LAYER_SET_PARA failed.\n");
- +
- + //open layer
- + args[0] = g_screenid;
- + args[1] = g_hlayer;
- + args[2] = 0;
- + args[3] = 0;
- + if (ioctl(g_hdisp, DISP_CMD_LAYER_OPEN, args))
- + CLog::Log(LOGERROR, "A10: DISP_CMD_LAYER_OPEN failed.\n");
- +
- + //put behind system layer
- + args[0] = g_screenid;
- + args[1] = g_hlayer;
- + args[2] = 0;
- + args[3] = 0;
- + if (ioctl(g_hdisp, DISP_CMD_LAYER_BOTTOM, args))
- + CLog::Log(LOGERROR, "A10: DISP_CMD_LAYER_BOTTOM failed.\n");
- +
- + //turn off colorkey (system layer)
- + args[0] = g_screenid;
- + args[1] = g_syslayer;
- + args[2] = 0;
- + args[3] = 0;
- + if (ioctl(g_hdisp, DISP_CMD_LAYER_CK_OFF, args))
- + CLog::Log(LOGERROR, "A10: DISP_CMD_LAYER_CK_OFF failed.\n");
- +
- + if ((g_height > 720) && (getenv("A10AB") == NULL))
- + {
- + //no tearing at the cost off alpha blending...
- +
- + //set colorkey
- + colorkey.ck_min.alpha = 0;
- + colorkey.ck_min.red = 1;
- + colorkey.ck_min.green = 2;
- + colorkey.ck_min.blue = 3;
- + colorkey.ck_max = colorkey.ck_min;
- + colorkey.ck_max.alpha = 255;
- + colorkey.red_match_rule = 2;
- + colorkey.green_match_rule = 2;
- + colorkey.blue_match_rule = 2;
- +
- + args[0] = g_screenid;
- + args[1] = (unsigned long)&colorkey;
- + args[2] = 0;
- + args[3] = 0;
- + if (ioctl(g_hdisp, DISP_CMD_SET_COLORKEY, args))
- + CLog::Log(LOGERROR, "A10: DISP_CMD_SET_COLORKEY failed.\n");
- +
- + //turn on colorkey
- + args[0] = g_screenid;
- + args[1] = g_hlayer;
- + args[2] = 0;
- + args[3] = 0;
- + if (ioctl(g_hdisp, DISP_CMD_LAYER_CK_ON, args))
- + CLog::Log(LOGERROR, "A10: DISP_CMD_LAYER_CK_ON failed.\n");
- +
- + //turn on global alpha (system layer)
- + args[0] = g_screenid;
- + args[1] = g_syslayer;
- + args[2] = 0;
- + args[3] = 0;
- + if (ioctl(g_hdisp, DISP_CMD_LAYER_ALPHA_ON, args))
- + CLog::Log(LOGERROR, "A10: DISP_CMD_LAYER_ALPHA_ON failed.\n");
- + }
- + else
- + {
- + //turn off global alpha (system layer)
- + args[0] = g_screenid;
- + args[1] = g_syslayer;
- + args[2] = 0;
- + args[3] = 0;
- + if (ioctl(g_hdisp, DISP_CMD_LAYER_ALPHA_OFF, args))
- + CLog::Log(LOGERROR, "A10: DISP_CMD_LAYER_ALPHA_OFF failed.\n");
- + }
- +
- + //enable vpp
- + args[0] = g_screenid;
- + args[1] = g_hlayer;
- + args[2] = 0;
- + args[3] = 0;
- + if (ioctl(g_hdisp, DISP_CMD_LAYER_VPP_ON, args))
- + CLog::Log(LOGERROR, "A10: DISP_CMD_LAYER_VPP_ON failed.\n");
- +
- + //enable enhance
- + args[0] = g_screenid;
- + args[1] = g_hlayer;
- + args[2] = 0;
- + args[3] = 0;
- + if (ioctl(g_hdisp, DISP_CMD_LAYER_ENHANCE_ON, args))
- + CLog::Log(LOGERROR, "A10: DISP_CMD_LAYER_ENHANCE_ON failed.\n");
- +
- + //start video
- + args[0] = g_screenid;
- + args[1] = g_hlayer;
- + args[2] = 0;
- + args[3] = 0;
- + if (ioctl(g_hdisp, DISP_CMD_VIDEO_START, args))
- + CLog::Log(LOGERROR, "A10: DISP_CMD_VIDEO_START failed.\n");
- +
- + g_srcRect = srcRect;
- + g_dstRect = dstRect;
- + }
- +
- + args[0] = g_screenid;
- + args[1] = g_hlayer;
- + args[2] = (unsigned long)&frmbuf;
- + args[3] = 0;
- + if (ioctl(g_hdisp, DISP_CMD_VIDEO_SET_FB, args))
- + CLog::Log(LOGERROR, "A10: DISP_CMD_VIDEO_SET_FB failed.\n");
- +
- + //CLog::Log(LOGDEBUG, "A10: render %d\n", buffer->picture.id);
- +
- + args[0] = g_screenid;
- + args[1] = g_hlayer;
- + args[2] = 0;
- + args[3] = 0;
- + return ioctl(g_hdisp, DISP_CMD_VIDEO_GET_FRAME_ID, args);
- +}
- +
- +#endif
- +
- diff -b -u -r -N '--exclude=.git' xbmc_orig/xbmc/cores/VideoRenderers/LinuxRendererA10.h xbmc_rellla/xbmc/cores/VideoRenderers/LinuxRendererA10.h
- --- xbmc_orig/xbmc/cores/VideoRenderers/LinuxRendererA10.h 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/xbmc/cores/VideoRenderers/LinuxRendererA10.h 2013-06-12 17:13:43.000000000 +0200
- @@ -0,0 +1,306 @@
- +#ifndef LinuxRendererA10_RENDERER
- +#define LinuxRendererA10_RENDERER
- +
- +/*
- + * Copyright (C) 2010-2012 Team XBMC and others
- + * http://www.xbmc.org
- + *
- + * This Program is free software; you can redistribute it and/or modify
- + * it under the terms of the GNU General Public License as published by
- + * the Free Software Foundation; either version 2, or (at your option)
- + * any later version.
- + *
- + * This Program is distributed in the hope that it will be useful,
- + * but WITHOUT ANY WARRANTY; without even the implied warranty of
- + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + * GNU General Public License for more details.
- + *
- + * You should have received a copy of the GNU General Public License
- + * along with XBMC; see the file COPYING. If not, see
- + * <http://www.gnu.org/licenses/>.
- + *
- + */
- +
- +#if HAS_GLES == 2
- +
- +#include "system_gl.h"
- +
- +#include "xbmc/guilib/FrameBufferObject.h"
- +#include "xbmc/guilib/Shader.h"
- +#include "settings/VideoSettings.h"
- +#include "RenderFlags.h"
- +#include "RenderFormats.h"
- +#include "guilib/GraphicContext.h"
- +#include "BaseRenderer.h"
- +#include "xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h"
- +#include "xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecA10.h"
- +
- +extern "C" {
- +#include <libcedarv.h>
- +#include <drv_display_sun4i.h>
- +#ifndef CEDARV_FRAME_HAS_PHY_ADDR
- +#include <os_adapter.h>
- +#endif
- +}
- +
- +class CRenderCapture;
- +
- +class CBaseTexture;
- +namespace Shaders { class BaseYUV2RGBShader; }
- +namespace Shaders { class BaseVideoFilterShader; }
- +
- +typedef std::vector<int> Features;
- +
- +#define NUM_BUFFERS 2
- +
- +
- +#undef ALIGN
- +#define ALIGN(value, alignment) (((value)+((alignment)-1))&~((alignment)-1))
- +#define CLAMP(a, min, max) ((a) > (max) ? (max) : ( (a) < (min) ? (min) : a ))
- +
- +#define AUTOSOURCE -1
- +
- +#define IMAGE_FLAG_WRITING 0x01 /* image is in use after a call to GetImage, caller may be reading or writing */
- +#define IMAGE_FLAG_READING 0x02 /* image is in use after a call to GetImage, caller is only reading */
- +#define IMAGE_FLAG_DYNAMIC 0x04 /* image was allocated due to a call to GetImage */
- +#define IMAGE_FLAG_RESERVED 0x08 /* image is reserved, must be asked for specifically used to preserve images */
- +#define IMAGE_FLAG_READY 0x16 /* image is ready to be uploaded to texture memory */
- +#define IMAGE_FLAG_INUSE (IMAGE_FLAG_WRITING | IMAGE_FLAG_READING | IMAGE_FLAG_RESERVED)
- +
- +struct DRAWRECT
- +{
- + float left;
- + float top;
- + float right;
- + float bottom;
- +};
- +
- +struct YUVRANGE
- +{
- + int y_min, y_max;
- + int u_min, u_max;
- + int v_min, v_max;
- +};
- +
- +struct YUVCOEF
- +{
- + float r_up, r_vp;
- + float g_up, g_vp;
- + float b_up, b_vp;
- +};
- +
- +enum RenderMethod
- +{
- + RENDER_GLSL = 0x001,
- + RENDER_A10BUF = 0x100,
- + RENDER_BYPASS = 0x400
- +};
- +
- +enum RenderQuality
- +{
- + RQ_LOW=1,
- + RQ_SINGLEPASS,
- + RQ_MULTIPASS,
- +};
- +
- +#define PLANE_Y 0
- +#define PLANE_U 1
- +#define PLANE_V 2
- +
- +#define FIELD_FULL 0
- +#define FIELD_TOP 1
- +#define FIELD_BOT 2
- +
- +class CEvent;
- +
- +struct A10VLQueueItem;
- +
- +class CLinuxRendererA10 : public CBaseRenderer
- +{
- +public:
- + CLinuxRendererA10();
- + virtual ~CLinuxRendererA10();
- +
- + virtual void Update(bool bPauseDrawing);
- + virtual void SetupScreenshot() {};
- +
- + bool RenderCapture(CRenderCapture* capture);
- +
- + // Player functions
- + virtual bool Configure(unsigned int width, unsigned int height, unsigned int d_width, unsigned int d_height, float fps, unsigned flags, ERenderFormat format, unsigned extended_formatunsigned, unsigned int orientation);
- + virtual bool IsConfigured() { return m_bConfigured; }
- + virtual int GetImage(YV12Image *image, int source = AUTOSOURCE, bool readonly = false);
- + virtual void ReleaseImage(int source, bool preserve = false);
- + virtual void FlipPage(int source);
- + virtual unsigned int PreInit();
- + virtual void UnInit();
- + virtual void Reset(); /* resets renderer after seek for example */
- + virtual void ReorderDrawPoints();
- +
- + virtual void RenderUpdate(bool clear, DWORD flags = 0, DWORD alpha = 255);
- +
- + // Feature support
- + virtual bool SupportsMultiPassRendering();
- + virtual bool Supports(ERENDERFEATURE feature);
- + virtual bool Supports(EDEINTERLACEMODE mode);
- + virtual bool Supports(EINTERLACEMETHOD method);
- + virtual bool Supports(ESCALINGMETHOD method);
- +
- + virtual EINTERLACEMETHOD AutoInterlaceMethod();
- +
- + virtual std::vector<ERenderFormat> SupportedFormats() { return m_formats; }
- +
- + virtual void AddProcessor(struct A10VLQueueItem *pVidBuff);
- +
- +protected:
- + virtual void Render(DWORD flags, int index);
- +
- + virtual void ManageTextures();
- + int NextYV12Texture();
- + virtual bool ValidateRenderTarget();
- + virtual void LoadShaders(int field=FIELD_FULL);
- + void SetTextureFilter(GLenum method);
- + void UpdateVideoFilter();
- +
- + // textures
- + void (CLinuxRendererA10::*m_textureUpload)(int index);
- + void (CLinuxRendererA10::*m_textureDelete)(int index);
- + bool (CLinuxRendererA10::*m_textureCreate)(int index);
- +
- + void UploadYV12Texture(int index);
- + void DeleteYV12Texture(int index);
- + bool CreateYV12Texture(int index);
- +
- + void UploadBYPASSTexture(int index);
- + void DeleteBYPASSTexture(int index);
- + bool CreateBYPASSTexture(int index);
- +
- + void CalculateTextureSourceRects(int source, int num_planes);
- +
- + // renderers
- + void RenderMultiPass(int index, int field); // multi pass glsl renderer
- + void RenderSinglePass(int index, int field); // single pass glsl renderer
- +
- + CFrameBufferObject m_fbo;
- +
- + int m_iYV12RenderBuffer;
- + int m_iLastRenderBuffer;
- +
- + bool m_bConfigured;
- + bool m_bValidated;
- + std::vector<ERenderFormat> m_formats;
- + bool m_bImageReady;
- + ERenderFormat m_format;
- + GLenum m_textureTarget;
- + unsigned short m_renderMethod;
- + unsigned short m_oldRenderMethod;
- + RenderQuality m_renderQuality;
- + unsigned int m_flipindex; // just a counter to keep track of if a image has been uploaded
- + bool m_StrictBinding;
- +
- + // Raw data used by renderer
- + int m_currentField;
- + int m_reloadShaders;
- +
- + struct YUVPLANE
- + {
- + GLuint id;
- + CRect rect;
- +
- + float width;
- + float height;
- +
- + unsigned texwidth;
- + unsigned texheight;
- +
- + unsigned flipindex;
- + };
- +
- + typedef YUVPLANE YUVPLANES[MAX_PLANES];
- + typedef YUVPLANES YUVFIELDS[MAX_FIELDS];
- +
- + struct YUVBUFFER
- + {
- + YUVFIELDS fields;
- + YV12Image image;
- + unsigned flipindex; /* used to decide if this has been uploaded */
- +
- + A10VLQueueItem *a10buffer;
- + };
- +
- + // YV12 decoder textures
- + // field index 0 is full image, 1 is odd scanlines, 2 is even scanlines
- + YUVBUFFER m_buffers[NUM_BUFFERS];
- +
- + void LoadPlane( YUVPLANE& plane, int type, unsigned flipindex
- + , unsigned width, unsigned height
- + , int stride, void* data );
- +
- + Shaders::BaseYUV2RGBShader *m_pYUVShader;
- + Shaders::BaseVideoFilterShader *m_pVideoFilterShader;
- +
- + ESCALINGMETHOD m_scalingMethod;
- + ESCALINGMETHOD m_scalingMethodGui;
- +
- + Features m_renderFeatures;
- + Features m_deinterlaceMethods;
- + Features m_deinterlaceModes;
- + Features m_scalingMethods;
- +
- + // clear colour for "black" bars
- + float m_clearColour;
- +
- + CEvent* m_eventTexturesDone[NUM_BUFFERS];
- +
- +};
- +
- +
- +inline int NP2( unsigned x )
- +{
- + --x;
- + x |= x >> 1;
- + x |= x >> 2;
- + x |= x >> 4;
- + x |= x >> 8;
- + x |= x >> 16;
- + return ++x;
- +}
- +#endif
- +
- +/*
- + * Video layer functions
- + */
- +
- +#define DISPQS 24
- +
- +typedef void (*A10VLCALLBACK)(void *callbackpriv, void *pictpriv, cedarv_picture_t &pict); //cleanup function
- +
- +struct A10VLQueueItem
- +{
- + int decnr;
- + A10VLCALLBACK callback;
- + void *callbackpriv;
- + void *pictpriv;
- + cedarv_picture_t pict;
- +};
- +
- +bool A10VLInit(int &width, int &height, double &refreshRate);
- +
- +void A10VLExit();
- +
- +void A10VLHide();
- +
- +void A10VLWaitVSYNC();
- +
- +A10VLQueueItem *A10VLPutQueue(A10VLCALLBACK callback,
- + void *callbackpriv,
- + void *pictpriv,
- + cedarv_picture_t &pict);
- +
- +void A10VLFreeQueue();
- +
- +void A10VLDisplayQueueItem(A10VLQueueItem *pItem, CRect &srcRect, CRect &dstRect);
- +
- +int A10VLDisplayPicture(cedarv_picture_t &pict, int refnr, CRect &srcRect, CRect &dstRect);
- +
- +#endif
- diff -b -u -r -N '--exclude=.git' xbmc_orig/xbmc/cores/VideoRenderers/Makefile.in xbmc_rellla/xbmc/cores/VideoRenderers/Makefile.in
- --- xbmc_orig/xbmc/cores/VideoRenderers/Makefile.in 2013-06-12 16:21:05.000000000 +0200
- +++ xbmc_rellla/xbmc/cores/VideoRenderers/Makefile.in 2013-06-12 17:13:43.000000000 +0200
- @@ -18,6 +18,8 @@
- SRCS += OverlayRendererGL.cpp
- endif
- +SRCS += LinuxRendererA10.cpp
- +
- LIB = VideoRenderer.a
- include @abs_top_srcdir@/Makefile.include
- diff -b -u -r -N '--exclude=.git' xbmc_orig/xbmc/cores/VideoRenderers/RenderFormats.h xbmc_rellla/xbmc/cores/VideoRenderers/RenderFormats.h
- --- xbmc_orig/xbmc/cores/VideoRenderers/RenderFormats.h 2013-06-12 16:21:05.000000000 +0200
- +++ xbmc_rellla/xbmc/cores/VideoRenderers/RenderFormats.h 2013-06-12 17:13:43.000000000 +0200
- @@ -33,6 +33,7 @@
- RENDER_FMT_VAAPI,
- RENDER_FMT_OMXEGL,
- RENDER_FMT_CVBREF,
- + RENDER_FMT_A10BUF,
- RENDER_FMT_BYPASS,
- };
- diff -b -u -r -N '--exclude=.git' xbmc_orig/xbmc/cores/VideoRenderers/RenderManager.cpp xbmc_rellla/xbmc/cores/VideoRenderers/RenderManager.cpp
- --- xbmc_orig/xbmc/cores/VideoRenderers/RenderManager.cpp 2013-06-12 17:20:26.000000000 +0200
- +++ xbmc_rellla/xbmc/cores/VideoRenderers/RenderManager.cpp 2013-06-12 17:13:43.000000000 +0200
- @@ -38,7 +38,11 @@
- #if defined(HAS_GL)
- #include "LinuxRendererGL.h"
- #elif HAS_GLES == 2
- +#ifdef ALLWINNERA10
- + #include "LinuxRendererA10.h"
- +#else
- #include "LinuxRendererGLES.h"
- +#endif
- #elif defined(HAS_DX)
- #include "WinRenderer.h"
- #elif defined(HAS_SDL)
- @@ -341,7 +345,11 @@
- #if defined(HAS_GL)
- m_pRenderer = new CLinuxRendererGL();
- #elif HAS_GLES == 2
- +#ifdef ALLWINNERA10
- + m_pRenderer = new CLinuxRendererA10();
- +#else
- m_pRenderer = new CLinuxRendererGLES();
- +#endif
- #elif defined(HAS_DX)
- m_pRenderer = new CWinRenderer();
- #elif defined(HAS_SDL)
- @@ -862,6 +870,10 @@
- else if(pic.format == RENDER_FMT_VAAPI)
- m_pRenderer->AddProcessor(*pic.vaapi);
- #endif
- +#ifdef ALLWINNERA10
- + else if (pic.format == RENDER_FMT_A10BUF)
- + m_pRenderer->AddProcessor(pic.a10buffer);
- +#endif
- m_pRenderer->ReleaseImage(index, false);
- return index;
- diff -b -u -r -N '--exclude=.git' xbmc_orig/xbmc/cores/VideoRenderers/RenderManager.h xbmc_rellla/xbmc/cores/VideoRenderers/RenderManager.h
- --- xbmc_orig/xbmc/cores/VideoRenderers/RenderManager.h 2013-06-12 17:20:26.000000000 +0200
- +++ xbmc_rellla/xbmc/cores/VideoRenderers/RenderManager.h 2013-06-12 17:13:43.000000000 +0200
- @@ -43,6 +43,7 @@
- class CLinuxRenderer;
- class CLinuxRendererGL;
- class CLinuxRendererGLES;
- +class CLinuxRendererA10;
- class CXBMCRenderManager
- {
- @@ -115,7 +116,11 @@
- #ifdef HAS_GL
- CLinuxRendererGL *m_pRenderer;
- #elif HAS_GLES == 2
- +#ifdef ALLWINNERA10
- + CLinuxRendererA10 *m_pRenderer;
- +#else
- CLinuxRendererGLES *m_pRenderer;
- +#endif
- #elif defined(HAS_DX)
- CWinRenderer *m_pRenderer;
- #elif defined(HAS_SDL)
- diff -b -u -r -N '--exclude=.git' xbmc_orig/xbmc/system.h xbmc_rellla/xbmc/system.h
- --- xbmc_orig/xbmc/system.h 2013-06-12 17:20:27.000000000 +0200
- +++ xbmc_rellla/xbmc/system.h 2013-06-12 17:13:44.000000000 +0200
- @@ -185,6 +185,9 @@
- #ifdef HAVE_ALSA
- #define HAS_ALSA
- #endif
- +#if !defined(HAVE_X11) && !defined(ANDROID)
- +#define HAS_LINUX_EVENTS
- +#endif
- #endif
- #ifdef HAVE_LIBSSH
- diff -b -u -r -N '--exclude=.git' xbmc_orig/xbmc/windowing/egl/EGLNativeTypeA10.cpp xbmc_rellla/xbmc/windowing/egl/EGLNativeTypeA10.cpp
- --- xbmc_orig/xbmc/windowing/egl/EGLNativeTypeA10.cpp 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/xbmc/windowing/egl/EGLNativeTypeA10.cpp 2013-06-12 17:13:46.000000000 +0200
- @@ -0,0 +1,158 @@
- +/*
- + * Copyright (C) 2011-2012 Team XBMC
- + * http://www.xbmc.org
- + *
- + * This Program is free software; you can redistribute it and/or modify
- + * it under the terms of the GNU General Public License as published by
- + * the Free Software Foundation; either version 2, or (at your option)
- + * any later version.
- + *
- + * This Program is distributed in the hope that it will be useful,
- + * but WITHOUT ANY WARRANTY; without even the implied warranty of
- + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + * GNU General Public License for more details.
- + *
- + * You should have received a copy of the GNU General Public License
- + * along with XBMC; see the file COPYING. If not, see
- + * <http://www.gnu.org/licenses/>.
- + *
- + */
- +#include "system.h"
- +#include <EGL/egl.h>
- +#include "EGLNativeTypeA10.h"
- +#include "utils/log.h"
- +#include "guilib/gui3d.h"
- +
- +#if defined(ALLWINNERA10) && !defined(TARGET_ANDROID)
- +#include "cores/VideoRenderers/LinuxRendererA10.h"
- +static struct mali_native_window g_fbwin;
- +static double g_refreshRate;
- +#endif
- +
- +CEGLNativeTypeA10::CEGLNativeTypeA10()
- +{
- +#if defined(ALLWINNERA10) && !defined(TARGET_ANDROID)
- + int width, height;
- +
- + A10VLInit(width, height, g_refreshRate);
- + g_fbwin.width = width;
- + g_fbwin.height = height;
- +#endif
- +}
- +
- +CEGLNativeTypeA10::~CEGLNativeTypeA10()
- +{
- +#if defined(ALLWINNERA10) && !defined(TARGET_ANDROID)
- + A10VLExit();
- +#endif
- +}
- +
- +bool CEGLNativeTypeA10::CheckCompatibility()
- +{
- +#if defined(ALLWINNERA10) && !defined(TARGET_ANDROID)
- + return true;
- +#endif
- + return false;
- +}
- +
- +void CEGLNativeTypeA10::Initialize()
- +{
- + return;
- +}
- +void CEGLNativeTypeA10::Destroy()
- +{
- + return;
- +}
- +
- +bool CEGLNativeTypeA10::CreateNativeDisplay()
- +{
- + m_nativeDisplay = EGL_DEFAULT_DISPLAY;
- + return true;
- +}
- +
- +bool CEGLNativeTypeA10::CreateNativeWindow()
- +{
- +#if defined(ALLWINNERA10) && !defined(TARGET_ANDROID)
- + m_nativeWindow = &g_fbwin;
- + return true;
- +#else
- + return false;
- +#endif
- +}
- +
- +bool CEGLNativeTypeA10::GetNativeDisplay(XBNativeDisplayType **nativeDisplay) const
- +{
- + if (!nativeDisplay)
- + return false;
- + *nativeDisplay = (XBNativeDisplayType*) &m_nativeDisplay;
- + return true;
- +}
- +
- +bool CEGLNativeTypeA10::GetNativeWindow(XBNativeWindowType **nativeWindow) const
- +{
- + if (!nativeWindow)
- + return false;
- + *nativeWindow = (XBNativeWindowType*) &m_nativeWindow;
- + return true;
- +}
- +
- +bool CEGLNativeTypeA10::DestroyNativeDisplay()
- +{
- + return true;
- +}
- +
- +bool CEGLNativeTypeA10::DestroyNativeWindow()
- +{
- + return true;
- +}
- +
- +bool CEGLNativeTypeA10::GetNativeResolution(RESOLUTION_INFO *res) const
- +{
- +#if defined(ALLWINNERA10) && !defined(TARGET_ANDROID)
- + res->iWidth = g_fbwin.width;
- + res->iHeight= g_fbwin.height;
- +
- + res->fRefreshRate = g_refreshRate;
- + res->dwFlags= D3DPRESENTFLAG_PROGRESSIVE | D3DPRESENTFLAG_WIDESCREEN;
- + res->iScreen = 0;
- + res->bFullScreen = true;
- + res->iSubtitles = (int)(0.965 * res->iHeight);
- + res->fPixelRatio = 1.0f;
- + res->iScreenWidth = res->iWidth;
- + res->iScreenHeight = res->iHeight;
- + res->strMode.Format("%dx%d @ %.2f%s - Full Screen", res->iScreenWidth, res->iScreenHeight, res->fRefreshRate,
- + res->dwFlags & D3DPRESENTFLAG_INTERLACED ? "i" : "");
- + CLog::Log(LOGNOTICE,"Current resolution: %s\n",res->strMode.c_str());
- + return true;
- +#else
- + return false;
- +#endif
- +}
- +
- +bool CEGLNativeTypeA10::SetNativeResolution(const RESOLUTION_INFO &res)
- +{
- + return false;
- +}
- +
- +bool CEGLNativeTypeA10::ProbeResolutions(std::vector<RESOLUTION_INFO> &resolutions)
- +{
- + RESOLUTION_INFO res;
- + bool ret = false;
- + ret = GetNativeResolution(&res);
- + if (ret && res.iWidth > 1 && res.iHeight > 1)
- + {
- + resolutions.push_back(res);
- + return true;
- + }
- + return false;
- +}
- +
- +bool CEGLNativeTypeA10::GetPreferredResolution(RESOLUTION_INFO *res) const
- +{
- + return false;
- +}
- +
- +bool CEGLNativeTypeA10::ShowWindow(bool show)
- +{
- + return false;
- +}
- diff -b -u -r -N '--exclude=.git' xbmc_orig/xbmc/windowing/egl/EGLNativeTypeA10.h xbmc_rellla/xbmc/windowing/egl/EGLNativeTypeA10.h
- --- xbmc_orig/xbmc/windowing/egl/EGLNativeTypeA10.h 1970-01-01 01:00:00.000000000 +0100
- +++ xbmc_rellla/xbmc/windowing/egl/EGLNativeTypeA10.h 2013-06-12 17:13:46.000000000 +0200
- @@ -0,0 +1,49 @@
- +#pragma once
- +
- +/*
- + * Copyright (C) 2011-2012 Team XBMC
- + * http://www.xbmc.org
- + *
- + * This Program is free software; you can redistribute it and/or modify
- + * it under the terms of the GNU General Public License as published by
- + * the Free Software Foundation; either version 2, or (at your option)
- + * any later version.
- + *
- + * This Program is distributed in the hope that it will be useful,
- + * but WITHOUT ANY WARRANTY; without even the implied warranty of
- + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + * GNU General Public License for more details.
- + *
- + * You should have received a copy of the GNU General Public License
- + * along with XBMC; see the file COPYING. If not, see
- + * <http://www.gnu.org/licenses/>.
- + *
- + */
- +
- +#include "EGLNativeType.h"
- +class CEGLNativeTypeA10 : public CEGLNativeType
- +{
- +public:
- + CEGLNativeTypeA10();
- + virtual ~CEGLNativeTypeA10();
- + virtual std::string GetNativeName() const { return "A10"; };
- + virtual bool CheckCompatibility();
- + virtual void Initialize();
- + virtual void Destroy();
- + virtual int GetQuirks() { return EGL_QUIRK_NEED_WINDOW_FOR_RES; };
- +
- + virtual bool CreateNativeDisplay();
- + virtual bool CreateNativeWindow();
- + virtual bool GetNativeDisplay(XBNativeDisplayType **nativeDisplay) const;
- + virtual bool GetNativeWindow(XBNativeWindowType **nativeWindow) const;
- +
- + virtual bool DestroyNativeWindow();
- + virtual bool DestroyNativeDisplay();
- +
- + virtual bool GetNativeResolution(RESOLUTION_INFO *res) const;
- + virtual bool SetNativeResolution(const RESOLUTION_INFO &res);
- + virtual bool ProbeResolutions(std::vector<RESOLUTION_INFO> &resolutions);
- + virtual bool GetPreferredResolution(RESOLUTION_INFO *res) const;
- +
- + virtual bool ShowWindow(bool show);
- +};
- diff -b -u -r -N '--exclude=.git' xbmc_orig/xbmc/windowing/egl/EGLNativeTypeAndroid.cpp xbmc_rellla/xbmc/windowing/egl/EGLNativeTypeAndroid.cpp
- --- xbmc_orig/xbmc/windowing/egl/EGLNativeTypeAndroid.cpp 2013-06-12 16:21:09.000000000 +0200
- +++ xbmc_rellla/xbmc/windowing/egl/EGLNativeTypeAndroid.cpp 2013-06-12 17:13:46.000000000 +0200
- @@ -24,13 +24,24 @@
- #include "guilib/gui3d.h"
- #if defined(TARGET_ANDROID)
- #include "android/activity/XBMCApp.h"
- +#ifdef ALLWINNERA10
- +#include "cores/VideoRenderers/LinuxRendererA10.h"
- +#endif
- #endif
- CEGLNativeTypeAndroid::CEGLNativeTypeAndroid()
- {
- +#if defined(ALLWINNERA10) && defined(TARGET_ANDROID)
- + int width, height;
- +
- + A10VLInit(width, height);
- +#endif
- }
- CEGLNativeTypeAndroid::~CEGLNativeTypeAndroid()
- {
- +#if defined(ALLWINNERA10) && defined(TARGET_ANDROID)
- + A10VLExit();
- +#endif
- }
- bool CEGLNativeTypeAndroid::CheckCompatibility()
- diff -b -u -r -N '--exclude=.git' xbmc_orig/xbmc/windowing/egl/EGLWrapper.cpp xbmc_rellla/xbmc/windowing/egl/EGLWrapper.cpp
- --- xbmc_orig/xbmc/windowing/egl/EGLWrapper.cpp 2013-06-12 17:20:27.000000000 +0200
- +++ xbmc_rellla/xbmc/windowing/egl/EGLWrapper.cpp 2013-06-12 17:13:46.000000000 +0200
- @@ -22,7 +22,10 @@
- #ifdef HAS_EGL
- +#include "system_gl.h"
- +
- #include "utils/log.h"
- +#include "EGLNativeTypeA10.h"
- #include "EGLNativeTypeAndroid.h"
- #include "EGLNativeTypeAmlogic.h"
- #include "EGLNativeTypeRaspberryPI.h"
- @@ -81,6 +84,7 @@
- // that we know will work
- if ((nativeGuess = CreateEGLNativeType<CEGLNativeTypeAndroid>(implementation)) ||
- (nativeGuess = CreateEGLNativeType<CEGLNativeTypeAmlogic>(implementation)) ||
- + (nativeGuess = CreateEGLNativeType<CEGLNativeTypeA10>(implementation)) ||
- (nativeGuess = CreateEGLNativeType<CEGLNativeTypeRaspberryPI>(implementation)))
- {
- m_nativeTypes = nativeGuess;
- @@ -291,6 +295,20 @@
- EGLBoolean status;
- status = eglMakeCurrent(display, surface, surface, context);
- CheckError();
- +
- + // For EGL backend, it needs to clear all the back buffers of the window
- + // surface before drawing anything, otherwise the image will be blinking
- + // heavily. The default eglWindowSurface has 3 gdl surfaces as the back
- + // buffer, that's why glClear should be called 3 times.
- + eglSwapInterval(display, 0);
- + glClearColor (0.0f, 0.0f, 0.0f, 0.0f);
- + glClear (GL_COLOR_BUFFER_BIT);
- + eglSwapBuffers(display, surface);
- + glClear (GL_COLOR_BUFFER_BIT);
- + eglSwapBuffers(display, surface);
- + glClear (GL_COLOR_BUFFER_BIT);
- + eglSwapBuffers(display, surface);
- +
- return status;
- }
- diff -b -u -r -N '--exclude=.git' xbmc_orig/xbmc/windowing/egl/Makefile xbmc_rellla/xbmc/windowing/egl/Makefile
- --- xbmc_orig/xbmc/windowing/egl/Makefile 2013-06-12 16:21:09.000000000 +0200
- +++ xbmc_rellla/xbmc/windowing/egl/Makefile 2013-06-12 17:13:46.000000000 +0200
- @@ -1,6 +1,7 @@
- INCLUDES=-I.
- SRCS = WinSystemEGL.cpp
- +SRCS+= EGLNativeTypeA10.cpp
- SRCS+= EGLNativeTypeAmlogic.cpp
- SRCS+= EGLNativeTypeAndroid.cpp
- SRCS+= EGLNativeTypeRaspberryPI.cpp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement