package g7;

import android.os.RemoteException;
import androidx.annotation.Nullable;
import n7.p2;
import n7.s3;

/* JADX INFO: loaded from: classes2.dex */
public final class x {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final Object f26314a = new Object();

    @Nullable
    private p2 zzb;

    @Nullable
    private w zzc;

    @Nullable
    public w getVideoLifecycleCallbacks() {
        w wVar;
        synchronized (this.f26314a) {
            wVar = this.zzc;
        }
        return wVar;
    }

    public void setVideoLifecycleCallbacks(@Nullable w wVar) {
        s3 s3Var;
        synchronized (this.f26314a) {
            this.zzc = wVar;
            p2 p2Var = this.zzb;
            if (p2Var == null) {
                return;
            }
            if (wVar == null) {
                s3Var = null;
            } else {
                try {
                    s3Var = new s3(wVar);
                } catch (RemoteException unused) {
                }
            }
            p2Var.zzl(s3Var);
        }
    }

    public final void zza(@Nullable p2 p2Var) {
        synchronized (this.f26314a) {
            try {
                this.zzb = p2Var;
                w wVar = this.zzc;
                if (wVar != null) {
                    setVideoLifecycleCallbacks(wVar);
                }
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    @Nullable
    public final p2 zzb() {
        p2 p2Var;
        synchronized (this.f26314a) {
            p2Var = this.zzb;
        }
        return p2Var;
    }
}
