Overview:
This CN contains initial port of helix to android 2.3 (gingerbread) and
a new android-gingerbread-arm.eabi build id. Most change are
superficial build fixes. With this, audio plays fine on a 2.3.1 Nexus
S. Video surf and hw decoder still need platform specific
porting/verification.
Branches:
hxclient_3_1_0_atlas and head
File added:
/cvsroot/ribosome/build/umakecf/android-2.2-arm.eabi.cf
Files modified:
/cvsroot/ribosome/build/lib/sysinfo.py
audio/device/platform/unix/audAndroid.cpp
audio/device/pub/platform/unix/audAndroid.h
audio/fixptresampler/core.h
client/core/hxmedengpln_android.pcf
player/kit/android/Attic/android.pcf
player/kit/android/Attic/clientcontext.h
player/kit/android/Attic/mediascanner.cpp
player/kit/android/Attic/sitesupplier.h
Qiang
# -*- python -*-
#
# ***** BEGIN LICENSE BLOCK *****
#
# Source last modified: $Id: android-gingerbread-arm.eabi.cf,v 1.2 2011/01/04
04:20:30 qluo Exp $
#
# Copyright Notices:
#
# Portions Copyright (c) 1995-2006 RealNetworks, Inc. All Rights Reserved.
#
# Patent Notices: This file may contain technology protected by one or
# more of the patents listed at www.helixcommunity.org
#
# 1. The contents of this file, and the files included with this file,
# are protected by copyright controlled by RealNetworks and its
# licensors, and made available by RealNetworks subject to the current
# version of the RealNetworks Public Source License (the "RPSL")
# available at * http://www.helixcommunity.org/content/rpsl unless
# you have licensed the file under the current version of the
# RealNetworks Community Source License (the "RCSL") available at
# http://www.helixcommunity.org/content/rcsl, in which case the RCSL
# will apply. You may also obtain the license terms directly from
# RealNetworks. You may not use this file except in compliance with
# the RPSL or, if you have a valid RCSL with RealNetworks applicable
# to this file, the RCSL. Please see the applicable RPSL or RCSL for
# the rights, obligations and limitations governing use of the
# contents of the file.
#
# 2. Alternatively, the contents of this file may be used under the
# terms of the GNU General Public License Version 2 (the
# "GPL") in which case the provisions of the GPL are applicable
# instead of those above. Please note that RealNetworks and its
# licensors disclaim any implied patent license under the GPL.
# If you wish to allow use of your version of this file only under
# the terms of the GPL, and not to allow others
# to use your version of this file under the terms of either the RPSL
# or RCSL, indicate your decision by deleting Paragraph 1 above
# and replace them with the notice and other provisions required by
# the GPL. If you do not delete Paragraph 1 above, a recipient may
# use your version of this file under the terms of any one of the
# RPSL, the RCSL or the GPL.
#
# This file is part of the Helix DNA Technology. RealNetworks is the
# developer of the Original Code and owns the copyrights in the
# portions it created. Copying, including reproducing, storing,
# adapting or translating, any or all of this material other than
# pursuant to the license terms referred to above requires the prior
# written consent of RealNetworks and its licensors
#
# This file, and the files included with this file, is distributed
# and made available by RealNetworks on an 'AS IS' basis, WITHOUT
# WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS
# AND ITS LICENSORS HEREBY DISCLAIM ALL SUCH WARRANTIES, INCLUDING
# WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS
# FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
#
# Technology Compatibility Kit Test Suite(s) Location:
# http://www.helixcommunity.org/content/tck
#
# Contributor(s):
#
# ***** END LICENSE BLOCK *****
#
"""Helix DNA for Android """
# base cf file. build for 'generic' target by default
# setup target product, the value can be set from parent cf file
# or the Android environment variable
try:
android_product
except NameError:
try:
android_product = os.environ['TARGET_PRODUCT']
except KeyError:
android_product = 'generic'
# put the TARGET_PRODUCT in the project define
project.AddDefines('ANDROID_PRODUCT=' + '"' + android_product + '"')
project.AddDefines('ANDROID_PRODUCT_' + android_product)
# these should stay the same for all board target
android_arch = 'arm'
android_toolchain_arch = 'arm-eabi'
android_toolchain_ver = '4.4.3'
## linux cross-compiling host
exec_config_file('linux-common.cf')
## run assembly files through gcc
platform.build_rules['.s'] = BuildRule('.s', '.o', cxx)
if project.BuildOption("debug"):
project.output_dir = "android-dbg"
else:
project.output_dir = "android-rel"
## list of PCF files to run
platform.pcf_prefix_list = ["unix", "linux2", "android"]
## platform defines
project.AddDefines('ANDROID', 'ANDROID_2_3', 'ANDROID_GINGERBREAD')
## ARM defines
## ARM_COTULLA = ARMv5E DSP
project.AddDefines('ARM', '_ARM', 'ARM_COTULLA')
## Turn on threads for all areas.
project.AddDefines("THREADS_SUPPORTED")
## This define enables compiling of the UnixThreads file.
## It means that that platform has a working threads lib
## that does everything we need.
project.AddDefines("_UNIX_THREADS_SUPPORTED")
project.AddDefines("_UNIX_THREADED_NETWORK_IO")
## use fixed point math for now
project.AddDefines('HELIX_CONFIG_FIXEDPOINT')
## Android sys/stat.h misses these
project.AddDefines('S_IREAD=0x400')
project.AddDefines('S_IWRITE=0x200')
project.AddDefines('INET6_ADDRSTRLEN=46')
## no X-Window
project.RemoveDefines("USE_XWINDOWS")
project.AddDefines("HELIX_CONFIG_NO_XWINDOWS")
project.RemoveDefines("HELIX_FEATURE_ALSA")
## Android source distribution
android_source = GetSDKPath("android_source")
## toolchain binaries
android_toolchain = android_source + '/prebuilt/linux-x86/toolchain/' +
android_toolchain_arch + '-' + android_toolchain_ver + '/'
## android out lib
android_out_lib = android_source + '/out/target/product/' + android_product +
'/obj/lib'
## system include paths
project.AddIncludes(android_source + '/bionic/libc/include')
project.AddIncludes(android_source + '/bionic/libc/arch-' + android_arch +
'/include')
project.AddIncludes(android_source + '/bionic/libc/kernel/common')
project.AddIncludes(android_source + '/bionic/libc/kernel/arch-' + android_arch)
project.AddIncludes(android_source + '/bionic/libm/include')
project.AddIncludes(android_source + '/system/core/include')
project.AddIncludes(android_source + '/hardware/libhardware/include')
project.AddIncludes(android_source + '/frameworks/base/include')
## system lib paths
project.AddSystemPaths('-L' + android_out_lib)
## add android LOG support for helix
project.AddSystemLibraries('log')
## cross compiling tools
platform.cc.cmd = android_toolchain + 'bin/arm-eabi-gcc'
platform.cxx.cmd = android_toolchain + 'bin/arm-eabi-g++'
soslim = android_source + '/out/host/linux-x86/bin/soslim'
project.AddDefines("__GCC__", "__GCC42__", "__GCC44__")
## sub cf file can override CPU flags
try:
cpu_flags
except NameError:
cpu_flags = "-march=armv5te -mtune=xscale"
## CXX args
platform.cxx.args["default"] = platform.cxx.args["default"] + " -fpermissive
-fno-short-enums " + \
"-fno-exceptions -Wno-multichar -msoft-float -fstack-protector -fpic
-ffunction-sections -fdata-sections " + \
cpu_flags + " -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__
-D__ARM_ARCH_5TE__ -mthumb-interwork " + \
"-fmessage-length=0 -W -Wall -Wno-unused -Wstrict-aliasing=2
-finline-functions " + \
"-fgcse-after-reload -frerun-cse-after-loop -frename-registers
-fvisibility-inlines-hidden " + \
"-fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -fno-rtti -MD
-funwind-tables " + \
"-include " + android_source + "/system/core/include/arch/linux-" +
android_arch + "/AndroidConfig.h " + \
"-include " + android_source + "/bionic/libc/include/string.h"
## Thumb build for release
platform.cxx.args["release"] = "-mthumb -D__MARM_THUMB__ -DTHUMB"
## linker options
libgcc = android_toolchain + 'lib/gcc/' + android_toolchain_arch + '/' +
android_toolchain_ver + '/libgcc.a'
## Linker
project.RemoveSystemPaths('-L/usr/X11R6/lib')
class AndroidLinker(GCCLinker):
def __init__(self):
GCCLinker.__init__(self)
self.make_var = 'LD'
self.make_flags = 'LDFLAGS'
self.ldcmd = platform.cxx.cmd
self.ldargs = ""
self.args["default"] = ""
def execute_lib(self, target, objects, static_libs, dynamic_libs):
ld_cmd = form_string(
platform.form_var(self.make_var),
platform.form_var(self.make_flags),
"-o", target, objects, static_libs)
return ld_cmd
def execute_dll(self, target, objects, static_libs, dynamic_libs):
ld_cmd = form_string(
platform.form_var(self.make_var),
platform.form_var(self.make_flags),
"-o", target, objects,
"-Wl,--start-group", static_libs, "-Wl,--end-group ", libgcc,
"-lcutils",
self.link_paths(), dynamic_libs)
##run soslim to reduce size for release build
if project.BuildOption("release"):
soslim_cmd = form_string(soslim, "--strip --shady --quiet",
target)
ld_cmd += ";" + soslim_cmd
return ld_cmd
def execute_exe(self, target, objects, static_libs, dynamic_libs):
ld_cmd = form_string(
platform.form_var(self.make_var),
platform.form_var(self.make_flags),
"-o", target, objects,
"-Wl,--start-group", static_libs, "-Wl,--end-group ", libgcc,
"-lcutils",
self.link_paths(), dynamic_libs)
##run soslim to reduce size for release build
if project.BuildOption("release"):
soslim_cmd = form_string(soslim, "--strip --shady --quiet",
target)
ld_cmd += ";" + soslim_cmd
return ld_cmd
def execute(self, target, objects, static_libs, dynamic_libs):
if project.getTargetType() == "dll":
return self.execute_dll(target, objects, static_libs, dynamic_libs)
elif project.getTargetType() == "exe":
return self.execute_exe(target, objects, static_libs, dynamic_libs)
elif project.getTargetType() == "lib":
return self.execute_lib(target, objects, static_libs, dynamic_libs)
else:
fatal("unknown target type=\"%s\"" % (project.getTargetType()))
def set_type(self):
self.cmd = self.ldcmd
if project.getTargetType() == 'dll':
self.args["default"] = '-nostdlib -Wl,-T,' + android_source +
'/build/core/armelf.xsc' + \
' -Wl,--gc-sections -Wl,-shared,-Bsymbolic' + \
' -Wl,-rpath-link=' + android_out_lib + ' -lc -lstdc++ -lm -ldl
-Wl,--no-undefined'
else:
self.args["default"] = '-nostdlib -Bdynamic -Wl,-T,' +
android_source + '/build/core/armelf.x' + \
' -Wl,-dynamic-linker,/system/bin/linker -Wl,--gc-sections
-Wl,-z,nocopyreloc' + \
' -Wl,-rpath-link=' + android_out_lib + ' -lc -lstdc++ -lm
-Wl,--no-undefined' + \
' ' + android_out_lib + '/crtbegin_dynamic.o' + ' ' +
android_out_lib + \
'/crtend_android.o'
platform.link = AndroidLinker()
Index: sysinfo.py
===================================================================
RCS file: /cvsroot/ribosome/build/lib/sysinfo.py,v
retrieving revision 1.166
retrieving revision 1.167
diff -u -r1.166 -r1.167
--- sysinfo.py 2 Dec 2010 22:18:00 -0000 1.166
+++ sysinfo.py 1 Jan 2011 03:38:54 -0000 1.167
@@ -1,7 +1,7 @@
#
# ***** BEGIN LICENSE BLOCK *****
#
-# Source last modified: $Id: sysinfo.py,v 1.166 2010/12/02 22:18:00 sfu Exp $
+# Source last modified: $Id: sysinfo.py,v 1.167 2011/01/01 03:38:54 qluo Exp
$
#
# Copyright Notices:
#
@@ -1626,6 +1626,14 @@
family_list = ['unix', 'linux', 'linux2', 'android', 'android-arm',
'android-froyo-armv7'] ))
+AddPlatform(Platform(
+ id = 'android-gingerbread-arm.eabi',
+ platform = 'android',
+ arch = 'arm',
+ distribution_id = 'android-gingerbread-arm.eabi',
+ family_list = ['unix', 'linux', 'linux2', 'android', 'android-arm',
+ 'android-gingerbread-arm.eabi'] ))
+
## returns the output of uname stripped
def uname_output(options = ''):
text = os.popen('uname %s' % (options), 'r').read()
Index: device/platform/unix/audAndroid.cpp
===================================================================
RCS file: /cvsroot/audio/device/platform/unix/audAndroid.cpp,v
retrieving revision 1.1.2.11
diff -u -r1.1.2.11 audAndroid.cpp
--- device/platform/unix/audAndroid.cpp 3 Dec 2010 03:15:52 -0000 1.1.2.11
+++ device/platform/unix/audAndroid.cpp 4 Jan 2011 04:21:13 -0000
@@ -89,15 +89,19 @@
virtual uint32_t latency() const { return 0; } //TODO: real latency
virtual float msecsPerFrame() const { return m_ulSampleRate ?
1000.0 / m_ulSampleRate : 0; }
-#ifdef ANDROID_2_2
+#if defined(ANDROID_2_2) || defined(ANDROID_2_3)
virtual status_t getPosition(uint32_t *position) { return 0; }
#endif
+#if defined(ANDROID_2_3)
+ virtual int getSessionId() { return 0; }
+#endif
+
virtual status_t open(uint32_t sampleRate, int channelCount,
#ifndef ANDROID_RELEASE_1
int
format=AudioSystem::PCM_16_BIT,
#endif
-#if defined(ANDROID_ECLAIR) || defined(ANDROID_FROYO)
+#if defined(ANDROID_ECLAIR) || defined(ANDROID_FROYO) ||
defined(ANDROID_GINGERBREAD)
int bufferCount=4,
AudioCallback cb = NULL,
void *cookie = NULL)
Index: device/pub/platform/unix/audAndroid.h
===================================================================
RCS file: /cvsroot/audio/device/pub/platform/unix/audAndroid.h,v
retrieving revision 1.1.2.6
diff -u -r1.1.2.6 audAndroid.h
--- device/pub/platform/unix/audAndroid.h 3 Dec 2010 03:15:52 -0000
1.1.2.6
+++ device/pub/platform/unix/audAndroid.h 4 Jan 2011 04:21:13 -0000
@@ -56,7 +56,7 @@
#include <sys/prctl.h>
#include <sys/resource.h>
-#if defined(ANDROID_ECLAIR) || defined(ANDROID_FROYO)
+#if defined(ANDROID_ECLAIR) || defined(ANDROID_FROYO) ||
defined(ANDROID_GINGERBREAD)
#include <binder/MemoryHeapBase.h>
#include <binder/MemoryBase.h>
#else
Index: fixptresampler/core.h
===================================================================
RCS file: /cvsroot/audio/fixptresampler/core.h,v
retrieving revision 1.2.10.3
diff -u -r1.2.10.3 core.h
--- fixptresampler/core.h 8 Jul 2010 01:53:45 -0000 1.2.10.3
+++ fixptresampler/core.h 4 Jan 2011 04:21:13 -0000
@@ -40,9 +40,9 @@
* Internal state.
*/
-#if !defined(LG_PORT) && !defined(ANDROID_2_2)
+#if !defined(LG_PORT) && !defined(ANDROID_2_2) && !defined(ANDROID_2_3)
typedef unsigned int uint;
-#endif //LG_PORT, ANDROID_2_2
+#endif //LG_PORT, ANDROID_2_2, ANDROID_2_3
typedef struct state_t {
int up;
Index: hxmedengpln_android.pcf
===================================================================
RCS file: /cvsroot/client/core/hxmedengpln_android.pcf,v
retrieving revision 1.1.2.4
diff -u -r1.1.2.4 hxmedengpln_android.pcf
--- hxmedengpln_android.pcf 3 Dec 2010 03:11:52 -0000 1.1.2.4
+++ hxmedengpln_android.pcf 4 Jan 2011 05:10:54 -0000
@@ -49,7 +49,7 @@
# ***** END LICENSE BLOCK *****
#
-if project.IsDefined("ANDROID_ECLAIR") or project.IsDefined("ANDROID_FROYO"):
+if project.IsDefined("ANDROID_ECLAIR") or project.IsDefined("ANDROID_FROYO")
or project.IsDefined("ANDROID_GINGERBREAD"):
project.AddSystemLibraries("media", "utils");
else:
project.AddSystemLibraries("corecg", "media", "utils", "log");
Index: android.pcf
===================================================================
RCS file: /cvsroot/player/kit/android/Attic/android.pcf,v
retrieving revision 1.3.2.6
diff -u -r1.3.2.6 android.pcf
--- android.pcf 3 Dec 2010 03:32:56 -0000 1.3.2.6
+++ android.pcf 4 Jan 2011 05:16:04 -0000
@@ -48,7 +48,7 @@
# Android shared libraries
-if project.IsDefined("ANDROID_ECLAIR") or project.IsDefined("ANDROID_FROYO"):
+if project.IsDefined("ANDROID_ECLAIR") or project.IsDefined("ANDROID_FROYO")
or project.IsDefined("ANDROID_GINGERBREAD"):
project.AddSystemLibraries('utils', 'media', 'binder', 'ui', 'skia')
else:
project.AddSystemLibraries('utils', 'media', 'log', 'corecg', 'ui',
'sgl')
Index: clientcontext.h
===================================================================
RCS file: /cvsroot/player/kit/android/Attic/clientcontext.h,v
retrieving revision 1.1.2.8
diff -u -r1.1.2.8 clientcontext.h
--- clientcontext.h 3 Dec 2010 03:33:33 -0000 1.1.2.8
+++ clientcontext.h 4 Jan 2011 05:16:04 -0000
@@ -57,13 +57,13 @@
class AndroidPDStatusObserver;
class AndroidSiteSupplier;
-#if defined(ANDROID_2_2)
+#if defined(ANDROID_2_2) || defined(ANDROID_2_3)
#include <surfaceflinger/ISurface.h>
#else
#include <ui/ISurface.h>
#endif
-#if defined(ANDROID_ECLAIR) || defined(ANDROID_FROYO)
+#if defined(ANDROID_ECLAIR) || defined(ANDROID_FROYO) ||
defined(ANDROID_GINGERBREAD)
#include <binder/MemoryBase.h>
#include <binder/MemoryHeapBase.h>
#else
Index: mediascanner.cpp
===================================================================
RCS file: /cvsroot/player/kit/android/Attic/mediascanner.cpp,v
retrieving revision 1.1.2.18
diff -u -r1.1.2.18 mediascanner.cpp
--- mediascanner.cpp 3 Dec 2010 03:37:01 -0000 1.1.2.18
+++ mediascanner.cpp 4 Jan 2011 05:16:04 -0000
@@ -6,7 +6,7 @@
#include <stdio.h>
#include <media/mediametadataretriever.h>
#include <media/thread_init.h>
-#if defined(ANDROID_ECLAIR) || defined(ANDROID_FROYO)
+#if defined(ANDROID_ECLAIR) || defined(ANDROID_FROYO) ||
defined(ANDROID_GINGERBREAD)
#include <utils/StringArray.h>
#else
#include <utils/string_array.h>
Index: sitesupplier.h
===================================================================
RCS file: /cvsroot/player/kit/android/Attic/sitesupplier.h,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 sitesupplier.h
--- sitesupplier.h 3 Dec 2010 14:40:43 -0000 1.1.2.3
+++ sitesupplier.h 4 Jan 2011 05:16:04 -0000
@@ -49,7 +49,7 @@
#ifndef _ANDROID_SITE_SUPPLIER_H_
#define _ANDROID_SITE_SUPPLIER_H_
-#if defined(ANDROID_2_2)
+#if defined(ANDROID_2_2) || defined(ANDROID_2_3)
#include <surfaceflinger/ISurface.h>
#else
#include <ui/ISurface.h>
_______________________________________________
Audio-dev mailing list
[email protected]
http://lists.helixcommunity.org/mailman/listinfo/audio-dev