1 /*
2  * Copyright (C) 2019 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef HARDWARE_GOOGLE_CAMERA_HAL_UTILS_PROFILER_UTIL_H
18 #define HARDWARE_GOOGLE_CAMERA_HAL_UTILS_PROFILER_UTIL_H
19 
20 #include <string>
21 
22 namespace android {
23 namespace google_camera_hal {
24 
25 constexpr char kFirstFrame[] = "First frame";
26 constexpr char kHalTotal[] = "HAL Total";
27 constexpr char kIdleString[] = "<-- IDLE -->";
28 constexpr char kOverall[] = "Overall";
29 
30 enum class EventType {
31   kNone,
32   kOpen,
33   kConfigureStream,
34   kFlush,
35   kClose,
36   kFirstFrameStart,
37   kFirstFrameEnd,
38 };
39 
EventTypeToString(EventType type)40 inline std::string EventTypeToString(EventType type) {
41   switch (type) {
42     case (EventType::kNone):
43       return std::string("None");
44     case (EventType::kOpen):
45       return std::string("Open");
46     case (EventType::kConfigureStream):
47       return std::string("ConfigureStream");
48     case (EventType::kFlush):
49       return std::string("Flush");
50     case (EventType::kClose):
51       return std::string("Close");
52     case (EventType::kFirstFrameStart):
53       return std::string("FirstFrameStart");
54     case (EventType::kFirstFrameEnd):
55       return std::string("FirstFrameEnd");
56   }
57 }
58 
59 }  // namespace google_camera_hal
60 }  // namespace android
61 
62 #endif  // HARDWARE_GOOGLE_CAMERA_HAL_UTILS_PROFILER_UTIL_H
63