Fix RCO menu coordinates and smooth video pacing
RCO object positions are screen-center with +Y up, but the renderer drew them as top-left, pushing menu items off-screen. Convert to top-left in the 480x272 design space before drawing. Also use precise parkNanos pacing and reuse per-frame ARGB/WritableImage buffers to remove the 1.4MB allocations per video frame.
This commit is contained in:
@@ -19,7 +19,16 @@ public final class YuvConverter {
|
||||
byte[] uPlane, int uStride,
|
||||
byte[] vPlane, int vStride) {
|
||||
int[] argb = new int[width * height];
|
||||
yuvj420ToArgb(width, height, yPlane, yStride, uPlane, uStride, vPlane, vStride, argb);
|
||||
return argb;
|
||||
}
|
||||
|
||||
/** Converts into a caller-provided buffer of at least {@code width*height} pixels. */
|
||||
public static void yuvj420ToArgb(int width, int height,
|
||||
byte[] yPlane, int yStride,
|
||||
byte[] uPlane, int uStride,
|
||||
byte[] vPlane, int vStride,
|
||||
int[] argb) {
|
||||
for (int row = 0; row < height; row++) {
|
||||
int yRow = row * yStride;
|
||||
int uvRow = (row >> 1) * uStride;
|
||||
@@ -43,8 +52,6 @@ public final class YuvConverter {
|
||||
| clamp(b);
|
||||
}
|
||||
}
|
||||
|
||||
return argb;
|
||||
}
|
||||
|
||||
private static int clamp(int value) {
|
||||
|
||||
Reference in New Issue
Block a user