package com.seewo.vtv.impl;

import android.os.SystemProperties;
import com.seewo.sdk.util.BoardTypeUtils;

/* JADX INFO: loaded from: classes.dex */
public class ScreenRecordHelper {
    public static final ScreenRecordHelper a = new ScreenRecordHelper();

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public volatile boolean f2057b;

    static {
        if (BoardTypeUtils.isHISIMachine()) {
            System.loadLibrary("screen_record");
        }
    }

    public static native boolean finishRecordScreen();

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

    public static native boolean startRecordScreen(int i2, int i3);

    public static native boolean startRecordScreen(int i2, int i3, boolean z);

    public void a() {
        if (this.f2057b) {
            throw new RuntimeException("You have started record, must call finishRecord first.");
        }
        this.f2057b = true;
        String str = SystemProperties.get("persist.sys.screenorientation", "");
        if (!((str.equals("portrait") || str.equals("upsideDown")) ? false : true)) {
            startRecordScreen(720, 1280, true);
        } else if (BoardTypeUtils.is510Machine() || BoardTypeUtils.is551Machine()) {
            startRecordScreen(1280, 720);
        } else {
            startRecordScreen(1920, 1080);
        }
    }
}
