• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 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 #ifndef OHOS_CAMERA_REPORT_DFX_UITLS_H
17 #define OHOS_CAMERA_REPORT_DFX_UITLS_H
18 
19 #include <map>
20 #include <refbase.h>
21 
22 namespace OHOS {
23 namespace CameraStandard {
24 class CameraReportDfxUtils : public RefBase {
25 public:
26     static sptr<CameraReportDfxUtils> &GetInstance();
27 
28     void SetFirstBufferStartInfo();
29     void SetFirstBufferEndInfo();
30 
31     void SetPrepareProxyStartInfo();
32     void SetPrepareProxyEndInfo();
33 
34     void SetAddProxyStartInfo();
35     void SetAddProxyEndInfo();
36 
37 private:
38     std::mutex mutex_;
39 
40     uint64_t setFirstBufferStartTime_;
41     uint64_t setFirstBufferEndTime_;
42     bool isBufferSetting_;
43 
44     uint64_t setPrepareProxyStartTime_;
45     uint64_t setPrepareProxyEndTime_;
46     bool isPrepareProxySetting_;
47 
48     uint64_t setAddProxyStartTime_;
49     uint64_t setAddProxyEndTime_;
50     bool isAddProxySetting_;
51 
52     static sptr<CameraReportDfxUtils> cameraReportDfx_;
53     static std::mutex instanceMutex_;
54 
55     void ReportPerformanceDeferredPhoto();
56 };
57 } // namespace CameraStandard
58 } // namespace OHOS
59 #endif // OHOS_CAMERA_REPORT_DFX_UITLS_H