4 * Copyright (c) 2022 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: jaekyu shim <jae915@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 /*=======================================================================================
24 ========================================================================================*/
25 #ifdef _MMCAMCORDER_CAMERA_BOOST_SUPPORT
26 #include <boost-api.h>
27 #include "mm_camcorder_internal.h"
28 #include "mm_camcorder_boost.h"
31 static void __apply_thread_boosting(const boost_generic_info_t *generic_info)
34 const char *thread_list[] = {
39 const int thread_list_size = sizeof(thread_list) / sizeof(char *);
43 for (int i = 0 ; i < thread_list_size ; i++) {
44 ret = boost_request_by_thread_name(pid, thread_list[i], (const boost_info_t *)generic_info);
45 MMCAM_LOG_INFO("apply boosting thread[%11s], event[%d], sched[%d] : ret[%d]",
46 thread_list[i], generic_info->event, generic_info->sched, ret);
50 void _mmcamcorder_start_boosting(void)
52 boost_generic_info_t generic_info = {
53 .parent.framework_type = BOOST_GENERIC,
54 .event = BOOST_GENERIC_EVENT_START,
55 .group = BOOST_CGROUP_END,
56 .sched = BOOST_API_SCHED_RR,
60 __apply_thread_boosting(&generic_info);
63 void _mmcamcorder_stop_boosting(void)
65 boost_generic_info_t generic_info = {
66 .parent.framework_type = BOOST_GENERIC,
67 .event = BOOST_GENERIC_EVENT_STOP,
68 .group = BOOST_CGROUP_END,
69 .sched = BOOST_API_SCHED_OTHER,
73 __apply_thread_boosting(&generic_info);
76 #endif /* _MMCAMCORDER_CAMERA_BOOST_SUPPORT*/