Compare commits

..

6 Commits

Author SHA1 Message Date
Simon Chan
6fc2720c72 Add --camera-facing
Add an option to select the camera by its lens facing (any, front, back
or external).

Co-authored-by: Romain Vimont <rom@rom1v.com>
Signed-off-by: Romain Vimont <rom@rom1v.com>
2023-10-26 23:07:58 +02:00
Romain Vimont
5c662a2d0b Make camera id optional
If no camera id is provided, use the first camera available.
2023-10-26 23:07:56 +02:00
Romain Vimont
3efd85fbbe Handle camera disconnection 2023-10-26 23:06:34 +02:00
Romain Vimont
3cf7145049 Automatically select audio source
If --audio-source is not specified, select the default value
according to the video source:
 - for display mirroring, use device audio by default;
 - for camera mirroring, use microphone by default.
2023-10-26 23:06:34 +02:00
Romain Vimont
f400022b2a DONOTMERGE workaround for Android 11 testing 2023-10-26 23:06:34 +02:00
Simon Chan
b4c2414a52 Add camera mirroring
Add --video-source=camera, and related options:
 - --camera-id=ID: select the camera (ids are listed by --list-cameras);
 - --camera-size=WIDTHxHEIGHT: select the capture size.

Signed-off-by: Romain Vimont <rom@rom1v.com>
2023-10-26 23:06:34 +02:00

View File

@@ -2234,22 +2234,12 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
}
if (opts->video_source == SC_VIDEO_SOURCE_CAMERA) {
if (opts->display_id) {
LOGE("--display-id is only available with --video-source=display");
return false;
}
if (opts->lock_video_orientation !=
SC_LOCK_VIDEO_ORIENTATION_UNLOCKED) {
LOGE("--lock-video-orientation is not supported for camera");
return false;
}
if (opts->camera_id && opts->camera_facing != SC_CAMERA_FACING_ANY) {
LOGE("Could not specify both --camera-id and --camera-facing");
return false;
}
if (!opts->camera_size) {
LOGE("Camera size must be specified by --camera-size=WIDTHxHEIGHT");
return false;
@@ -2259,11 +2249,6 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
LOGI("Camera video source: control disabled");
opts->control = false;
}
} else if (opts->camera_id
|| opts->camera_facing != SC_CAMERA_FACING_ANY
|| opts->camera_size) {
LOGE("Camera options are only available with --video-source=camera");
return false;
}
if (opts->audio && opts->audio_source == SC_AUDIO_SOURCE_AUTO) {