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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 @Override public void run() { | 216 @Override public void run() { |
217 startPreviewOnCameraThread(width, height, framerate); | 217 startPreviewOnCameraThread(width, height, framerate); |
218 } | 218 } |
219 }); | 219 }); |
220 } | 220 } |
221 | 221 |
222 public synchronized List<CaptureFormat> getSupportedFormats() { | 222 public synchronized List<CaptureFormat> getSupportedFormats() { |
223 return CameraEnumerationAndroid.supportedFormats.get(id); | 223 return CameraEnumerationAndroid.supportedFormats.get(id); |
224 } | 224 } |
225 | 225 |
| 226 // Return a list of timestamps for the frames that have been sent out, but not
returned yet. |
| 227 // Useful for logging and testing. |
| 228 public String pendingFramesTimeStamps() { |
| 229 return videoBuffers.pendingFramesTimeStamps(); |
| 230 } |
| 231 |
226 private VideoCapturerAndroid() { | 232 private VideoCapturerAndroid() { |
227 Log.d(TAG, "VideoCapturerAndroid"); | 233 Log.d(TAG, "VideoCapturerAndroid"); |
228 } | 234 } |
229 | 235 |
230 // Called by native code. | 236 // Called by native code. |
231 // Enumerates resolution and frame rates for all cameras to be able to switch | 237 // Enumerates resolution and frame rates for all cameras to be able to switch |
232 // cameras. Initializes local variables for the camera named |deviceName| and | 238 // cameras. Initializes local variables for the camera named |deviceName| and |
233 // starts a thread to be used for capturing. | 239 // starts a thread to be used for capturing. |
234 // If deviceName is empty, the first available device is used in order to be | 240 // If deviceName is empty, the first available device is used in order to be |
235 // compatible with the generic VideoCapturer class. | 241 // compatible with the generic VideoCapturer class. |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 } | 753 } |
748 | 754 |
749 private native void nativeCapturerStarted(long nativeCapturer, | 755 private native void nativeCapturerStarted(long nativeCapturer, |
750 boolean success); | 756 boolean success); |
751 private native void nativeOnFrameCaptured(long nativeCapturer, | 757 private native void nativeOnFrameCaptured(long nativeCapturer, |
752 byte[] data, int length, int width, int height, int rotation, long timeS
tamp); | 758 byte[] data, int length, int width, int height, int rotation, long timeS
tamp); |
753 private native void nativeOnOutputFormatRequest(long nativeCapturer, | 759 private native void nativeOnOutputFormatRequest(long nativeCapturer, |
754 int width, int height, int fps); | 760 int width, int height, int fps); |
755 } | 761 } |
756 } | 762 } |
OLD | NEW |