<commit_before>DESCRIPTION = "OMX Media Components R-Car Gen3"
LICENSE = "CLOSED"
require include/omx-control.inc
require include/rcar-gen3-modules-common.inc

DEPENDS = " \
    kernel-module-mmngr mmngr-user-module \
    vspmif-user-module kernel-module-vspmif \
    kernel-module-vspm kernel-module-vsp2driver \
"

# Task Control. Compile is not performed when not installing OMX Video and Audio Libs.
# Note) dummy-omx-user-module.inc does not exist.
INCLUDE_FILE = '${@base_conditional("USE_OMX_COMMON", "1", "dummy", "deltask", d )}'
include ${INCLUDE_FILE}-omx-user-module.inc

DEPENDS += '${@base_conditional("USE_VIDEO_OMX", "1", "kernel-module-uvcs-drv", "", d )}'

inherit autotools

includedir = "${RENESAS_DATADIR}/include"
CFLAGS += " -I${STAGING_DIR_HOST}${RENESAS_DATADIR}/include"
PACKAGE_ARCH = "${MACHINE_ARCH}"

OMX_EVA_PREFIX = '${@base_conditional("USE_OMX_EVA_PKG", "1", "EVA", "", d )}'

# SRC file name
SRC_URI_OMX = '${@base_conditional("USE_OMX_COMMON", "1", "file://${OMX_EVA_PREFIX}RTM0AC0000XCMCTL30SL40C.tar.bz2;unpack=0", "", d )}'
SRC_URI_VCMND = '${@base_conditional("USE_VIDEO_DEC", "1", "file://${OMX_EVA_PREFIX}RTM0AC0000XVCMND30SL40C.tar.bz2;unpack=0", "", d )}'
SRC_URI_VCMNE = '${@base_conditional("USE_VIDEO_ENC", "1", "file://${OMX_EVA_PREFIX}RTM0AC0000XVCMNE30SL40C.tar.bz2;unpack=0", "", d )}'
SRC_URI_H263D = '${@base_conditional("USE_H263D_OMX", "1", "file://${OMX_EVA_PREFIX}RTM0AC0000XV263D30SL40C.tar.bz2", "", d )}'
SRC_URI_H264D = '${@base_conditional("USE_H264D_OMX", "1", "file://${OMX_EVA_PREFIX}RTM0AC0000XV264D30SL40C.tar.bz2", "", d )}'
SRC_URI_H264E = '${@base_conditional("USE_H264E_OMX", "1", "file://${OMX_EVA_PREFIX}RTM0AC0000XV264E30SL40C.tar.bz2", "", d )}'
SRC_URI_H265D = '${@base_conditional("USE_H265D_OMX", "1", "file://${OMX_EVA_PREFIX}RTM0AC0000XV265D30SL40C.tar.bz2", "", d )}'
SRC_URI_MPEG2D = '${@base_conditional("USE_MPEG2D_OMX", "1", "file://${OMX_EVA_PREFIX}RTM0AC0000XVM2VD30SL40C.tar.bz2", "", d )}'
SRC_URI_MPEG4D = '${@base_conditional("USE_MPEG4D_OMX", "1", "file://${OMX_EVA_PREFIX}RTM0AC0000XVM4VD30SL40C.tar.bz2", "", d )}'
SRC_URI_VC1D = '${@base_conditional("USE_VC1D_OMX", "1", "file://${OMX_EVA_PREFIX}RTM0AC0000XVVC1D30SL40C.tar.bz2", "", d )}'
SRC_URI_DIVXD = '${@base_conditional("USE_DIVXD_OMX", "1", "file://${OMX_EVA_PREFIX}RTM0AC0000XVDVXD30SL40C.tar.bz2", "", d )}'
SRC_URI_RVD = '${@base_conditional("USE_RVD_OMX", "1", "file://${OMX_EVA_PREFIX}RTM0AC0000XVRLVD30SL40C.tar.bz2", "", d )}'
SRC_URI_ACMND = '${@base_conditional("USE_AUDIO_OMX", "1", "file://RTM0AC0000XACMND30SL40C.tar.gz", "", d )}'
SRC_URI_AACLC = '${@base_conditional("USE_AACLCD_OMX", "1", "file://RTM0AC0000XAAACD30SL40C.tar.gz", "", d )}'
SRC_URI_AACPV2 = '${@base_conditional("USE_AACPV2D_OMX", "1", "file://RTM0AC0000XAAAPD30SL40C.tar.gz", "", d )}'
SRC_URI_MP3 = '${@base_conditional("USE_MP3D_OMX", "1", "file://RTM0AC0000XAMP3D30SL40C.tar.gz", "", d )}'
SRC_URI_AACLCE = '${@base_conditional("USE_AACLCE_OMX", "1", "file://RTM0AC0000XAAACE30SL40C.tar.gz", "", d )}'
SRC_URI_WMA = '${@base_conditional("USE_WMAD_OMX", "1", "file://RTM0AC0000XAWMAD30SL40C.tar.gz", "", d )}'
SRC_URI_ALACD = '${@base_conditional("USE_ALACD_OMX", "1", "file://RTM0AC0000XAALAD30SL40C.tar.gz", "", d )}'
SRC_URI_FLACD = '${@base_conditional("USE_FLACD_OMX", "1", "file://RTM0AC0000XAFLAD30SL40C.tar.gz", "", d )}'
SRC_URI_DDD = '${@base_conditional("USE_DDD_OMX", "1", "file://RTM0AC0000XADD5D30SL40C.tar.gz", "", d )}'
SRC_URI_AACMZ = '${@base_conditional("USE_AACLC_MDW", "1", "file://RTM0AC0000ADAACMZ1SL40C.tar.gz", "", d )}'
SRC_URI_AACPV2MZ = '${@base_conditional("USE_AACPV2_MDW", "1", "file://RTM0AC0000ADAAPMZ1SL40C.tar.gz", "", d )}'
SRC_URI_MP3MZ = '${@base_conditional("USE_MP3_MDW", "1", "file://RTM0AC0000ADMP3MZ1SL40C.tar.gz", "", d )}'
SRC_URI_WMAMZ = '${@base_conditional("USE_WMA_MDW", "1", "file://RTM0AC0000ADWMAMZ1SL40C.tar.gz", "", d )}'
SRC_URI_DDMZ = '${@base_conditional("USE_DD_MDW", "1", "file://RTM0AC0000ADDD5MZ1SL40C.tar.gz", "", d )}'
SRC_URI_AEAACMZ = '${@base_conditional("USE_AACLCE_MDW", "1", "file://RTM0AC0000AEAACMZ1SL40C.tar.gz", "", d )}'

