You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.2 KiB
45 lines
1.2 KiB
4 months ago
|
/*
|
||
|
* Copyright (c) Hisilicon Technologies Co., Ltd.. 2016-2019. All rights reserved.
|
||
|
* Description: bootvideo main and start bootvideo
|
||
|
*/
|
||
|
|
||
|
#include <sys/resource.h>
|
||
|
#include <utils/Log.h>
|
||
|
#include <cutils/klog.h>
|
||
|
#include <cutils/properties.h>
|
||
|
|
||
|
#include "BootvideoManager.h"
|
||
|
|
||
|
#undef LOG_TAG
|
||
|
#define LOG_TAG "BootVideo"
|
||
|
|
||
|
using namespace android;
|
||
|
|
||
|
int main(const int argc, const char **argv)
|
||
|
{
|
||
|
(void)argc;
|
||
|
(void)argv;
|
||
|
int count = 0;
|
||
|
const int waitPropCount = 100; // try to wait prop service 1 sec
|
||
|
const int waitPropDelay = 10000; // delay is 10ms
|
||
|
char bootop[PROPERTY_VALUE_MAX] = {0};
|
||
|
while (!property_get("service.bootop.type", bootop, nullptr)) {
|
||
|
// bootvideo starts at on init process, property may not load ready,
|
||
|
// try to wait a while...
|
||
|
count++;
|
||
|
if (count >= waitPropCount) {
|
||
|
break;
|
||
|
}
|
||
|
usleep(waitPropDelay);
|
||
|
}
|
||
|
ALOGD("Get bootop is %s", bootop);
|
||
|
if (strncmp(bootop, "bootvideo", strlen("bootvideo"))) {
|
||
|
ALOGD("property is not bootvideo");
|
||
|
return 0;
|
||
|
}
|
||
|
ALOGD("Bootvideo start to play!");
|
||
|
StartPlayBootvideo();
|
||
|
ALOGD("Bootvideo finished!");
|
||
|
return 0;
|
||
|
}
|