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

Unified Diff: webrtc/api/android/java/src/org/webrtc/VideoCapturer.java

Issue 2168623002: Refactor stopCapture to be asynchronous in VideoCapturerAndroid. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@androidvideotracksource
Patch Set: Synchronized. Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/api/android/java/src/org/webrtc/VideoCapturer.java
diff --git a/webrtc/api/android/java/src/org/webrtc/VideoCapturer.java b/webrtc/api/android/java/src/org/webrtc/VideoCapturer.java
index c92f82ac18701694a23dafe62f0855d9199f3432..547ec78996508dbb56b45459a0174a62c0138986 100644
--- a/webrtc/api/android/java/src/org/webrtc/VideoCapturer.java
+++ b/webrtc/api/android/java/src/org/webrtc/VideoCapturer.java
@@ -15,27 +15,26 @@ import android.content.Context;
import java.util.List;
// Base interface for all VideoCapturers to implement.
+// All events will be fired on the camera thread.
public interface VideoCapturer {
// Interface used for providing callbacks to an observer.
public interface CapturerObserver {
// Notify if the camera have been started successfully or not.
- // Called on a Java thread owned by VideoCapturer.
void onCapturerStarted(boolean success);
+
void onCapturerStopped();
- // Delivers a captured frame. Called on a Java thread owned by VideoCapturer.
+ // Delivers a captured frame.
void onByteBufferFrameCaptured(byte[] data, int width, int height, int rotation,
long timeStamp);
- // Delivers a captured frame in a texture with id |oesTextureId|. Called on a Java thread
- // owned by VideoCapturer.
+ // Delivers a captured frame in a texture with id |oesTextureId|.
void onTextureFrameCaptured(
int width, int height, int oesTextureId, float[] transformMatrix, int rotation,
long timestamp);
// Requests an output format from the video capturer. Captured frames
// by the camera will be scaled/or dropped by the video capturer.
- // Called on a Java thread owned by VideoCapturer.
void onOutputFormatRequest(int width, int height, int framerate);
}
@@ -160,9 +159,10 @@ public interface VideoCapturer {
void startCapture(int width, int height, int framerate);
/**
- * Stop capturing. This function should block until capture is actually stopped.
+ * Stop capturing. No more frames/events will be delivered to the observer when this method
+ * returns.
*/
- void stopCapture() throws InterruptedException;
+ void stopCapture();
void onOutputFormatRequest(int width, int height, int framerate);

Powered by Google App Engine
This is Rietveld 408576698