package com.mstar.android.tvapi.common;

import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.Parcel;
import android.util.Log;
import com.mstar.android.tvapi.common.exception.TvCommonException;
import com.mstar.android.tvapi.common.exception.TvNativeCallFailException;
import com.mstar.android.tvapi.common.listener.OnEventListener;
import com.mstar.android.tvapi.common.listener.OnPictureEventListener;
import com.mstar.android.tvapi.common.vo.ColorTemperatureExData;
import com.mstar.android.tvapi.common.vo.EnumLocalDimmingMode;
import com.mstar.android.tvapi.common.vo.EnumMfcMode;
import com.mstar.android.tvapi.common.vo.EnumMfcOsdWindow;
import com.mstar.android.tvapi.common.vo.EnumPanelTiming;
import com.mstar.android.tvapi.common.vo.EnumScalerWindow;
import com.mstar.android.tvapi.common.vo.EnumUrsaMode;
import com.mstar.android.tvapi.common.vo.EnumVideoArcType;
import com.mstar.android.tvapi.common.vo.Film;
import com.mstar.android.tvapi.common.vo.GammaTable;
import com.mstar.android.tvapi.common.vo.GetPixelRgbStage;
import com.mstar.android.tvapi.common.vo.HdrAttribute;
import com.mstar.android.tvapi.common.vo.MpegNoiseReduction;
import com.mstar.android.tvapi.common.vo.MweType;
import com.mstar.android.tvapi.common.vo.NoiseReduction;
import com.mstar.android.tvapi.common.vo.PanelProperty;
import com.mstar.android.tvapi.common.vo.PglValue;
import com.mstar.android.tvapi.common.vo.PqRange;
import com.mstar.android.tvapi.common.vo.Rgb_Data;
import com.mstar.android.tvapi.common.vo.ScreenPixelInfo;
import com.mstar.android.tvapi.common.vo.SetLocationType;
import com.mstar.android.tvapi.common.vo.SwdrLevel;
import com.mstar.android.tvapi.common.vo.TestPattern;
import com.mstar.android.tvapi.common.vo.TimingInfo;
import com.mstar.android.tvapi.common.vo.UltraBlackWhite;
import com.mstar.android.tvapi.common.vo.VideoWindowType;
import java.lang.ref.WeakReference;

/* JADX INFO: loaded from: classes.dex */
public final class PictureManager {
    public static final String FHD_40_INX = "InxFullHD40";
    public static final String FHD_40_NON_DS = "FullHD40";
    public static final String FHD_46_NON_DS = "FullHD46";
    public static final String FHD_50_INX = "InxFullHD50";
    public static final String FHD_52_DS = "DoubleScan52";
    public static final String FHD_60_DS = "DoubleScan60";
    public static final String FHD_70_DS = "DoubleScan70";
    public static final int INDEX_B_LV_HIGH = 7;
    public static final int INDEX_B_LV_LOW = 4;
    public static final int INDEX_B_LV_MAX = 10;
    public static final int INDEX_G_LV_HIGH = 6;
    public static final int INDEX_G_LV_LOW = 3;
    public static final int INDEX_G_LV_MAX = 9;
    public static final int INDEX_HIGH_LEVEL_FIX = 13;
    public static final int INDEX_IN_POINT_HIGH = 1;
    public static final int INDEX_IN_POINT_LOW = 0;
    public static final int INDEX_LOW_LEVEL_FIX = 12;
    public static final int INDEX_LOW_TEMP_OFFSET = 11;
    public static final int INDEX_MAX_LEVEL_FIX = 14;
    public static final int INDEX_R_LV_HIGH = 5;
    public static final int INDEX_R_LV_LOW = 2;
    public static final int INDEX_R_LV_MAX = 8;
    public static final int MODE_10_BIT = 1;
    public static final int MODE_8_BIT = 0;
    private static final String TAG = "PictureManager";
    public static final int TVPICTURE_EVENT_CONFLICT = 1;
    public static final int TVPICTURE_EVENT_CONFLICT_END = 999;
    public static final int TVPICTURE_EVENT_CONFLICT_START = 0;
    public static final int TVPICTURE_EVENT_VIDEO_STATUS = 1001;
    public static final int TVPICTURE_EVENT_VIDEO_STATUS_END = 1999;
    public static final int TVPICTURE_EVENT_VIDEO_STATUS_START = 1000;
    public static final int VALUE_DISABLE = -1;
    public static final int VALUE_ENABLE = 1;
    public static final String WXGA32 = "Wxga32";
    private static PictureManager _pictureManager;
    private final String IPICTURE_MANAGER = "mstar.IPictureManager";
    private EventHandler mEventHandler;
    private long mNativeContext;
    private OnEventListener mOnEventListener;
    private OnPictureEventListener mOnPicEventListener;
    private int mPictureManagerContext;

