Index: webrtc/sdk/android/api/org/webrtc/CameraVideoCapturer.java |
diff --git a/webrtc/sdk/android/api/org/webrtc/CameraVideoCapturer.java b/webrtc/sdk/android/api/org/webrtc/CameraVideoCapturer.java |
index 283d5d1f2bd55609f461dea4ac124fa4449bfb77..be9d669fc4dfcae3cfd83634a26358c9f746b143 100644 |
--- a/webrtc/sdk/android/api/org/webrtc/CameraVideoCapturer.java |
+++ b/webrtc/sdk/android/api/org/webrtc/CameraVideoCapturer.java |
@@ -10,6 +10,8 @@ |
package org.webrtc; |
+import android.media.MediaRecorder; |
+ |
/** |
* Base interface for camera1 and camera2 implementations. Extends VideoCapturer with a |
* switchCamera() function. Also provides subinterfaces for handling camera events, and a helper |
@@ -60,6 +62,32 @@ public interface CameraVideoCapturer extends VideoCapturer { |
void switchCamera(CameraSwitchHandler switchEventsHandler); |
/** |
+ * MediaRecorder add/remove handler - one of these functions are invoked with the result of |
+ * addMediaRecorderToCamera() or removeMediaRecorderFromCamera calls. |
+ * The callback may be called on an arbitrary thread. |
+ */ |
+ public interface MediaRecorderHandler { |
+ // Invoked on success. |
+ void onMediaRecorderSuccess(); |
+ |
+ // Invoked on failure, e.g. camera is stopped or any exception happens. |
+ void onMediaRecorderError(String errorDescription); |
+ } |
+ |
+ /** |
+ * Add MediaRecorder to camera pipeline. This can only be called while the camera is running. |
+ * Once MediaRecorder is added to camera pipeline camera switch is not allowed. |
+ * This function can be called from any thread. |
+ */ |
+ void addMediaRecorderToCamera(MediaRecorder mediaRecorder, MediaRecorderHandler resultHandler); |
+ |
+ /** |
+ * Remove MediaRecorder from camera pipeline. This can only be called while the camera is running. |
+ * This function can be called from any thread. |
+ */ |
+ void removeMediaRecorderFromCamera(MediaRecorderHandler resultHandler); |
+ |
+ /** |
* Helper class to log framerate and detect if the camera freezes. It will run periodic callbacks |
* on the SurfaceTextureHelper thread passed in the ctor, and should only be operated from that |
* thread. |