unplugged-vendor/frameworks/av/media/mediaserver/main_mediahelper.cpp

54 lines
1.4 KiB
C++
Executable File

/*
**
** 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.
*/
#define LOG_TAG "mediaserver"
//#define LOG_NDEBUG 0
#include <utils/Log.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
#include <cutils/properties.h>
int main(int argc __unused, char **argv __unused)
{
char value[PROPERTY_VALUE_MAX];
memset(value,0,sizeof(value));
int prefer64 = 0;
if(property_get("ro.vendor.mtk_prefer_64bit_proc", value, NULL)) {
prefer64 = atoi(value);
}
ALOGD("start mediaserver in 64-bit=%d", prefer64);
int ret = 0;
if(prefer64 == 1){
ret = execl("/system/bin/mediaserver64","mediaserver64",NULL);
}else {
ret = execl("/system/bin/mediaserver","mediaserver",NULL);
}
if(ret == -1){
ALOGD("start mediaserver fail ... %d:%s", errno, strerror(errno));
}
}