blob: 921dd630557fdc8feba97c5c616c40a9fa82dae8 [file] [log] [blame]
Ray Essick2e9c63b2017-03-29 15:16:44 -07001/*
2 * Copyright (C) 2017 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#define LOG_TAG "MetricsSummarizerCodec"
18#include <utils/Log.h>
19
Ray Essick002e4132017-09-05 16:52:05 -070020#include <stdint.h>
21#include <inttypes.h>
Ray Essick2e9c63b2017-03-29 15:16:44 -070022
23#include <utils/threads.h>
24#include <utils/Errors.h>
25#include <utils/KeyedVector.h>
26#include <utils/String8.h>
27#include <utils/List.h>
28
29#include <media/IMediaAnalyticsService.h>
30
31#include "MetricsSummarizer.h"
32#include "MetricsSummarizerCodec.h"
33
34
35
36
37namespace android {
38
Ray Essick002e4132017-09-05 16:52:05 -070039static const char *codec_ignorable[] = {
40 "android.media.mediacodec.bytesin",
41 0
42};
43
Ray Essick2e9c63b2017-03-29 15:16:44 -070044MetricsSummarizerCodec::MetricsSummarizerCodec(const char *key)
45 : MetricsSummarizer(key)
46{
47 ALOGV("MetricsSummarizerCodec::MetricsSummarizerCodec");
Ray Essick002e4132017-09-05 16:52:05 -070048 setIgnorables(codec_ignorable);
49
50}
51
52void MetricsSummarizerCodec::mergeRecord(MediaAnalyticsItem &summation, MediaAnalyticsItem &item) {
53
54 ALOGV("MetricsSummarizerCodec::mergeRecord()");
55
56 int64_t bytesin = 0;
57 if (item.getInt64("android.media.mediacodec.bytesin", &bytesin)) {
58 ALOGV("found bytesin of %" PRId64, bytesin);
59 }
60 if (bytesin >= 0) {
61 minMaxVar64(summation,"android.media.mediacodec.bytesin", bytesin);
62 }
Ray Essick2e9c63b2017-03-29 15:16:44 -070063}
64
65
66} // namespace android