scrcpy
scrcpy copied to clipboard
How to listen on the change of the screen when the screen is rotated
If I only use the scrcpy-server, and then use the jmuxer to decode on frontend, how will the frontend listen when the screen is rotated. Only when it listens, can the next step, such as reset jmuxer to make sure the screen display is normal
I refer to this issue, but didn't find the answer.
Looking forward to your reply. @rom1v
how will the frontend listen when the screen is rotated
On the client side, scrcpy
does not detect rotation per-se, but only video frame size changes. So when a new frame has a different size from the previous one, it resizes the window accordingly.
but only video frame size changes
That is to say, my frontend needs to detect the size of each frame in real time, and reset jmuxer if it is different from the last time?
my frontend needs to detect the size of each frame in real time
This is what the scrcpy client does. Alternatively, you could adapt the protocol to send a "rotation" event on the wire before sending the next frame at the new dimension.
Since when the frame is decoded, the size is available directly in the resulting AVFrame
, such an event is not necessary for the scrcpy client currently.