SRC_URI = " \
    ${SRC_URI_OMX} \
    ${SRC_URI_VCMND} \
    ${SRC_URI_VCMNE} \
    ${SRC_URI_H263D} \
    ${SRC_URI_H264D} \
    ${SRC_URI_H264E} \
    ${SRC_URI_H265D} \
    ${SRC_URI_MPEG2D} \
    ${SRC_URI_MPEG4D} \
    ${SRC_URI_VC1D} \
    ${SRC_URI_DIVXD} \
    ${SRC_URI_RVD} \
    ${SRC_URI_ACMND} \
    ${SRC_URI_AACLC} \
    ${SRC_URI_AACPV2} \
    ${SRC_URI_MP3} \
    ${SRC_URI_WMA} \
    ${SRC_URI_ALACD} \
    ${SRC_URI_FLACD} \
    ${SRC_URI_DDD} \
    ${SRC_URI_AACLCE} \
    ${SRC_URI_AACMZ} \
    ${SRC_URI_AACPV2MZ} \
    ${SRC_URI_MP3MZ} \
    ${SRC_URI_WMAMZ} \
    ${SRC_URI_DDMZ} \
    ${SRC_URI_AEAACMZ} \
"

# SRC directory name
OMX_COMMON_SRC = '${@base_conditional("USE_OMX_COMMON", "1", "${OMX_EVA_PREFIX}RTM0AC0000XCMCTL30SL40C", "", d )}'
OMX_VIDEO_DEC_COMMON_SRC = '${@base_conditional("USE_VIDEO_DEC", "1", "${OMX_EVA_PREFIX}RTM0AC0000XVCMND30SL40C", "", d )}'
OMX_VIDEO_ENC_COMMON_SRC = '${@base_conditional("USE_VIDEO_ENC", "1", "${OMX_EVA_PREFIX}RTM0AC0000XVCMNE30SL40C", "", d )}'

