| 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 60%
|
| copy from talk/app/webrtc/java/src/org/webrtc/CallSessionFileRotatingLogSink.java
|
| copy to talk/app/webrtc/java/src/org/webrtc/RtpReceiver.java
|
| index f7032a739bdbb24ac93dc000b9a42fb11223cc40..6f0d68890eb077bdfdd17ff190b1d163e9d3c247 100644
|
| --- a/talk/app/webrtc/java/src/org/webrtc/CallSessionFileRotatingLogSink.java
|
| +++ b/talk/app/webrtc/java/src/org/webrtc/RtpReceiver.java
|
| @@ -27,31 +27,35 @@
|
|
|
| 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++ RtpReceiverInterface. */
|
| +public class RtpReceiver {
|
| + private final long nativeRtpReceiver;
|
| +
|
| + public RtpReceiver(long nativeRtpReceiver) {
|
| + this.nativeRtpReceiver = nativeRtpReceiver;
|
| + }
|
| +
|
| + public MediaStreamTrack track() {
|
| + long track = nativeTrack(nativeRtpReceiver);
|
| + return track == 0 ? null : new MediaStreamTrack(track);
|
| + }
|
| +
|
| + // TODO(deadbeef): Expose mid once it can be guaranteed to uniquely
|
| + // identify an RtpReceiver.
|
| +// public String mid() {
|
| +// return nativeMid(nativeRtpReceiver);
|
| +// }
|
| +
|
| + public void dispose() {
|
| + free(nativeRtpReceiver);
|
| }
|
| - }
|
|
|
| - 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 String nativeMid(long nativeRtpReceiver);
|
| +
|
| + private static native void free(long nativeRtpReceiver);
|
| }
|
| +;
|
|
|