From 76d0a0a8b5e63037c9418126921337732143de48 Mon Sep 17 00:00:00 2001 From: Andrew Mahone Date: Fri, 8 Jul 2011 21:22:22 -0400 Subject: [PATCH] Build specialized mediaserver that loads Yamaha service library. Change-Id: Ie61fa8ee537fed093014fa0e3a01d149c1b31b86 --- common.mk | 3 +- mediaserver/Android.mk | 26 ++++++++++++++++ mediaserver/main_mediaserver.cpp | 52 ++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 mediaserver/Android.mk create mode 100644 mediaserver/main_mediaserver.cpp diff --git a/common.mk b/common.mk index 428df4a..abd17e4 100644 --- a/common.mk +++ b/common.mk @@ -43,7 +43,8 @@ DEVICE_PACKAGE_OVERLAYS := device/samsung/c1-common/overlay PRODUCT_PACKAGES := \ gps.smdkv310 \ sensors.smdkv310 \ - lights.smdkv310 + lights.smdkv310 \ + mediaserver.smdkv310 # These are the hardware-specific configuration files PRODUCT_COPY_FILES := \ diff --git a/mediaserver/Android.mk b/mediaserver/Android.mk new file mode 100644 index 0000000..23ad8ba --- /dev/null +++ b/mediaserver/Android.mk @@ -0,0 +1,26 @@ +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_SRC_FILES:= \ + main_mediaserver.cpp + +LOCAL_SHARED_LIBRARIES := \ + libaudioflinger \ + libcameraservice \ + libmediaplayerservice \ + libmediayamahaservice \ + libutils \ + libbinder + +base := $(TOP)/frameworks/base + +LOCAL_C_INCLUDES := \ + $(base)/services/audioflinger \ + $(base)/services/camera/libcameraservice \ + $(base)/media/libmediaplayerservice + +LOCAL_MODULE:= mediaserver.smdkv310 +LOCAL_MODULE_STEM := mediaserver +LOCAL_MODULE_TAGS := optional + +include $(BUILD_EXECUTABLE) diff --git a/mediaserver/main_mediaserver.cpp b/mediaserver/main_mediaserver.cpp new file mode 100644 index 0000000..91530c7 --- /dev/null +++ b/mediaserver/main_mediaserver.cpp @@ -0,0 +1,52 @@ +/* +** +** Copyright 2008, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +// System headers required for setgroups, etc. +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +using namespace android; + +namespace android { namespace yamaha { namespace media { +void InstantiateService(void); +} } } + +int main(int argc, char** argv) +{ + sp proc(ProcessState::self()); + sp sm = defaultServiceManager(); + LOGI("ServiceManager: %p", sm.get()); + yamaha::media::InstantiateService(); + AudioFlinger::instantiate(); + MediaPlayerService::instantiate(); + CameraService::instantiate(); + AudioPolicyService::instantiate(); + ProcessState::self()->startThreadPool(); + IPCThreadState::self()->joinThreadPool(); +}