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());
|
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
|
@MediumTest
|
||||||
// Test what happens when attempting to call e.g. switchCamera() after camera has been stopped.
|
// Test what happens when attempting to call e.g. switchCamera() after camera has been stopped.
|
||||||
public void testCameraCallsAfterStop() throws InterruptedException {
|
public void testCameraCallsAfterStop() throws InterruptedException {
|
||||||
|
|||||||
@ -682,6 +682,10 @@ public class VideoCapturerAndroid implements
|
|||||||
dropNextFrame = false;
|
dropNextFrame = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (eventsHandler != null && !firstFrameReported) {
|
||||||
|
eventsHandler.onFirstFrameAvailable();
|
||||||
|
firstFrameReported = true;
|
||||||
|
}
|
||||||
|
|
||||||
int rotation = getFrameOrientation();
|
int rotation = getFrameOrientation();
|
||||||
if (info.facing == android.hardware.Camera.CameraInfo.CAMERA_FACING_FRONT) {
|
if (info.facing == android.hardware.Camera.CameraInfo.CAMERA_FACING_FRONT) {
|
||||||
|
|||||||
Reference in New Issue
Block a user