OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 | 236 |
237 public static VideoCapturerAndroid create(String name, | 237 public static VideoCapturerAndroid create(String name, |
238 CameraEventsHandler eventsHandler, EGLContext sharedEglContext) { | 238 CameraEventsHandler eventsHandler, EGLContext sharedEglContext) { |
239 final int cameraId = lookupDeviceName(name); | 239 final int cameraId = lookupDeviceName(name); |
240 if (cameraId == -1) { | 240 if (cameraId == -1) { |
241 return null; | 241 return null; |
242 } | 242 } |
243 | 243 |
244 final VideoCapturerAndroid capturer = new VideoCapturerAndroid(cameraId, eve
ntsHandler, | 244 final VideoCapturerAndroid capturer = new VideoCapturerAndroid(cameraId, eve
ntsHandler, |
245 sharedEglContext); | 245 sharedEglContext); |
246 capturer.setNativeCapturer(nativeCreateVideoCapturer(capturer)); | 246 capturer.setNativeCapturer( |
| 247 nativeCreateVideoCapturer(capturer, capturer.surfaceHelper)); |
247 return capturer; | 248 return capturer; |
248 } | 249 } |
249 | 250 |
250 public void printStackTrace() { | 251 public void printStackTrace() { |
251 if (cameraThread != null) { | 252 if (cameraThread != null) { |
252 StackTraceElement[] cameraStackTraces = cameraThread.getStackTrace(); | 253 StackTraceElement[] cameraStackTraces = cameraThread.getStackTrace(); |
253 if (cameraStackTraces.length > 0) { | 254 if (cameraStackTraces.length > 0) { |
254 Logging.d(TAG, "VideoCapturerAndroid stacks trace:"); | 255 Logging.d(TAG, "VideoCapturerAndroid stacks trace:"); |
255 for (StackTraceElement stackTrace : cameraStackTraces) { | 256 for (StackTraceElement stackTrace : cameraStackTraces) { |
256 Logging.d(TAG, stackTrace.toString()); | 257 Logging.d(TAG, stackTrace.toString()); |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
938 private native void nativeCapturerStarted(long nativeCapturer, | 939 private native void nativeCapturerStarted(long nativeCapturer, |
939 boolean success); | 940 boolean success); |
940 private native void nativeOnByteBufferFrameCaptured(long nativeCapturer, | 941 private native void nativeOnByteBufferFrameCaptured(long nativeCapturer, |
941 byte[] data, int length, int width, int height, int rotation, long timeS
tamp); | 942 byte[] data, int length, int width, int height, int rotation, long timeS
tamp); |
942 private native void nativeOnTextureFrameCaptured(long nativeCapturer, int wi
dth, int height, | 943 private native void nativeOnTextureFrameCaptured(long nativeCapturer, int wi
dth, int height, |
943 int oesTextureId, float[] transformMatrix, long timestamp); | 944 int oesTextureId, float[] transformMatrix, long timestamp); |
944 private native void nativeOnOutputFormatRequest(long nativeCapturer, | 945 private native void nativeOnOutputFormatRequest(long nativeCapturer, |
945 int width, int height, int framerate); | 946 int width, int height, int framerate); |
946 } | 947 } |
947 | 948 |
948 private static native long nativeCreateVideoCapturer(VideoCapturerAndroid vide
oCapturer); | 949 private static native long nativeCreateVideoCapturer( |
| 950 VideoCapturerAndroid videoCapturer, |
| 951 SurfaceTextureHelper surfaceHelper); |
949 } | 952 } |
OLD | NEW |