@yume-chan/scrcpy 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +43 -0
- package/CHANGELOG.md +21 -0
- package/LICENSE +21 -0
- package/README.md +88 -0
- package/bin/scrcpy-server +0 -0
- package/bin/version.d.ts +1 -0
- package/bin/version.js +1 -0
- package/esm/client.d.ts +36 -0
- package/esm/client.d.ts.map +1 -0
- package/esm/client.js +209 -0
- package/esm/client.js.map +1 -0
- package/esm/codec.d.ts +34 -0
- package/esm/codec.d.ts.map +1 -0
- package/esm/codec.js +37 -0
- package/esm/codec.js.map +1 -0
- package/esm/connection.d.ts +37 -0
- package/esm/connection.d.ts.map +1 -0
- package/esm/connection.js +103 -0
- package/esm/connection.js.map +1 -0
- package/esm/decoder/index.d.ts +4 -0
- package/esm/decoder/index.d.ts.map +1 -0
- package/esm/decoder/index.js +4 -0
- package/esm/decoder/index.js.map +1 -0
- package/esm/decoder/tinyh264/index.d.ts +20 -0
- package/esm/decoder/tinyh264/index.d.ts.map +1 -0
- package/esm/decoder/tinyh264/index.js +86 -0
- package/esm/decoder/tinyh264/index.js.map +1 -0
- package/esm/decoder/tinyh264/worker.d.ts +2 -0
- package/esm/decoder/tinyh264/worker.d.ts.map +1 -0
- package/esm/decoder/tinyh264/worker.js +3 -0
- package/esm/decoder/tinyh264/worker.js.map +1 -0
- package/esm/decoder/tinyh264/wrapper.d.ts +21 -0
- package/esm/decoder/tinyh264/wrapper.d.ts.map +1 -0
- package/esm/decoder/tinyh264/wrapper.js +67 -0
- package/esm/decoder/tinyh264/wrapper.js.map +1 -0
- package/esm/decoder/types.d.ts +28 -0
- package/esm/decoder/types.d.ts.map +1 -0
- package/esm/decoder/types.js +2 -0
- package/esm/decoder/types.js.map +1 -0
- package/esm/decoder/web-codecs/index.d.ts +22 -0
- package/esm/decoder/web-codecs/index.d.ts.map +1 -0
- package/esm/decoder/web-codecs/index.js +75 -0
- package/esm/decoder/web-codecs/index.js.map +1 -0
- package/esm/index.d.ts +9 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +9 -0
- package/esm/index.js.map +1 -0
- package/esm/message.d.ts +93 -0
- package/esm/message.d.ts.map +1 -0
- package/esm/message.js +92 -0
- package/esm/message.js.map +1 -0
- package/esm/options/1_16/index.d.ts +107 -0
- package/esm/options/1_16/index.d.ts.map +1 -0
- package/esm/options/1_16/index.js +211 -0
- package/esm/options/1_16/index.js.map +1 -0
- package/esm/options/1_16/sps.d.ts +22 -0
- package/esm/options/1_16/sps.d.ts.map +1 -0
- package/esm/options/1_16/sps.js +254 -0
- package/esm/options/1_16/sps.js.map +1 -0
- package/esm/options/1_18.d.ts +19 -0
- package/esm/options/1_18.d.ts.map +1 -0
- package/esm/options/1_18.js +23 -0
- package/esm/options/1_18.js.map +1 -0
- package/esm/options/1_21.d.ts +10 -0
- package/esm/options/1_21.d.ts.map +1 -0
- package/esm/options/1_21.js +23 -0
- package/esm/options/1_21.js.map +1 -0
- package/esm/options/1_22.d.ts +43 -0
- package/esm/options/1_22.d.ts.map +1 -0
- package/esm/options/1_22.js +40 -0
- package/esm/options/1_22.js.map +1 -0
- package/esm/options/common.d.ts +30 -0
- package/esm/options/common.d.ts.map +1 -0
- package/esm/options/common.js +16 -0
- package/esm/options/common.js.map +1 -0
- package/esm/options/index.d.ts +6 -0
- package/esm/options/index.d.ts.map +1 -0
- package/esm/options/index.js +6 -0
- package/esm/options/index.js.map +1 -0
- package/esm/push-server.d.ts +6 -0
- package/esm/push-server.d.ts.map +1 -0
- package/esm/push-server.js +23 -0
- package/esm/push-server.js.map +1 -0
- package/esm/utils.d.ts +4 -0
- package/esm/utils.d.ts.map +1 -0
- package/esm/utils.js +14 -0
- package/esm/utils.js.map +1 -0
- package/package.json +61 -0
- package/scrcpy.LICENSE +203 -0
- package/scripts/fetch-server.cjs +28 -0
- package/src/client.ts +275 -0
- package/src/codec.ts +35 -0
- package/src/connection.ts +123 -0
- package/src/decoder/index.ts +3 -0
- package/src/decoder/tinyh264/index.ts +112 -0
- package/src/decoder/tinyh264/types.d.ts +137 -0
- package/src/decoder/tinyh264/worker.ts +2 -0
- package/src/decoder/tinyh264/wrapper.ts +89 -0
- package/src/decoder/types.ts +35 -0
- package/src/decoder/web-codecs/index.ts +98 -0
- package/src/index.ts +8 -0
- package/src/message.ts +105 -0
- package/src/options/1_16/index.ts +322 -0
- package/src/options/1_16/sps.ts +300 -0
- package/src/options/1_18.ts +41 -0
- package/src/options/1_21.ts +34 -0
- package/src/options/1_22.ts +80 -0
- package/src/options/common.ts +61 -0
- package/src/options/index.ts +5 -0
- package/src/push-server.ts +26 -0
- package/src/utils.ts +16 -0
package/esm/message.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import Struct, { placeholder } from '@yume-chan/struct';
|
|
2
|
+
export var ScrcpyControlMessageType;
|
|
3
|
+
(function (ScrcpyControlMessageType) {
|
|
4
|
+
ScrcpyControlMessageType[ScrcpyControlMessageType["InjectKeycode"] = 0] = "InjectKeycode";
|
|
5
|
+
ScrcpyControlMessageType[ScrcpyControlMessageType["InjectText"] = 1] = "InjectText";
|
|
6
|
+
ScrcpyControlMessageType[ScrcpyControlMessageType["InjectTouch"] = 2] = "InjectTouch";
|
|
7
|
+
ScrcpyControlMessageType[ScrcpyControlMessageType["InjectScroll"] = 3] = "InjectScroll";
|
|
8
|
+
ScrcpyControlMessageType[ScrcpyControlMessageType["BackOrScreenOn"] = 4] = "BackOrScreenOn";
|
|
9
|
+
ScrcpyControlMessageType[ScrcpyControlMessageType["ExpandNotificationPanel"] = 5] = "ExpandNotificationPanel";
|
|
10
|
+
ScrcpyControlMessageType[ScrcpyControlMessageType["CollapseNotificationPanel"] = 6] = "CollapseNotificationPanel";
|
|
11
|
+
ScrcpyControlMessageType[ScrcpyControlMessageType["GetClipboard"] = 7] = "GetClipboard";
|
|
12
|
+
ScrcpyControlMessageType[ScrcpyControlMessageType["SetClipboard"] = 8] = "SetClipboard";
|
|
13
|
+
ScrcpyControlMessageType[ScrcpyControlMessageType["SetScreenPowerMode"] = 9] = "SetScreenPowerMode";
|
|
14
|
+
ScrcpyControlMessageType[ScrcpyControlMessageType["RotateDevice"] = 10] = "RotateDevice";
|
|
15
|
+
})(ScrcpyControlMessageType || (ScrcpyControlMessageType = {}));
|
|
16
|
+
// https://developer.android.com/reference/android/view/MotionEvent#constants_1
|
|
17
|
+
export var AndroidMotionEventAction;
|
|
18
|
+
(function (AndroidMotionEventAction) {
|
|
19
|
+
AndroidMotionEventAction[AndroidMotionEventAction["Down"] = 0] = "Down";
|
|
20
|
+
AndroidMotionEventAction[AndroidMotionEventAction["Up"] = 1] = "Up";
|
|
21
|
+
AndroidMotionEventAction[AndroidMotionEventAction["Move"] = 2] = "Move";
|
|
22
|
+
AndroidMotionEventAction[AndroidMotionEventAction["Cancel"] = 3] = "Cancel";
|
|
23
|
+
AndroidMotionEventAction[AndroidMotionEventAction["Outside"] = 4] = "Outside";
|
|
24
|
+
AndroidMotionEventAction[AndroidMotionEventAction["PointerDown"] = 5] = "PointerDown";
|
|
25
|
+
AndroidMotionEventAction[AndroidMotionEventAction["PointerUp"] = 6] = "PointerUp";
|
|
26
|
+
AndroidMotionEventAction[AndroidMotionEventAction["HoverMove"] = 7] = "HoverMove";
|
|
27
|
+
AndroidMotionEventAction[AndroidMotionEventAction["Scroll"] = 8] = "Scroll";
|
|
28
|
+
AndroidMotionEventAction[AndroidMotionEventAction["HoverEnter"] = 9] = "HoverEnter";
|
|
29
|
+
AndroidMotionEventAction[AndroidMotionEventAction["HoverExit"] = 10] = "HoverExit";
|
|
30
|
+
AndroidMotionEventAction[AndroidMotionEventAction["ButtonPress"] = 11] = "ButtonPress";
|
|
31
|
+
AndroidMotionEventAction[AndroidMotionEventAction["ButtonRelease"] = 12] = "ButtonRelease";
|
|
32
|
+
})(AndroidMotionEventAction || (AndroidMotionEventAction = {}));
|
|
33
|
+
export const ScrcpyInjectTouchControlMessage = new Struct()
|
|
34
|
+
.uint8('type', ScrcpyControlMessageType.InjectTouch)
|
|
35
|
+
.uint8('action', placeholder())
|
|
36
|
+
.uint64('pointerId')
|
|
37
|
+
.uint32('pointerX')
|
|
38
|
+
.uint32('pointerY')
|
|
39
|
+
.uint16('screenWidth')
|
|
40
|
+
.uint16('screenHeight')
|
|
41
|
+
.uint16('pressure')
|
|
42
|
+
.uint32('buttons');
|
|
43
|
+
export const ScrcpyInjectTextControlMessage = new Struct()
|
|
44
|
+
.uint8('type', ScrcpyControlMessageType.InjectText)
|
|
45
|
+
.uint32('length')
|
|
46
|
+
.string('text', { lengthField: 'length' });
|
|
47
|
+
export var AndroidKeyEventAction;
|
|
48
|
+
(function (AndroidKeyEventAction) {
|
|
49
|
+
AndroidKeyEventAction[AndroidKeyEventAction["Down"] = 0] = "Down";
|
|
50
|
+
AndroidKeyEventAction[AndroidKeyEventAction["Up"] = 1] = "Up";
|
|
51
|
+
})(AndroidKeyEventAction || (AndroidKeyEventAction = {}));
|
|
52
|
+
export var AndroidKeyCode;
|
|
53
|
+
(function (AndroidKeyCode) {
|
|
54
|
+
AndroidKeyCode[AndroidKeyCode["Home"] = 3] = "Home";
|
|
55
|
+
AndroidKeyCode[AndroidKeyCode["Back"] = 4] = "Back";
|
|
56
|
+
AndroidKeyCode[AndroidKeyCode["A"] = 29] = "A";
|
|
57
|
+
AndroidKeyCode[AndroidKeyCode["B"] = 30] = "B";
|
|
58
|
+
AndroidKeyCode[AndroidKeyCode["C"] = 31] = "C";
|
|
59
|
+
AndroidKeyCode[AndroidKeyCode["D"] = 32] = "D";
|
|
60
|
+
AndroidKeyCode[AndroidKeyCode["E"] = 33] = "E";
|
|
61
|
+
AndroidKeyCode[AndroidKeyCode["F"] = 34] = "F";
|
|
62
|
+
AndroidKeyCode[AndroidKeyCode["G"] = 35] = "G";
|
|
63
|
+
AndroidKeyCode[AndroidKeyCode["H"] = 36] = "H";
|
|
64
|
+
AndroidKeyCode[AndroidKeyCode["I"] = 37] = "I";
|
|
65
|
+
AndroidKeyCode[AndroidKeyCode["J"] = 38] = "J";
|
|
66
|
+
AndroidKeyCode[AndroidKeyCode["K"] = 39] = "K";
|
|
67
|
+
AndroidKeyCode[AndroidKeyCode["L"] = 40] = "L";
|
|
68
|
+
AndroidKeyCode[AndroidKeyCode["M"] = 41] = "M";
|
|
69
|
+
AndroidKeyCode[AndroidKeyCode["N"] = 42] = "N";
|
|
70
|
+
AndroidKeyCode[AndroidKeyCode["O"] = 43] = "O";
|
|
71
|
+
AndroidKeyCode[AndroidKeyCode["P"] = 44] = "P";
|
|
72
|
+
AndroidKeyCode[AndroidKeyCode["Q"] = 45] = "Q";
|
|
73
|
+
AndroidKeyCode[AndroidKeyCode["R"] = 46] = "R";
|
|
74
|
+
AndroidKeyCode[AndroidKeyCode["S"] = 47] = "S";
|
|
75
|
+
AndroidKeyCode[AndroidKeyCode["T"] = 48] = "T";
|
|
76
|
+
AndroidKeyCode[AndroidKeyCode["U"] = 49] = "U";
|
|
77
|
+
AndroidKeyCode[AndroidKeyCode["V"] = 50] = "V";
|
|
78
|
+
AndroidKeyCode[AndroidKeyCode["W"] = 51] = "W";
|
|
79
|
+
AndroidKeyCode[AndroidKeyCode["X"] = 52] = "X";
|
|
80
|
+
AndroidKeyCode[AndroidKeyCode["Y"] = 53] = "Y";
|
|
81
|
+
AndroidKeyCode[AndroidKeyCode["Z"] = 54] = "Z";
|
|
82
|
+
AndroidKeyCode[AndroidKeyCode["Space"] = 62] = "Space";
|
|
83
|
+
AndroidKeyCode[AndroidKeyCode["Delete"] = 67] = "Delete";
|
|
84
|
+
AndroidKeyCode[AndroidKeyCode["AppSwitch"] = 187] = "AppSwitch";
|
|
85
|
+
})(AndroidKeyCode || (AndroidKeyCode = {}));
|
|
86
|
+
export const ScrcpyInjectKeyCodeControlMessage = new Struct()
|
|
87
|
+
.uint8('type', ScrcpyControlMessageType.InjectKeycode)
|
|
88
|
+
.uint8('action', placeholder())
|
|
89
|
+
.uint32('keyCode')
|
|
90
|
+
.uint32('repeat')
|
|
91
|
+
.uint32('metaState');
|
|
92
|
+
//# sourceMappingURL=message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.js","sourceRoot":"","sources":["../src/message.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,CAAN,IAAY,wBAYX;AAZD,WAAY,wBAAwB;IAChC,yFAAa,CAAA;IACb,mFAAU,CAAA;IACV,qFAAW,CAAA;IACX,uFAAY,CAAA;IACZ,2FAAc,CAAA;IACd,6GAAuB,CAAA;IACvB,iHAAyB,CAAA;IACzB,uFAAY,CAAA;IACZ,uFAAY,CAAA;IACZ,mGAAkB,CAAA;IAClB,wFAAY,CAAA;AAChB,CAAC,EAZW,wBAAwB,KAAxB,wBAAwB,QAYnC;AAED,+EAA+E;AAC/E,MAAM,CAAN,IAAY,wBAcX;AAdD,WAAY,wBAAwB;IAChC,uEAAI,CAAA;IACJ,mEAAE,CAAA;IACF,uEAAI,CAAA;IACJ,2EAAM,CAAA;IACN,6EAAO,CAAA;IACP,qFAAW,CAAA;IACX,iFAAS,CAAA;IACT,iFAAS,CAAA;IACT,2EAAM,CAAA;IACN,mFAAU,CAAA;IACV,kFAAS,CAAA;IACT,sFAAW,CAAA;IACX,0FAAa,CAAA;AACjB,CAAC,EAdW,wBAAwB,KAAxB,wBAAwB,QAcnC;AAED,MAAM,CAAC,MAAM,+BAA+B,GACxC,IAAI,MAAM,EAAE;KACP,KAAK,CAAC,MAAM,EAAE,wBAAwB,CAAC,WAAoB,CAAC;KAC5D,KAAK,CAAC,QAAQ,EAAE,WAAW,EAA4B,CAAC;KACxD,MAAM,CAAC,WAAW,CAAC;KACnB,MAAM,CAAC,UAAU,CAAC;KAClB,MAAM,CAAC,UAAU,CAAC;KAClB,MAAM,CAAC,aAAa,CAAC;KACrB,MAAM,CAAC,cAAc,CAAC;KACtB,MAAM,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AAC;KACrD,MAAM,CAAC,SAAS,CAAC;KACjB,MAAM,CAAC,QAAQ,CAAC;KAChB,MAAM,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { ReadableStream, type Adb, type AdbBufferedStream } from "@yume-chan/adb";
|
|
2
|
+
import Struct from "@yume-chan/struct";
|
|
3
|
+
import type { AndroidCodecLevel, AndroidCodecProfile } from "../../codec.js";
|
|
4
|
+
import { ScrcpyClientConnection } from "../../connection.js";
|
|
5
|
+
import { ScrcpyControlMessageType } from "../../message.js";
|
|
6
|
+
import type { ScrcpyBackOrScreenOnEvent1_18 } from "../1_18.js";
|
|
7
|
+
import type { ScrcpyInjectScrollControlMessage1_22 } from "../1_22.js";
|
|
8
|
+
import { type ScrcpyOptions, type ScrcpyOptionValue, type VideoStreamPacket } from "../common.js";
|
|
9
|
+
export declare enum ScrcpyLogLevel {
|
|
10
|
+
Verbose = "verbose",
|
|
11
|
+
Debug = "debug",
|
|
12
|
+
Info = "info",
|
|
13
|
+
Warn = "warn",
|
|
14
|
+
Error = "error"
|
|
15
|
+
}
|
|
16
|
+
export declare enum ScrcpyScreenOrientation {
|
|
17
|
+
Initial = -2,
|
|
18
|
+
Unlocked = -1,
|
|
19
|
+
Portrait = 0,
|
|
20
|
+
Landscape = 1,
|
|
21
|
+
PortraitFlipped = 2,
|
|
22
|
+
LandscapeFlipped = 3
|
|
23
|
+
}
|
|
24
|
+
export interface CodecOptionsInit {
|
|
25
|
+
profile: AndroidCodecProfile;
|
|
26
|
+
level: AndroidCodecLevel;
|
|
27
|
+
}
|
|
28
|
+
export declare class CodecOptions implements ScrcpyOptionValue {
|
|
29
|
+
value: Partial<CodecOptionsInit>;
|
|
30
|
+
constructor(value: Partial<CodecOptionsInit>);
|
|
31
|
+
toOptionValue(): string | undefined;
|
|
32
|
+
}
|
|
33
|
+
export interface ScrcpyOptionsInit1_16 {
|
|
34
|
+
logLevel: ScrcpyLogLevel;
|
|
35
|
+
/**
|
|
36
|
+
* The maximum value of both width and height.
|
|
37
|
+
*/
|
|
38
|
+
maxSize: number;
|
|
39
|
+
bitRate: number;
|
|
40
|
+
/**
|
|
41
|
+
* 0 for unlimited.
|
|
42
|
+
*
|
|
43
|
+
* @default 0
|
|
44
|
+
*/
|
|
45
|
+
maxFps: number;
|
|
46
|
+
/**
|
|
47
|
+
* The orientation of the video stream.
|
|
48
|
+
*
|
|
49
|
+
* It will not keep the device screen in specific orientation,
|
|
50
|
+
* only the captured video will in this orientation.
|
|
51
|
+
*/
|
|
52
|
+
lockVideoOrientation: ScrcpyScreenOrientation;
|
|
53
|
+
tunnelForward: boolean;
|
|
54
|
+
crop: string;
|
|
55
|
+
/**
|
|
56
|
+
* Send PTS so that the client may record properly
|
|
57
|
+
*
|
|
58
|
+
* Note: When `sendFrameMeta: false` is specified,
|
|
59
|
+
* `onChangeEncoding` event won't fire and `onVideoData` event doesn't
|
|
60
|
+
* merge sps/pps frame and first video frame. Which means you can't use
|
|
61
|
+
* the shipped decoders to render the video
|
|
62
|
+
* (You can still record the stream into a file).
|
|
63
|
+
*
|
|
64
|
+
* @default true
|
|
65
|
+
*/
|
|
66
|
+
sendFrameMeta: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* @default true
|
|
69
|
+
*/
|
|
70
|
+
control: boolean;
|
|
71
|
+
displayId: number;
|
|
72
|
+
showTouches: boolean;
|
|
73
|
+
stayAwake: boolean;
|
|
74
|
+
codecOptions: CodecOptions;
|
|
75
|
+
encoderName: string;
|
|
76
|
+
}
|
|
77
|
+
export declare const VideoPacket: Struct<{
|
|
78
|
+
pts: bigint;
|
|
79
|
+
size: number;
|
|
80
|
+
data: Uint8Array;
|
|
81
|
+
}, "size", {}, undefined>;
|
|
82
|
+
export declare const NoPts: bigint;
|
|
83
|
+
export declare const ScrcpyBackOrScreenOnEvent1_16: Struct<{
|
|
84
|
+
type: ScrcpyControlMessageType.BackOrScreenOn;
|
|
85
|
+
}, never, {}, undefined>;
|
|
86
|
+
export declare const ScrcpyInjectScrollControlMessage1_16: Struct<{
|
|
87
|
+
type: ScrcpyControlMessageType.InjectScroll;
|
|
88
|
+
pointerX: number;
|
|
89
|
+
pointerY: number;
|
|
90
|
+
screenWidth: number;
|
|
91
|
+
screenHeight: number;
|
|
92
|
+
scrollX: number;
|
|
93
|
+
scrollY: number;
|
|
94
|
+
}, never, {}, undefined>;
|
|
95
|
+
export declare class ScrcpyOptions1_16<T extends ScrcpyOptionsInit1_16 = ScrcpyOptionsInit1_16> implements ScrcpyOptions<T> {
|
|
96
|
+
value: Partial<T>;
|
|
97
|
+
constructor(value: Partial<ScrcpyOptionsInit1_16>);
|
|
98
|
+
protected getArgumentOrder(): (keyof T)[];
|
|
99
|
+
protected getDefaultValue(): T;
|
|
100
|
+
formatServerArguments(): string[];
|
|
101
|
+
createConnection(adb: Adb): ScrcpyClientConnection;
|
|
102
|
+
getOutputEncoderNameRegex(): RegExp;
|
|
103
|
+
parseVideoStream(stream: AdbBufferedStream): ReadableStream<VideoStreamPacket>;
|
|
104
|
+
serializeBackOrScreenOnControlMessage(message: ScrcpyBackOrScreenOnEvent1_18): Uint8Array | undefined;
|
|
105
|
+
serializeInjectScrollControlMessage(message: ScrcpyInjectScrollControlMessage1_22): Uint8Array;
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/options/1_16/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,cAAc,EAAmB,KAAK,GAAG,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC7H,OAAO,MAAuB,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAoG,MAAM,qBAAqB,CAAC;AAC/J,OAAO,EAAyB,wBAAw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O,CAAC;IAEnB,YAAY,EAAE,YAAY,CAAC;IAE3B,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,WAAW;;;;yBAI4B,CAAC;AAErD,eAAO,MAAM,KAAK,QAAa,CAAC;AAEhC,eAAO,MAAM,6BAA6B;;wBAEoC,CAAC;AAE/E,eAAO,MAAM,oCAAoC;;;;;;;;wBAQxB,CAAC;AAE1B,qBAAa,iBAAiB,CAAC,CAAC,SAAS,qBAAqB,GAAG,qBAAqB,CAAE,YAAW,aAAa,CAAC,CAAC,CAAC;IACxG,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;gBAEN,KAAK,EAAE,OAAO,CAAC,qBAAqB,CAAC;IAcxD,SAAS,CAAC,gBAAgB,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE;IAmBzC,SAAS,CAAC,eAAe,IAAI,CAAC;IAmBvB,qBAAqB,IAAI,MAAM,EAAE;IAMjC,gBAAgB,CAAC,GAAG,EAAE,GAAG,GAAG,sBAAsB;IAclD,yBAAyB,IAAI,MAAM;IAInC,gBAAgB,CAAC,MAAM,EAAE,iBAAiB,GAAG,cAAc,CAAC,iBAAiB,CAAC;IA6F9E,qCAAqC,CACxC,OAAO,EAAE,6BAA6B;IASnC,mCAAmC,CACtC,OAAO,EAAE,oCAAoC,GAC9C,UAAU;CAGhB"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { BufferedStreamEndedError, ReadableStream, TransformStream } from "@yume-chan/adb";
|
|
3
|
+
import Struct, { placeholder } from "@yume-chan/struct";
|
|
4
|
+
import { ScrcpyClientForwardConnection, ScrcpyClientReverseConnection } from "../../connection.js";
|
|
5
|
+
import { AndroidKeyEventAction, ScrcpyControlMessageType } from "../../message.js";
|
|
6
|
+
import { toScrcpyOptionValue } from "../common.js";
|
|
7
|
+
import { parse_sequence_parameter_set } from "./sps.js";
|
|
8
|
+
export var ScrcpyLogLevel;
|
|
9
|
+
(function (ScrcpyLogLevel) {
|
|
10
|
+
ScrcpyLogLevel["Verbose"] = "verbose";
|
|
11
|
+
ScrcpyLogLevel["Debug"] = "debug";
|
|
12
|
+
ScrcpyLogLevel["Info"] = "info";
|
|
13
|
+
ScrcpyLogLevel["Warn"] = "warn";
|
|
14
|
+
ScrcpyLogLevel["Error"] = "error";
|
|
15
|
+
})(ScrcpyLogLevel || (ScrcpyLogLevel = {}));
|
|
16
|
+
export var ScrcpyScreenOrientation;
|
|
17
|
+
(function (ScrcpyScreenOrientation) {
|
|
18
|
+
ScrcpyScreenOrientation[ScrcpyScreenOrientation["Initial"] = -2] = "Initial";
|
|
19
|
+
ScrcpyScreenOrientation[ScrcpyScreenOrientation["Unlocked"] = -1] = "Unlocked";
|
|
20
|
+
ScrcpyScreenOrientation[ScrcpyScreenOrientation["Portrait"] = 0] = "Portrait";
|
|
21
|
+
ScrcpyScreenOrientation[ScrcpyScreenOrientation["Landscape"] = 1] = "Landscape";
|
|
22
|
+
ScrcpyScreenOrientation[ScrcpyScreenOrientation["PortraitFlipped"] = 2] = "PortraitFlipped";
|
|
23
|
+
ScrcpyScreenOrientation[ScrcpyScreenOrientation["LandscapeFlipped"] = 3] = "LandscapeFlipped";
|
|
24
|
+
})(ScrcpyScreenOrientation || (ScrcpyScreenOrientation = {}));
|
|
25
|
+
export class CodecOptions {
|
|
26
|
+
constructor(value) {
|
|
27
|
+
this.value = value;
|
|
28
|
+
}
|
|
29
|
+
toOptionValue() {
|
|
30
|
+
const entries = Object.entries(this.value)
|
|
31
|
+
.filter(([key, value]) => value !== undefined);
|
|
32
|
+
if (entries.length === 0) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
return entries
|
|
36
|
+
.map(([key, value]) => `${key}=${value}`)
|
|
37
|
+
.join(',');
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export const VideoPacket = new Struct()
|
|
41
|
+
.int64('pts')
|
|
42
|
+
.uint32('size')
|
|
43
|
+
.uint8Array('data', { lengthField: 'size' });
|
|
44
|
+
export const NoPts = BigInt(-1);
|
|
45
|
+
export const ScrcpyBackOrScreenOnEvent1_16 = new Struct()
|
|
46
|
+
.uint8('type', placeholder());
|
|
47
|
+
export const ScrcpyInjectScrollControlMessage1_16 = new Struct()
|
|
48
|
+
.uint8('type', ScrcpyControlMessageType.InjectScroll)
|
|
49
|
+
.uint32('pointerX')
|
|
50
|
+
.uint32('pointerY')
|
|
51
|
+
.uint16('screenWidth')
|
|
52
|
+
.uint16('screenHeight')
|
|
53
|
+
.int32('scrollX')
|
|
54
|
+
.int32('scrollY');
|
|
55
|
+
export class ScrcpyOptions1_16 {
|
|
56
|
+
constructor(value) {
|
|
57
|
+
if (new.target === ScrcpyOptions1_16 &&
|
|
58
|
+
value.logLevel === ScrcpyLogLevel.Verbose) {
|
|
59
|
+
value.logLevel = ScrcpyLogLevel.Debug;
|
|
60
|
+
}
|
|
61
|
+
if (new.target === ScrcpyOptions1_16 &&
|
|
62
|
+
value.lockVideoOrientation === ScrcpyScreenOrientation.Initial) {
|
|
63
|
+
value.lockVideoOrientation = ScrcpyScreenOrientation.Unlocked;
|
|
64
|
+
}
|
|
65
|
+
this.value = value;
|
|
66
|
+
}
|
|
67
|
+
getArgumentOrder() {
|
|
68
|
+
return [
|
|
69
|
+
'logLevel',
|
|
70
|
+
'maxSize',
|
|
71
|
+
'bitRate',
|
|
72
|
+
'maxFps',
|
|
73
|
+
'lockVideoOrientation',
|
|
74
|
+
'tunnelForward',
|
|
75
|
+
'crop',
|
|
76
|
+
'sendFrameMeta',
|
|
77
|
+
'control',
|
|
78
|
+
'displayId',
|
|
79
|
+
'showTouches',
|
|
80
|
+
'stayAwake',
|
|
81
|
+
'codecOptions',
|
|
82
|
+
'encoderName',
|
|
83
|
+
];
|
|
84
|
+
}
|
|
85
|
+
getDefaultValue() {
|
|
86
|
+
return {
|
|
87
|
+
logLevel: ScrcpyLogLevel.Debug,
|
|
88
|
+
maxSize: 0,
|
|
89
|
+
bitRate: 8000000,
|
|
90
|
+
maxFps: 0,
|
|
91
|
+
lockVideoOrientation: ScrcpyScreenOrientation.Unlocked,
|
|
92
|
+
tunnelForward: false,
|
|
93
|
+
crop: '-',
|
|
94
|
+
sendFrameMeta: true,
|
|
95
|
+
control: true,
|
|
96
|
+
displayId: 0,
|
|
97
|
+
showTouches: false,
|
|
98
|
+
stayAwake: false,
|
|
99
|
+
codecOptions: new CodecOptions({}),
|
|
100
|
+
encoderName: '-',
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
formatServerArguments() {
|
|
104
|
+
const defaults = this.getDefaultValue();
|
|
105
|
+
return this.getArgumentOrder()
|
|
106
|
+
.map(key => toScrcpyOptionValue(this.value[key] || defaults[key], '-'));
|
|
107
|
+
}
|
|
108
|
+
createConnection(adb) {
|
|
109
|
+
const options = {
|
|
110
|
+
// Old scrcpy connection always have control stream no matter what the option is
|
|
111
|
+
control: true,
|
|
112
|
+
sendDummyByte: true,
|
|
113
|
+
sendDeviceMeta: true,
|
|
114
|
+
};
|
|
115
|
+
if (this.value.tunnelForward) {
|
|
116
|
+
return new ScrcpyClientForwardConnection(adb, options);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
return new ScrcpyClientReverseConnection(adb, options);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
getOutputEncoderNameRegex() {
|
|
123
|
+
return /\s+scrcpy --encoder-name '(.*?)'/;
|
|
124
|
+
}
|
|
125
|
+
parseVideoStream(stream) {
|
|
126
|
+
// Optimized path for video frames only
|
|
127
|
+
if (this.value.sendFrameMeta === false) {
|
|
128
|
+
return stream
|
|
129
|
+
.release()
|
|
130
|
+
.pipeThrough(new TransformStream({
|
|
131
|
+
transform(chunk, controller) {
|
|
132
|
+
controller.enqueue({
|
|
133
|
+
type: 'frame',
|
|
134
|
+
data: chunk,
|
|
135
|
+
});
|
|
136
|
+
},
|
|
137
|
+
}));
|
|
138
|
+
}
|
|
139
|
+
let header;
|
|
140
|
+
return new ReadableStream({
|
|
141
|
+
pull(controller) {
|
|
142
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
143
|
+
try {
|
|
144
|
+
const { pts, data } = yield VideoPacket.deserialize(stream);
|
|
145
|
+
if (pts === NoPts) {
|
|
146
|
+
const sequenceParameterSet = parse_sequence_parameter_set(data.slice().buffer);
|
|
147
|
+
const { profile_idc: profileIndex, constraint_set: constraintSet, level_idc: levelIndex, pic_width_in_mbs_minus1, pic_height_in_map_units_minus1, frame_mbs_only_flag, frame_crop_left_offset, frame_crop_right_offset, frame_crop_top_offset, frame_crop_bottom_offset, } = sequenceParameterSet;
|
|
148
|
+
const encodedWidth = (pic_width_in_mbs_minus1 + 1) * 16;
|
|
149
|
+
const encodedHeight = (pic_height_in_map_units_minus1 + 1) * (2 - frame_mbs_only_flag) * 16;
|
|
150
|
+
const cropLeft = frame_crop_left_offset * 2;
|
|
151
|
+
const cropRight = frame_crop_right_offset * 2;
|
|
152
|
+
const cropTop = frame_crop_top_offset * 2;
|
|
153
|
+
const cropBottom = frame_crop_bottom_offset * 2;
|
|
154
|
+
const croppedWidth = encodedWidth - cropLeft - cropRight;
|
|
155
|
+
const croppedHeight = encodedHeight - cropTop - cropBottom;
|
|
156
|
+
header = data;
|
|
157
|
+
controller.enqueue({
|
|
158
|
+
type: 'configuration',
|
|
159
|
+
data: {
|
|
160
|
+
profileIndex,
|
|
161
|
+
constraintSet,
|
|
162
|
+
levelIndex,
|
|
163
|
+
encodedWidth,
|
|
164
|
+
encodedHeight,
|
|
165
|
+
cropLeft,
|
|
166
|
+
cropRight,
|
|
167
|
+
cropTop,
|
|
168
|
+
cropBottom,
|
|
169
|
+
croppedWidth,
|
|
170
|
+
croppedHeight,
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
let frameData;
|
|
176
|
+
if (header) {
|
|
177
|
+
frameData = new Uint8Array(header.byteLength + data.byteLength);
|
|
178
|
+
frameData.set(header);
|
|
179
|
+
frameData.set(data, header.byteLength);
|
|
180
|
+
header = undefined;
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
frameData = data;
|
|
184
|
+
}
|
|
185
|
+
controller.enqueue({
|
|
186
|
+
type: 'frame',
|
|
187
|
+
data: frameData,
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
catch (e) {
|
|
191
|
+
if (e instanceof BufferedStreamEndedError) {
|
|
192
|
+
controller.close();
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
throw e;
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
serializeBackOrScreenOnControlMessage(message) {
|
|
202
|
+
if (message.action === AndroidKeyEventAction.Down) {
|
|
203
|
+
return ScrcpyBackOrScreenOnEvent1_16.serialize(message);
|
|
204
|
+
}
|
|
205
|
+
return undefined;
|
|
206
|
+
}
|
|
207
|
+
serializeInjectScrollControlMessage(message) {
|
|
208
|
+
return ScrcpyInjectScrollControlMessage1_16.serialize(message);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/options/1_16/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,wBAAwB,EAAE,cAAc,EAAE,eAAe,EAAoC,MAAM,gBAAgB,CAAC;AAC7H,OAAO,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAA0B,6BAA6B,EAAE,6BAA6B,EAAsC,MAAM,qBAAqB,CAAC;AAC/J,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAGnF,OAAO,EAAE,mBAAmB,EAAsE,MAAM,cAAc,CAAC;AACvH,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAExD,MAAM,C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YAAY;oCACZ,aAAa;oCACb,QAAQ;oCACR,SAAS;oCACT,OAAO;oCACP,UAAU;oCACV,YAAY;oCACZ,aAAa;iCAChB;6BACJ,CAAC,CAAC;4BACH,OAAO;yBACV;wBAED,IAAI,SAAqB,CAAC;wBAC1B,IAAI,MAAM,EAAE;4BACR,SAAS,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;4BAChE,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;4BACtB,SAAS,CAAC,GAAG,CAAC,IAAK,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;4BACxC,MAAM,GAAG,SAAS,CAAC;yBACtB;6BAAM;4BACH,SAAS,GAAG,IAAI,CAAC;yBACpB;wBAED,UAAU,CAAC,OAAO,CAAC;4BACf,IAAI,EAAE,OAAO;4BACb,IAAI,EAAE,SAAS;yBAClB,CAAC,CAAC;qBACN;oBAAC,OAAO,CAAC,EAAE;wBACR,IAAI,CAAC,YAAY,wBAAwB,EAAE;4BACvC,UAAU,CAAC,KAAK,EAAE,CAAC;4BACnB,OAAO;yBACV;wBAED,MAAM,CAAC,CAAC;qBACX;gBACL,CAAC;aAAA;SACJ,CAAC,CAAC;IACP,CAAC;IAEM,qCAAqC,CACxC,OAAsC;QAEtC,IAAI,OAAO,CAAC,MAAM,KAAK,qBAAqB,CAAC,IAAI,EAAE;YAC/C,OAAO,6BAA6B,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;SAC3D;QAED,OAAO,SAAS,CAAC;IACrB,CAAC;IAEM,mCAAmC,CACtC,OAA6C;QAE7C,OAAO,oCAAoC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACnE,CAAC;CACJ"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare function parse_sequence_parameter_set(buffer: ArrayBuffer): {
|
|
2
|
+
profile_idc: number;
|
|
3
|
+
constraint_set: number;
|
|
4
|
+
constraint_set0_flag: boolean;
|
|
5
|
+
constraint_set1_flag: boolean;
|
|
6
|
+
constraint_set2_flag: boolean;
|
|
7
|
+
constraint_set3_flag: boolean;
|
|
8
|
+
constraint_set4_flag: boolean;
|
|
9
|
+
constraint_set5_flag: boolean;
|
|
10
|
+
level_idc: number;
|
|
11
|
+
seq_parameter_set_id: number;
|
|
12
|
+
pic_width_in_mbs_minus1: number;
|
|
13
|
+
pic_height_in_map_units_minus1: number;
|
|
14
|
+
frame_mbs_only_flag: number;
|
|
15
|
+
frame_cropping_flag: boolean;
|
|
16
|
+
frame_crop_left_offset: number;
|
|
17
|
+
frame_crop_right_offset: number;
|
|
18
|
+
frame_crop_top_offset: number;
|
|
19
|
+
frame_crop_bottom_offset: number;
|
|
20
|
+
};
|
|
21
|
+
export declare type SequenceParameterSet = ReturnType<typeof parse_sequence_parameter_set>;
|
|
22
|
+
//# sourceMappingURL=sps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sps.d.ts","sourceRoot":"","sources":["../../../src/options/1_16/sps.ts"],"names":[],"mappings":"AA4IA,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,WAAW;;;;;;;;;;;;;;;;;;;EA6J/D;AAED,oBAAY,oBAAoB,GAAG,UAAU,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
|