Search in sources :

Example 1 with Log

use of com.amazonaws.kinesisvideo.common.logging.Log in project aws-sdk-android by aws-amplify.

the class KinesisVideoAndroidClientFactory method createKinesisVideoClient.

/**
 * Create KinesisVideo client.
 *
 * @param context Android context to use
 * @param regions Regions object
 * @param awsCredentialsProvider Credentials provider
 * @return
 * @throws KinesisVideoException
 */
public static KinesisVideoClient createKinesisVideoClient(@NonNull final Context context, @NonNull final Regions regions, @NonNull final AWSCredentialsProvider awsCredentialsProvider) throws KinesisVideoException {
    final OutputChannel outputChannel = new AndroidLogOutputChannel();
    final Log log = new Log(outputChannel, LogLevel.VERBOSE, LOG_TAG);
    final KinesisVideoCredentialsProvider kinesisVideoCredentialsProvider = new KinesisVideoCredentialsProviderImpl(awsCredentialsProvider, log);
    final KinesisVideoClientConfiguration configuration = KinesisVideoClientConfiguration.builder().withRegion(regions.getName()).withCredentialsProvider(kinesisVideoCredentialsProvider).withLogChannel(outputChannel).withStorageCallbacks(new DefaultStorageCallbacks()).build();
    final ScheduledExecutorService executor = Executors.newScheduledThreadPool(NUMBER_OF_THREADS_IN_POOL);
    return createKinesisVideoClient(context, configuration, defaultDeviceInfo(context), log, executor);
}
Also used : ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) DefaultStorageCallbacks(com.amazonaws.kinesisvideo.storage.DefaultStorageCallbacks) Log(com.amazonaws.kinesisvideo.common.logging.Log) KinesisVideoCredentialsProviderImpl(com.amazonaws.mobileconnectors.kinesisvideo.auth.KinesisVideoCredentialsProviderImpl) OutputChannel(com.amazonaws.kinesisvideo.common.logging.OutputChannel) AndroidLogOutputChannel(com.amazonaws.mobileconnectors.kinesisvideo.util.AndroidLogOutputChannel) KinesisVideoCredentialsProvider(com.amazonaws.kinesisvideo.auth.KinesisVideoCredentialsProvider) KinesisVideoClientConfiguration(com.amazonaws.kinesisvideo.client.KinesisVideoClientConfiguration) AndroidLogOutputChannel(com.amazonaws.mobileconnectors.kinesisvideo.util.AndroidLogOutputChannel)

Aggregations

KinesisVideoCredentialsProvider (com.amazonaws.kinesisvideo.auth.KinesisVideoCredentialsProvider)1 KinesisVideoClientConfiguration (com.amazonaws.kinesisvideo.client.KinesisVideoClientConfiguration)1 Log (com.amazonaws.kinesisvideo.common.logging.Log)1 OutputChannel (com.amazonaws.kinesisvideo.common.logging.OutputChannel)1 DefaultStorageCallbacks (com.amazonaws.kinesisvideo.storage.DefaultStorageCallbacks)1 KinesisVideoCredentialsProviderImpl (com.amazonaws.mobileconnectors.kinesisvideo.auth.KinesisVideoCredentialsProviderImpl)1 AndroidLogOutputChannel (com.amazonaws.mobileconnectors.kinesisvideo.util.AndroidLogOutputChannel)1 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)1