mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-18 20:36:04 +00:00
chore: remove source comments and unused code, translate every missing string (#1965)
* chore(i18n): translate every missing string in all locales Adds the 87 strings the bottom-screen Dashboard and in-game stats pages introduced to all 32 locales, plus the 51 older settings strings Japanese and the 50 Chinese locales were still missing. Every locale now has all 3456 translatable strings with the same placeholders as English. Also translates 36 entries that were still English where the language does not use the English word, and makes es-419 touch_app_id use the same %1$s placeholder as English. * chore(patches): drop comments from the lines downstream patches add Removes comment lines and trailing comments from lines our patches add, with hunk headers recounted. Lines that a later patch uses as context and the upstream backport 0123 are left as they are. The gamescope, FEX, proot and xodus series still apply to their pinned sources, and the patched trees differ only in those comments. test_hud_frames now finds the HUD writer by its first declaration. * docs: credit Greenlight, Better xCloud, viture-v2, GameNative and DiRTTelemetryErrorFix These were credited only in source headers and NOTICE files. * chore: remove source comments and unused functions Removes explanatory comments from first-party Kotlin, Java, C, C++, Rust, TypeScript, Python, shell, Gradle, CMake and workflow files. License and attribution headers stay, and vendored third-party trees, generated files and license files are untouched. A shellcheck directive is kept, and udevmon's fallthrough comments became fallthrough attributes. Syntax trees and token streams match the previous sources apart from the comments and Python docstrings. Module docstrings that argparse prints are kept, and device-smoke.sh prints the same --help text from a heredoc. Also removes 37 functions and 4 fields that nothing referenced. * chore: remove comments from the Syncthing integration and the latest main sources * docs: credit Syncthing and the syncthing-android fork * chore(i18n): translate the Syncthing strings in all locales The 107 strings the Syncthing integration added are now in all 32 locales. sync_web_path_locked names the Syncthing tab by its label. * docs: credit @xXJSONDeruloXx for the HUD metric readers The CPU, GPU load, thermal and battery readers come from their PerformanceHudView pull requests #777, #877, #991, #1406 and #1573. The FusionHUD credit line is unchanged. * docs: credit the HUD metric readers to @xXJSONDeruloXx's work
This commit is contained in:
1 parent
d730f0fa8b
commit
c5577478ca
511 files changed
+6813
-4068
No files matched your search
@@ -19,31 +19,14 @@ import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* DroidDeck's hardware video decoder factory for the native Xbox Cloud Gaming player. It builds WebRTC's own
|
||||
* AndroidVideoDecoder (hence this package) around a MediaCodec wrapper that can:
|
||||
* - ask the decoder for low-latency output (Android's KEY_LOW_LATENCY and Qualcomm's low-latency / picture-order
|
||||
* vendor keys; unknown keys are ignored, and a decoder that refuses them is configured without them);
|
||||
* - for zero-copy, decode straight onto the player's SurfaceView instead of WebRTC's texture, rendering every
|
||||
* output buffer there (no GL copy, no compositor; WebRTC then gets no decoded frames to draw).
|
||||
* Without either option it behaves like WebRTC's HardwareVideoDecoderFactory.
|
||||
* The route is switchable while the decoder runs (setOutputSurface): {@link #useScreen} sends frames straight to the
|
||||
* screen (zero-copy) or, with null, back to WebRTC's texture (for the Vulkan compositor and frame generation);
|
||||
* {@link #setZeroCopySurface} moves a zero-copy decoder to a stand-in surface while the screen surface is gone.
|
||||
* The factory also reports the decoded size and the decode time (input queued to output ready), which WebRTC's
|
||||
* stats lack in zero-copy.
|
||||
*/
|
||||
public class DroidDeckLowLatencyDecoderFactory implements VideoDecoderFactory {
|
||||
/** Counts frames sent to the display in zero-copy mode (WebRTC's own stats see none). */
|
||||
public interface FrameCounter { void onFrameShown(); }
|
||||
|
||||
private final HardwareVideoDecoderFactory hardware;
|
||||
private final EglBase.Context sharedContext;
|
||||
private final boolean lowLatency;
|
||||
/** Frames go to {@link #zeroCopySurface} (the screen or the stand-in), not WebRTC's texture. */
|
||||
private volatile boolean zeroCopy;
|
||||
private volatile Surface zeroCopySurface;
|
||||
/** Back on WebRTC's texture: render the next buffer there, so WebRTC's pending texture frame completes. */
|
||||
private volatile boolean renderNext;
|
||||
private final FrameCounter counter;
|
||||
private volatile Wrapper live;
|
||||
@@ -64,19 +47,11 @@ public class DroidDeckLowLatencyDecoderFactory implements VideoDecoderFactory {
|
||||
this.counter = counter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Zero-copy: the surface to decode onto from now on; null = a stand-in that drops every frame (the screen
|
||||
* surface is being destroyed). Must be called before a destroyed surface's callback returns.
|
||||
*/
|
||||
public synchronized void setZeroCopySurface(Surface surface) {
|
||||
if (!zeroCopy) return;
|
||||
moveTo(surface != null ? surface : standInSurface(), surface != null ? "the screen" : "a stand-in");
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch the route live: a surface = zero-copy onto it; null = WebRTC's texture again. Returns false when the
|
||||
* decoder refused the new surface (the route is then unchanged).
|
||||
*/
|
||||
public synchronized boolean useScreen(Surface screen) {
|
||||
if (screen != null) {
|
||||
Wrapper w = live;
|
||||
@@ -120,12 +95,10 @@ public class DroidDeckLowLatencyDecoderFactory implements VideoDecoderFactory {
|
||||
return standIn.getSurface();
|
||||
}
|
||||
|
||||
/** The decoder's picture size, or null before the first decoder is configured. */
|
||||
public String videoSize() {
|
||||
return width > 0 ? width + "x" + height : null;
|
||||
}
|
||||
|
||||
/** Average decode time since the last call, in ms (-1 when no frame was decoded in between). */
|
||||
public double takeDecodeMs() {
|
||||
synchronized (decodeLock) {
|
||||
double avg = decodeCount > 0 ? decodeSumMs / decodeCount : -1;
|
||||
@@ -170,10 +143,8 @@ public class DroidDeckLowLatencyDecoderFactory implements VideoDecoderFactory {
|
||||
}
|
||||
}
|
||||
|
||||
/** MediaCodec itself (not WebRTC's wrapper) so the output surface can be changed while it runs. */
|
||||
private class Wrapper implements MediaCodecWrapper {
|
||||
final MediaCodec raw;
|
||||
/** WebRTC's texture surface, the route back from zero-copy. */
|
||||
Surface texture;
|
||||
Wrapper(MediaCodec raw) { this.raw = raw; }
|
||||
|
||||
@@ -207,8 +178,6 @@ public class DroidDeckLowLatencyDecoderFactory implements VideoDecoderFactory {
|
||||
if (from.containsKey(key)) to.setInteger(key, from.getInteger(key));
|
||||
}
|
||||
|
||||
// Zero-copy: AndroidVideoDecoder renders one buffer to its texture and drops the rest until the texture
|
||||
// hands the frame back, which never happens with the display surface; show every buffer instead.
|
||||
@Override public void releaseOutputBuffer(int index, boolean render) {
|
||||
if (zeroCopy) { raw.releaseOutputBuffer(index, true); if (counter != null) counter.onFrameShown(); }
|
||||
else if (renderNext) { renderNext = false; raw.releaseOutputBuffer(index, true); }
|
||||
|
||||
Reference in new issue
Block a user