Search in sources :

Example 1 with MediaSourceConfiguration

use of com.amazonaws.kinesisvideo.internal.client.mediasource.MediaSourceConfiguration in project aws-sdk-android by aws-amplify.

the class CameraUtils method getCameras.

/**
 * Lists only cameras by getting known media sources known to the KinesisVideoClient
 */
public static List<CameraMediaSourceConfiguration> getCameras(final KinesisVideoClient kinesisVideoClient) {
    final List<CameraMediaSourceConfiguration> cameras = new ArrayList<CameraMediaSourceConfiguration>();
    for (final MediaSourceConfiguration.Builder mediaSourceConfiguration : kinesisVideoClient.listSupportedConfigurations()) {
        if (!(mediaSourceConfiguration instanceof CameraMediaSourceConfiguration.Builder)) {
            continue;
        }
        final CameraMediaSourceConfiguration configuration = ((CameraMediaSourceConfiguration.Builder) mediaSourceConfiguration).build();
        cameras.add(configuration);
    }
    return cameras;
}
Also used : CameraMediaSourceConfiguration(com.amazonaws.kinesisvideo.client.mediasource.CameraMediaSourceConfiguration) ArrayList(java.util.ArrayList) MediaSourceConfiguration(com.amazonaws.kinesisvideo.internal.client.mediasource.MediaSourceConfiguration) CameraMediaSourceConfiguration(com.amazonaws.kinesisvideo.client.mediasource.CameraMediaSourceConfiguration)

Aggregations

CameraMediaSourceConfiguration (com.amazonaws.kinesisvideo.client.mediasource.CameraMediaSourceConfiguration)1 MediaSourceConfiguration (com.amazonaws.kinesisvideo.internal.client.mediasource.MediaSourceConfiguration)1 ArrayList (java.util.ArrayList)1