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

Side by Side Diff: talk/app/webrtc/java/src/org/webrtc/VideoRenderer.java

Issue 1379793003: Android SurfaceViewRenderer: Add tests for onMeasure() (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: import Point Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « talk/app/webrtc/java/android/org/webrtc/SurfaceViewRenderer.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2013 Google Inc. 3 * Copyright 2013 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 18 matching lines...) Expand all
29 29
30 import java.nio.ByteBuffer; 30 import java.nio.ByteBuffer;
31 31
32 /** 32 /**
33 * Java version of VideoRendererInterface. In addition to allowing clients to 33 * Java version of VideoRendererInterface. In addition to allowing clients to
34 * define their own rendering behavior (by passing in a Callbacks object), this 34 * define their own rendering behavior (by passing in a Callbacks object), this
35 * class also provides a createGui() method for creating a GUI-rendering window 35 * class also provides a createGui() method for creating a GUI-rendering window
36 * on various platforms. 36 * on various platforms.
37 */ 37 */
38 public class VideoRenderer { 38 public class VideoRenderer {
39 39 /**
40 /** Java version of cricket::VideoFrame. Frames are only constructed from nati ve code. */ 40 * Java version of cricket::VideoFrame. Frames are only constructed from nativ e code and test
41 * code.
42 */
41 public static class I420Frame { 43 public static class I420Frame {
42 public final int width; 44 public final int width;
43 public final int height; 45 public final int height;
44 public final int[] yuvStrides; 46 public final int[] yuvStrides;
45 public ByteBuffer[] yuvPlanes; 47 public ByteBuffer[] yuvPlanes;
46 public final boolean yuvFrame; 48 public final boolean yuvFrame;
47 public Object textureObject; 49 public Object textureObject;
48 public int textureId; 50 public int textureId;
49 // Frame pointer in C++. 51 // Frame pointer in C++.
50 private long nativeFramePointer; 52 private long nativeFramePointer;
51 53
52 // rotationDegree is the degree that the frame must be rotated clockwisely 54 // rotationDegree is the degree that the frame must be rotated clockwisely
53 // to be rendered correctly. 55 // to be rendered correctly.
54 public int rotationDegree; 56 public int rotationDegree;
55 57
56 /** 58 /**
57 * Construct a frame of the given dimensions with the specified planar data. 59 * Construct a frame of the given dimensions with the specified planar data.
58 */ 60 */
59 private I420Frame( 61 public I420Frame(
perkj_webrtc 2015/10/08 11:06:22 use package scope if this is not intended to be us
60 int width, int height, int rotationDegree, 62 int width, int height, int rotationDegree,
61 int[] yuvStrides, ByteBuffer[] yuvPlanes, long nativeFramePointer) { 63 int[] yuvStrides, ByteBuffer[] yuvPlanes, long nativeFramePointer) {
62 this.width = width; 64 this.width = width;
63 this.height = height; 65 this.height = height;
64 this.yuvStrides = yuvStrides; 66 this.yuvStrides = yuvStrides;
65 this.yuvPlanes = yuvPlanes; 67 this.yuvPlanes = yuvPlanes;
66 this.yuvFrame = true; 68 this.yuvFrame = true;
67 this.rotationDegree = rotationDegree; 69 this.rotationDegree = rotationDegree;
68 this.nativeFramePointer = nativeFramePointer; 70 this.nativeFramePointer = nativeFramePointer;
69 if (rotationDegree % 90 != 0) { 71 if (rotationDegree % 90 != 0) {
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 } 171 }
170 172
171 private static native long nativeCreateGuiVideoRenderer(int x, int y); 173 private static native long nativeCreateGuiVideoRenderer(int x, int y);
172 private static native long nativeWrapVideoRenderer(Callbacks callbacks); 174 private static native long nativeWrapVideoRenderer(Callbacks callbacks);
173 175
174 private static native void freeGuiVideoRenderer(long nativeVideoRenderer); 176 private static native void freeGuiVideoRenderer(long nativeVideoRenderer);
175 private static native void freeWrappedVideoRenderer(long nativeVideoRenderer); 177 private static native void freeWrappedVideoRenderer(long nativeVideoRenderer);
176 178
177 private static native void releaseNativeFrame(long nativeFramePointer); 179 private static native void releaseNativeFrame(long nativeFramePointer);
178 } 180 }
OLDNEW
« no previous file with comments | « talk/app/webrtc/java/android/org/webrtc/SurfaceViewRenderer.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698