Index: talk/app/webrtc/java/src/org/webrtc/VideoRenderer.java |
diff --git a/talk/app/webrtc/java/src/org/webrtc/VideoRenderer.java b/talk/app/webrtc/java/src/org/webrtc/VideoRenderer.java |
index 1b6a5ed56e46b5fac59afd9df1f97f35b04f23c4..401640b463bfdfff7f832ebf75ce73100a0b40fb 100644 |
--- a/talk/app/webrtc/java/src/org/webrtc/VideoRenderer.java |
+++ b/talk/app/webrtc/java/src/org/webrtc/VideoRenderer.java |
@@ -42,12 +42,10 @@ |
public final int width; |
public final int height; |
public final int[] yuvStrides; |
- public ByteBuffer[] yuvPlanes; |
+ public final ByteBuffer[] yuvPlanes; |
public final boolean yuvFrame; |
public Object textureObject; |
public int textureId; |
- // If |nativeFramePointer| is non-zero, the memory is allocated on the C++ side. |
- private long nativeFramePointer; |
// rotationDegree is the degree that the frame must be rotated clockwisely |
// to be rendered correctly. |
@@ -60,7 +58,7 @@ |
*/ |
public I420Frame( |
int width, int height, int rotationDegree, |
- int[] yuvStrides, ByteBuffer[] yuvPlanes, long nativeFramePointer) { |
+ int[] yuvStrides, ByteBuffer[] yuvPlanes) { |
this.width = width; |
this.height = height; |
this.yuvStrides = yuvStrides; |
@@ -73,7 +71,6 @@ |
this.yuvPlanes = yuvPlanes; |
this.yuvFrame = true; |
this.rotationDegree = rotationDegree; |
- this.nativeFramePointer = nativeFramePointer; |
if (rotationDegree % 90 != 0) { |
throw new IllegalArgumentException("Rotation degree not multiple of 90: " + rotationDegree); |
} |
@@ -84,7 +81,7 @@ |
*/ |
public I420Frame( |
int width, int height, int rotationDegree, |
- Object textureObject, int textureId, long nativeFramePointer) { |
+ Object textureObject, int textureId) { |
this.width = width; |
this.height = height; |
this.yuvStrides = null; |
@@ -93,7 +90,6 @@ |
this.textureId = textureId; |
this.yuvFrame = false; |
this.rotationDegree = rotationDegree; |
- this.nativeFramePointer = nativeFramePointer; |
if (rotationDegree % 90 != 0) { |
throw new IllegalArgumentException("Rotation degree not multiple of 90: " + rotationDegree); |
} |
@@ -168,31 +164,16 @@ |
} |
// Helper native function to do a video frame plane copying. |
- public static native void nativeCopyPlane(ByteBuffer src, int width, |
+ private static native void nativeCopyPlane(ByteBuffer src, int width, |
int height, int srcStride, ByteBuffer dst, int dstStride); |
/** The real meat of VideoRendererInterface. */ |
public static interface Callbacks { |
// |frame| might have pending rotation and implementation of Callbacks |
- // should handle that by applying rotation during rendering. The callee |
- // is responsible for signaling when it is done with |frame| by calling |
- // renderFrameDone(frame). |
+ // should handle that by applying rotation during rendering. |
public void renderFrame(I420Frame frame); |
// TODO(guoweis): Remove this once chrome code base is updated. |
public boolean canApplyRotation(); |
- } |
- |
- /** |
- * This must be called after every renderFrame() to release the frame. |
- */ |
- public static void renderFrameDone(I420Frame frame) { |
- frame.yuvPlanes = null; |
- frame.textureObject = null; |
- frame.textureId = 0; |
- if (frame.nativeFramePointer != 0) { |
- releaseNativeFrame(frame.nativeFramePointer); |
- frame.nativeFramePointer = 0; |
- } |
} |
// |this| either wraps a native (GUI) renderer or a client-supplied Callbacks |
@@ -231,6 +212,4 @@ |
private static native void freeGuiVideoRenderer(long nativeVideoRenderer); |
private static native void freeWrappedVideoRenderer(long nativeVideoRenderer); |
- |
- private static native void releaseNativeFrame(long nativeFramePointer); |
} |