• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include <sched.h>
17 #include <signal.h>
18 #include <sys/time.h>
19 #include <sys/resource.h>
20 #include <hilog/log.h>
21 
22 #include "platform/common/rs_log.h"
23 #include "pipeline/main_thread/rs_render_service.h"
24 
25 using namespace OHOS;
26 using namespace OHOS::Rosen;
27 
main(int argc,const char * argv[])28 int main(int argc, const char *argv[])
29 {
30     signal(SIGPIPE, SIG_IGN);
31 
32     setpriority(PRIO_PROCESS, 0, -8);
33 
34     struct sched_param param = {0};
35     param.sched_priority = 1;
36     if (sched_setscheduler(0, SCHED_FIFO, &param) != 0) {
37         RS_LOGE("RSRenderService Couldn't set SCHED_FIFO.");
38     } else {
39         RS_LOGE("RSRenderService set SCHED_FIFO succeed.");
40     }
41 
42     sptr<RSRenderService> renderService(new RSRenderService());
43     if (!renderService->Init()) {
44         RS_LOGE("RSRenderService init failed.");
45         return -1;
46     }
47 
48     renderService->Run();
49 
50     return 0;
51 }
52