Skip to content

Conversation

@tomm1e
Copy link

@tomm1e tomm1e commented Jul 20, 2025

Handles screen events by video source. I put the input event logic for camera in a new folder (src/im) to keep things organized. New video sources can add event logic there.

New shortcuts:

  • MOD+q: Camera toggle torch
  • MOD+1: Camera zoom in
  • MOD+2: Camera zoom out

New CLI options:

  • --camera-torch (Turn on torch when starting)
  • --camera-zoom-step=0.05 (Adjust step value)

Tested on Samsung Galaxy A52 5G, no issues.

Closes #4670, #4903

Note: I think some functions such as apply_orientation_transform could be put into a util file since those could be used across all video source event handlers.

@rom1v
Copy link
Collaborator

rom1v commented Jul 20, 2025

Thank you 👍 Looks great.

However, to be honest, it might take some time (at least weeks) before I can review properly and merge.

FYI, in the past, I had started a branch (torch, which I just pushed), but I stopped before adding the mechanism for camera controls.

@Tiger-roar13
Copy link

Thanks, I'm getting an error .\scrcpy: unknown option -- camera-torch

scrcpy is working happily without the camera-torch option

I assume this isn't in the latest version yet, 3.3.3 ?

@rom1v
Copy link
Collaborator

rom1v commented Oct 23, 2025

I assume this isn't in the latest version yet, 3.3.3 ?

No, it's not merged. It will be in the future.

(Locally, I started to rebase it onto the SDL3 branch.)

@rom1v
Copy link
Collaborator

rom1v commented Nov 28, 2025

Here are some updates about my local work.

I rebased on the (current) SDL3 branch (#6216).

First, in preliminary commits, I enabled "control" (shortcuts) for a camera video source directly in input_manager.c (eliminating the need for a separate im/camera.c with code duplication) and implemented a first camera "control" for the existing "reset video" shortcut.

Next, I addressed some threading issues (the control to switch the torch is called from the controller thread, but requestBuilder was being set from the camera thread).

I also changed the shortcuts from "toggle torch" to explicit "turn on" and "turn off", allowing users to set a specific mode without needing to know the current state (consistent with "turn screen on/off").

You're the main author of the --camera-torch commit and co-author of two other commits.

The current working branch is here: https://github.com/Genymobile/scrcpy/commits/camera_control.11/

I still need to rebase the zoom feature (with your authorship).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Turn on the torch

3 participants