Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c17bfef authored by TheScarastic's avatar TheScarastic
Browse files

Recorder: Use getRealMetrics

 * fixes issue where proper height of device was not returned

Change-Id: I64405d060d70b3ad2b1f8ec377d28404858a2cd0
parent 2338a0cd
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import android.text.format.DateUtils;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Surface;
import android.view.WindowManager;
import android.widget.Toast;

import androidx.annotation.Nullable;
@@ -248,7 +249,9 @@ public class ScreencastService extends Service implements MediaProviderHelper.On
            mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);

            // Set up video
            DisplayMetrics metrics = getResources().getDisplayMetrics();
            DisplayMetrics metrics = new DisplayMetrics();
            WindowManager wm = getSystemService(WindowManager.class);
            wm.getDefaultDisplay().getRealMetrics(metrics);
            int screenWidth = metrics.widthPixels;
            int screenHeight = metrics.heightPixels;
            mMediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);