    /* JADX INFO: renamed from: com.mstar.android.tvapi.common.PictureManager$1, reason: invalid class name */
    static /* synthetic */ class AnonymousClass1 {
        static final /* synthetic */ int[] $SwitchMap$com$mstar$android$tvapi$common$PictureManager$EVENT;

        static {
            int[] iArr = new int[EVENT.values().length];
            $SwitchMap$com$mstar$android$tvapi$common$PictureManager$EVENT = iArr;
            try {
                iArr[EVENT.EV_SET_ASPECTRATIO.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                $SwitchMap$com$mstar$android$tvapi$common$PictureManager$EVENT[EVENT.EV_4K2K_PHOTO_DISABLE_PIP.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                $SwitchMap$com$mstar$android$tvapi$common$PictureManager$EVENT[EVENT.EV_4K2K_PHOTO_DISABLE_POP.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                $SwitchMap$com$mstar$android$tvapi$common$PictureManager$EVENT[EVENT.EV_4K2K_PHOTO_DISABLE_DUALVIEW.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                $SwitchMap$com$mstar$android$tvapi$common$PictureManager$EVENT[EVENT.EV_4K2K_PHOTO_DISABLE_TRAVELINGMODE.ordinal()] = 5;
            } catch (NoSuchFieldError unused5) {
            }
        }
    }

    protected enum EVENT {
        EV_SET_ASPECTRATIO,
        EV_4K2K_PHOTO_DISABLE_PIP,
        EV_4K2K_PHOTO_DISABLE_POP,
        EV_4K2K_PHOTO_DISABLE_DUALVIEW,
        EV_4K2K_PHOTO_DISABLE_TRAVELINGMODE,
        EV_MAX
    }

    private class EventHandler extends Handler {
        private PictureManager mMSrv;

        public EventHandler(PictureManager pictureManager, Looper looper) {
            super(looper);
            this.mMSrv = pictureManager;
        }

        @Override // android.os.Handler
        public void handleMessage(Message message) {
            if (this.mMSrv.mNativeContext == 0) {
                return;
            }
            if (PictureManager.this.mOnEventListener != null) {
                PictureManager.this.mOnEventListener.onEvent(message);
            }
            EVENT[] eventArrValues = EVENT.values();
            if (message.what > EVENT.EV_MAX.ordinal() || message.what < EVENT.EV_SET_ASPECTRATIO.ordinal()) {
                Log.e(getClass().getCanonicalName(), "Native post event out of bound:" + Integer.toString(message.what));
                return;
            }
            int i2 = AnonymousClass1.$SwitchMap$com$mstar$android$tvapi$common$PictureManager$EVENT[eventArrValues[message.what].ordinal()];
            if (i2 == 1) {
                if (PictureManager.this.mOnPicEventListener != null) {
                    PictureManager.this.mOnPicEventListener.onSetAspectratio(message.what, message.arg1, message.arg2);
                    return;
                }
                return;
            }
            if (i2 == 2) {
                if (PictureManager.this.mOnPicEventListener != null) {
                    PictureManager.this.mOnPicEventListener.on4K2KPhotoDisablePip(message.what, message.arg1, message.arg2);
                    return;
                }
                return;
            }
            if (i2 == 3) {
                if (PictureManager.this.mOnPicEventListener != null) {
                    PictureManager.this.mOnPicEventListener.on4K2KPhotoDisablePop(message.what, message.arg1, message.arg2);
                    return;
                }
                return;
            }
            if (i2 == 4) {
                if (PictureManager.this.mOnPicEventListener != null) {
                    PictureManager.this.mOnPicEventListener.on4K2KPhotoDisableDualview(message.what, message.arg1, message.arg2);
                }
            } else if (i2 == 5) {
                if (PictureManager.this.mOnPicEventListener != null) {
                    PictureManager.this.mOnPicEventListener.on4K2KPhotoDisableTravelingmode(message.what, message.arg1, message.arg2);
                }
            } else {
                System.err.println("Unknown message type " + message.what);
            }
        }
    }

    static {
        try {
            System.loadLibrary("picturemanager_jni");
            native_init();
        } catch (UnsatisfiedLinkError e2) {
            System.err.println("Cannot load picturemanager_jni library:\n" + e2.toString());
        }
        _pictureManager = null;
    }

    protected PictureManager() {
        Looper looperMyLooper = Looper.myLooper();
        if (looperMyLooper != null) {
            this.mEventHandler = new EventHandler(this, looperMyLooper);
        } else {
            Looper mainLooper = Looper.getMainLooper();
            if (mainLooper != null) {
                this.mEventHandler = new EventHandler(this, mainLooper);
            } else {
                this.mEventHandler = null;
            }
        }
        native_setup(new WeakReference(this));
    }

    private static void PostEvent_4K2KPhotoDisableDualview(Object obj, int i2, int i3) {
        EventHandler eventHandler;
        PictureManager pictureManager = (PictureManager) ((WeakReference) obj).get();
        if (pictureManager == null || (eventHandler = pictureManager.mEventHandler) == null) {
            return;
        }
        pictureManager.mEventHandler.sendMessage(eventHandler.obtainMessage(EVENT.EV_4K2K_PHOTO_DISABLE_DUALVIEW.ordinal(), i2, i3));
    }

    private static void PostEvent_4K2KPhotoDisablePip(Object obj, int i2, int i3) {
        EventHandler eventHandler;
        PictureManager pictureManager = (PictureManager) ((WeakReference) obj).get();
        if (pictureManager == null || (eventHandler = pictureManager.mEventHandler) == null) {
            return;
        }
        pictureManager.mEventHandler.sendMessage(eventHandler.obtainMessage(EVENT.EV_4K2K_PHOTO_DISABLE_PIP.ordinal(), i2, i3));
    }

    private static void PostEvent_4K2KPhotoDisablePop(Object obj, int i2, int i3) {
        EventHandler eventHandler;
        PictureManager pictureManager = (PictureManager) ((WeakReference) obj).get();
        if (pictureManager == null || (eventHandler = pictureManager.mEventHandler) == null) {
            return;
        }
        pictureManager.mEventHandler.sendMessage(eventHandler.obtainMessage(EVENT.EV_4K2K_PHOTO_DISABLE_POP.ordinal(), i2, i3));
    }

    private static void PostEvent_4K2KPhotoDisableTravelingmode(Object obj, int i2, int i3) {
        EventHandler eventHandler;
        PictureManager pictureManager = (PictureManager) ((WeakReference) obj).get();
        if (pictureManager == null || (eventHandler = pictureManager.mEventHandler) == null) {
            return;
        }
        pictureManager.mEventHandler.sendMessage(eventHandler.obtainMessage(EVENT.EV_4K2K_PHOTO_DISABLE_TRAVELINGMODE.ordinal(), i2, i3));
    }

    private static void PostEvent_SetAspectratio(Object obj, int i2, int i3) {
        EventHandler eventHandler;
        PictureManager pictureManager = (PictureManager) ((WeakReference) obj).get();
        if (pictureManager == null || (eventHandler = pictureManager.mEventHandler) == null) {
            return;
        }
        pictureManager.mEventHandler.sendMessage(eventHandler.obtainMessage(EVENT.EV_SET_ASPECTRATIO.ordinal(), i2, i3));
    }

    private static void PostEvent_SnServiceDeadth(Object obj, int i2, int i3) {
    }

    private native boolean calGammaTable(GammaTable gammaTable, int i2);

    private final native boolean getHdrAttributes(Parcel parcel, Parcel parcel2) throws TvCommonException;

    public static PictureManager getInstance() {
        if (_pictureManager == null) {
            synchronized (PictureManager.class) {
                try {
                    if (_pictureManager == null) {
                        _pictureManager = new PictureManager();
                    }
                } finally {
                }
            }
        }
        return _pictureManager;
    }

    private native boolean native_disableAllOsdWindow() throws TvCommonException;

    private native boolean native_disableOsdWindow(int i2) throws TvCommonException;

    private final native void native_finalize();

    private native int native_get4K2KMode() throws TvCommonException;

    private final native int native_getAspectRatio() throws TvCommonException;

    private final native int native_getDemoMode() throws TvCommonException;

    private native ScreenPixelInfo native_getPixelInfo(int i2, int i3, int i4, int i5) throws TvCommonException;

    private native Rgb_Data native_getPixelRgb(int i2, short s2, short s3, int i3) throws TvCommonException;

    private final native int native_getReproduceRate() throws TvCommonException;

    private final native byte native_getResolution() throws TvCommonException;

    private static final native void native_init();

    private final native boolean native_selectWindow(int i2) throws TvCommonException;

    private native boolean native_set4K2KMode(int i2, int i3) throws TvCommonException;

    private final native void native_setAspectRatio(int i2) throws TvCommonException;

    private final native void native_setDemoMode(int i2) throws TvCommonException;

    private final native void native_setFilm(int i2) throws TvCommonException;

    private native boolean native_setLocalDimmingMode(int i2) throws TvCommonException;

    private final native void native_setMfc(int i2) throws TvCommonException;

    private final native boolean native_setMpegNoiseReduction(int i2) throws TvCommonException;

    private final native boolean native_setNoiseReduction(int i2) throws TvCommonException;

    private native boolean native_setOsdWindow(int i2, int i3, int i4, int i5, int i6) throws TvCommonException;

    private final native void native_setPictureModeBrightness(int i2, int i3) throws TvCommonException;

    private final native void native_setReproduceRate(int i2) throws TvCommonException;

    private final native void native_setResolution(byte b2) throws TvCommonException;

    private final native void native_setup(Object obj);

    private static void postEventFromNative(Object obj, int i2, int i3, int i4, Object obj2) {
        EventHandler eventHandler;
        PictureManager pictureManager = (PictureManager) ((WeakReference) obj).get();
        if (pictureManager == null || (eventHandler = pictureManager.mEventHandler) == null) {
            return;
        }
        pictureManager.mEventHandler.sendMessage(eventHandler.obtainMessage(i2, i3, i4, obj2));
    }

    private final native boolean setHdrAttributes(Parcel parcel, Parcel parcel2) throws TvCommonException;

    public native boolean autoHDMIColorRange() throws TvCommonException;

    public boolean calCustomerGammaTable(GammaTable gammaTable, int i2) {
        return calGammaTable(gammaTable, i2);
    }

    public final native int cvte_GetDCRBacklightMAX() throws TvCommonException;

    public final native int cvte_GetDCRBacklightRange() throws TvCommonException;

    public final native int cvte_GetDCRBacklightStep() throws TvCommonException;

    public final native int cvte_GetDCREnableStatus() throws TvCommonException;

    public final native int cvte_GetDCRStepTime() throws TvCommonException;

    public final native void cvte_SetDCRBacklightMAX(int i2) throws TvCommonException;

    public final native void cvte_SetDCRBacklightRange(int i2) throws TvCommonException;

    public final native void cvte_SetDCRBacklightStep(int i2) throws TvCommonException;

    public final native void cvte_SetDCREnableStatus(int i2) throws TvCommonException;

    public final native void cvte_SetDCRStepTime(int i2) throws TvCommonException;

    public native boolean disableAllDualWinMode() throws TvCommonException;

    public final boolean disableAllOsdWindow() throws TvCommonException {
        return native_disableAllOsdWindow();
    }

    public native void disableBacklight() throws TvCommonException;

    public final native void disableDlc() throws TvCommonException;

    public final boolean disableOsdWindow(EnumMfcOsdWindow enumMfcOsdWindow) throws TvCommonException {
        return native_disableOsdWindow(enumMfcOsdWindow.ordinal());
    }

    public final native void disableOverScan() throws TvCommonException;

    public native void enableBacklight() throws TvCommonException;

    public final native void enableDlc() throws TvCommonException;

    public final native void enableOverScan() throws TvCommonException;

    public native boolean enableXvyccCompensation(boolean z2, int i2) throws TvCommonException;

    public native boolean enter4K2KMode(boolean z2) throws TvCommonException;

    protected void finalize() throws Throwable {
        super.finalize();
        native_finalize();
        _pictureManager = null;
    }

    public native boolean forceFreerun(boolean z2, boolean z3) throws TvCommonException;

    public final native boolean freezeImage() throws TvCommonException;

    public native void generateTestPattern(int i2, TestPattern testPattern) throws TvCommonException;

    public EnumUrsaMode get4K2KMode() throws TvCommonException {
        int iNative_get4K2KMode = native_get4K2KMode();
        if (iNative_get4K2KMode < EnumUrsaMode.E_URSA_4K2K_MODE_FULLHD.ordinal() || iNative_get4K2KMode > EnumUrsaMode.E_URSA_4K2K_MODE_UNDEFINED.ordinal()) {
            throw new TvCommonException("native_get4K2KMode failed");
        }
        return EnumUrsaMode.values()[iNative_get4K2KMode];
    }

    public final native int[] getAdvanceColor(int i2) throws TvCommonException;

    public final native boolean getAdvanceColorEnable();

    public final native int[] getAdvanceColorIniSetting() throws TvCommonException;

    public final EnumVideoArcType getAspectRatio() throws TvCommonException {
        int iNative_getAspectRatio = native_getAspectRatio();
        if (iNative_getAspectRatio < EnumVideoArcType.E_DEFAULT.ordinal() || iNative_getAspectRatio > EnumVideoArcType.E_MAX.ordinal()) {
            throw new TvCommonException("native_getAspectRatio failed");
        }
        return EnumVideoArcType.values()[iNative_getAspectRatio];
    }

    public final native int getBacklight() throws TvCommonException;

    public final native int getBacklightMaxValue() throws TvCommonException;

    public final native int getBacklightMinValue() throws TvCommonException;

    public native int getCustomerPqRuleNumber() throws TvCommonException;

    public final MweType.EnumMweType getDemoMode() throws TvCommonException {
        int ordinalThroughValue = MweType.EnumMweType.getOrdinalThroughValue(native_getDemoMode());
        if (ordinalThroughValue != -1) {
            return MweType.EnumMweType.values()[ordinalThroughValue];
        }
        throw new TvCommonException("get demomode error ");
    }

    public native short getDlcAverageLuma() throws TvCommonException;

    public native short getDlcHistogramMax() throws TvCommonException;

    public native short getDlcHistogramMin() throws TvCommonException;

    public native int[] getDlcLumArray(int i2) throws TvCommonException;

    public native int getDlcLumAverageTemporary() throws TvCommonException;

    public native int getDlcLumTotalCount() throws TvCommonException;

    public final native int[] getDynamicContrastCurve() throws TvCommonException;

    public final native int[] getGamma(int i2) throws TvCommonException;

    public final native boolean getGammaEnable();

    public final native int[] getGammaIniSetting() throws TvCommonException;

    public native int getHDMIColorFormat() throws TvCommonException;

    public final HdrAttribute getHdrAttributes(int i2, int i3) throws TvCommonException {
        Parcel parcelObtain = Parcel.obtain();
        Parcel parcelObtain2 = Parcel.obtain();
        Log.d(TAG, "attribute = " + i2);
        Log.d(TAG, "window = " + i3);
        parcelObtain.writeInterfaceToken("mstar.IPictureManager");
        parcelObtain.writeInt(i2);
        parcelObtain.writeInt(i3);
        boolean hdrAttributes = getHdrAttributes(parcelObtain, parcelObtain2);
        Log.e(TAG, "ret = " + hdrAttributes);
        if (!hdrAttributes) {
            parcelObtain.recycle();
            parcelObtain2.recycle();
            throw new TvNativeCallFailException("funtion failed at tvservice ");
        }
        HdrAttribute hdrAttribute = new HdrAttribute();
        hdrAttribute.result = parcelObtain2.readInt();
        hdrAttribute.level = parcelObtain2.readInt();
        hdrAttribute.isRunning = parcelObtain2.readInt() == 1;
        Log.d(TAG, "result = " + hdrAttribute.result);
        Log.d(TAG, "level = " + hdrAttribute.level);
        Log.d(TAG, "isRunning = " + hdrAttribute.isRunning);
        parcelObtain.recycle();
        parcelObtain2.recycle();
        return hdrAttribute;
    }

    public native byte getMfcLevel() throws TvCommonException;

    public int getMfcLevelInt() throws TvCommonException {
        return getMfcLevel();
    }

    public final native PanelProperty getPanelWidthHeight() throws TvCommonException;

    public ScreenPixelInfo getPixelInfo(int i2, int i3, int i4, int i5) throws TvCommonException {
        ScreenPixelInfo screenPixelInfoNative_getPixelInfo = native_getPixelInfo(i2, i3, i4, i5);
        if (screenPixelInfoNative_getPixelInfo != null) {
            screenPixelInfoNative_getPixelInfo.enStage = ScreenPixelInfo.EnumPixelRGBStage.valueOf(screenPixelInfoNative_getPixelInfo.tmpStage);
        }
        return screenPixelInfoNative_getPixelInfo;
    }

    public Rgb_Data getPixelRgb(GetPixelRgbStage.EnumGetPixelRgbStage enumGetPixelRgbStage, short s2, short s3, EnumScalerWindow enumScalerWindow) throws TvCommonException {
        return native_getPixelRgb(enumGetPixelRgbStage.getValue(), s2, s3, enumScalerWindow.ordinal());
    }

    public final native PqRange getPqRange(int i2, int i3, int i4) throws TvCommonException;

    public final native int getPqStatus(int i2, int i3) throws TvCommonException;

    public final native PglValue getPqValue(int i2, int i3, int i4) throws TvCommonException;

    public final int getReproduceRate() throws TvCommonException {
        return native_getReproduceRate();
    }

    public final byte getResolution() throws TvCommonException {
        return native_getResolution();
    }

    public native byte getScalerMotion();

    public native int getStatusNumberByCustomerPqRule(int i2) throws TvCommonException;

    public final native SwdrLevel getSwdrInfo() throws TvCommonException;

    public final native SwdrLevel getSwdrLevel() throws TvCommonException;

    public final native UltraBlackWhite getUltraBlackWhite() throws TvCommonException;

    public native boolean is3DTVPlugedIn() throws TvCommonException;

    public native boolean is4K2KMode(boolean z2) throws TvCommonException;

    public final native boolean isImageFreezed() throws TvCommonException;

    public final native boolean isOverscanEnabled() throws TvCommonException;

    public native boolean isSupportedZoom() throws TvCommonException;

    public native boolean keepScalerOutput4k2k(boolean z2) throws TvCommonException;

    public native void lock4K2KMode(boolean z2) throws TvCommonException;

    public native boolean moveWindow() throws TvCommonException;

    public native int native_getCurrentTimingId() throws TvCommonException;

    public final native TimingInfo[] native_getSupportedTimingList() throws TvCommonException;

    public native int native_getSupportedTimingListCount() throws TvCommonException;

    public native boolean panelInitial(String str);

    protected void release() throws Throwable {
        _pictureManager = null;
    }

    public final native boolean resetAdvanceColor();

    public final native boolean resetGamma();

    public final native boolean resetPq(int i2, int i3) throws TvCommonException;

    public final native boolean scaleWindow() throws TvCommonException;

    public boolean selectWindow(EnumScalerWindow enumScalerWindow) throws TvCommonException {
        return native_selectWindow(enumScalerWindow.ordinal());
    }

    public boolean set4K2KMode(EnumPanelTiming enumPanelTiming, EnumUrsaMode enumUrsaMode) throws TvCommonException {
        return native_set4K2KMode(enumPanelTiming.ordinal(), enumUrsaMode.ordinal());
    }

    public final native boolean setAdvanceColor(int i2, int i3, int i4);

    public final native boolean setAdvanceColorEnable(boolean z2);

    public final void setAspectRatio(EnumVideoArcType enumVideoArcType) throws TvCommonException {
        long jCurrentTimeMillis = System.currentTimeMillis();
        native_setAspectRatio(enumVideoArcType.ordinal());
        Log.d(TAG, "Time elapsed for setAspectRatio() is: " + (System.currentTimeMillis() - jCurrentTimeMillis) + " ms");
    }

    public final native void setBacklight(int i2) throws TvCommonException;

    public native void setColorRange(boolean z2) throws TvCommonException;

    public final native void setColorTemperature(ColorTemperatureExData colorTemperatureExData) throws TvCommonException;

    public final native void setCropWindow(VideoWindowType videoWindowType) throws TvCommonException;

    public native boolean setCustomerGammaParameter(int i2, int i3);

    public native void setDebugMode(boolean z2) throws TvCommonException;

    public void setDemoMode(MweType.EnumMweType enumMweType) throws TvCommonException {
        native_setDemoMode(enumMweType.getValue());
    }

    public final native void setDisplayWindow(VideoWindowType videoWindowType) throws TvCommonException;

    public final native void setDynamicContrastCurve(int[] iArr, int[] iArr2, int[] iArr3) throws TvCommonException;

    public void setFilm(Film.EnumFilm enumFilm) throws TvCommonException {
        native_setFilm(enumFilm.getValue());
    }

    public final native boolean setGamma(int i2, int i3);

    public final native boolean setGammaEnable(boolean z2);

    public native boolean setHLinearScaling(boolean z2, boolean z3, int i2) throws TvCommonException;

    public final boolean setHdrAttributes(int i2, int i3, int i4) throws TvCommonException {
        Parcel parcelObtain = Parcel.obtain();
        Parcel parcelObtain2 = Parcel.obtain();
        Log.d(TAG, "attribute = " + i2);
        Log.d(TAG, "window = " + i3);
        Log.d(TAG, "level = " + i4);
        parcelObtain.writeInterfaceToken("mstar.IPictureManager");
        parcelObtain.writeInt(i2);
        parcelObtain.writeInt(i3);
        parcelObtain.writeInt(i4);
        if (setHdrAttributes(parcelObtain, parcelObtain2)) {
            return true;
        }
        parcelObtain.recycle();
        parcelObtain2.recycle();
        throw new TvNativeCallFailException("funtion failed at tvservice ");
    }

    public final native boolean setIrePattern(int i2);

    public native boolean setLocalDimmingBrightLevel(short s2) throws TvCommonException;

    public boolean setLocalDimmingMode(EnumLocalDimmingMode enumLocalDimmingMode) throws TvCommonException {
        return native_setLocalDimmingMode(enumLocalDimmingMode.ordinal());
    }

    public native boolean setMEMCMode(String str) throws TvCommonException;

    public final void setMfc(EnumMfcMode enumMfcMode) throws TvCommonException {
        native_setMfc(enumMfcMode.ordinal());
    }

    public native void setMfcLevel(byte b2) throws TvCommonException;

    public void setMfcLevel(int i2) throws TvCommonException {
        setMfcLevel((byte) i2);
    }

    public final boolean setMpegNoiseReduction(MpegNoiseReduction.EnumMpegNoiseReduction enumMpegNoiseReduction) throws TvCommonException {
        return native_setMpegNoiseReduction(enumMpegNoiseReduction.getValue());
    }

    public final boolean setNoiseReduction(NoiseReduction.EnumNoiseReduction enumNoiseReduction) throws TvCommonException {
        return native_setNoiseReduction(enumNoiseReduction.getValue());
    }

    public void setOnEventListener(OnEventListener onEventListener) {
        this.mOnEventListener = onEventListener;
    }

    public void setOnPictureEventListener(OnPictureEventListener onPictureEventListener) {
        this.mOnPicEventListener = onPictureEventListener;
    }

    public final boolean setOsdWindow(EnumMfcOsdWindow enumMfcOsdWindow, int i2, int i3, int i4, int i5) throws TvCommonException {
        return native_setOsdWindow(enumMfcOsdWindow.ordinal(), i2, i3, i4, i5);
    }

    public final native void setOutputPattern(boolean z2, int i2, int i3, int i4) throws TvCommonException;

    public final native void setOverscan(int i2, int i3, int i4, int i5) throws TvCommonException;

    public final void setPictureModeBrightness(SetLocationType.EnumSetLocationType enumSetLocationType, int i2) throws TvCommonException {
        native_setPictureModeBrightness(enumSetLocationType.getValue(), i2);
    }

    public final native void setPictureModeBrightness(short s2) throws TvCommonException;

    public final native void setPictureModeColor(short s2) throws TvCommonException;

    public final native void setPictureModeContrast(short s2) throws TvCommonException;

    public final native void setPictureModeSharpness(short s2) throws TvCommonException;

    public final native void setPictureModeTint(short s2) throws TvCommonException;

    public final native boolean setPqStatus(int i2, int i3, int i4) throws TvCommonException;

    public final native boolean setPqValue(int i2, int i3, int i4, int i5) throws TvCommonException;

    public void setReproduceRate(int i2) throws TvCommonException {
        native_setReproduceRate(i2);
    }

    public void setResolution(byte b2) throws TvCommonException {
        native_setResolution(b2);
    }

    public native void setScalerGammaByIndex(byte b2) throws TvCommonException;

    public native boolean setScalerGammaTable(GammaTable gammaTable);

    public native boolean setStatusByCustomerPqRule(int i2, int i3) throws TvCommonException;

    public final native boolean setSwdrLevel(int i2, int i3) throws TvCommonException;

    public native boolean setSwingLevel(short s2) throws TvCommonException;

    @Deprecated
    public native boolean setTurnOffLocalDimmingBacklight(boolean z2) throws TvCommonException;

    public final native boolean setUltraBlackWhite(UltraBlackWhite ultraBlackWhite) throws TvCommonException;

    public native boolean setUltraClear(boolean z2) throws TvCommonException;

    public final native void setWindowInvisible() throws TvCommonException;

    public final native void setWindowVisible() throws TvCommonException;

    public native boolean setxvYCCEnable(boolean z2, int i2) throws TvCommonException;

    public native boolean switchDlcCurve(short s2) throws TvCommonException;

    public native boolean turnOffLocalDimmingBacklight(boolean z2) throws TvCommonException;

    public final native boolean unFreezeImage() throws TvCommonException;
}