OMX_H263_DEC_SRC = '${@base_conditional("USE_H263D_OMX", "1", "${OMX_EVA_PREFIX}RTM0AC0000XV263D30SL40C", "", d )}'
OMX_H264_DEC_SRC = '${@base_conditional("USE_H264D_OMX", "1", "${OMX_EVA_PREFIX}RTM0AC0000XV264D30SL40C", "", d )}'
OMX_H264_ENC_SRC = '${@base_conditional("USE_H264E_OMX", "1", "${OMX_EVA_PREFIX}RTM0AC0000XV264E30SL40C", "", d )}'
OMX_H265_DEC_SRC = '${@base_conditional("USE_H265D_OMX", "1", "${OMX_EVA_PREFIX}RTM0AC0000XV265D30SL40C", "", d )}'
OMX_MPEG2_DEC_SRC = '${@base_conditional("USE_MPEG2D_OMX", "1", "${OMX_EVA_PREFIX}RTM0AC0000XVM2VD30SL40C", "", d )}'
OMX_MPEG4_DEC_SRC = '${@base_conditional("USE_MPEG4D_OMX", "1", "${OMX_EVA_PREFIX}RTM0AC0000XVM4VD30SL40C", "", d )}'
OMX_VC1_DEC_SRC = '${@base_conditional("USE_VC1D_OMX", "1", "${OMX_EVA_PREFIX}RTM0AC0000XVVC1D30SL40C", "", d )}'
OMX_DIVX_DEC_SRC = '${@base_conditional("USE_DIVXD_OMX", "1", "${OMX_EVA_PREFIX}RTM0AC0000XVDVXD30SL40C", "", d )}'
OMX_RV_DEC_SRC = '${@base_conditional("USE_RVD_OMX", "1", "${OMX_EVA_PREFIX}RTM0AC0000XVRLVD30SL40C", "", d )}'

OMX_VIDEO_SRC_LIST = " \
    ${OMX_COMMON_SRC} \
    ${OMX_VIDEO_DEC_COMMON_SRC} \
    ${OMX_VIDEO_ENC_COMMON_SRC} \
    ${OMX_H263_DEC_SRC} \
    ${OMX_H264_DEC_SRC} \
    ${OMX_H264_ENC_SRC} \
    ${OMX_H265_DEC_SRC} \
    ${OMX_MPEG2_DEC_SRC} \
    ${OMX_MPEG4_DEC_SRC} \
    ${OMX_VC1_DEC_SRC} \
    ${OMX_DIVX_DEC_SRC} \
    ${OMX_RV_DEC_SRC} \
"

AAC_MIDDLEWARE_SRC = "RTM0AC0000ADAACMZ1SL40C"
AACPV2_MIDDLEWARE_SRC = "RTM0AC0000ADAAPMZ1SL40C"
MP3_MIDDLEWARE_SRC = "RTM0AC0000ADMP3MZ1SL40C"
WMA_MIDDLEWARE_SRC = "RTM0AC0000ADWMAMZ1SL40C"
DD_MIDDLEWARE_SRC = "RTM0AC0000ADDD5MZ1SL40C"
AEAAC_MIDDLEWARE_SRC = "RTM0AC0000AEAACMZ1SL40C"

OMX_AUDIO_COMMON_SRC = '${@base_conditional("USE_AUDIO_OMX", "1", "RTM0AC0000XACMND30SL40C", "", d )}'
OMX_AACLC_DEC_SRC = '${@base_conditional("USE_AACLCD_OMX", "1", "RTM0AC0000XAAACD30SL40C", "", d )}'
OMX_AACPV2_DEC_SRC = '${@base_conditional("USE_AACPV2D_OMX", "1", "RTM0AC0000XAAAPD30SL40C", "", d )}'
OMX_MP3_DEC_SRC = '${@base_conditional("USE_MP3D_OMX", "1", "RTM0AC0000XAMP3D30SL40C", "", d )}'
OMX_WMA_DEC_SRC = '${@base_conditional("USE_WMAD_OMX", "1", "RTM0AC0000XAWMAD30SL40C", "", d )}'
OMX_ALAC_DEC_SRC = '${@base_conditional("USE_ALACD_OMX", "1", "RTM0AC0000XAALAD30SL40C", "", d )}'
OMX_FLAC_DEC_SRC = '${@base_conditional("USE_FLACD_OMX", "1", "RTM0AC0000XAFLAD30SL40C", "", d )}'
OMX_DD_DEC_SRC = '${@base_conditional("USE_DDD_OMX", "1", "RTM0AC0000XADD5D30SL40C", "", d )}'
OMX_AACLC_ENC_SRC = '${@base_conditional("USE_AACLCE_OMX", "1", "RTM0AC0000XAAACE30SL40C", "", d )}'

