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 #include <memory>
18 
19 #include <stats_event.h>
20 #include <StatsdLog.h>
21 
22 namespace android {
23 namespace mediametrics {
24 class Item;
25 }
26 
27 using statsd_pusher = bool (const std::shared_ptr<const mediametrics::Item>& item,
28          const std::shared_ptr<mediametrics::StatsdLog>& statsdLog);
29 // component specific dumpers
30 extern statsd_pusher statsd_audiopolicy;
31 extern statsd_pusher statsd_audiorecord;
32 extern statsd_pusher statsd_audiothread;
33 extern statsd_pusher statsd_audiotrack;
34 extern statsd_pusher statsd_codec;
35 extern statsd_pusher statsd_drmmanager;
36 extern statsd_pusher statsd_extractor;
37 extern statsd_pusher statsd_mediadrm;
38 extern statsd_pusher statsd_mediadrm_created;
39 extern statsd_pusher statsd_mediadrm_errored;
40 extern statsd_pusher statsd_mediadrm_session_opened;
41 extern statsd_pusher statsd_mediaparser;
42 extern statsd_pusher statsd_nuplayer;
43 extern statsd_pusher statsd_recorder;
44 
45 using statsd_puller = bool (const std::shared_ptr<const mediametrics::Item>& item,
46         AStatsEventList *, const std::shared_ptr<mediametrics::StatsdLog>& statsdLog);
47 // component specific pullers
48 extern statsd_puller statsd_mediadrm_puller;
49 
50 bool dump2Statsd(const std::shared_ptr<const mediametrics::Item>& item,
51         const std::shared_ptr<mediametrics::StatsdLog>& statsdLog);
52 bool dump2Statsd(const std::shared_ptr<const mediametrics::Item>& item, AStatsEventList* out,
53         const std::shared_ptr<mediametrics::StatsdLog>& statsdLog);
54 } // namespace android
55