Beispiel #1
0
    private (int, int) GetScreenDimensions(XRCameraConfigHandler config)
    {
        if (Screen.orientation == ScreenOrientation.Landscape || Screen.orientation == ScreenOrientation.LandscapeLeft || Screen.orientation == ScreenOrientation.LandscapeRight)
        {
            int height = config.activeXRCameraConfig.height;
            int width  = config.activeXRCameraConfig.width;

            return(width, height);
        }

        else if (Screen.orientation == ScreenOrientation.Portrait || Screen.orientation == ScreenOrientation.PortraitUpsideDown)
        {
            int width  = config.activeXRCameraConfig.height;
            int height = config.activeXRCameraConfig.width;

            return(width, height);
        }

        else
        {
            int width  = config.activeXRCameraConfig.height;
            int height = config.activeXRCameraConfig.width;

            return(height, width);
        }
    }
Beispiel #2
0
    public void Init(string path, string title)
    {
        //path and media title
        mediaDesitinationPath = path;
        this.title            = title;

        //referencing
        var sessionOrigin            = GameObject.FindGameObjectWithTag("arSessionOrigin");
        XRCameraConfigHandler config = sessionOrigin.GetComponentInChildren <XRCameraConfigHandler>();

        //assigning running config
        int?fps = config.activeXRCameraConfig.framerate;

        (int width, int height) = GetScreenDimensions(config);
        int bitrate = (int)PlayerPrefsHandler.Instance.GetFloat("bitrate", 8);

        //init the recorder
        if (fps == 0 || fps == null)
        {
            InitRecorder(width, height, 30, bitrate, 3);
        }

        else
        {
            InitRecorder(width, height, (int)fps, 8, 3);
        }
    }