Files
SimpleRemoter/android/app
yuanyuanxiang 7faca2c01b Fix(android): keep encoder operating rate at 30 to restore screen streaming
3ab5154 tied KEY_OPERATING_RATE to the tuned fps, so any profile below 30 (Good=20, Medium=15, Low=12, Minimal=8) pushed it under 30. Some hardware encoders, notably TV SoCs, then drop into a low-power mode that accepts configure/createInputSurface/start without error but never emits a single buffer. The controller receives BITMAPINFO and waits forever on the first decoded frame.

Confirmed on a Changhong Android TV: with operating rate 20 the log stopped right after SendBitmapInfo with no H.264 output at all; clamping to maxOf(fps, 30) produced a first IDR within the same second. KEY_OPERATING_RATE is a resource-planning hint, not a frame limiter - the actual rate is driven by KEY_FRAME_RATE and scene content.

Harden the capture lifecycle while here: fail loudly when createVirtualDisplay returns null instead of advertising a dead surface; downgrade the foreground type back to dataSync before stopping that projection, otherwise Android 14+ tears down a service still declaring mediaProjection and the controller loses the connection entirely; release the previous capture when MainActivity is reopened, including the projection-only state left behind when encoder creation throws before mediaCodec is assigned; ignore stale MediaProjection onStop callbacks that would otherwise tear down a fresh encoder; zero the native screen size on teardown; and make SendLoop's wait timeout so a silent zero-output encoder is reported instead of hanging.
2026-11-14 20:09:14 +01:00
..