package com.mstar.android.media;

import android.util.Log;

/* JADX INFO: loaded from: classes.dex */
public final class DVStreamInfo {
    public static final int DV_STREAM_LEVEL_ID_FHD24 = 4;
    public static final int DV_STREAM_LEVEL_ID_FHD30 = 8;
    public static final int DV_STREAM_LEVEL_ID_FHD60 = 16;
    public static final int DV_STREAM_LEVEL_ID_HD24 = 1;
    public static final int DV_STREAM_LEVEL_ID_HD30 = 2;
    public static final int DV_STREAM_LEVEL_ID_UHD24 = 32;
    public static final int DV_STREAM_LEVEL_ID_UHD30 = 64;
    public static final int DV_STREAM_LEVEL_ID_UHD48 = 128;
    public static final int DV_STREAM_LEVEL_ID_UHD60 = 256;
    public static final int DV_STREAM_LEVEL_ID_UNSUPPORTED = 0;
    public static final int DV_STREAM_PROFILE_ID_DVAV_PEN = 2;
    public static final int DV_STREAM_PROFILE_ID_DVAV_PER = 1;
    public static final int DV_STREAM_PROFILE_ID_DVHE_DEN = 8;
    public static final int DV_STREAM_PROFILE_ID_DVHE_DER = 4;
    public static final int DV_STREAM_PROFILE_ID_DVHE_DTH = 64;
    public static final int DV_STREAM_PROFILE_ID_DVHE_DTR = 16;
    public static final int DV_STREAM_PROFILE_ID_DVHE_STN = 32;
    public static final int DV_STREAM_PROFILE_ID_UNSUPPORTED = 0;
    public static final int DV_STREAM_STREAM_TYPE_DV = 1;
    public static final int DV_STREAM_STREAM_TYPE_HDR10 = 4;
    public static final int DV_STREAM_STREAM_TYPE_NULL = 0;
    public static final int DV_STREAM_STREAM_TYPE_SDR = 2;
    private static final boolean LOGD = true;
    private static final String TAG = "DVStreamInfo";
    private int mInputStreamType = 0;
    private int mInputDVStreamLevel = 2;
    private int mInputDVStreamProfile = 4;
    private final int[] mDVProfileIdMap = {1, 2, 4, 8, 16, 32, 64};
    private final int[] mDVLevelIdMap = {0, 1, 2, 4, 8, 16, 32, 64, 128, 256};
    private final int[] mStreamTypeMap = {1, 2, 4};

    public enum DVStatusCodes {
        DV_STATUS_SUCCESS(0),
        DV_ERR_UNSUPPORTED_PROFILE(1),
        DV_ERR_UNSUPPORTED_LEVEL(2),
        DV_ERR_UNSUPPORTED_STREAM_TYPE(3);

        private int status;

        DVStatusCodes(int i2) {
            this.status = i2;
        }
    }

    static {
        System.loadLibrary("dvstreaminfo_jni");
    }

    public DVStreamInfo() {
        Log.d(TAG, "DVStreamInfo constructed");
    }

    private final native int native_getDVLevel();

    private final native int native_getDVProfile();

    private final native int native_getStreamType();

    private final native int native_getSupportedDVLevels(int i2);

    private final native int native_getSupportedDVProfiles();

    private final native int native_getSupportedStreamTypes();

    private final native int native_setDVLevel(int i2);

    private final native int native_setDVProfile(int i2);

    private final native int native_setStreamType(int i2);

    public int getDVLevel() {
        return native_getDVLevel();
    }

    public int getDVProfile() {
        return native_getDVProfile();
    }

    public int getStreamType() {
        return native_getStreamType();
    }

    public int getSupportedDVLevels(int i2) {
        return native_getSupportedDVLevels(i2);
    }

    public int getSupportedDVProfiles() {
        return native_getSupportedDVProfiles();
    }

    public int getSupportedStreamTypes() {
        return native_getSupportedStreamTypes();
    }

    public DVStatusCodes setDVLevel(int i2) {
        if (i2 != 0 && i2 != 1 && i2 != 2 && i2 != 4 && i2 != 8 && i2 != 16 && i2 != 32 && i2 != 64 && i2 != 128 && i2 != 256) {
            return DVStatusCodes.DV_ERR_UNSUPPORTED_LEVEL;
        }
        this.mInputDVStreamLevel = i2;
        native_setDVLevel(i2);
        return DVStatusCodes.DV_STATUS_SUCCESS;
    }

    public DVStatusCodes setDVProfile(int i2) {
        if (i2 != 0 && i2 != 1 && i2 != 2 && i2 != 4 && i2 != 8 && i2 != 16 && i2 != 32 && i2 != 64) {
            return DVStatusCodes.DV_ERR_UNSUPPORTED_PROFILE;
        }
        this.mInputDVStreamProfile = i2;
        native_setDVProfile(i2);
        return DVStatusCodes.DV_STATUS_SUCCESS;
    }

    public DVStatusCodes setStreamType(int i2) {
        if (i2 != 1 && i2 != 2 && i2 != 4) {
            return DVStatusCodes.DV_ERR_UNSUPPORTED_STREAM_TYPE;
        }
        this.mInputStreamType = i2;
        native_setStreamType(i2);
        return DVStatusCodes.DV_STATUS_SUCCESS;
    }
}
