package com.bytedance.ies.nle.editor_jni;

import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;

public class NLEOnFrameAvailableWrapper {
    public transient boolean swigCMemOwn;
    public transient long swigCPtr;

    static {
        Covode.recordClassIndex(29831);
    }

    public void finalize() {
        delete();
    }

    public void swigDirectorDisconnect() {
        swigSetCMemOwn(false);
        delete();
    }

    public NLEOnFrameAvailableWrapper() {
        this(NLEMediaPublicJniJNI.new_NLEOnFrameAvailableWrapper(), true);
        MethodCollector.i(14923);
        NLEMediaPublicJniJNI.NLEOnFrameAvailableWrapper_director_connect(this, this.swigCPtr, true, true);
        MethodCollector.o(14923);
    }

    public void swigReleaseOwnership() {
        MethodCollector.i(14709);
        swigSetCMemOwn(false);
        NLEMediaPublicJniJNI.NLEOnFrameAvailableWrapper_change_ownership(this, this.swigCPtr, false);
        MethodCollector.o(14709);
    }

    public void swigTakeOwnership() {
        MethodCollector.i(14710);
        swigSetCMemOwn(true);
        NLEMediaPublicJniJNI.NLEOnFrameAvailableWrapper_change_ownership(this, this.swigCPtr, true);
        MethodCollector.o(14710);
    }

    public synchronized void delete() {
        MethodCollector.i(14497);
        long j = this.swigCPtr;
        if (j != 0) {
            if (this.swigCMemOwn) {
                this.swigCMemOwn = false;
                NLEMediaPublicJniJNI.delete_NLEOnFrameAvailableWrapper(j);
            }
            this.swigCPtr = 0;
        }
        MethodCollector.o(14497);
    }

    public void swigSetCMemOwn(boolean z) {
        this.swigCMemOwn = z;
    }

    public static long getCPtr(NLEOnFrameAvailableWrapper nLEOnFrameAvailableWrapper) {
        if (nLEOnFrameAvailableWrapper == null) {
            return 0;
        }
        return nLEOnFrameAvailableWrapper.swigCPtr;
    }

    public NLEOnFrameAvailableWrapper(long j, boolean z) {
        this.swigCMemOwn = z;
        this.swigCPtr = j;
    }

    public boolean onGetFrame(byte[] bArr, long j, long j2, long j3) {
        MethodCollector.i(14924);
        boolean NLEOnFrameAvailableWrapper_onGetFrame = NLEMediaPublicJniJNI.NLEOnFrameAvailableWrapper_onGetFrame(this.swigCPtr, this, bArr, j, j2, j3);
        MethodCollector.o(14924);
        return NLEOnFrameAvailableWrapper_onGetFrame;
    }
}