OMX_AUDIO_SRC_LIST = " \
    ${OMX_AUDIO_COMMON_SRC} \
    ${OMX_AACLC_DEC_SRC} \
    ${OMX_AACPV2_DEC_SRC} \
    ${OMX_MP3_DEC_SRC} \
    ${OMX_WMA_DEC_SRC} \
    ${OMX_ALAC_DEC_SRC} \
    ${OMX_FLAC_DEC_SRC} \
    ${OMX_DD_DEC_SRC} \
    ${OMX_AACLC_ENC_SRC} \
"

S = "${WORKDIR}/omx/"

# Create ${S} directory
do_unpack_prepend() {
    os.system("install -d ${S}")
}

do_unpack_append() {
    bb.build.exec_func('setup_build_tree', d)
}

setup_build_tree() {
    for omxmc in ${OMX_COMMON_SRC} ${OMX_VIDEO_DEC_COMMON_SRC} ${OMX_VIDEO_ENC_COMMON_SRC}
    do
        tar xf ${WORKDIR}/${omxmc}.tar.bz2 -C ${WORKDIR}
        tar xf ${WORKDIR}/${omxmc}.tar.bz2 ${omxmc}/src --strip=2 -C ${S}
        tar xf ${WORKDIR}/${omxmc}.tar.bz2 ${omxmc}/include --strip=1 -C ${S}
    done
}

B = "${S}"

EXTRA_OECONF = "OMXR_DEFAULT_CONFIG_FILE_NAME=${sysconfdir}/omxr/omxr_config_base.txt"

