VideoCapturerAndroid: Report onFirstFrameAvailable() for textures as well
We currently only trigger onFirstFrameAvailable() for byte buffer frames. R=perkj@webrtc.org Review URL: https://codereview.webrtc.org/1701993002 . Cr-Commit-Position: refs/heads/master@{#11670}
This commit is contained in:
@ -152,6 +152,18 @@ public class VideoCapturerAndroidTest extends ActivityTestCase {
|
||||
capturer, cameraEvents, getInstrumentation().getContext());
|
||||
}
|
||||
|
||||
@MediumTest
|
||||
public void testCameraEventsUsingTextures() throws InterruptedException {
|
||||
EglBase eglBase = EglBase.create();
|
||||
VideoCapturerAndroidTestFixtures.CameraEvents cameraEvents =
|
||||
VideoCapturerAndroidTestFixtures.createCameraEvents();
|
||||
VideoCapturerAndroid capturer =
|
||||
VideoCapturerAndroid.create("", cameraEvents, eglBase.getEglBaseContext());
|
||||
VideoCapturerAndroidTestFixtures.cameraEventsInvoked(
|
||||
capturer, cameraEvents, getInstrumentation().getContext());
|
||||
eglBase.release();
|
||||
}
|
||||
|
||||
@MediumTest
|
||||
// Test what happens when attempting to call e.g. switchCamera() after camera has been stopped.
|
||||
public void testCameraCallsAfterStop() throws InterruptedException {
|
||||
|
||||
@ -682,6 +682,10 @@ public class VideoCapturerAndroid implements
|
||||
dropNextFrame = false;
|
||||
return;
|
||||
}
|
||||
if (eventsHandler != null && !firstFrameReported) {
|
||||
eventsHandler.onFirstFrameAvailable();
|
||||
firstFrameReported = true;
|
||||
}
|
||||
|
||||
int rotation = getFrameOrientation();
|
||||
if (info.facing == android.hardware.Camera.CameraInfo.CAMERA_FACING_FRONT) {
|
||||
|
||||
Reference in New Issue
Block a user