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:
Magnus Jedvert
2016-02-18 15:47:47 +01:00
parent 5199c74d25
commit f45381e1e5
2 changed files with 19 additions and 3 deletions

View File

@ -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 {

View File

@ -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) {