summaryrefslogtreecommitdiff
path: root/service/src/com/android/telephony/imsmedia/lib/libimsmedia/config/include/MediaQualityThreshold.h
blob: ecb33980dae3438861b6c198e93f1711063fb5fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/**
 * Copyright (C) 2022 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef MEDIA_QUALITY_THRESHOLD_H
#define MEDIA_QUALITY_THRESHOLD_H

#include <binder/Parcel.h>
#include <binder/Parcelable.h>
#include <binder/Status.h>
#include <stdint.h>
#include <vector>

namespace android
{

namespace telephony
{

namespace imsmedia
{

/** Native representation of android.telephony.imsmedia.MediaQualityThreshold */
class MediaQualityThreshold : public Parcelable
{
public:
    MediaQualityThreshold();
    MediaQualityThreshold(const MediaQualityThreshold& threshold);
    virtual ~MediaQualityThreshold();
    MediaQualityThreshold& operator=(const MediaQualityThreshold& threshold);
    bool operator==(const MediaQualityThreshold& threshold) const;
    bool operator!=(const MediaQualityThreshold& threshold) const;
    virtual status_t writeToParcel(Parcel* parcel) const;
    virtual status_t readFromParcel(const Parcel* in);
    void setRtpInactivityTimerMillis(std::vector<int32_t> times);
    std::vector<int32_t> getRtpInactivityTimerMillis() const;
    void setRtcpInactivityTimerMillis(int32_t time);
    int32_t getRtcpInactivityTimerMillis() const;
    void setRtpHysteresisTimeInMillis(int32_t time);
    int32_t getRtpHysteresisTimeInMillis() const;
    void setRtpPacketLossDurationMillis(int32_t time);
    int32_t getRtpPacketLossDurationMillis() const;
    void setRtpPacketLossRate(std::vector<int32_t> rates);
    std::vector<int32_t> getRtpPacketLossRate() const;
    void setRtpJitterMillis(std::vector<int32_t> jitters);
    std::vector<int32_t> getRtpJitterMillis() const;
    void setNotifyCurrentStatus(bool status);
    bool getNotifyCurrentStatus() const;

private:
    /** The timer in milliseconds for monitoring RTP inactivity */
    std::vector<int32_t> mRtpInactivityTimerMillis;
    /** The timer in milliseconds for monitoring RTCP inactivity */
    int32_t mRtcpInactivityTimerMillis;
    /**
     * Set the threshold hysteresis time for packet loss and jitter. This has a goal to prevent
     * frequent ping-pong notification. So whenever a notifier needs to report the cross of
     * threshold in opposite direction, this hysteresis timer should be respected.
     */
    int32_t mRtpHysteresisTimeInMillis;
    /** Set the duration in milliseconds for monitoring the RTP packet loss rate */
    int32_t mRtpPacketLossDurationMillis;
    /**
     * Packet loss rate in percentage of (total number of packets lost) /
     * (total number of packets expected) during rtpPacketLossDurationMs
     */
    std::vector<int32_t> mRtpPacketLossRate;
    /** RTP jitter threshold in milliseconds */
    std::vector<int32_t> mRtpJitterMillis;
    /**
     * A flag indicating whether the client needs to be notify the current media quality status
     * right after threshold is being set. True means the media stack should notify the client
     * of the current status.
     */
    bool mNotifyCurrentStatus;
};

}  // namespace imsmedia

}  // namespace telephony

}  // namespace android

#endif