예제 #1
0
    public static Vector2 GetRecordingResolution(int width, int height, DownScale downscale, Vector2 maxVideoSize)
    {
        int targetWidth  = width;
        int targetHeight = height;

        if (downscale != DownScale.Custom)
        {
            targetWidth  /= (int)downscale;
            targetHeight /= (int)downscale;
        }
        else
        {
            if (maxVideoSize.x >= 1.0f && maxVideoSize.y >= 1.0f)
            {
                targetWidth  = Mathf.FloorToInt(maxVideoSize.x);
                targetHeight = Mathf.FloorToInt(maxVideoSize.y);
            }
        }

        // Some codecs like Lagarith in YUY2 mode need size to be multiple of 4
        targetWidth  = NextMultipleOf4(targetWidth);
        targetHeight = NextMultipleOf4(targetHeight);

        return(new Vector2(targetWidth, targetHeight));
    }
    public static Vector2 GetRecordingResolution(int width, int height, DownScale downscale, Vector2 maxVideoSize)
    {
        int targetWidth = width;
        int targetHeight = height;
        if (downscale != DownScale.Specific)
        {
            targetWidth /= (int)downscale;
            targetHeight /= (int)downscale;
        }
        else
        {
            if (maxVideoSize.x >= 1.0f && maxVideoSize.y >= 1.0f)
            {
                targetWidth = Mathf.FloorToInt(maxVideoSize.x);
                targetHeight = Mathf.FloorToInt(maxVideoSize.y);
            }
        }

        // Some codecs like Lagarith in YUY2 mode need size to be multiple of 4
        targetWidth = NextMultipleOf4(targetWidth);
        targetHeight = NextMultipleOf4(targetHeight);

        return new Vector2(targetWidth, targetHeight);
    }