Index: talk/app/webrtc/java/src/org/webrtc/RtpSender.java |
diff --git a/talk/app/webrtc/java/src/org/webrtc/CallSessionFileRotatingLogSink.java b/talk/app/webrtc/java/src/org/webrtc/RtpSender.java |
similarity index 56% |
copy from talk/app/webrtc/java/src/org/webrtc/CallSessionFileRotatingLogSink.java |
copy to talk/app/webrtc/java/src/org/webrtc/RtpSender.java |
index f7032a739bdbb24ac93dc000b9a42fb11223cc40..816f385da0d193ff1402410c210ce4fb73b624ad 100644 |
--- a/talk/app/webrtc/java/src/org/webrtc/CallSessionFileRotatingLogSink.java |
+++ b/talk/app/webrtc/java/src/org/webrtc/RtpSender.java |
@@ -27,31 +27,41 @@ |
package org.webrtc; |
-public class CallSessionFileRotatingLogSink { |
- static { |
- System.loadLibrary("jingle_peerconnection_so"); |
- } |
- |
- private long nativeSink; |
- |
- public static byte[] getLogData(String dirPath) { |
- return nativeGetLogData(dirPath); |
- } |
- |
- public CallSessionFileRotatingLogSink( |
- String dirPath, int maxFileSize, Logging.Severity severity) { |
- nativeSink = nativeAddSink(dirPath, maxFileSize, severity.ordinal()); |
- } |
- |
- public void dispose() { |
- if (nativeSink != 0) { |
- nativeDeleteSink(nativeSink); |
- nativeSink = 0; |
+/** Java wrapper for a C++ RtpSenderInterface. */ |
+public class RtpSender { |
+ private final long nativeRtpSender; |
+ |
+ public RtpSender(long nativeRtpSender) { |
+ this.nativeRtpSender = nativeRtpSender; |
+ } |
+ |
+ public void setTrack(MediaStreamTrack track) { |
+ nativeSetTrack(nativeRtpSender, track.nativeTrack); |
} |
- } |
- 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); |
+ public MediaStreamTrack track() { |
+ long track = nativeTrack(nativeRtpSender); |
+ return track == 0 ? null : new MediaStreamTrack(track); |
+ } |
+ |
+ // TODO(deadbeef): Expose mid once it can be guaranteed to uniquely |
+ // identify an RtpSender. |
+// public String mid() { |
+// return nativeMid(nativeRtpSender); |
+// } |
+ |
+ public void dispose() { |
+ free(nativeRtpSender); |
+ } |
+ |
+ private static native void nativeSetTrack(long nativeRtpSender, long nativeTrack); |
+ |
+ // 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 nativeRtpSender); |
+ |
+ private static native String nativeMid(long nativeRtpSender); |
+ |
+ private static native void free(long nativeRtpSender); |
} |
+; |