do_configure() {
    export uvcsdrv_dir="${INCSHARED}"
    chmod u+x autogen.sh<commit_msg>rcar-gen3: omx-user-module: Correct build tree setup for YP 2.2 morty<commit_after>DESCRIPTION = "OMX Media Components R-Car Gen3"
LICENSE = "CLOSED"
require include/omx-control.inc
require include/rcar-gen3-modules-common.inc

DEPENDS = " \
    kernel-module-mmngr mmngr-user-module \
    vspmif-user-module kernel-module-vspmif \
    kernel-module-vspm kernel-module-vsp2driver \
"

# Task Control. Compile is not performed when not installing OMX Video and Audio Libs.
# Note) dummy-omx-user-module.inc does not exist.
INCLUDE_FILE = '${@base_conditional("USE_OMX_COMMON", "1", "dummy", "deltask", d )}'
include ${INCLUDE_FILE}-omx-user-module.inc

DEPENDS += '${@base_conditional("USE_VIDEO_OMX", "1", "kernel-module-uvcs-drv", "", d )}'

inherit autotools

includedir = "${RENESAS_DATADIR}/include"
CFLAGS += " -I${STAGING_DIR_HOST}${RENESAS_DATADIR}/include"
PACKAGE_ARCH = "${MACHINE_ARCH}"

OMX_EVA_PREFIX = '${@base_conditional("USE_OMX_EVA_PKG", "1", "EVA", "", d )}'

# SRC file name
SRC_URI_OMX = '${@base_conditional("USE_OMX_COMMON", "1", "file://${OMX_EVA_PREFIX}RTM0AC0000XCMCTL30SL40C.tar.bz2;unpack=0", "", d )}'
SRC_URI_VCMND = '${@base_conditional("USE_VIDEO_DEC", "1", "file://${OMX_EVA_PREFIX}RTM0AC0000XVCMND30SL40C.tar.bz2;unpack=0", "", d )}'
SRC_URI_VCMNE = '${@base_conditional("USE_VIDEO_ENC", "1", "file://${OMX_EVA_PREFIX}RTM0AC0000XVCMNE30SL40C.tar.bz2;unpack=0", "", d )}'
SRC_URI_H263D = '${@base_conditional("USE_H263D_OMX", "1", "file://${OMX_EVA_PREFIX}RTM0AC0000XV263D30SL40C.tar.bz2", "", d )}'
SRC_URI_H264D = '${@base_conditional("USE_H264D_OMX", "1", "file://${OMX_EVA_PREFIX}RTM0AC0000XV264D30SL40C.tar.bz2", "", d )}'
SRC_URI_H264E = '${@base_conditional("USE_H264E_OMX", "1", "file://${OMX_EVA_PREFIX}RTM0AC0000XV264E30SL40C.tar.bz2", "", d )}'
SRC_URI_H265D = '${@base_conditional("USE_H265D_OMX", "1", "file://${OMX_EVA_PREFIX}RTM0AC0000XV265D30SL40C.tar.bz2", "", d )}'
SRC_URI_MPEG2D = '${@base_conditional("USE_MPEG2D_OMX", "1", "file://${OMX_EVA_PREFIX}RTM0AC0000XVM2VD30SL40C.tar.bz2", "", d )}'
SRC_URI_MPEG4D = '${@base_conditional("USE_MPEG4D_OMX", "1", "file://${OMX_EVA_PREFIX}RTM0AC0000XVM4VD30SL40C.tar.bz2", "", d )}'
SRC_URI_VC1D = '${@base_conditional("USE_VC1D_OMX", "1", "file://${OMX_EVA_PREFIX}RTM0AC0000XVVC1D30SL40C.tar.bz2", "", d )}'
SRC_URI_DIVXD = '${@base_conditional("USE_DIVXD_OMX", "1", "file://${OMX_EVA_PREFIX}RTM0AC0000XVDVXD30SL40C.tar.bz2", "", d )}'
SRC_URI_RVD = '${@base_conditional("USE_RVD_OMX", "1", "file://${OMX_EVA_PREFIX}RTM0AC0000XVRLVD30SL40C.tar.bz2", "", d )}'
SRC_URI_ACMND = '${@base_conditional("USE_AUDIO_OMX", "1", "file://RTM0AC0000XACMND30SL40C.tar.gz", "", d )}'
SRC_URI_AACLC = '${@base_conditional("USE_AACLCD_OMX", "1", "file://RTM0AC0000XAAACD30SL40C.tar.gz", "", d )}'
SRC_URI_AACPV2 = '${@base_conditional("USE_AACPV2D_OMX", "1", "file://RTM0AC0000XAAAPD30SL40C.tar.gz", "", d )}'
SRC_URI_MP3 = '${@base_conditional("USE_MP3D_OMX", "1", "file://RTM0AC0000XAMP3D30SL40C.tar.gz", "", d )}'
SRC_URI_AACLCE = '${@base_conditional("USE_AACLCE_OMX", "1", "file://RTM0AC0000XAAACE30SL40C.tar.gz", "", d )}'
SRC_URI_WMA = '${@base_conditional("USE_WMAD_OMX", "1", "file://RTM0AC0000XAWMAD30SL40C.tar.gz", "", d )}'
SRC_URI_ALACD = '${@base_conditional("USE_ALACD_OMX", "1", "file://RTM0AC0000XAALAD30SL40C.tar.gz", "", d )}'
SRC_URI_FLACD = '${@base_conditional("USE_FLACD_OMX", "1", "file://RTM0AC0000XAFLAD30SL40C.tar.gz", "", d )}'
SRC_URI_DDD = '${@base_conditional("USE_DDD_OMX", "1", "file://RTM0AC0000XADD5D30SL40C.tar.gz", "", d )}'
SRC_URI_AACMZ = '${@base_conditional("USE_AACLC_MDW", "1", "file://RTM0AC0000ADAACMZ1SL40C.tar.gz", "", d )}'
SRC_URI_AACPV2MZ = '${@base_conditional("USE_AACPV2_MDW", "1", "file://RTM0AC0000ADAAPMZ1SL40C.tar.gz", "", d )}'
SRC_URI_MP3MZ = '${@base_conditional("USE_MP3_MDW", "1", "file://RTM0AC0000ADMP3MZ1SL40C.tar.gz", "", d )}'
SRC_URI_WMAMZ = '${@base_conditional("USE_WMA_MDW", "1", "file://RTM0AC0000ADWMAMZ1SL40C.tar.gz", "", d )}'
SRC_URI_DDMZ = '${@base_conditional("USE_DD_MDW", "1", "file://RTM0AC0000ADDD5MZ1SL40C.tar.gz", "", d )}'
SRC_URI_AEAACMZ = '${@base_conditional("USE_AACLCE_MDW", "1", "file://RTM0AC0000AEAACMZ1SL40C.tar.gz", "", d )}'

SRC_URI = " \
    ${SRC_URI_OMX} \
    ${SRC_URI_VCMND} \
    ${SRC_URI_VCMNE} \
    ${SRC_URI_H263D} \
    ${SRC_URI_H264D} \
    ${SRC_URI_H264E} \
    ${SRC_URI_H265D} \
    ${SRC_URI_MPEG2D} \
    ${SRC_URI_MPEG4D} \
    ${SRC_URI_VC1D} \
    ${SRC_URI_DIVXD} \
    ${SRC_URI_RVD} \
    ${SRC_URI_ACMND} \
    ${SRC_URI_AACLC} \
    ${SRC_URI_AACPV2} \
    ${SRC_URI_MP3} \
    ${SRC_URI_WMA} \
    ${SRC_URI_ALACD} \
    ${SRC_URI_FLACD} \
    ${SRC_URI_DDD} \
    ${SRC_URI_AACLCE} \
    ${SRC_URI_AACMZ} \
    ${SRC_URI_AACPV2MZ} \
    ${SRC_URI_MP3MZ} \
    ${SRC_URI_WMAMZ} \
    ${SRC_URI_DDMZ} \
    ${SRC_URI_AEAACMZ} \
"

# SRC directory name
OMX_COMMON_SRC = '${@base_conditional("USE_OMX_COMMON", "1", "${OMX_EVA_PREFIX}RTM0AC0000XCMCTL30SL40C", "", d )}'
OMX_VIDEO_DEC_COMMON_SRC = '${@base_conditional("USE_VIDEO_DEC", "1", "${OMX_EVA_PREFIX}RTM0AC0000XVCMND30SL40C", "", d )}'
OMX_VIDEO_ENC_COMMON_SRC = '${@base_conditional("USE_VIDEO_ENC", "1", "${OMX_EVA_PREFIX}RTM0AC0000XVCMNE30SL40C", "", d )}'

OMX_H263_DEC_SRC = '${@base_conditional("USE_H263D_OMX", "1", "${OMX_EVA_PREFIX}RTM0AC0000XV263D30SL40C", "", d )}'
OMX_H264_DEC_SRC = '${@base_conditional("USE_H264D_OMX", "1", "${OMX_EVA_PREFIX}RTM0AC0000XV264D30SL40C", "", d )}'
OMX_H264_ENC_SRC = '${@base_conditional("USE_H264E_OMX", "1", "${OMX_EVA_PREFIX}RTM0AC0000XV264E30SL40C", "", d )}'
OMX_H265_DEC_SRC = '${@base_conditional("USE_H265D_OMX", "1", "${OMX_EVA_PREFIX}RTM0AC0000XV265D30SL40C", "", d )}'
OMX_MPEG2_DEC_SRC = '${@base_conditional("USE_MPEG2D_OMX", "1", "${OMX_EVA_PREFIX}RTM0AC0000XVM2VD30SL40C", "", d )}'
OMX_MPEG4_DEC_SRC = '${@base_conditional("USE_MPEG4D_OMX", "1", "${OMX_EVA_PREFIX}RTM0AC0000XVM4VD30SL40C", "", d )}'
OMX_VC1_DEC_SRC = '${@base_conditional("USE_VC1D_OMX", "1", "${OMX_EVA_PREFIX}RTM0AC0000XVVC1D30SL40C", "", d )}'
OMX_DIVX_DEC_SRC = '${@base_conditional("USE_DIVXD_OMX", "1", "${OMX_EVA_PREFIX}RTM0AC0000XVDVXD30SL40C", "", d )}'
OMX_RV_DEC_SRC = '${@base_conditional("USE_RVD_OMX", "1", "${OMX_EVA_PREFIX}RTM0AC0000XVRLVD30SL40C", "", d )}'

OMX_VIDEO_SRC_LIST = " \
    ${OMX_COMMON_SRC} \
    ${OMX_VIDEO_DEC_COMMON_SRC} \
    ${OMX_VIDEO_ENC_COMMON_SRC} \
    ${OMX_H263_DEC_SRC} \
    ${OMX_H264_DEC_SRC} \
    ${OMX_H264_ENC_SRC} \
    ${OMX_H265_DEC_SRC} \
    ${OMX_MPEG2_DEC_SRC} \
    ${OMX_MPEG4_DEC_SRC} \
    ${OMX_VC1_DEC_SRC} \
    ${OMX_DIVX_DEC_SRC} \
    ${OMX_RV_DEC_SRC} \
"

AAC_MIDDLEWARE_SRC = "RTM0AC0000ADAACMZ1SL40C"
AACPV2_MIDDLEWARE_SRC = "RTM0AC0000ADAAPMZ1SL40C"
MP3_MIDDLEWARE_SRC = "RTM0AC0000ADMP3MZ1SL40C"
WMA_MIDDLEWARE_SRC = "RTM0AC0000ADWMAMZ1SL40C"
DD_MIDDLEWARE_SRC = "RTM0AC0000ADDD5MZ1SL40C"
AEAAC_MIDDLEWARE_SRC = "RTM0AC0000AEAACMZ1SL40C"

OMX_AUDIO_COMMON_SRC = '${@base_conditional("USE_AUDIO_OMX", "1", "RTM0AC0000XACMND30SL40C", "", d )}'
OMX_AACLC_DEC_SRC = '${@base_conditional("USE_AACLCD_OMX", "1", "RTM0AC0000XAAACD30SL40C", "", d )}'
OMX_AACPV2_DEC_SRC = '${@base_conditional("USE_AACPV2D_OMX", "1", "RTM0AC0000XAAAPD30SL40C", "", d )}'
OMX_MP3_DEC_SRC = '${@base_conditional("USE_MP3D_OMX", "1", "RTM0AC0000XAMP3D30SL40C", "", d )}'
OMX_WMA_DEC_SRC = '${@base_conditional("USE_WMAD_OMX", "1", "RTM0AC0000XAWMAD30SL40C", "", d )}'
OMX_ALAC_DEC_SRC = '${@base_conditional("USE_ALACD_OMX", "1", "RTM0AC0000XAALAD30SL40C", "", d )}'
OMX_FLAC_DEC_SRC = '${@base_conditional("USE_FLACD_OMX", "1", "RTM0AC0000XAFLAD30SL40C", "", d )}'
OMX_DD_DEC_SRC = '${@base_conditional("USE_DDD_OMX", "1", "RTM0AC0000XADD5D30SL40C", "", d )}'
OMX_AACLC_ENC_SRC = '${@base_conditional("USE_AACLCE_OMX", "1", "RTM0AC0000XAAACE30SL40C", "", d )}'

OMX_AUDIO_SRC_LIST = " \
    ${OMX_AUDIO_COMMON_SRC} \
    ${OMX_AACLC_DEC_SRC} \
    ${OMX_AACPV2_DEC_SRC} \
    ${OMX_MP3_DEC_SRC} \
    ${OMX_WMA_DEC_SRC} \
    ${OMX_ALAC_DEC_SRC} \
    ${OMX_FLAC_DEC_SRC} \
    ${OMX_DD_DEC_SRC} \
    ${OMX_AACLC_ENC_SRC} \
"

S = "${WORKDIR}/omx/"

# Create ${S} directory
do_unpack_prepend() {
    os.system("install -d ${S}")
}

do_unpack_append() {
    bb.build.exec_func('setup_build_tree', d)
}

setup_build_tree() {
    for omxmc in ${OMX_COMMON_SRC} ${OMX_VIDEO_DEC_COMMON_SRC} ${OMX_VIDEO_ENC_COMMON_SRC}
    do
        tar xf ${WORKDIR}/${omxmc}.tar.bz2 -C ${WORKDIR}
        tar xf ${WORKDIR}/${omxmc}.tar.bz2 -C ${S} ${omxmc}/src --strip=2
        tar xf ${WORKDIR}/${omxmc}.tar.bz2 -C ${S} ${omxmc}/include --strip=1
    done
}

B = "${S}"

EXTRA_OECONF = "OMXR_DEFAULT_CONFIG_FILE_NAME=${sysconfdir}/omxr/omxr_config_base.txt"

do_configure() {
    export uvcsdrv_dir="${INCSHARED}"
    chmod u+x autogen.sh
{'fraction_non_alphanumeric': 0.1973202015574897, 'fraction_numerical': 0.0798786074209803, 'mean_word_length': 6.394157493649449, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6986695', 'n_tokens_mistral': 9267, 'n_tokens_neox': 8410, 'n_words': 854}