1 /*
2 * Copyright (c) 2021 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 "buffer_tracking.h"
17 #include "buffer_loop_tracking.h"
18
19 namespace OHOS::Camera {
AddTrackingStreamBegin(const int32_t trackingId,const int64_t poolId)20 void BufferTracking::AddTrackingStreamBegin(const int32_t trackingId, const int64_t poolId)
21 {
22 BufferLoopTracking& stalker = BufferLoopTracking::GetInstance();
23 stalker.AddTrackingStreamBegin(trackingId, poolId);
24
25 return;
26 }
27
AddTrackingStreamEnd(const int32_t trackingId)28 void BufferTracking::AddTrackingStreamEnd(const int32_t trackingId)
29 {
30 BufferLoopTracking& stalker = BufferLoopTracking::GetInstance();
31 stalker.AddTrackingStreamEnd(trackingId);
32
33 return;
34 }
35
DeleteTrackingStream(const int32_t trackingId)36 void BufferTracking::DeleteTrackingStream(const int32_t trackingId)
37 {
38 BufferLoopTracking& stalker = BufferLoopTracking::GetInstance();
39 stalker.DeleteTrackingStream(trackingId);
40 return;
41 }
42
AddTrackingNode(const int32_t trackingId,const std::string node)43 void BufferTracking::AddTrackingNode(const int32_t trackingId, const std::string node)
44 {
45 BufferLoopTracking& stalker = BufferLoopTracking::GetInstance();
46 stalker.AddTrackingNode(trackingId, node);
47 return;
48 }
49
ReportBufferLocation(const std::shared_ptr<BufferTrackingMessage> & message)50 void BufferTracking::ReportBufferLocation(const std::shared_ptr<BufferTrackingMessage>& message)
51 {
52 BufferLoopTracking& stalker = BufferLoopTracking::GetInstance();
53 stalker.SendBufferMovementMessage(message);
54 return;
55 }
56
StartTracking()57 void BufferTracking::StartTracking()
58 {
59 BufferLoopTracking& stalker = BufferLoopTracking::GetInstance();
60 stalker.StartTracking();
61 return;
62 }
63
StopTracking()64 void BufferTracking::StopTracking()
65 {
66 BufferLoopTracking& stalker = BufferLoopTracking::GetInstance();
67 stalker.StopTracking();
68 return;
69 }
70
IsNodeEmpty(const int32_t id,const std::string node)71 int32_t BufferTracking::IsNodeEmpty(const int32_t id, const std::string node)
72 {
73 BufferLoopTracking& stalker = BufferLoopTracking::GetInstance();
74 return stalker.IsEmpty(id, node);
75 }
76
IsNodeEmpty(const int32_t id,const std::string beginNode,const std::string endNode)77 int32_t BufferTracking::IsNodeEmpty(const int32_t id, const std::string beginNode, const std::string endNode)
78 {
79 BufferLoopTracking& stalker = BufferLoopTracking::GetInstance();
80 return stalker.IsEmpty(id, beginNode, endNode);
81 }
82
DumpBufferTrace(const int32_t id,BufferTraceGraph & graph)83 void BufferTracking::DumpBufferTrace(const int32_t id, BufferTraceGraph& graph)
84 {
85 BufferLoopTracking& stalker = BufferLoopTracking::GetInstance();
86 stalker.DumpTrace(id, graph);
87 return;
88 }
89 } // namespace OHOS::Camera
90