39 lines
1.1 KiB
C++
39 lines
1.1 KiB
C++
/*
|
|
* Copyright (c) 2026 Amlogic, Inc. All rights reserved.
|
|
*
|
|
* This source code is subject to the terms and conditions defined in the
|
|
* file 'LICENSE' which is part of this source code package.
|
|
*
|
|
* Description: Aml MP Service Main Entry
|
|
*/
|
|
|
|
#include <android/binder_process.h>
|
|
#include <android/binder_manager.h>
|
|
#include <log/log.h>
|
|
|
|
#include "AmlMpPlayerService.h"
|
|
|
|
using namespace com::amlogic::aml_mp::player;
|
|
std::shared_ptr<AmlMpPlayerService> gSelfService;
|
|
|
|
int main() {
|
|
ALOGI("Starting Aml MP Service...");
|
|
|
|
const std::string serviceName = std::string(IAmlMpPlayer::descriptor) + "/default";
|
|
|
|
auto playerService = ndk::SharedRefBase::make<AmlMpPlayerService>();
|
|
gSelfService = playerService;
|
|
ndk::SpAIBinder binder = playerService->asBinder();
|
|
binder_status_t status = AServiceManager_addService(binder.get(), serviceName.c_str());
|
|
if (status != STATUS_OK) {
|
|
return -1;
|
|
}
|
|
|
|
ABinderProcess_setThreadPoolMaxThreadCount(32);
|
|
ALOGI("Binder thread pool set max thread ");
|
|
ABinderProcess_joinThreadPool();
|
|
ALOGI("Aml MP Service started successfully");
|
|
|
|
return 0;
|
|
}
|