Expose peer connection's getStats by RtpSender/Receiver in Android SDK
Currently if you want to obtain the stats for a specific sender/receiver in Android, you need to call peerConnection.getStats() and filter manually the result by sender. pc.getStats(receiver/sender) exists in c++ and ios but was not exposed in Android Bug: webrtc:14547 Change-Id: I9954434880f0f93821fcd2e2de24a875e8d136ae Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/275880 Reviewed-by: Xavier Lepaul <xalep@webrtc.org> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org> Cr-Commit-Position: refs/heads/main@{#38428}
This commit is contained in:
committed by
WebRTC LUCI CQ
parent
048f5c7516
commit
4dc6e05ac9
@ -842,6 +842,32 @@ static void JNI_PeerConnection_NewGetStats(
|
||||
ExtractNativePC(jni, j_pc)->GetStats(callback.get());
|
||||
}
|
||||
|
||||
static void JNI_PeerConnection_NewGetStatsSender(
|
||||
JNIEnv* jni,
|
||||
const JavaParamRef<jobject>& j_pc,
|
||||
jlong native_sender,
|
||||
const JavaParamRef<jobject>& j_callback) {
|
||||
auto callback =
|
||||
rtc::make_ref_counted<RTCStatsCollectorCallbackWrapper>(jni, j_callback);
|
||||
ExtractNativePC(jni, j_pc)->GetStats(
|
||||
rtc::scoped_refptr<RtpSenderInterface>(
|
||||
reinterpret_cast<RtpSenderInterface*>(native_sender)),
|
||||
rtc::scoped_refptr<RTCStatsCollectorCallbackWrapper>(callback.get()));
|
||||
}
|
||||
|
||||
static void JNI_PeerConnection_NewGetStatsReceiver(
|
||||
JNIEnv* jni,
|
||||
const JavaParamRef<jobject>& j_pc,
|
||||
jlong native_receiver,
|
||||
const JavaParamRef<jobject>& j_callback) {
|
||||
auto callback =
|
||||
rtc::make_ref_counted<RTCStatsCollectorCallbackWrapper>(jni, j_callback);
|
||||
ExtractNativePC(jni, j_pc)->GetStats(
|
||||
rtc::scoped_refptr<RtpReceiverInterface>(
|
||||
reinterpret_cast<RtpReceiverInterface*>(native_receiver)),
|
||||
rtc::scoped_refptr<RTCStatsCollectorCallbackWrapper>(callback.get()));
|
||||
}
|
||||
|
||||
static jboolean JNI_PeerConnection_SetBitrate(
|
||||
JNIEnv* jni,
|
||||
const JavaParamRef<jobject>& j_pc,
|
||||
|
||||
Reference in New Issue
Block a user