package com.ss.android.ttve.nativePort;

import X.8XX;
import X.C0347IDi;
import X.IL5;
import android.graphics.Bitmap;
import android.text.TextUtils;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import com.ss.android.ttve.model.VEMusicWaveBean;
import com.ss.android.vesdk.VEConfigCenter;
import com.ss.android.vesdk.VEException;
import java.io.File;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public final class TEVideoUtils {
    public static long getFrameInterval = 1000;

    public interface CompileProbeListener {
        static {
            Covode.recordClassIndex(49447);
        }

        void onCompileProbeResult(int i, int i2, float f, int i3, int i4, int i5, int i6, float f2);
    }

    public interface CompileProbeListener2 {
        static {
            Covode.recordClassIndex(49448);
        }

        void onCompileProbeResult2(int i, int i2, float f, float f2, int i3, int i4, int i5, int i6, float f3);
    }

    public interface ExecuteCommandAndDumpInfoListener {
        static {
            Covode.recordClassIndex(49449);
        }

        void updateFFmpegInfo(String str);
    }

    public static native boolean nativeApplyLensNightEnhance(int i, int i2, int i3, int i4, String str, String str2, byte[][] bArr, byte[] bArr2);

    public static native void nativeCancelCompileProbe();

    public static native int nativeCheckAudioFile(String str);

    public static native int nativeCheckMVResourceIntegrity(String str);

    public static native int nativeCheckMp3File(String str);

    public static native int nativeClearWavSeg(String str, int i, int i2);

    public static native int nativeCompileProbe(String str, String str2, int i, int i2, long j, long j2, int i3, int i4, int i5, long j3, double d, CompileProbeListener compileProbeListener, CompileProbeListener2 compileProbeListener2, int i6);

    public static native int nativeConcat(String[] strArr, String str, int i);

    public static native int nativeConcatRecordFrag(String[] strArr, long[] jArr, String[] strArr2, long[] jArr2, boolean z, int i, String str, String str2, String str3, String str4);

    public static native int nativeConverBitmapToRGBA(Bitmap bitmap, String str);

    public static native int nativeConverRGBAToIMG(String str, String str2, int i, int i2);

    public static native int nativeConvertJpegToMp4(String str, String str2, int i, boolean z);

    public static native long nativeCreateCurveSpeedUtils(float[] fArr, float[] fArr2);

    public static native long nativeCreateGetFrameHandler(String str);

    public static native long nativeCreateRTAudioWaveformMgr(int i, int i2, float f, int i3);

    public static native void nativeCurveSpeedDestroy(long j);

    public static native int nativeDeleteRTAudioWaveformMgr(long j);

    public static native int nativeDetachAudioFromVideos(String str, String[] strArr, long[] jArr, long[] jArr2, long j, long j2, float[] fArr, int i, int i2, int i3, int i4, boolean z);

    public static native int nativeDetectAudioMetrics(String str, String str2, String str3, Object obj);

    public static native int nativeExecuteFFmpegCommand(String str, ExecuteCommandListener executeCommandListener);

    public static native int nativeExecuteFFmpegCommandAndDumpInfo(String str, ExecuteCommandListener executeCommandListener, ExecuteCommandAndDumpInfoListener executeCommandAndDumpInfoListener);

    public static native int nativeExtractVideo(String str, String str2);

    public static native int nativeFindAudioSegmentStartTimeInOrigin(String str, int i, String str2, int i2, int i3);

    public static native String nativeFindBestRemuxSuffix(String str);

    public static native int nativeGenerateMuteWav(String str, int i, int i2, int i3);

    public static native int nativeGetAVFileInfoFromXml(String str, int[] iArr);

    public static native Object nativeGetAudioAlgorithmResult(String str, String str2, int i, int i2);

    public static native int nativeGetAudioFileInfo(String str, int[] iArr);

    public static native int nativeGetAudioFileInfoForAllTracks(String str, int[][] iArr);

    public static native double nativeGetAudioVolume(byte[] bArr, int i, int i2, int i3);

    public static native VEMusicWaveBean nativeGetAudioWaveData(String str, int i, int i2, int i3, int i4, int i5);

    public static native double nativeGetAveCurveSpeed(long j);

    public static native double nativeGetCurveSpeedWithSeqDelta(long j, long j2);

    public static native void nativeGetDstBitmapSize(long j, int i, int i2, int[] iArr);

    public static native int nativeGetFileAudio(String str, String str2, ArrayList<String> arrayList, boolean z);

    public static native Object nativeGetFileInfo(String str, int[] iArr);

    public static native int nativeGetFileType(String str);

    public static native int nativeGetFrameWithHandler(long j, Bitmap bitmap, int i, int i2, int i3, boolean z);

    public static native String nativeGetInfostickerConvertTotemplate(String str);

    public static native String nativeGetMD5FileName(String str, String str2);

    public static native Object nativeGetMVAlgorithmConfigs(String str, String[] strArr, int i);

    public static native String nativeGetMVAlgorithmConfigsWithMultiImage(String str, String[] strArr, int i);

    public static native int nativeGetMetaData(String str, ArrayList<String> arrayList);

    public static native int nativeGetMusicDefaultAlgorithm(String str, String str2);

    public static native VEMusicWaveBean nativeGetResampleMusicWaveData(float[] fArr, int i, int i2);

    public static native Object nativeGetVEFileInfo(String str);

    public static native int nativeGetVideoFrame(String str, int[] iArr, int i, int i2, boolean z, Object obj, int i3);

    public static native int nativeGetVideoFrame2(String str, int[] iArr, int i, int i2, boolean z, Object obj);

    public static native int nativeGetVideoFrame3(String str, int[] iArr, int i, int i2, boolean z, Object obj);

    public static native int nativeGetVideoFrameData(String str, int i, int i2, int i3, int i4, int i5, Object obj);

    public static native int nativeGetVideoFrameMore(String str, int[] iArr, int i, int i2, boolean z, boolean z2, int i3, boolean z3, Object obj);

    public static native int nativeGetVideoThumb(String str, int i, Object obj, boolean z, int i2, int i3, long j, int i4);

    public static native int nativeInitAREffect();

    public static native long nativeInitResampleContext(int i, int i2, int i3, int i4);

    public static native int nativeIsByteVC110Bit(byte[] bArr);

    public static native int nativeIsCanImport(String str);

    public static native int nativeIsCanImportFd(int i, long j, long j2);

    public static native int nativeIsCanTransCode(String str, int i, int i2);

    public static native int nativeIsCanTransCodeWithResult(String str, int i, int i2, String[] strArr);

    public static native boolean nativeIsFrameCanDrop(ByteBuffer byteBuffer, int i, boolean z);

    public static native boolean nativeIsSupportGLES3();

    public static native long nativeLoadModel(int i, String str);

    public static native long nativeMapSeqDeltaToTrimDelta(long j, long j2);

    public static native long nativeMapTrimDeltaToSeqDelta(long j, long j2);

    public static native int nativeMixAudio(ArrayList<String> arrayList, String str, Object obj);

    public static native int nativeMux(String str, String str2, String str3);

    public static native int nativePcmResampleFilter(long j, byte[] bArr, byte[] bArr2, int i, int i2);

    public static native int nativeProcessAudioTuning(String[] strArr, int[] iArr, int[] iArr2, float f, float f2, String str, String str2);

    public static native int nativeRTAudioWaveformFinish(long j);

    public static native int nativeRTAudioWaveformGetPoints(long j, float[] fArr, int i, int i2);

    public static native int nativeRTAudioWaveformProcess(long j, float[][] fArr, int i, int i2);

    public static native int nativeRTAudioWaveformReset(long j);

    public static native void nativeReleaseGetFrameHandler(long j);

    public static native int nativeReleaseGetFramesReader();

    public static native void nativeReleaseResampleContext(long j);

    public static native void nativeResetModel(long j);

    public static native int nativeReverseAllIFrameVideoAndMuxAudio(String str, String str2, String str3);

    public static native int nativeReverseAllIFrameVideoAndMuxAudio2(String str, String str2, String str3, TEReverseCallback tEReverseCallback);

    public static native int nativeReverseAllIVideo(String str, String str2);

    public static native int nativeReverseAllIVideo2(String str, String str2, TEReverseCallback tEReverseCallback);

    public static native int nativeSaveVideoFrames(String str, int[] iArr, int i, int i2, boolean z, String str2, int i3, int i4);

    public static native int nativeSetCurveSpeedData(long j, float[] fArr, float[] fArr2);

    public static native void nativeSetSeqDuration(long j, long j2);

    public static native int nativeSplitVideo(String str, String[] strArr, int[] iArr, boolean z);

    public static native int nativeTransCodecAudioFile(String str, int i, int i2, String str2, int i3, int i4, int i5);

    public static native int nativeTrimFile(String str, String str2, int[] iArr, int[] iArr2);

    public static native double nativeVoiceActivityDetection(byte[] bArr, long j, int i, int i2);

    static {
        Covode.recordClassIndex(49446);
        8XX.LIZ();
    }

    public static int initAREffect() {
        MethodCollector.i(13766);
        int nativeInitAREffect = nativeInitAREffect();
        MethodCollector.o(13766);
        return nativeInitAREffect;
    }

    public static boolean isSupportGLES3() {
        MethodCollector.i(12791);
        boolean nativeIsSupportGLES3 = nativeIsSupportGLES3();
        MethodCollector.o(12791);
        return nativeIsSupportGLES3;
    }

    public static int releaseGetFramesReader() {
        MethodCollector.i(9504);
        int nativeReleaseGetFramesReader = nativeReleaseGetFramesReader();
        MethodCollector.o(9504);
        return nativeReleaseGetFramesReader;
    }

    public static int checkAudioFile(String str) {
        MethodCollector.i(10897);
        int nativeCheckAudioFile = nativeCheckAudioFile(str);
        MethodCollector.o(10897);
        return nativeCheckAudioFile;
    }

    public static int checkMVResourceIntegrity(String str) {
        MethodCollector.i(5121);
        int nativeCheckMVResourceIntegrity = nativeCheckMVResourceIntegrity(str);
        MethodCollector.o(5121);
        return nativeCheckMVResourceIntegrity;
    }

    public static int checkMp3File(String str) {
        MethodCollector.i(10896);
        int nativeCheckMp3File = nativeCheckMp3File(str);
        MethodCollector.o(10896);
        return nativeCheckMp3File;
    }

    public static long createGetFrameHandler(String str) {
        MethodCollector.i(11588);
        long nativeCreateGetFrameHandler = nativeCreateGetFrameHandler(str);
        MethodCollector.o(11588);
        return nativeCreateGetFrameHandler;
    }

    public static int deleteRTAudioWaveformMgr(long j) {
        MethodCollector.i(12307);
        int nativeDeleteRTAudioWaveformMgr = nativeDeleteRTAudioWaveformMgr(j);
        MethodCollector.o(12307);
        return nativeDeleteRTAudioWaveformMgr;
    }

    public static int getFileType(String str) {
        MethodCollector.i(11113);
        int nativeGetFileType = nativeGetFileType(str);
        MethodCollector.o(11113);
        return nativeGetFileType;
    }

    public static String getInfostickerConvertTotemplate(String str) {
        MethodCollector.i(4951);
        String nativeGetInfostickerConvertTotemplate = nativeGetInfostickerConvertTotemplate(str);
        MethodCollector.o(4951);
        return nativeGetInfostickerConvertTotemplate;
    }

    public static Object getVEVideoFileInfo(String str) {
        MethodCollector.i(10255);
        Object nativeGetVEFileInfo = nativeGetVEFileInfo(str);
        MethodCollector.o(10255);
        return nativeGetVEFileInfo;
    }

    public static int isByteVC110Bit(byte[] bArr) {
        MethodCollector.i(13209);
        int nativeIsByteVC110Bit = nativeIsByteVC110Bit(bArr);
        MethodCollector.o(13209);
        return nativeIsByteVC110Bit;
    }

    public static void releaseGetFrameHandler(long j) {
        MethodCollector.i(11814);
        nativeReleaseGetFrameHandler(j);
        MethodCollector.o(11814);
    }

    public static void releaseResampleContext(long j) {
        MethodCollector.i(12241);
        nativeReleaseResampleContext(j);
        MethodCollector.o(12241);
    }

    public static void resetModel(long j) {
        MethodCollector.i(11339);
        nativeResetModel(j);
        MethodCollector.o(11339);
    }

    public static int rtAudioWaveformFinish(long j) {
        MethodCollector.i(12528);
        int nativeRTAudioWaveformFinish = nativeRTAudioWaveformFinish(j);
        MethodCollector.o(12528);
        return nativeRTAudioWaveformFinish;
    }

    public static int rtAudioWaveformReset(long j) {
        MethodCollector.i(12310);
        int nativeRTAudioWaveformReset = nativeRTAudioWaveformReset(j);
        MethodCollector.o(12310);
        return nativeRTAudioWaveformReset;
    }

    public static int isCanImport(String str) {
        MethodCollector.i(13001);
        if (TextUtils.isEmpty(str)) {
            MethodCollector.o(13001);
            return -100;
        }
        int nativeIsCanImport = nativeIsCanImport(str);
        MethodCollector.o(13001);
        return nativeIsCanImport;
    }

    public static String findBestRemuxSuffix(String str) {
        MethodCollector.i(13429);
        if (str.length() > 0) {
            String nativeFindBestRemuxSuffix = nativeFindBestRemuxSuffix(str);
            if (nativeFindBestRemuxSuffix.length() > 0) {
                MethodCollector.o(13429);
                return nativeFindBestRemuxSuffix;
            }
            VEException vEException = new VEException(-205, "This file does not support re-packaging for the time being!");
            MethodCollector.o(13429);
            throw vEException;
        }
        VEException vEException2 = new VEException(-100, "Please check the input parameters!");
        MethodCollector.o(13429);
        throw vEException2;
    }

    public static HashMap<String, String> getMetaData(String str) {
        MethodCollector.i(5221);
        ArrayList arrayList = new ArrayList();
        if (nativeGetMetaData(str, arrayList) != 0) {
            C0347IDi.LIZLLL("TEVideoUtils", "failed to get MetaData");
            MethodCollector.o(5221);
            return null;
        }
        HashMap<String, String> hashMap = new HashMap<>();
        for (int i = 0; i < arrayList.size() / 2; i++) {
            int i2 = i * 2;
            hashMap.put(arrayList.get(i2), arrayList.get(i2 + 1));
        }
        MethodCollector.o(5221);
        return hashMap;
    }

    public static int ConverBitmapToRGBA(Bitmap bitmap, String str) {
        MethodCollector.i(13956);
        int nativeConverBitmapToRGBA = nativeConverBitmapToRGBA(bitmap, str);
        MethodCollector.o(13956);
        return nativeConverBitmapToRGBA;
    }

    public static int concat(String[] strArr, String str) {
        MethodCollector.i(3403);
        int nativeConcat = nativeConcat(strArr, str, 0);
        MethodCollector.o(3403);
        return nativeConcat;
    }

    public static long createCurveSpeedUtils(float[] fArr, float[] fArr2) {
        MethodCollector.i(12305);
        long nativeCreateCurveSpeedUtils = nativeCreateCurveSpeedUtils(fArr, fArr2);
        MethodCollector.o(12305);
        return nativeCreateCurveSpeedUtils;
    }

    public static int executeFFmpegCommand(String str, ExecuteCommandListener executeCommandListener) {
        MethodCollector.i(11818);
        int nativeExecuteFFmpegCommand = nativeExecuteFFmpegCommand(str, executeCommandListener);
        MethodCollector.o(11818);
        return nativeExecuteFFmpegCommand;
    }

    public static int extractVideo(String str, String str2) {
        MethodCollector.i(13762);
        int nativeExtractVideo = nativeExtractVideo(str, str2);
        MethodCollector.o(13762);
        return nativeExtractVideo;
    }

    public static int getAVFileInfoFromXml(String str, int[] iArr) {
        MethodCollector.i(10681);
        int nativeGetAVFileInfoFromXml = nativeGetAVFileInfoFromXml(str, iArr);
        MethodCollector.o(10681);
        return nativeGetAVFileInfoFromXml;
    }

    public static int getAudioFileInfo(String str, int[] iArr) {
        MethodCollector.i(10895);
        int nativeGetAudioFileInfo = nativeGetAudioFileInfo(str, iArr);
        MethodCollector.o(10895);
        return nativeGetAudioFileInfo;
    }

    public static int getAudioFileInfoForAllTracks(String str, int[][] iArr) {
        MethodCollector.i(11340);
        int nativeGetAudioFileInfoForAllTracks = nativeGetAudioFileInfoForAllTracks(str, iArr);
        MethodCollector.o(11340);
        return nativeGetAudioFileInfoForAllTracks;
    }

    public static String getMD5FileName(String str, String str2) {
        MethodCollector.i(10254);
        String nativeGetMD5FileName = nativeGetMD5FileName(str, str2);
        MethodCollector.o(10254);
        return nativeGetMD5FileName;
    }

    public static int getMusicDefaultAlgorithm(String str, String str2) {
        MethodCollector.i(13382);
        int nativeGetMusicDefaultAlgorithm = nativeGetMusicDefaultAlgorithm(str, str2);
        MethodCollector.o(13382);
        return nativeGetMusicDefaultAlgorithm;
    }

    public static Object getVideoFileInfo(String str, int[] iArr) {
        MethodCollector.i(10473);
        Object nativeGetFileInfo = nativeGetFileInfo(str, iArr);
        MethodCollector.o(10473);
        return nativeGetFileInfo;
    }

    public static long loadModel(int i, String str) {
        MethodCollector.i(11337);
        long nativeLoadModel = nativeLoadModel(i, str);
        MethodCollector.o(11337);
        return nativeLoadModel;
    }

    public static int reverseAllIVideo(String str, String str2) {
        MethodCollector.i(12455);
        int nativeReverseAllIVideo = nativeReverseAllIVideo(str, str2);
        MethodCollector.o(12455);
        return nativeReverseAllIVideo;
    }

    public static Object getMVAlgorithmConfigs(String str, List<String> list) {
        MethodCollector.i(5046);
        int size = list.size();
        String[] strArr = new String[size];
        list.toArray(strArr);
        Object nativeGetMVAlgorithmConfigs = nativeGetMVAlgorithmConfigs(str, strArr, size);
        MethodCollector.o(5046);
        return nativeGetMVAlgorithmConfigs;
    }

    public static String getMVAlgorithmConfigsWithMultiImage(String str, List<String> list) {
        MethodCollector.i(5056);
        int size = list.size();
        String[] strArr = new String[size];
        list.toArray(strArr);
        String nativeGetMVAlgorithmConfigsWithMultiImage = nativeGetMVAlgorithmConfigsWithMultiImage(str, strArr, size);
        MethodCollector.o(5056);
        return nativeGetMVAlgorithmConfigsWithMultiImage;
    }

    public static int clearWavSeg(String str, int i, int i2) {
        MethodCollector.i(13765);
        int nativeClearWavSeg = nativeClearWavSeg(str, i, i2);
        MethodCollector.o(13765);
        return nativeClearWavSeg;
    }

    public static int executeFFmpegCommandAndDumpInfo(String str, ExecuteCommandListener executeCommandListener, ExecuteCommandAndDumpInfoListener executeCommandAndDumpInfoListener) {
        MethodCollector.i(12029);
        int nativeExecuteFFmpegCommandAndDumpInfo = nativeExecuteFFmpegCommandAndDumpInfo(str, executeCommandListener, executeCommandAndDumpInfoListener);
        MethodCollector.o(12029);
        return nativeExecuteFFmpegCommandAndDumpInfo;
    }

    public static VEMusicWaveBean getResampleMusicWaveData(float[] fArr, int i, int i2) {
        MethodCollector.i(12095);
        VEMusicWaveBean nativeGetResampleMusicWaveData = nativeGetResampleMusicWaveData(fArr, i, i2);
        MethodCollector.o(12095);
        return nativeGetResampleMusicWaveData;
    }

    public static int isCanTransCode(String str, int i, int i2) {
        MethodCollector.i(12237);
        int nativeIsCanTransCode = nativeIsCanTransCode(str, i, i2);
        MethodCollector.o(12237);
        return nativeIsCanTransCode;
    }

    public static boolean isFrameCanDrop(ByteBuffer byteBuffer, int i, boolean z) {
        MethodCollector.i(13428);
        boolean nativeIsFrameCanDrop = nativeIsFrameCanDrop(byteBuffer, i, z);
        MethodCollector.o(13428);
        return nativeIsFrameCanDrop;
    }

    public static int mixAudio(ArrayList<String> arrayList, String str, Object obj) {
        MethodCollector.i(13763);
        int nativeMixAudio = nativeMixAudio(arrayList, str, obj);
        MethodCollector.o(13763);
        return nativeMixAudio;
    }

    public static int mux(String str, String str2, String str3) {
        MethodCollector.i(9983);
        int nativeMux = nativeMux(str, str2, str3);
        MethodCollector.o(9983);
        return nativeMux;
    }

    public static int reverseAllIVideoAndMuxAudio(String str, String str2, String str3) {
        MethodCollector.i(13171);
        int nativeReverseAllIFrameVideoAndMuxAudio = nativeReverseAllIFrameVideoAndMuxAudio(str, str2, str3);
        MethodCollector.o(13171);
        return nativeReverseAllIFrameVideoAndMuxAudio;
    }

    public static int concat(String[] strArr, String str, int i) {
        MethodCollector.i(3400);
        int nativeConcat = nativeConcat(strArr, str, i);
        MethodCollector.o(3400);
        return nativeConcat;
    }

    public static int isCanImportFd(int i, long j, long j2) {
        MethodCollector.i(13210);
        if (i <= 0) {
            MethodCollector.o(13210);
            return -100;
        }
        int nativeIsCanImportFd = nativeIsCanImportFd(i, j, j2);
        MethodCollector.o(13210);
        return nativeIsCanImportFd;
    }

    public static int reverseAllIVideo(String str, String str2, TEReverseCallback tEReverseCallback) {
        MethodCollector.i(13172);
        int nativeReverseAllIVideo2 = nativeReverseAllIVideo2(str, str2, tEReverseCallback);
        MethodCollector.o(13172);
        return nativeReverseAllIVideo2;
    }

    public static int ConverRGBAToIMG(String str, String str2, int i, int i2) {
        MethodCollector.i(13954);
        int nativeConverRGBAToIMG = nativeConverRGBAToIMG(str, str2, i, i2);
        MethodCollector.o(13954);
        return nativeConverRGBAToIMG;
    }

    public static int convertJpegToMp4(String str, String str2, int i, boolean z) {
        MethodCollector.i(4882);
        int nativeConvertJpegToMp4 = nativeConvertJpegToMp4(str, str2, i, z);
        MethodCollector.o(4882);
        return nativeConvertJpegToMp4;
    }

    public static long createRTAudioWaveformMgr(int i, int i2, float f, int i3) {
        MethodCollector.i(12306);
        long nativeCreateRTAudioWaveformMgr = nativeCreateRTAudioWaveformMgr(i, i2, f, i3);
        MethodCollector.o(12306);
        return nativeCreateRTAudioWaveformMgr;
    }

    public static int detectAudioMetrics(String str, String str2, String str3, Object obj) {
        MethodCollector.i(13760);
        int nativeDetectAudioMetrics = nativeDetectAudioMetrics(str, str2, str3, obj);
        MethodCollector.o(13760);
        return nativeDetectAudioMetrics;
    }

    public static int generateMuteWav(String str, int i, int i2, int i3) {
        MethodCollector.i(13764);
        int nativeGenerateMuteWav = nativeGenerateMuteWav(str, i, i2, i3);
        MethodCollector.o(13764);
        return nativeGenerateMuteWav;
    }

    public static Object getAudioAlgorithmResult(String str, String str2, int i, int i2) {
        MethodCollector.i(13383);
        Object nativeGetAudioAlgorithmResult = nativeGetAudioAlgorithmResult(str, str2, i, i2);
        MethodCollector.o(13383);
        return nativeGetAudioAlgorithmResult;
    }

    public static double getAudioVolume(byte[] bArr, int i, int i2, int i3) {
        MethodCollector.i(11112);
        double nativeGetAudioVolume = nativeGetAudioVolume(bArr, i, i2, i3);
        MethodCollector.o(11112);
        return nativeGetAudioVolume;
    }

    public static int getFileAudio(String str, String str2, ArrayList<String> arrayList, boolean z) {
        MethodCollector.i(13761);
        int nativeGetFileAudio = nativeGetFileAudio(str, str2, arrayList, z);
        MethodCollector.o(13761);
        return nativeGetFileAudio;
    }

    public static long initResampleContext(int i, int i2, int i3, int i4) {
        MethodCollector.i(12239);
        long nativeInitResampleContext = nativeInitResampleContext(i, i2, i3, i4);
        MethodCollector.o(12239);
        return nativeInitResampleContext;
    }

    public static int isCanTransCodeWithResult(String str, int i, int i2, String[] strArr) {
        MethodCollector.i(12238);
        int nativeIsCanTransCodeWithResult = nativeIsCanTransCodeWithResult(str, i, i2, strArr);
        MethodCollector.o(12238);
        return nativeIsCanTransCodeWithResult;
    }

    public static int rtAudioWaveformGetPoints(long j, float[] fArr, int i, int i2) {
        MethodCollector.i(12309);
        int nativeRTAudioWaveformGetPoints = nativeRTAudioWaveformGetPoints(j, fArr, i, i2);
        MethodCollector.o(12309);
        return nativeRTAudioWaveformGetPoints;
    }

    public static int rtAudioWaveformProcess(long j, float[][] fArr, int i, int i2) {
        MethodCollector.i(12308);
        int nativeRTAudioWaveformProcess = nativeRTAudioWaveformProcess(j, fArr, i, i2);
        MethodCollector.o(12308);
        return nativeRTAudioWaveformProcess;
    }

    public static int splitVideo(String str, String[] strArr, int[] iArr, boolean z) {
        MethodCollector.i(9984);
        int nativeSplitVideo = nativeSplitVideo(str, strArr, iArr, z);
        MethodCollector.o(9984);
        return nativeSplitVideo;
    }

    public static int trimVideoFile(String str, int[] iArr, String str2, int[] iArr2) {
        MethodCollector.i(13174);
        int nativeTrimFile = nativeTrimFile(str, str2, iArr, iArr2);
        MethodCollector.o(13174);
        return nativeTrimFile;
    }

    public static double voiceActivityDetection(byte[] bArr, long j, int i, int i2) {
        MethodCollector.i(11338);
        double nativeVoiceActivityDetection = nativeVoiceActivityDetection(bArr, j, i, i2);
        MethodCollector.o(11338);
        return nativeVoiceActivityDetection;
    }

    public static int reverseAllIVideoAndMuxAudio(String str, String str2, String str3, TEReverseCallback tEReverseCallback) {
        MethodCollector.i(13173);
        int nativeReverseAllIFrameVideoAndMuxAudio2 = nativeReverseAllIFrameVideoAndMuxAudio2(str, str2, str3, tEReverseCallback);
        MethodCollector.o(13173);
        return nativeReverseAllIFrameVideoAndMuxAudio2;
    }

    public static int findAudioSegmentStartTimeInOrigin(String str, int i, String str2, int i2, int i3) {
        MethodCollector.i(13729);
        int nativeFindAudioSegmentStartTimeInOrigin = nativeFindAudioSegmentStartTimeInOrigin(str, i, str2, i2, i3);
        MethodCollector.o(13729);
        return nativeFindAudioSegmentStartTimeInOrigin;
    }

    public static int pcmResampleFilter(long j, byte[] bArr, byte[] bArr2, int i, int i2) {
        MethodCollector.i(12240);
        int nativePcmResampleFilter = nativePcmResampleFilter(j, bArr, bArr2, i, i2);
        MethodCollector.o(12240);
        return nativePcmResampleFilter;
    }

    public static Bitmap getFrameWithHandler(long j, int i, int i2, int i3, boolean z) {
        MethodCollector.i(11590);
        int[] iArr = new int[2];
        long j2 = j;
        nativeGetDstBitmapSize(j2, i2, i3, iArr);
        Bitmap createBitmap = Bitmap.createBitmap(iArr[0], iArr[1], Bitmap.Config.ARGB_8888);
        if (createBitmap == null) {
            MethodCollector.o(11590);
            return null;
        }
        if (nativeGetFrameWithHandler(j2, createBitmap, i, iArr[0], iArr[1], z) != 0) {
            if (!createBitmap.isRecycled()) {
                createBitmap.recycle();
            }
            createBitmap = null;
        }
        MethodCollector.o(11590);
        return createBitmap;
    }

    public static VEMusicWaveBean getAudioWaveData(String str, int i, int i2, int i3, int i4, int i5) {
        MethodCollector.i(11341);
        VEMusicWaveBean nativeGetAudioWaveData = nativeGetAudioWaveData(str, i, i2, i3, i4, i5);
        MethodCollector.o(11341);
        return nativeGetAudioWaveData;
    }

    public static int getVideoFrames2(String str, int[] iArr, int i, int i2, boolean z, Object obj) {
        MethodCollector.i(9299);
        int nativeGetVideoFrame2 = nativeGetVideoFrame2(str, iArr, i, i2, z, obj);
        MethodCollector.o(9299);
        return nativeGetVideoFrame2;
    }

    public static int getVideoFrames3(String str, int[] iArr, int i, int i2, boolean z, Object obj) {
        MethodCollector.i(9503);
        int nativeGetVideoFrame3 = nativeGetVideoFrame3(str, iArr, i, i2, z, obj);
        MethodCollector.o(9503);
        return nativeGetVideoFrame3;
    }

    public static int getVideoFrames(String str, int[] iArr, int i, int i2, boolean z, Object obj, int i3) {
        MethodCollector.i(13768);
        int nativeGetVideoFrame = nativeGetVideoFrame(str, iArr, i, i2, z, obj, i3);
        MethodCollector.o(13768);
        return nativeGetVideoFrame;
    }

    public static int processAudioTuning(String[] strArr, int[] iArr, int[] iArr2, float f, float f2, String str, String str2) {
        MethodCollector.i(13431);
        int nativeProcessAudioTuning = nativeProcessAudioTuning(strArr, iArr, iArr2, f, f2, str, str2);
        MethodCollector.o(13431);
        return nativeProcessAudioTuning;
    }

    public static int getVideoFrameData(String str, int i, int i2, int i3, int i4, IL5 il5, Object obj) {
        MethodCollector.i(13767);
        int nativeGetVideoFrameData = nativeGetVideoFrameData(str, i, i2, i3, i4, il5.getValue(), obj);
        MethodCollector.o(13767);
        return nativeGetVideoFrameData;
    }

    /*  JADX ERROR: JadxRuntimeException in pass: CodeShrinkVisitor
        jadx.core.utils.exceptions.JadxRuntimeException: Don't wrap MOVE or CONST insns: 0x0009: MOVE  (r4v0 int) = (r10v0 int)
        	at jadx.core.dex.instructions.args.InsnArg.wrapArg(InsnArg.java:164)
        	at jadx.core.dex.visitors.shrink.CodeShrinkVisitor.assignInline(CodeShrinkVisitor.java:133)
        	at jadx.core.dex.visitors.shrink.CodeShrinkVisitor.checkInline(CodeShrinkVisitor.java:118)
        	at jadx.core.dex.visitors.shrink.CodeShrinkVisitor.shrinkBlock(CodeShrinkVisitor.java:65)
        	at jadx.core.dex.visitors.shrink.CodeShrinkVisitor.shrinkMethod(CodeShrinkVisitor.java:43)
        	at jadx.core.dex.visitors.shrink.CodeShrinkVisitor.visit(CodeShrinkVisitor.java:35)
        */
    public static byte[] applyLensNightEnhance(int r9, int r10, int r11, int r12, java.lang.String r13, java.lang.String r14, byte[][] r15) {
        /*
            r2 = 5016(0x1398, float:7.029E-42)
            com.bytedance.frameworks.apm.trace.MethodCollector.i(r2)
            r1 = 0
            r3 = r9
            if (r3 <= 0) goto L_0x000c
            r4 = r10
            if (r4 > 0) goto L_0x0010
        L_0x000c:
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r2)
            return r1
        L_0x0010:
            r9 = r15
            int r0 = r9.length
            r6 = r12
            if (r6 >= r0) goto L_0x0019
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r2)
            return r1
        L_0x0019:
            int r0 = r3 * r4
            int r0 = r0 * 3
            int r0 = r0 / 2
            byte[] r10 = new byte[r0]
            r8 = r14
            r5 = r11
            r7 = r13
            boolean r0 = nativeApplyLensNightEnhance(r3, r4, r5, r6, r7, r8, r9, r10)
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r2)
            if (r0 == 0) goto L_0x002e
            return r10
        L_0x002e:
            return r1
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ttve.nativePort.TEVideoUtils.applyLensNightEnhance(int, int, int, int, java.lang.String, java.lang.String, byte[][]):byte[]");
    }

    public static int transCodeAudioFile(String str, int i, int i2, String str2, int i3, int i4, int i5) {
        MethodCollector.i(13430);
        if (TextUtils.isEmpty(str)) {
            MethodCollector.o(13430);
            return -100;
        } else if (TextUtils.isEmpty(str2)) {
            MethodCollector.o(13430);
            return -100;
        } else {
            int nativeTransCodecAudioFile = nativeTransCodecAudioFile(str, i, i2, str2, i3, i4, i5);
            MethodCollector.o(13430);
            return nativeTransCodecAudioFile;
        }
    }

    public static int getVideoThumb(String str, int i, Object obj, boolean z, int i2, int i3, long j, int i4) {
        MethodCollector.i(11815);
        int nativeGetVideoThumb = nativeGetVideoThumb(str, i, obj, z, i2, i3, j, i4);
        MethodCollector.o(11815);
        return nativeGetVideoThumb;
    }

    public static int saveVideoFrames(String str, int[] iArr, int i, int i2, boolean z, String str2, int i3, int i4) {
        MethodCollector.i(11111);
        int nativeSaveVideoFrames = nativeSaveVideoFrames(str, iArr, i, i2, z, str2, i3, i4);
        MethodCollector.o(11111);
        return nativeSaveVideoFrames;
    }

    public static int getVideoFramesMore(String str, int[] iArr, int i, int i2, boolean z, boolean z2, int i3, boolean z3, Object obj) {
        MethodCollector.i(11342);
        int nativeGetVideoFrameMore = nativeGetVideoFrameMore(str, iArr, i, i2, z, z2, i3, z3, obj);
        MethodCollector.o(11342);
        return nativeGetVideoFrameMore;
    }

    public static int detachAudioFromVideos(String str, String[] strArr, long[] jArr, long[] jArr2, long j, long j2, float[] fArr, int i, int i2, int i3) {
        MethodCollector.i(11816);
        long j3 = j;
        long[] jArr3 = jArr2;
        long[] jArr4 = jArr;
        int i4 = i;
        float[] fArr2 = fArr;
        String[] strArr2 = strArr;
        String str2 = str;
        int nativeDetachAudioFromVideos = nativeDetachAudioFromVideos(str2, strArr2, jArr4, jArr3, j3, j2, fArr2, i4, i2, i3, 0, VEConfigCenter.getInstance().getValue("ve_enable_fix_detach_wav_format", true).booleanValue());
        MethodCollector.o(11816);
        return nativeDetachAudioFromVideos;
    }

    public static int concatRecordFrag(String[] strArr, long[] jArr, String[] strArr2, long[] jArr2, boolean z, int i, String str, String str2, String str3, String str4) {
        MethodCollector.i(5208);
        String str5 = str3;
        if (!TextUtils.isEmpty(str5)) {
            String str6 = str4;
            if (!TextUtils.isEmpty(str6) && strArr.length != 0 && jArr.length == strArr.length && strArr.length == strArr2.length && strArr.length == jArr2.length) {
                File file = new File(str5.substring(0, str5.lastIndexOf("/")));
                if (file.exists() || file.mkdirs()) {
                    File file2 = new File(str6.substring(0, str6.lastIndexOf("/")));
                    if (file2.exists() || file2.mkdirs()) {
                        int nativeConcatRecordFrag = nativeConcatRecordFrag(strArr, jArr, strArr2, jArr2, z, i, str, str2, str5, str6);
                        MethodCollector.o(5208);
                        return nativeConcatRecordFrag;
                    }
                    C0347IDi.LIZLLL("TEVideoUtils", "create audio output dir failed. Output audio Directory: ".concat(String.valueOf(str6)));
                    MethodCollector.o(5208);
                    return -114;
                }
                C0347IDi.LIZLLL("TEVideoUtils", "create video output dir failed. Output Video Directory: ".concat(String.valueOf(str5)));
                MethodCollector.o(5208);
                return -114;
            }
        }
        C0347IDi.LIZLLL("TEVideoUtils", "ConmatRecordFrag parameter error!");
        MethodCollector.o(5208);
        return -100;
    }

    public static int detachAudioFromVideos(String str, String[] strArr, long[] jArr, long[] jArr2, long j, long j2, float[] fArr, int i, int i2, int i3, int i4) {
        MethodCollector.i(11817);
        long j3 = j;
        long[] jArr3 = jArr2;
        long[] jArr4 = jArr;
        String str2 = str;
        int i5 = i2;
        int i6 = i;
        float[] fArr2 = fArr;
        String[] strArr2 = strArr;
        int nativeDetachAudioFromVideos = nativeDetachAudioFromVideos(str2, strArr2, jArr4, jArr3, j3, j2, fArr2, i6, i5, i3, i4, VEConfigCenter.getInstance().getValue("ve_enable_fix_detach_wav_format", true).booleanValue());
        MethodCollector.o(11817);
        return nativeDetachAudioFromVideos;
    }
}
