Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(device): stop stream and clear first-frame timer on unsupported Simlock AVCC codec #48247

Opensaphid(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/48247/headopened View on GitHub

Showing 2 changed files with 24 additions and 2 deletions.

x
0 of 2 viewed, 2 left
23 additions and 0 deletionspackages/client-runtime/src/device/stream.test.tsModified
View file
@@ -631,6 +631,29 @@
client.stop();
expect(vi.getTimerCount()).toBe(0);
});
+​
+ it("stops the stream and clears the first-frame timer on unsupported Simlock AVCC codec", async () => {
+ const { client, events, sockets, videoBodies, Decoder } = recoveryFixture("ios", false, true);
+ Decoder.isConfigSupported.mockResolvedValue({ supported: false });
+ client.start();
+ await vi.advanceTimersByTimeAsync(0);
+ const avcc = [
+ 1, 0x64, 0x00, 0x1f, 0xff, 0xe1, 0x00, 0x04, 0x67, 0x64, 0x00, 0x1f, 0x01, 0x00, 0x02, 0x68,
+ 0xee,
+ ];
+ videoBodies[0]!.enqueue(new Uint8Array(envelope(1, avcc)));
+ await vi.advanceTimersByTimeAsync(0);
+​
+ const expected = "This browser cannot decode this device's avc1.64001f stream.";
+ expect(events.onStatus).toHaveBeenLastCalledWith("error", expected);
+ expect(sockets[0]!.close).toHaveBeenCalledOnce();
+ expect(events.onInputConnected).toHaveBeenLastCalledWith(false, expected);
+ expect(vi.getTimerCount()).toBe(0);
+​
+ await vi.advanceTimersByTimeAsync(15_000);
+ const errors = events.onStatus.mock.calls.filter(([status]) => status === "error");
+ expect(errors).toEqual([["error", expected]]);
+ });
});
​
describe("WebRTC device streams", () => {