Skip to content

Commit

Permalink
Fail-fast camera mirroring on Android 11 and older
Browse files Browse the repository at this point in the history
PR #4213 <#4213>

Co-authored-by: Romain Vimont <[email protected]>
Signed-off-by: Romain Vimont <[email protected]>
  • Loading branch information
yume-chan and rom1v committed Oct 31, 2023
1 parent dd36d61 commit 9fc5835
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/src/main/java/com/genymobile/scrcpy/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ private static void initAndCleanUp(Options options) {

private static void scrcpy(Options options) throws IOException, ConfigurationException {
Ln.i("Device: [" + Build.MANUFACTURER + "] " + Build.BRAND + " " + Build.MODEL + " (Android " + Build.VERSION.RELEASE + ")");

if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S && options.getVideoSource() == VideoSource.CAMERA) {
Ln.e("Camera mirroring is not supported before Android 12");
throw new ConfigurationException("Camera mirroring is not supported");
}

final Device device = new Device(options);

Thread initThread = startInitThread(options);
Expand Down

0 comments on commit 9fc5835

Please sign in to comment.