/* * Copyright (c) Hisilicon Technologies Co., Ltd.. 2016-2019. All rights reserved. * Description: bootvideo main and start bootvideo */ #include #include #include #include #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; }