Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Unified Diff: talk/app/webrtc/java/src/org/webrtc/RtpReceiver.java

Issue 1351803002: Exposing RtpSenders and RtpReceivers from PeerConnection. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing indentation. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: talk/app/webrtc/java/src/org/webrtc/RtpReceiver.java
diff --git a/talk/app/webrtc/java/src/org/webrtc/CallSessionFileRotatingLogSink.java b/talk/app/webrtc/java/src/org/webrtc/RtpReceiver.java
similarity index 66%
copy from talk/app/webrtc/java/src/org/webrtc/CallSessionFileRotatingLogSink.java
copy to talk/app/webrtc/java/src/org/webrtc/RtpReceiver.java
index f7032a739bdbb24ac93dc000b9a42fb11223cc40..2cd1eb52ec5823d18fb10d2568329bb31487efee 100644
--- a/talk/app/webrtc/java/src/org/webrtc/CallSessionFileRotatingLogSink.java
+++ b/talk/app/webrtc/java/src/org/webrtc/RtpReceiver.java
@@ -27,31 +27,32 @@
package org.webrtc;
-public class CallSessionFileRotatingLogSink {
- static {
- System.loadLibrary("jingle_peerconnection_so");
- }
+/** Java wrapper for a C++ RtpReceiverInterface. */
+public class RtpReceiver {
+ final long nativeRtpReceiver;
- private long nativeSink;
+ private MediaStreamTrack cachedTrack;
pthatcher1 2015/09/23 14:47:39 Why not just call it track?
- public static byte[] getLogData(String dirPath) {
- return nativeGetLogData(dirPath);
+ public RtpReceiver(long nativeRtpReceiver) {
+ this.nativeRtpReceiver = nativeRtpReceiver;
+ long track = nativeTrack(nativeRtpReceiver);
+ cachedTrack = new MediaStreamTrack(track);
pthatcher1 2015/09/23 14:47:39 Please use the "this." prefix in both place or nei
}
- public CallSessionFileRotatingLogSink(
- String dirPath, int maxFileSize, Logging.Severity severity) {
- nativeSink = nativeAddSink(dirPath, maxFileSize, severity.ordinal());
+ public MediaStreamTrack track() {
+ return cachedTrack;
}
public void dispose() {
- if (nativeSink != 0) {
- nativeDeleteSink(nativeSink);
- nativeSink = 0;
+ free(nativeRtpReceiver);
+ if (cachedTrack != null) {
+ cachedTrack.dispose();
}
}
- private static native long nativeAddSink(
- String dirPath, int maxFileSize, int severity);
- private static native void nativeDeleteSink(long nativeSink);
- private static native byte[] nativeGetLogData(String dirPath);
-}
+ // This should increment the reference count of the track, with the assumption
+ // that a MediaStreamTrack will be created which will release it.
+ private static native long nativeTrack(long nativeRtpReceiver);
+
+ private static native void free(long nativeRtpReceiver);
+};

Powered by Google App Engine
This is Rietveld 408576698