summaryrefslogtreecommitdiffstats
path: root/extras/recipes-ti/gstreamer-ti/gstreamer-ti.inc
diff options
context:
space:
mode:
Diffstat (limited to 'extras/recipes-ti/gstreamer-ti/gstreamer-ti.inc')
-rw-r--r--extras/recipes-ti/gstreamer-ti/gstreamer-ti.inc164
1 files changed, 164 insertions, 0 deletions
diff --git a/extras/recipes-ti/gstreamer-ti/gstreamer-ti.inc b/extras/recipes-ti/gstreamer-ti/gstreamer-ti.inc
new file mode 100644
index 00000000..cb032666
--- /dev/null
+++ b/extras/recipes-ti/gstreamer-ti/gstreamer-ti.inc
@@ -0,0 +1,164 @@
1DESCRIPTION = "GSTREAMER Plugin (gstreamer-ti) for TI ARM/DSP processors"
2HOMEPAGE = "https://gforge.ti.com/gf/project/gstreamer_ti/"
3SECTION = "multimedia"
4LICENSE = "LGPL"
5
6# TODO :: Replace omapl137 with official support in GST (currently linking to omapl138)
7# TODO :: Codec Server Environment Variables shouldn't be required
8# TODO :: Add (and check) rc scripts for all targets (just copied for now) (365,6467,omapl137)
9# TODO :: Check if CPPFLAGS_append is still required
10# TODO :: Remove ENCODE/DECODE combo exports - these are not used anymore (check?)
11
12inherit autotools
13inherit update-rc.d
14require recipes-ti/includes/ti-paths.inc
15require recipes-ti/includes/ti-staging.inc
16
17# Rebuild on kernel change since it links statically to ti-dmai, ti-codec-engine, etc
18PR = "r85+${MACHINE_KERNEL_PR}"
19
20DEPENDS = "ti-dmai gstreamer gst-plugins-base"
21
22# enable c6accel elements on omapl138 and omap3
23#DEPENDS_append_omapl138 = " ti-c6accel "
24#EXTRA_OECONF_omapl138 = "--enable-c6accel"
25#DEPENDS_append_omap3 = " ti-c6accel "
26#EXTRA_OECONF_omap3 = "--enable-c6accel"
27export C6ACCEL_INSTALL_DIR
28
29# gstreamer_ti picks up some config variables from the environment
30# - variables are used in the gstreamer makefile
31# - PLATFORM, XDC_PLATFORM, XDC_TARGET, MVTOOL_DIR
32# - others used by config.bld (which it gets from the dmai config.bld)
33# - CROSS_COMPILE, PLATFORM_XDC
34
35PLATFORM_dm6446 = "dm6446"
36PLATFORM_dm6467 = "dm6467"
37PLATFORM_dm6467t = "dm6467t"
38PLATFORM_omap3 = "omap3530"
39PLATFORM_dm355 = "dm355"
40PLATFORM_dm365 = "dm365"
41PLATFORM_omapl137 = "omapl137"
42PLATFORM_omapl138 = "omapl138"
43PLATFORM ?= "UNDEFINED_PLATFORM"
44GST_TI_PLATFORM = "${PLATFORM}"
45
46XDC_PLATFORM_dm6446 = "ti.platforms.evmDM6446"
47XDC_PLATFORM_dm6467 = "ti.platforms.evmDM6467"
48XDC_PLATFORM_omap3 = "ti.platforms.evm3530"
49XDC_PLATFORM_dm355 = "ti.platforms.evmDM355"
50XDC_PLATFORM_dm365 = "ti.platforms.evmDM365"
51XDC_PLATFORM_omapl137 = "ti.platforms.evmOMAPL137"
52XDC_PLATFORM_omapl138 = "ti.platforms.evmOMAPL138"
53XDC_PLATFORM ?= "UNDEFINED_XDC_PLATFORM"
54
55MEMARGS_omap3 = "99M@0x80000000"
56MEMARGS ?= "UNDEFINED_MEM_ARGS"
57
58export MEMARGS
59export PLATFORM
60export GST_TI_PLATFORM
61export XDC_PLATFORM
62export XDC_TARGET = "gnu.targets.arm.GCArmv5T"
63export PLATFORM_XDC = "${XDC_PLATFORM}"
64export CSTOOL_DIR = "${TOOLCHAIN_PATH}"
65export MVTOOL_DIR = "${TOOLCHAIN_PATH}"
66export MVTOOL_PREFIX = "${TARGET_PREFIX}"
67export CROSS_COMPILE = "${TOOLCHAIN_PATH}/${TARGET_PREFIX}"
68export LINK_XDC_ROOT = "${LINK_INSTALL_DIR}"
69
70# export codec combo (or server) locations
71# Why do we need to do this?? - These will get picked up from CODEC_INSTALL_DIR?
72# Sould only need this if we change from default server
73
74export CODEC_SERVER = "${installdir}/ti-codecs-server/cs.x64P"
75CPPFLAGS_append = " -DPlatform_${PLATFORM}"
76
77# We are still using encode/decode combo for DM6446
78export ENCODE_COMBO = "${installdir}/ti-codecs-server/encodeCombo.x64P"
79export DECODE_COMBO = "${installdir}/ti-codecs-server/decodeCombo.x64P"
80# Makefile also expects to be able to find the kernel headers from the envirionment
81export LINUXKERNEL_INSTALL_DIR = "${STAGING_KERNEL_DIR}"
82
83do_configure_prepend() {
84 # PSP kernel is based on older DSS. we need to replace linux/omapfb.h with mach/omapfb.h
85 if ! [ -e ${STAGING_KERNEL_DIR}/include/linux/omapfb.h ] ; then
86 sed -i -e s:linux/omapfb:mach/omapfb:g ${S}/src/omapfb.h || true
87 fi
88
89 # Angstrom 2008 breaks with -Wl,-T, while angstrom 2010 needs it
90 if [ $(${TARGET_PREFIX}gcc -dumpversion | awk -F. '{print $2}') -gt 3 ] ; then
91 # Fix up linkerscripts, recent toolchains need -T to prepend the default script to the custom one
92 for makefile in $(find ${S} -name "Makefile.am") ; do
93 sed -i -e 's:-Wl,$(XDC_CONFIG_BASENAME)/linker.cmd:-Wl,-T,$(XDC_CONFIG_BASENAME)/linker.cmd:g' $makefile
94 done
95 fi
96}
97
98do_compile() {
99 # Recent kernel headers warn against inclusion from userspace
100 for makefile in $(find ${S} -name "Makefile") ; do
101 sed -i -e s:-Werror::g $makefile
102 done
103
104 oe_runmake
105}
106
107do_install_prepend () {
108
109 install -d ${D}/${installdir}/gst/${PLATFORM}
110
111 # copy gstreamer demo scripts
112 cp -R ${WORKDIR}/gstreamer_ti/gstreamer_demo/shared ${D}/${installdir}/gst
113
114 # If we have loadmodules.sh in WORKDIR then give preference to this over
115 # the default gst-ti loadmdules.sh
116 if [ -f ${WORKDIR}/loadmodules.sh ]; then
117 cp ${WORKDIR}/loadmodules.sh ${D}/${installdir}/gst/${PLATFORM}
118 else
119 cp -R ${WORKDIR}/gstreamer_ti/gstreamer_demo/${PLATFORM} ${D}/${installdir}/gst
120 fi
121
122 # delete .svn files
123 find ${D}/${installdir}/gst -name .svn -type d | xargs rm -rf
124 chmod 0755 ${D}/${installdir}/gst -R
125
126 install -d ${D}${sysconfdir}/init.d/
127 install -m 0755 ${WORKDIR}/gstreamer-ti-rc.sh ${D}${sysconfdir}/init.d/gstti-init
128 sed -i -e 's|<platform>|${PLATFORM}|g' ${D}${sysconfdir}/init.d/gstti-init
129
130 install -d ${D}${base_libdir}/systemd/system
131 install -m 0644 ${WORKDIR}/gstti-init.service ${D}${base_libdir}/systemd/system/
132 sed -i -e 's|<platform>|${PLATFORM}|g' -e 's|MEMARGS|${MEMARGS}|' ${D}${base_libdir}/systemd/system/gstti-init.service
133}
134
135RRECOMMENDS_${PN}_append_dm6446 += "ti-codecs-dm6446-server ti-cmem-module ti-dsplink-module"
136RRECOMMENDS_${PN}_append_dm6467 += "ti-codecs-dm6467 ti-cmem-module ti-dsplink-module"
137RRECOMMENDS_${PN}_append_omap3 += "ti-codecs-omap3530-server ti-cmem-module ti-dsplink-module ti-lpm-module ti-sdma-module"
138RRECOMMENDS_${PN}_append_dm355 += "ti-codecs-dm355 ti-cmem-module ti-dm355mm-module"
139RRECOMMENDS_${PN}_append_dm365 += "ti-codecs-dm365 ti-cmem-module ti-dm365mm-module ti-edma-module ti-irq-module"
140RRECOMMENDS_${PN}_append_omapl137 += "ti-codecs-omapl137-server ti-cmem-module ti-dsplink-module"
141RRECOMMENDS_${PN}_append_omapl138 += "ti-codecs-omapl138-server ti-cmem-module ti-dsplink-module"
142
143FILES_${PN} += "${libdir}/gstreamer-0.10/*.so ${sysconfdir} ${installdir} ${base_libdir}/systemd"
144FILES_${PN}-dev += "${libdir}/gstreamer-0.10/*.a ${libdir}/gstreamer-0.10/*.la"
145FILES_${PN}-dbg += "${libdir}/gstreamer-0.10/.debug"
146
147pkg_postinst_${PN} () {
148if test "x$D" != "x"; then
149 echo "Can't run gstreamer-ti postinst offline"
150 exit 1
151fi
152 if [ -e ${base_bindir}/systemctl ] ; then
153 systemctl enable gstti-init.service
154 fi
155
156 if [ -d ${installdir}/ti-codecs-server/ ]; then
157 ln -sf ${installdir}/ti-codecs-server/* ${installdir}/gst/${PLATFORM}/
158 fi
159}
160
161PACKAGE_ARCH = "${MACHINE_ARCH}"
162
163INITSCRIPT_NAME = "gstti-init"
164INITSCRIPT_PARAMS = "start 30 5 2 . stop 40 0 1 6 ."