Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a2d90d32 authored by Eino-Ville Talvala's avatar Eino-Ville Talvala Committed by Zhijun He
Browse files

Camera2: Remove unused parameters in ICameraDeviceUser#createStream

- width, height, format are unused

Change-Id: I26540aab1118108b0325df69cfa2dd23da41849b
parent 3e880a36
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ interface ICameraDeviceUser
    int deleteStream(int streamId);

    // non-negative value is the stream ID. negative value is status_t
    int createStream(int width, int height, int format, in Surface surface);
    int createStream(in Surface surface);

    int createDefaultRequest(int templateId, out CameraMetadataNative request);

+1 −3
Original line number Diff line number Diff line
@@ -373,9 +373,7 @@ public class CameraDeviceImpl extends CameraDevice {

                // Add all new streams
                for (Surface s : addSet) {
                    // TODO: remove width,height,format since we are ignoring
                    // it.
                    int streamId = mRemoteDevice.createStream(0, 0, 0, s);
                    int streamId = mRemoteDevice.createStream(s);
                    mConfiguredOutputs.put(streamId, s);
                }

+1 −1
Original line number Diff line number Diff line
@@ -504,7 +504,7 @@ public class CameraDeviceUserShim implements ICameraDeviceUser {
    }

    @Override
    public int createStream(int width, int height, int format, Surface surface) {
    public int createStream(Surface surface) {
        if (DEBUG) {
            Log.d(TAG, "createStream called.");
        }
+6 −10
Original line number Diff line number Diff line
@@ -161,8 +161,7 @@ public class CameraDeviceBinderTest extends AndroidTestCase {
        assertFalse(request.isEmpty());
        assertFalse(metadata.isEmpty());
        if (needStream) {
            int streamId = mCameraUser.createStream(/* ignored */10, /* ignored */20,
                    /* ignored */30, mSurface);
            int streamId = mCameraUser.createStream(mSurface);
            assertEquals(0, streamId);
            request.addTarget(mSurface);
        }
@@ -235,12 +234,11 @@ public class CameraDeviceBinderTest extends AndroidTestCase {

    @SmallTest
    public void testCreateStream() throws Exception {
        int streamId = mCameraUser.createStream(/* ignored */10, /* ignored */20, /* ignored */30,
                mSurface);
        int streamId = mCameraUser.createStream(mSurface);
        assertEquals(0, streamId);

        assertEquals(CameraBinderTestUtils.ALREADY_EXISTS,
                mCameraUser.createStream(/* ignored */0, /* ignored */0, /* ignored */0, mSurface));
                mCameraUser.createStream(mSurface));

        assertEquals(CameraBinderTestUtils.NO_ERROR, mCameraUser.deleteStream(streamId));
    }
@@ -257,20 +255,18 @@ public class CameraDeviceBinderTest extends AndroidTestCase {
    public void testCreateStreamTwo() throws Exception {

        // Create first stream
        int streamId = mCameraUser.createStream(/* ignored */0, /* ignored */0, /* ignored */0,
                mSurface);
        int streamId = mCameraUser.createStream(mSurface);
        assertEquals(0, streamId);

        assertEquals(CameraBinderTestUtils.ALREADY_EXISTS,
                mCameraUser.createStream(/* ignored */0, /* ignored */0, /* ignored */0, mSurface));
                mCameraUser.createStream(mSurface));

        // Create second stream with a different surface.
        SurfaceTexture surfaceTexture = new SurfaceTexture(/* ignored */0);
        surfaceTexture.setDefaultBufferSize(640, 480);
        Surface surface2 = new Surface(surfaceTexture);

        int streamId2 = mCameraUser.createStream(/* ignored */0, /* ignored */0, /* ignored */0,
                surface2);
        int streamId2 = mCameraUser.createStream(surface2);
        assertEquals(1, streamId2);

        // Clean up streams