package com.discord.stores; import co.discord.media_engine.VideoInputDeviceDescription; import co.discord.media_engine.VideoInputDeviceFacing; import d0.t.k; import d0.z.d.m; import d0.z.d.o; import kotlin.Unit; import kotlin.jvm.functions.Function1; /* compiled from: StoreMediaEngine.kt */ public final class StoreMediaEngine$selectDefaultVideoDevice$1 extends o implements Function1 { public final /* synthetic */ Function1 $onSelected; public final /* synthetic */ StoreMediaEngine this$0; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public StoreMediaEngine$selectDefaultVideoDevice$1(StoreMediaEngine storeMediaEngine, Function1 function1) { super(1); this.this$0 = storeMediaEngine; this.$onSelected = function1; } /* Return type fixed from 'java.lang.Object' to match base method */ /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */ @Override // kotlin.jvm.functions.Function1 public /* bridge */ /* synthetic */ Unit invoke(VideoInputDeviceDescription[] videoInputDeviceDescriptionArr) { invoke(videoInputDeviceDescriptionArr); return Unit.a; } public final void invoke(VideoInputDeviceDescription[] videoInputDeviceDescriptionArr) { boolean z2; VideoInputDeviceDescription videoInputDeviceDescription; m.checkNotNullParameter(videoInputDeviceDescriptionArr, "devices"); int length = videoInputDeviceDescriptionArr.length; int i = 0; while (true) { if (i >= length) { z2 = false; break; } else if (m.areEqual(videoInputDeviceDescriptionArr[i].getGuid(), StoreMediaEngine.access$getPreferredVideoInputDeviceGUID$p(this.this$0))) { z2 = true; break; } else { i++; } } String str = null; if (z2) { str = StoreMediaEngine.access$getPreferredVideoInputDeviceGUID$p(this.this$0); } else { int length2 = videoInputDeviceDescriptionArr.length; int i2 = 0; while (true) { if (i2 >= length2) { videoInputDeviceDescription = null; break; } videoInputDeviceDescription = videoInputDeviceDescriptionArr[i2]; if (videoInputDeviceDescription.getFacing() == VideoInputDeviceFacing.Front) { break; } i2++; } if (videoInputDeviceDescription == null) { videoInputDeviceDescription = (VideoInputDeviceDescription) k.firstOrNull(videoInputDeviceDescriptionArr); } if (videoInputDeviceDescription != null) { str = videoInputDeviceDescription.getGuid(); } } StoreMediaEngine.access$handleVideoInputDevices(this.this$0, videoInputDeviceDescriptionArr, str, this.$onSelected); } }