Skip to content

Camera2Source choose with cameraId when streaming #1611

@Lyman92

Description

@Lyman92

Hello.
Android TV app
There are two cameras (the facing is both Back)
How can i switch camera with cameraId.

Camera2Source camera2Source = new Camera2Source(mContext);
String currentCameraId = camera2Source.getCurrentCameraId();
if (!currentCameraId.equals(cameraId)) {
    camera2Source.switchCamera(); // not work, because both Facing.Back.
    camera2Source.openCameraId(cameraId);  //   Camera2ApiManager need be prepared, Camera2ApiManager not enabled
}
...
genericStream.changeVideoSource(camera2Source);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions