summaryrefslogtreecommitdiff
path: root/recipes/ti/ti-codec-engine.inc
blob: bb9466419d5b144a02457056ae46bddfef22927d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
DESCRIPTION = "Codec Engine for TI ARM/DSP processors"

require ti-paths.inc

# compile time dependencies
DEPENDS = "ti-framework-components ti-xdais ti-xdctools ti-cgt6x ti-biosutils ti-edma3lld ti-linuxutils"

DEPENDS_append_dm6446 	= " ti-dspbios ti-dsplink-module"
DEPENDS_append_dm6467 	= " ti-dspbios ti-dsplink-module"
DEPENDS_append_omap3   	= " ti-dspbios ti-dsplink-module ti-lpm-module"
DEPENDS_append_omapl138 = " ti-dspbios ti-dsplink-module"

SRC_URI = "http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/ce/${PV}/exports/codec_engine_${PV},lite.tar.gz;name=cetarball"

# Set the source directory
S = "${WORKDIR}/codec_engine_${PV}"

# Define Device variable
DEVICES           = ""
DEVICES_dm6446 	 ?= "DM6446"
DEVICES_dm6467   ?= "DM6467"
DEVICES_omap3    ?= "OMAP3530"
DEVICES_dm355    ?= "DM355"
DEVICES_dm365    ?= "DM365"
DEVICES_omapl137 ?= "OMAPL137"
DEVICES_omapl138 ?= "OMAPL138"

#define PROGRAM variables
#TODO - should we build APP_LOCAL for SOCs as well?? - probably?
PROGRAMS         ?= "APP_CLIENT DSP_SERVER"
PROGRAMS_dm355    = "APP_LOCAL"
PROGRAMS_dm365    = "APP_LOCAL"

CGT6x_DIR = "${CODEGEN_INSTALL_DIR}"
XDCTOOLS_DIR = "${XDC_INSTALL_DIR}"
CE_INSTALL_DIR = "${S}"

do_compile () {

	# No way to pass this via ENV?
	sed -i  \
		-e s:arm-none-linux-gnueabi-:${TARGET_PREFIX}:g \
		${S}/examples/xdcpaths.mak

        for i in codecs extensions servers apps ; do
                cd ${S}/examples/ti/sdo/ce/examples/$i
                make DEVICES="${DEVICES}" \
                     GPPOS="${GPPOS}" \
                     PROGRAMS="${PROGRAMS}" \
                     CE_INSTALL_DIR="${CE_INSTALL_DIR}" \
                     XDC_INSTALL_DIR="${XDCTOOLS_DIR}" \
                     BIOS_INSTALL_DIR="${BIOS_INSTALL_DIR}" \
                     BIOSUTILS_INSTALL_DIR="${BIOSUTILS_INSTALL_DIR}" \
		     DSPLINK_INSTALL_DIR="${LINK_INSTALL_DIR}" \
                     XDAIS_INSTALL_DIR="${XDAIS_INSTALL_DIR}" \
                     FC_INSTALL_DIR="${FC_INSTALL_DIR}" \
                     CMEM_INSTALL_DIR="${CMEM_INSTALL_DIR}" \
                     LPM_INSTALL_DIR="${LPM_INSTALL_DIR}" \
                     EDMA3_LLD_INSTALL_DIR="${EDMA3_LLD_INSTALL_DIR}" \
                     CGTOOLS_V5T="${TOOLCHAIN_PATH}" \
                     CGTOOLS_C64P="${CGT6x_DIR}" \
                     CGTOOLS_C674="${CGT6x_DIR}" \
                     clean all
        done
}

do_install() {

	install -d ${D}/${installdir}/codec-engine-apps
	if [-e ${S}/examples/apps/system_files/${DEVICES}/loadmodules.sh ]; then
		cp ${S}/examples/apps/system_files/${DEVICES}/loadmodules.sh ${D}/${installdir}/codec-engine-apps
	fi

	cd ${S}/examples/ti/sdo/ce/examples

	# Install the apps, servers and test data, mirroring the source directory structure
	#  - Put the servers inside the same folder as the executable
	#  - TODO - Check nested dirs (e.g. dualcpu_separateconfig)

        # Put all servers in separate tree.
        for i in $(find . -name "*.${DSPSUFFIX}"); do
                install -d ${D}/${installdir}/codec-engine-apps/servers/`dirname ${i} | cut -f3 -d /`
                install ${i} ${D}/${installdir}/codec-engine-apps/servers/`dirname ${i} | cut -f3 -d /`
        done

	for i in $(find . -name "*.xv5T"); do
		install -d ${D}/${installdir}/codec-engine-apps/`dirname ${i} | cut -f3 -d /`
		install ${i} ${D}/${installdir}/codec-engine-apps/`dirname ${i} | cut -f3 -d /`
	done

	for i in $(find . -name "*.dat"); do
		install -d ${D}/${installdir}/codec-engine-apps/`dirname ${i} | cut -f3 -d /`
		install ${i} ${D}/${installdir}/codec-engine-apps/`dirname ${i} | cut -f3 -d /`
        done

	# For each directory, softlink to the app server, except special cases
	cd ${D}/${installdir}/codec-engine-apps
	for i in $(find . -type d | grep -v servers); do
		{
		pwd
		cd ${D}/${installdir}/codec-engine-apps/$i
		if [ $(basename $i) == "audio1_ires" ] ; then 
			ln -s ../servers/audio1_ires/audio1_ires.${DSPSUFFIX}
		elif [ $(basename $i) == "server_api_example" ] ; then
			ln -s ../servers/server_api_example/audio_copy.${DSPSUFFIX}
                elif [ $(basename $i) != "." ] ; then
			ln -s ../servers/all_codecs/all.${DSPSUFFIX}
		else
			echo Skipping $i
		fi
		}
	done
}


# We can't use CE_INSTALL_DIR directly since we redefined it earlier on
do_stage() {
    install -d ${STAGING_DIR}/${MULTIMACH_TARGET_SYS}${CE_INSTALL_DIR_RECIPE}
    cp -pPrf ${S}/* ${STAGING_DIR}/${MULTIMACH_TARGET_SYS}${CE_INSTALL_DIR_RECIPE}
}


RDEPENDS_ti-codec-engine-apps = "ti-cmem-module"
RDEPENDS_append_dm6446   = " ti-dsplink-module"
RDEPENDS_append_omap3    = " ti-dsplink-module"
RDEPENDS_append_omapl138 = " ti-dsplink-module"

PACKAGE_ARCH = "${MACHINE_ARCH}"
INHIBIT_PACKAGE_STRIP = "1"
PACKAGES += "ti-codec-engine-apps"
FILES_ti-codec-engine-apps = "${installdir}/codec-engine-apps/*"
INSANE_SKIP_ti-codec-engine-apps = True