package com.bytedance.ies.nle.editor_jni;

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

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

    static {
        Covode.recordClassIndex(29790);
    }

    public void finalize() {
        delete();
    }

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

    public NLEEncodeListenerWrapper() {
        this(NLEMediaPublicJniJNI.new_NLEEncodeListenerWrapper(), true);
        MethodCollector.i(18546);
        NLEMediaPublicJniJNI.NLEEncodeListenerWrapper_director_connect(this, this.swigCPtr, true, true);
        MethodCollector.o(18546);
    }

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

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

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

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

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

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

    public void onCompressBuffer(byte[] bArr, int i, int i2, boolean z) {
        MethodCollector.i(18545);
        NLEMediaPublicJniJNI.NLEEncodeListenerWrapper_onCompressBuffer(this.swigCPtr, this, bArr, i, i2, z);
        MethodCollector.o(18545);
    }
}
