summaryrefslogtreecommitdiff
path: root/framework/src
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src')
-rw-r--r--framework/src/android/telephony/imsmedia/IImsVideoSessionCallback.aidl2
-rw-r--r--framework/src/android/telephony/imsmedia/MediaQualityThreshold.java26
-rw-r--r--framework/src/android/telephony/imsmedia/VideoSessionCallback.java11
3 files changed, 30 insertions, 9 deletions
diff --git a/framework/src/android/telephony/imsmedia/IImsVideoSessionCallback.aidl b/framework/src/android/telephony/imsmedia/IImsVideoSessionCallback.aidl
index 8de33a39..b48e560d 100644
--- a/framework/src/android/telephony/imsmedia/IImsVideoSessionCallback.aidl
+++ b/framework/src/android/telephony/imsmedia/IImsVideoSessionCallback.aidl
@@ -35,6 +35,6 @@ oneway interface IImsVideoSessionCallback {
void onPeerDimensionChanged(in int width, in int height);
void onHeaderExtensionReceived(in List<RtpHeaderExtension> extensions);
void notifyMediaInactivity(int packetType);
- void notifyPacketLoss(int packetLossPercentage);
+ void notifyBitrate(int bitate);
void notifyVideoDataUsage(long bytes);
}
diff --git a/framework/src/android/telephony/imsmedia/MediaQualityThreshold.java b/framework/src/android/telephony/imsmedia/MediaQualityThreshold.java
index 3f38e89a..42024a87 100644
--- a/framework/src/android/telephony/imsmedia/MediaQualityThreshold.java
+++ b/framework/src/android/telephony/imsmedia/MediaQualityThreshold.java
@@ -38,6 +38,7 @@ public final class MediaQualityThreshold implements Parcelable {
private final int[] mRtpPacketLossRate;
private final int[] mRtpJitterMillis;
private final boolean mNotifyCurrentStatus;
+ private final int mVideoBitrateBps;
/** @hide **/
public MediaQualityThreshold(Parcel in) {
@@ -60,6 +61,7 @@ public final class MediaQualityThreshold implements Parcelable {
mRtpJitterMillis[i] = in.readInt();
}
mNotifyCurrentStatus = in.readBoolean();
+ mVideoBitrateBps = in.readInt();
}
/** @hide **/
@@ -74,6 +76,7 @@ public final class MediaQualityThreshold implements Parcelable {
mRtpJitterMillis = Arrays.copyOf(builder.mRtpJitterMillis,
builder.mRtpJitterMillis.length);
mNotifyCurrentStatus = builder.mNotifyCurrentStatus;
+ mVideoBitrateBps = builder.mVideoBitrateBps;
}
/** @hide **/
@@ -111,6 +114,10 @@ public final class MediaQualityThreshold implements Parcelable {
return mNotifyCurrentStatus;
}
+ public int getVideoBitrateBps() {
+ return mVideoBitrateBps;
+ }
+
@NonNull
@Override
public String toString() {
@@ -122,6 +129,7 @@ public final class MediaQualityThreshold implements Parcelable {
+ ", mRtpPacketLossRate=" + Arrays.toString(mRtpPacketLossRate)
+ ", mRtpJitterMillis=" + Arrays.toString(mRtpJitterMillis)
+ ", mNotifyCurrentStatus=" + mNotifyCurrentStatus
+ + ", mVideoBitrateBps=" + mVideoBitrateBps
+ " }";
}
@@ -130,7 +138,7 @@ public final class MediaQualityThreshold implements Parcelable {
return Objects.hash(Arrays.hashCode(mRtpInactivityTimerMillis), mRtcpInactivityTimerMillis,
mRtpHysteresisTimeInMillis, mRtpPacketLossDurationMillis,
Arrays.hashCode(mRtpPacketLossRate), Arrays.hashCode(mRtpJitterMillis),
- mNotifyCurrentStatus);
+ mNotifyCurrentStatus, mVideoBitrateBps);
}
@Override
@@ -151,7 +159,8 @@ public final class MediaQualityThreshold implements Parcelable {
&& mRtpPacketLossDurationMillis == s.mRtpPacketLossDurationMillis
&& Arrays.equals(mRtpPacketLossRate, s.mRtpPacketLossRate)
&& Arrays.equals(mRtpJitterMillis, s.mRtpJitterMillis)
- && mNotifyCurrentStatus == s.mNotifyCurrentStatus);
+ && mNotifyCurrentStatus == s.mNotifyCurrentStatus
+ && mVideoBitrateBps == s.mVideoBitrateBps);
}
/**
@@ -172,6 +181,7 @@ public final class MediaQualityThreshold implements Parcelable {
dest.writeIntArray(mRtpPacketLossRate);
dest.writeIntArray(mRtpJitterMillis);
dest.writeBoolean(mNotifyCurrentStatus);
+ dest.writeInt(mVideoBitrateBps);
}
public static final @NonNull Parcelable.Creator<MediaQualityThreshold>
@@ -198,6 +208,7 @@ public final class MediaQualityThreshold implements Parcelable {
private int[] mRtpPacketLossRate;
private int[] mRtpJitterMillis;
private boolean mNotifyCurrentStatus;
+ private int mVideoBitrateBps;
/**
* Default constructor for Builder.
@@ -209,6 +220,7 @@ public final class MediaQualityThreshold implements Parcelable {
mRtpPacketLossDurationMillis = 0;
mRtpPacketLossRate = new int[0];
mRtpJitterMillis = new int[0];
+ mVideoBitrateBps = 0;
}
/**
@@ -303,6 +315,16 @@ public final class MediaQualityThreshold implements Parcelable {
}
/**
+ * The receiving bitrate threshold in bps for video call. If it is not zero, bitrate
+ * notification event is triggered when the receiving frame bitrate is less than the
+ * threshold.
+ */
+ public @NonNull Builder setVideoBitrateBps(final int bitrate) {
+ this.mVideoBitrateBps = bitrate;
+ return this;
+ }
+
+ /**
* Build the MediaQualityThreshold.
*
* @return the MediaQualityThreshold object.
diff --git a/framework/src/android/telephony/imsmedia/VideoSessionCallback.java b/framework/src/android/telephony/imsmedia/VideoSessionCallback.java
index cf66ee56..17748bbb 100644
--- a/framework/src/android/telephony/imsmedia/VideoSessionCallback.java
+++ b/framework/src/android/telephony/imsmedia/VideoSessionCallback.java
@@ -151,12 +151,12 @@ public class VideoSessionCallback extends ImsMediaManager.SessionCallback {
}
@Override
- public void notifyPacketLoss(final int packetLossPercentage) {
+ public void notifyBitrate(final int bitrate) {
if (mLocalCallback == null) return;
final long callingIdentity = Binder.clearCallingIdentity();
try {
- mExecutor.execute(() -> mLocalCallback.notifyPacketLoss(packetLossPercentage));
+ mExecutor.execute(() -> mLocalCallback.notifyBitrate(bitrate));
} finally {
restoreCallingIdentity(callingIdentity);
}
@@ -234,13 +234,12 @@ public class VideoSessionCallback extends ImsMediaManager.SessionCallback {
}
/**
- * Notifies RTP packet loss observed as per thresholds set by
+ * Notifies when the video bitrate decreased below the threshold set by
* setMediaQualityThreshold() API
*
- * @param packetLossPercentage percentage of packet loss calculated
- * over the duration
+ * @param bitrate The bitrate of sending video packets in bps unit
*/
- public void notifyPacketLoss(final int packetLossPercentage) {
+ public void notifyBitrate(final int bitrate) {
// Base Implementation
}