mirror of
https://github.com/LuanRT/googlevideo.git
synced 2026-06-28 09:06:41 +00:00
788 lines
29 KiB
TypeScript
788 lines
29 KiB
TypeScript
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
// versions:
|
|
// protoc-gen-ts_proto v2.2.0
|
|
// protoc v5.28.0
|
|
// source: video_streaming/client_abr_state.proto
|
|
|
|
/* eslint-disable */
|
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
|
|
export const protobufPackage = "video_streaming";
|
|
|
|
export interface ClientAbrState {
|
|
timeSinceLastManualFormatSelectionMs?: number | undefined;
|
|
lastManualDirection?: number | undefined;
|
|
lastManualSelectedResolution?: number | undefined;
|
|
detailedNetworkType?: number | undefined;
|
|
clientViewportWidth?: number | undefined;
|
|
clientViewportHeight?: number | undefined;
|
|
clientBitrateCap?: number | undefined;
|
|
stickyResolution?: number | undefined;
|
|
clientViewportIsFlexible?: boolean | undefined;
|
|
bandwidthEstimate?: number | undefined;
|
|
playerTimeMs?: number | undefined;
|
|
timeSinceLastSeek?: number | undefined;
|
|
dataSaverMode?: boolean | undefined;
|
|
visibility?: number | undefined;
|
|
playbackRate?: number | undefined;
|
|
elapsedWallTimeMs?: number | undefined;
|
|
mediaCapabilities?: Uint8Array | undefined;
|
|
timeSinceLastActionMs?: number | undefined;
|
|
enabledTrackTypesBitfield?: number | undefined;
|
|
maxPacingRate?: number | undefined;
|
|
playerState?: number | undefined;
|
|
drcEnabled?: boolean | undefined;
|
|
Jda?: number | undefined;
|
|
qw?: number | undefined;
|
|
Ky?: number | undefined;
|
|
sabrReportRequestCancellationInfo?: number | undefined;
|
|
l?: boolean | undefined;
|
|
G7?: number | undefined;
|
|
preferVp9?: boolean | undefined;
|
|
qj?: number | undefined;
|
|
Hx?: number | undefined;
|
|
isPrefetch?: boolean | undefined;
|
|
sabrSupportQualityConstraints?: number | undefined;
|
|
sabrLicenseConstraint?: Uint8Array | undefined;
|
|
allowProximaLiveLatency?: number | undefined;
|
|
sabrForceProxima?: number | undefined;
|
|
Tqb?: number | undefined;
|
|
sabrForceMaxNetworkInterruptionDurationMs?: number | undefined;
|
|
}
|
|
|
|
function createBaseClientAbrState(): ClientAbrState {
|
|
return {
|
|
timeSinceLastManualFormatSelectionMs: 0,
|
|
lastManualDirection: 0,
|
|
lastManualSelectedResolution: 0,
|
|
detailedNetworkType: 0,
|
|
clientViewportWidth: 0,
|
|
clientViewportHeight: 0,
|
|
clientBitrateCap: 0,
|
|
stickyResolution: 0,
|
|
clientViewportIsFlexible: false,
|
|
bandwidthEstimate: 0,
|
|
playerTimeMs: 0,
|
|
timeSinceLastSeek: 0,
|
|
dataSaverMode: false,
|
|
visibility: 0,
|
|
playbackRate: 0,
|
|
elapsedWallTimeMs: 0,
|
|
mediaCapabilities: new Uint8Array(0),
|
|
timeSinceLastActionMs: 0,
|
|
enabledTrackTypesBitfield: 0,
|
|
maxPacingRate: 0,
|
|
playerState: 0,
|
|
drcEnabled: false,
|
|
Jda: 0,
|
|
qw: 0,
|
|
Ky: 0,
|
|
sabrReportRequestCancellationInfo: 0,
|
|
l: false,
|
|
G7: 0,
|
|
preferVp9: false,
|
|
qj: 0,
|
|
Hx: 0,
|
|
isPrefetch: false,
|
|
sabrSupportQualityConstraints: 0,
|
|
sabrLicenseConstraint: new Uint8Array(0),
|
|
allowProximaLiveLatency: 0,
|
|
sabrForceProxima: 0,
|
|
Tqb: 0,
|
|
sabrForceMaxNetworkInterruptionDurationMs: 0,
|
|
};
|
|
}
|
|
|
|
export const ClientAbrState: MessageFns<ClientAbrState> = {
|
|
encode(message: ClientAbrState, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
if (
|
|
message.timeSinceLastManualFormatSelectionMs !== undefined && message.timeSinceLastManualFormatSelectionMs !== 0
|
|
) {
|
|
writer.uint32(104).int32(message.timeSinceLastManualFormatSelectionMs);
|
|
}
|
|
if (message.lastManualDirection !== undefined && message.lastManualDirection !== 0) {
|
|
writer.uint32(112).int32(message.lastManualDirection);
|
|
}
|
|
if (message.lastManualSelectedResolution !== undefined && message.lastManualSelectedResolution !== 0) {
|
|
writer.uint32(128).int32(message.lastManualSelectedResolution);
|
|
}
|
|
if (message.detailedNetworkType !== undefined && message.detailedNetworkType !== 0) {
|
|
writer.uint32(136).int32(message.detailedNetworkType);
|
|
}
|
|
if (message.clientViewportWidth !== undefined && message.clientViewportWidth !== 0) {
|
|
writer.uint32(144).int32(message.clientViewportWidth);
|
|
}
|
|
if (message.clientViewportHeight !== undefined && message.clientViewportHeight !== 0) {
|
|
writer.uint32(152).int32(message.clientViewportHeight);
|
|
}
|
|
if (message.clientBitrateCap !== undefined && message.clientBitrateCap !== 0) {
|
|
writer.uint32(160).int64(message.clientBitrateCap);
|
|
}
|
|
if (message.stickyResolution !== undefined && message.stickyResolution !== 0) {
|
|
writer.uint32(168).int32(message.stickyResolution);
|
|
}
|
|
if (message.clientViewportIsFlexible !== undefined && message.clientViewportIsFlexible !== false) {
|
|
writer.uint32(176).bool(message.clientViewportIsFlexible);
|
|
}
|
|
if (message.bandwidthEstimate !== undefined && message.bandwidthEstimate !== 0) {
|
|
writer.uint32(184).int32(message.bandwidthEstimate);
|
|
}
|
|
if (message.playerTimeMs !== undefined && message.playerTimeMs !== 0) {
|
|
writer.uint32(224).int64(message.playerTimeMs);
|
|
}
|
|
if (message.timeSinceLastSeek !== undefined && message.timeSinceLastSeek !== 0) {
|
|
writer.uint32(232).int64(message.timeSinceLastSeek);
|
|
}
|
|
if (message.dataSaverMode !== undefined && message.dataSaverMode !== false) {
|
|
writer.uint32(240).bool(message.dataSaverMode);
|
|
}
|
|
if (message.visibility !== undefined && message.visibility !== 0) {
|
|
writer.uint32(272).int32(message.visibility);
|
|
}
|
|
if (message.playbackRate !== undefined && message.playbackRate !== 0) {
|
|
writer.uint32(285).float(message.playbackRate);
|
|
}
|
|
if (message.elapsedWallTimeMs !== undefined && message.elapsedWallTimeMs !== 0) {
|
|
writer.uint32(288).int64(message.elapsedWallTimeMs);
|
|
}
|
|
if (message.mediaCapabilities !== undefined && message.mediaCapabilities.length !== 0) {
|
|
writer.uint32(306).bytes(message.mediaCapabilities);
|
|
}
|
|
if (message.timeSinceLastActionMs !== undefined && message.timeSinceLastActionMs !== 0) {
|
|
writer.uint32(312).int64(message.timeSinceLastActionMs);
|
|
}
|
|
if (message.enabledTrackTypesBitfield !== undefined && message.enabledTrackTypesBitfield !== 0) {
|
|
writer.uint32(320).int32(message.enabledTrackTypesBitfield);
|
|
}
|
|
if (message.maxPacingRate !== undefined && message.maxPacingRate !== 0) {
|
|
writer.uint32(344).int32(message.maxPacingRate);
|
|
}
|
|
if (message.playerState !== undefined && message.playerState !== 0) {
|
|
writer.uint32(352).int64(message.playerState);
|
|
}
|
|
if (message.drcEnabled !== undefined && message.drcEnabled !== false) {
|
|
writer.uint32(368).bool(message.drcEnabled);
|
|
}
|
|
if (message.Jda !== undefined && message.Jda !== 0) {
|
|
writer.uint32(384).int32(message.Jda);
|
|
}
|
|
if (message.qw !== undefined && message.qw !== 0) {
|
|
writer.uint32(400).int32(message.qw);
|
|
}
|
|
if (message.Ky !== undefined && message.Ky !== 0) {
|
|
writer.uint32(408).int32(message.Ky);
|
|
}
|
|
if (message.sabrReportRequestCancellationInfo !== undefined && message.sabrReportRequestCancellationInfo !== 0) {
|
|
writer.uint32(432).int32(message.sabrReportRequestCancellationInfo);
|
|
}
|
|
if (message.l !== undefined && message.l !== false) {
|
|
writer.uint32(448).bool(message.l);
|
|
}
|
|
if (message.G7 !== undefined && message.G7 !== 0) {
|
|
writer.uint32(456).int64(message.G7);
|
|
}
|
|
if (message.preferVp9 !== undefined && message.preferVp9 !== false) {
|
|
writer.uint32(464).bool(message.preferVp9);
|
|
}
|
|
if (message.qj !== undefined && message.qj !== 0) {
|
|
writer.uint32(472).int32(message.qj);
|
|
}
|
|
if (message.Hx !== undefined && message.Hx !== 0) {
|
|
writer.uint32(480).int32(message.Hx);
|
|
}
|
|
if (message.isPrefetch !== undefined && message.isPrefetch !== false) {
|
|
writer.uint32(488).bool(message.isPrefetch);
|
|
}
|
|
if (message.sabrSupportQualityConstraints !== undefined && message.sabrSupportQualityConstraints !== 0) {
|
|
writer.uint32(496).int32(message.sabrSupportQualityConstraints);
|
|
}
|
|
if (message.sabrLicenseConstraint !== undefined && message.sabrLicenseConstraint.length !== 0) {
|
|
writer.uint32(506).bytes(message.sabrLicenseConstraint);
|
|
}
|
|
if (message.allowProximaLiveLatency !== undefined && message.allowProximaLiveLatency !== 0) {
|
|
writer.uint32(512).int32(message.allowProximaLiveLatency);
|
|
}
|
|
if (message.sabrForceProxima !== undefined && message.sabrForceProxima !== 0) {
|
|
writer.uint32(528).int32(message.sabrForceProxima);
|
|
}
|
|
if (message.Tqb !== undefined && message.Tqb !== 0) {
|
|
writer.uint32(536).int32(message.Tqb);
|
|
}
|
|
if (
|
|
message.sabrForceMaxNetworkInterruptionDurationMs !== undefined &&
|
|
message.sabrForceMaxNetworkInterruptionDurationMs !== 0
|
|
) {
|
|
writer.uint32(544).int64(message.sabrForceMaxNetworkInterruptionDurationMs);
|
|
}
|
|
return writer;
|
|
},
|
|
|
|
decode(input: BinaryReader | Uint8Array, length?: number): ClientAbrState {
|
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
const message = createBaseClientAbrState();
|
|
while (reader.pos < end) {
|
|
const tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 13:
|
|
if (tag !== 104) {
|
|
break;
|
|
}
|
|
|
|
message.timeSinceLastManualFormatSelectionMs = reader.int32();
|
|
continue;
|
|
case 14:
|
|
if (tag !== 112) {
|
|
break;
|
|
}
|
|
|
|
message.lastManualDirection = reader.int32();
|
|
continue;
|
|
case 16:
|
|
if (tag !== 128) {
|
|
break;
|
|
}
|
|
|
|
message.lastManualSelectedResolution = reader.int32();
|
|
continue;
|
|
case 17:
|
|
if (tag !== 136) {
|
|
break;
|
|
}
|
|
|
|
message.detailedNetworkType = reader.int32();
|
|
continue;
|
|
case 18:
|
|
if (tag !== 144) {
|
|
break;
|
|
}
|
|
|
|
message.clientViewportWidth = reader.int32();
|
|
continue;
|
|
case 19:
|
|
if (tag !== 152) {
|
|
break;
|
|
}
|
|
|
|
message.clientViewportHeight = reader.int32();
|
|
continue;
|
|
case 20:
|
|
if (tag !== 160) {
|
|
break;
|
|
}
|
|
|
|
message.clientBitrateCap = longToNumber(reader.int64());
|
|
continue;
|
|
case 21:
|
|
if (tag !== 168) {
|
|
break;
|
|
}
|
|
|
|
message.stickyResolution = reader.int32();
|
|
continue;
|
|
case 22:
|
|
if (tag !== 176) {
|
|
break;
|
|
}
|
|
|
|
message.clientViewportIsFlexible = reader.bool();
|
|
continue;
|
|
case 23:
|
|
if (tag !== 184) {
|
|
break;
|
|
}
|
|
|
|
message.bandwidthEstimate = reader.int32();
|
|
continue;
|
|
case 28:
|
|
if (tag !== 224) {
|
|
break;
|
|
}
|
|
|
|
message.playerTimeMs = longToNumber(reader.int64());
|
|
continue;
|
|
case 29:
|
|
if (tag !== 232) {
|
|
break;
|
|
}
|
|
|
|
message.timeSinceLastSeek = longToNumber(reader.int64());
|
|
continue;
|
|
case 30:
|
|
if (tag !== 240) {
|
|
break;
|
|
}
|
|
|
|
message.dataSaverMode = reader.bool();
|
|
continue;
|
|
case 34:
|
|
if (tag !== 272) {
|
|
break;
|
|
}
|
|
|
|
message.visibility = reader.int32();
|
|
continue;
|
|
case 35:
|
|
if (tag !== 285) {
|
|
break;
|
|
}
|
|
|
|
message.playbackRate = reader.float();
|
|
continue;
|
|
case 36:
|
|
if (tag !== 288) {
|
|
break;
|
|
}
|
|
|
|
message.elapsedWallTimeMs = longToNumber(reader.int64());
|
|
continue;
|
|
case 38:
|
|
if (tag !== 306) {
|
|
break;
|
|
}
|
|
|
|
message.mediaCapabilities = reader.bytes();
|
|
continue;
|
|
case 39:
|
|
if (tag !== 312) {
|
|
break;
|
|
}
|
|
|
|
message.timeSinceLastActionMs = longToNumber(reader.int64());
|
|
continue;
|
|
case 40:
|
|
if (tag !== 320) {
|
|
break;
|
|
}
|
|
|
|
message.enabledTrackTypesBitfield = reader.int32();
|
|
continue;
|
|
case 43:
|
|
if (tag !== 344) {
|
|
break;
|
|
}
|
|
|
|
message.maxPacingRate = reader.int32();
|
|
continue;
|
|
case 44:
|
|
if (tag !== 352) {
|
|
break;
|
|
}
|
|
|
|
message.playerState = longToNumber(reader.int64());
|
|
continue;
|
|
case 46:
|
|
if (tag !== 368) {
|
|
break;
|
|
}
|
|
|
|
message.drcEnabled = reader.bool();
|
|
continue;
|
|
case 48:
|
|
if (tag !== 384) {
|
|
break;
|
|
}
|
|
|
|
message.Jda = reader.int32();
|
|
continue;
|
|
case 50:
|
|
if (tag !== 400) {
|
|
break;
|
|
}
|
|
|
|
message.qw = reader.int32();
|
|
continue;
|
|
case 51:
|
|
if (tag !== 408) {
|
|
break;
|
|
}
|
|
|
|
message.Ky = reader.int32();
|
|
continue;
|
|
case 54:
|
|
if (tag !== 432) {
|
|
break;
|
|
}
|
|
|
|
message.sabrReportRequestCancellationInfo = reader.int32();
|
|
continue;
|
|
case 56:
|
|
if (tag !== 448) {
|
|
break;
|
|
}
|
|
|
|
message.l = reader.bool();
|
|
continue;
|
|
case 57:
|
|
if (tag !== 456) {
|
|
break;
|
|
}
|
|
|
|
message.G7 = longToNumber(reader.int64());
|
|
continue;
|
|
case 58:
|
|
if (tag !== 464) {
|
|
break;
|
|
}
|
|
|
|
message.preferVp9 = reader.bool();
|
|
continue;
|
|
case 59:
|
|
if (tag !== 472) {
|
|
break;
|
|
}
|
|
|
|
message.qj = reader.int32();
|
|
continue;
|
|
case 60:
|
|
if (tag !== 480) {
|
|
break;
|
|
}
|
|
|
|
message.Hx = reader.int32();
|
|
continue;
|
|
case 61:
|
|
if (tag !== 488) {
|
|
break;
|
|
}
|
|
|
|
message.isPrefetch = reader.bool();
|
|
continue;
|
|
case 62:
|
|
if (tag !== 496) {
|
|
break;
|
|
}
|
|
|
|
message.sabrSupportQualityConstraints = reader.int32();
|
|
continue;
|
|
case 63:
|
|
if (tag !== 506) {
|
|
break;
|
|
}
|
|
|
|
message.sabrLicenseConstraint = reader.bytes();
|
|
continue;
|
|
case 64:
|
|
if (tag !== 512) {
|
|
break;
|
|
}
|
|
|
|
message.allowProximaLiveLatency = reader.int32();
|
|
continue;
|
|
case 66:
|
|
if (tag !== 528) {
|
|
break;
|
|
}
|
|
|
|
message.sabrForceProxima = reader.int32();
|
|
continue;
|
|
case 67:
|
|
if (tag !== 536) {
|
|
break;
|
|
}
|
|
|
|
message.Tqb = reader.int32();
|
|
continue;
|
|
case 68:
|
|
if (tag !== 544) {
|
|
break;
|
|
}
|
|
|
|
message.sabrForceMaxNetworkInterruptionDurationMs = longToNumber(reader.int64());
|
|
continue;
|
|
}
|
|
if ((tag & 7) === 4 || tag === 0) {
|
|
break;
|
|
}
|
|
reader.skip(tag & 7);
|
|
}
|
|
return message;
|
|
},
|
|
|
|
fromJSON(object: any): ClientAbrState {
|
|
return {
|
|
timeSinceLastManualFormatSelectionMs: isSet(object.timeSinceLastManualFormatSelectionMs)
|
|
? globalThis.Number(object.timeSinceLastManualFormatSelectionMs)
|
|
: 0,
|
|
lastManualDirection: isSet(object.lastManualDirection) ? globalThis.Number(object.lastManualDirection) : 0,
|
|
lastManualSelectedResolution: isSet(object.lastManualSelectedResolution)
|
|
? globalThis.Number(object.lastManualSelectedResolution)
|
|
: 0,
|
|
detailedNetworkType: isSet(object.detailedNetworkType) ? globalThis.Number(object.detailedNetworkType) : 0,
|
|
clientViewportWidth: isSet(object.clientViewportWidth) ? globalThis.Number(object.clientViewportWidth) : 0,
|
|
clientViewportHeight: isSet(object.clientViewportHeight) ? globalThis.Number(object.clientViewportHeight) : 0,
|
|
clientBitrateCap: isSet(object.clientBitrateCap) ? globalThis.Number(object.clientBitrateCap) : 0,
|
|
stickyResolution: isSet(object.stickyResolution) ? globalThis.Number(object.stickyResolution) : 0,
|
|
clientViewportIsFlexible: isSet(object.clientViewportIsFlexible)
|
|
? globalThis.Boolean(object.clientViewportIsFlexible)
|
|
: false,
|
|
bandwidthEstimate: isSet(object.bandwidthEstimate) ? globalThis.Number(object.bandwidthEstimate) : 0,
|
|
playerTimeMs: isSet(object.playerTimeMs) ? globalThis.Number(object.playerTimeMs) : 0,
|
|
timeSinceLastSeek: isSet(object.timeSinceLastSeek) ? globalThis.Number(object.timeSinceLastSeek) : 0,
|
|
dataSaverMode: isSet(object.dataSaverMode) ? globalThis.Boolean(object.dataSaverMode) : false,
|
|
visibility: isSet(object.visibility) ? globalThis.Number(object.visibility) : 0,
|
|
playbackRate: isSet(object.playbackRate) ? globalThis.Number(object.playbackRate) : 0,
|
|
elapsedWallTimeMs: isSet(object.elapsedWallTimeMs) ? globalThis.Number(object.elapsedWallTimeMs) : 0,
|
|
mediaCapabilities: isSet(object.mediaCapabilities)
|
|
? bytesFromBase64(object.mediaCapabilities)
|
|
: new Uint8Array(0),
|
|
timeSinceLastActionMs: isSet(object.timeSinceLastActionMs) ? globalThis.Number(object.timeSinceLastActionMs) : 0,
|
|
enabledTrackTypesBitfield: isSet(object.enabledTrackTypesBitfield)
|
|
? globalThis.Number(object.enabledTrackTypesBitfield)
|
|
: 0,
|
|
maxPacingRate: isSet(object.maxPacingRate) ? globalThis.Number(object.maxPacingRate) : 0,
|
|
playerState: isSet(object.playerState) ? globalThis.Number(object.playerState) : 0,
|
|
drcEnabled: isSet(object.drcEnabled) ? globalThis.Boolean(object.drcEnabled) : false,
|
|
Jda: isSet(object.Jda) ? globalThis.Number(object.Jda) : 0,
|
|
qw: isSet(object.qw) ? globalThis.Number(object.qw) : 0,
|
|
Ky: isSet(object.Ky) ? globalThis.Number(object.Ky) : 0,
|
|
sabrReportRequestCancellationInfo: isSet(object.sabrReportRequestCancellationInfo)
|
|
? globalThis.Number(object.sabrReportRequestCancellationInfo)
|
|
: 0,
|
|
l: isSet(object.l) ? globalThis.Boolean(object.l) : false,
|
|
G7: isSet(object.G7) ? globalThis.Number(object.G7) : 0,
|
|
preferVp9: isSet(object.preferVp9) ? globalThis.Boolean(object.preferVp9) : false,
|
|
qj: isSet(object.qj) ? globalThis.Number(object.qj) : 0,
|
|
Hx: isSet(object.Hx) ? globalThis.Number(object.Hx) : 0,
|
|
isPrefetch: isSet(object.isPrefetch) ? globalThis.Boolean(object.isPrefetch) : false,
|
|
sabrSupportQualityConstraints: isSet(object.sabrSupportQualityConstraints)
|
|
? globalThis.Number(object.sabrSupportQualityConstraints)
|
|
: 0,
|
|
sabrLicenseConstraint: isSet(object.sabrLicenseConstraint)
|
|
? bytesFromBase64(object.sabrLicenseConstraint)
|
|
: new Uint8Array(0),
|
|
allowProximaLiveLatency: isSet(object.allowProximaLiveLatency)
|
|
? globalThis.Number(object.allowProximaLiveLatency)
|
|
: 0,
|
|
sabrForceProxima: isSet(object.sabrForceProxima) ? globalThis.Number(object.sabrForceProxima) : 0,
|
|
Tqb: isSet(object.Tqb) ? globalThis.Number(object.Tqb) : 0,
|
|
sabrForceMaxNetworkInterruptionDurationMs: isSet(object.sabrForceMaxNetworkInterruptionDurationMs)
|
|
? globalThis.Number(object.sabrForceMaxNetworkInterruptionDurationMs)
|
|
: 0,
|
|
};
|
|
},
|
|
|
|
toJSON(message: ClientAbrState): unknown {
|
|
const obj: any = {};
|
|
if (
|
|
message.timeSinceLastManualFormatSelectionMs !== undefined && message.timeSinceLastManualFormatSelectionMs !== 0
|
|
) {
|
|
obj.timeSinceLastManualFormatSelectionMs = Math.round(message.timeSinceLastManualFormatSelectionMs);
|
|
}
|
|
if (message.lastManualDirection !== undefined && message.lastManualDirection !== 0) {
|
|
obj.lastManualDirection = Math.round(message.lastManualDirection);
|
|
}
|
|
if (message.lastManualSelectedResolution !== undefined && message.lastManualSelectedResolution !== 0) {
|
|
obj.lastManualSelectedResolution = Math.round(message.lastManualSelectedResolution);
|
|
}
|
|
if (message.detailedNetworkType !== undefined && message.detailedNetworkType !== 0) {
|
|
obj.detailedNetworkType = Math.round(message.detailedNetworkType);
|
|
}
|
|
if (message.clientViewportWidth !== undefined && message.clientViewportWidth !== 0) {
|
|
obj.clientViewportWidth = Math.round(message.clientViewportWidth);
|
|
}
|
|
if (message.clientViewportHeight !== undefined && message.clientViewportHeight !== 0) {
|
|
obj.clientViewportHeight = Math.round(message.clientViewportHeight);
|
|
}
|
|
if (message.clientBitrateCap !== undefined && message.clientBitrateCap !== 0) {
|
|
obj.clientBitrateCap = Math.round(message.clientBitrateCap);
|
|
}
|
|
if (message.stickyResolution !== undefined && message.stickyResolution !== 0) {
|
|
obj.stickyResolution = Math.round(message.stickyResolution);
|
|
}
|
|
if (message.clientViewportIsFlexible !== undefined && message.clientViewportIsFlexible !== false) {
|
|
obj.clientViewportIsFlexible = message.clientViewportIsFlexible;
|
|
}
|
|
if (message.bandwidthEstimate !== undefined && message.bandwidthEstimate !== 0) {
|
|
obj.bandwidthEstimate = Math.round(message.bandwidthEstimate);
|
|
}
|
|
if (message.playerTimeMs !== undefined && message.playerTimeMs !== 0) {
|
|
obj.playerTimeMs = Math.round(message.playerTimeMs);
|
|
}
|
|
if (message.timeSinceLastSeek !== undefined && message.timeSinceLastSeek !== 0) {
|
|
obj.timeSinceLastSeek = Math.round(message.timeSinceLastSeek);
|
|
}
|
|
if (message.dataSaverMode !== undefined && message.dataSaverMode !== false) {
|
|
obj.dataSaverMode = message.dataSaverMode;
|
|
}
|
|
if (message.visibility !== undefined && message.visibility !== 0) {
|
|
obj.visibility = Math.round(message.visibility);
|
|
}
|
|
if (message.playbackRate !== undefined && message.playbackRate !== 0) {
|
|
obj.playbackRate = message.playbackRate;
|
|
}
|
|
if (message.elapsedWallTimeMs !== undefined && message.elapsedWallTimeMs !== 0) {
|
|
obj.elapsedWallTimeMs = Math.round(message.elapsedWallTimeMs);
|
|
}
|
|
if (message.mediaCapabilities !== undefined && message.mediaCapabilities.length !== 0) {
|
|
obj.mediaCapabilities = base64FromBytes(message.mediaCapabilities);
|
|
}
|
|
if (message.timeSinceLastActionMs !== undefined && message.timeSinceLastActionMs !== 0) {
|
|
obj.timeSinceLastActionMs = Math.round(message.timeSinceLastActionMs);
|
|
}
|
|
if (message.enabledTrackTypesBitfield !== undefined && message.enabledTrackTypesBitfield !== 0) {
|
|
obj.enabledTrackTypesBitfield = Math.round(message.enabledTrackTypesBitfield);
|
|
}
|
|
if (message.maxPacingRate !== undefined && message.maxPacingRate !== 0) {
|
|
obj.maxPacingRate = Math.round(message.maxPacingRate);
|
|
}
|
|
if (message.playerState !== undefined && message.playerState !== 0) {
|
|
obj.playerState = Math.round(message.playerState);
|
|
}
|
|
if (message.drcEnabled !== undefined && message.drcEnabled !== false) {
|
|
obj.drcEnabled = message.drcEnabled;
|
|
}
|
|
if (message.Jda !== undefined && message.Jda !== 0) {
|
|
obj.Jda = Math.round(message.Jda);
|
|
}
|
|
if (message.qw !== undefined && message.qw !== 0) {
|
|
obj.qw = Math.round(message.qw);
|
|
}
|
|
if (message.Ky !== undefined && message.Ky !== 0) {
|
|
obj.Ky = Math.round(message.Ky);
|
|
}
|
|
if (message.sabrReportRequestCancellationInfo !== undefined && message.sabrReportRequestCancellationInfo !== 0) {
|
|
obj.sabrReportRequestCancellationInfo = Math.round(message.sabrReportRequestCancellationInfo);
|
|
}
|
|
if (message.l !== undefined && message.l !== false) {
|
|
obj.l = message.l;
|
|
}
|
|
if (message.G7 !== undefined && message.G7 !== 0) {
|
|
obj.G7 = Math.round(message.G7);
|
|
}
|
|
if (message.preferVp9 !== undefined && message.preferVp9 !== false) {
|
|
obj.preferVp9 = message.preferVp9;
|
|
}
|
|
if (message.qj !== undefined && message.qj !== 0) {
|
|
obj.qj = Math.round(message.qj);
|
|
}
|
|
if (message.Hx !== undefined && message.Hx !== 0) {
|
|
obj.Hx = Math.round(message.Hx);
|
|
}
|
|
if (message.isPrefetch !== undefined && message.isPrefetch !== false) {
|
|
obj.isPrefetch = message.isPrefetch;
|
|
}
|
|
if (message.sabrSupportQualityConstraints !== undefined && message.sabrSupportQualityConstraints !== 0) {
|
|
obj.sabrSupportQualityConstraints = Math.round(message.sabrSupportQualityConstraints);
|
|
}
|
|
if (message.sabrLicenseConstraint !== undefined && message.sabrLicenseConstraint.length !== 0) {
|
|
obj.sabrLicenseConstraint = base64FromBytes(message.sabrLicenseConstraint);
|
|
}
|
|
if (message.allowProximaLiveLatency !== undefined && message.allowProximaLiveLatency !== 0) {
|
|
obj.allowProximaLiveLatency = Math.round(message.allowProximaLiveLatency);
|
|
}
|
|
if (message.sabrForceProxima !== undefined && message.sabrForceProxima !== 0) {
|
|
obj.sabrForceProxima = Math.round(message.sabrForceProxima);
|
|
}
|
|
if (message.Tqb !== undefined && message.Tqb !== 0) {
|
|
obj.Tqb = Math.round(message.Tqb);
|
|
}
|
|
if (
|
|
message.sabrForceMaxNetworkInterruptionDurationMs !== undefined &&
|
|
message.sabrForceMaxNetworkInterruptionDurationMs !== 0
|
|
) {
|
|
obj.sabrForceMaxNetworkInterruptionDurationMs = Math.round(message.sabrForceMaxNetworkInterruptionDurationMs);
|
|
}
|
|
return obj;
|
|
},
|
|
|
|
create<I extends Exact<DeepPartial<ClientAbrState>, I>>(base?: I): ClientAbrState {
|
|
return ClientAbrState.fromPartial(base ?? ({} as any));
|
|
},
|
|
fromPartial<I extends Exact<DeepPartial<ClientAbrState>, I>>(object: I): ClientAbrState {
|
|
const message = createBaseClientAbrState();
|
|
message.timeSinceLastManualFormatSelectionMs = object.timeSinceLastManualFormatSelectionMs ?? 0;
|
|
message.lastManualDirection = object.lastManualDirection ?? 0;
|
|
message.lastManualSelectedResolution = object.lastManualSelectedResolution ?? 0;
|
|
message.detailedNetworkType = object.detailedNetworkType ?? 0;
|
|
message.clientViewportWidth = object.clientViewportWidth ?? 0;
|
|
message.clientViewportHeight = object.clientViewportHeight ?? 0;
|
|
message.clientBitrateCap = object.clientBitrateCap ?? 0;
|
|
message.stickyResolution = object.stickyResolution ?? 0;
|
|
message.clientViewportIsFlexible = object.clientViewportIsFlexible ?? false;
|
|
message.bandwidthEstimate = object.bandwidthEstimate ?? 0;
|
|
message.playerTimeMs = object.playerTimeMs ?? 0;
|
|
message.timeSinceLastSeek = object.timeSinceLastSeek ?? 0;
|
|
message.dataSaverMode = object.dataSaverMode ?? false;
|
|
message.visibility = object.visibility ?? 0;
|
|
message.playbackRate = object.playbackRate ?? 0;
|
|
message.elapsedWallTimeMs = object.elapsedWallTimeMs ?? 0;
|
|
message.mediaCapabilities = object.mediaCapabilities ?? new Uint8Array(0);
|
|
message.timeSinceLastActionMs = object.timeSinceLastActionMs ?? 0;
|
|
message.enabledTrackTypesBitfield = object.enabledTrackTypesBitfield ?? 0;
|
|
message.maxPacingRate = object.maxPacingRate ?? 0;
|
|
message.playerState = object.playerState ?? 0;
|
|
message.drcEnabled = object.drcEnabled ?? false;
|
|
message.Jda = object.Jda ?? 0;
|
|
message.qw = object.qw ?? 0;
|
|
message.Ky = object.Ky ?? 0;
|
|
message.sabrReportRequestCancellationInfo = object.sabrReportRequestCancellationInfo ?? 0;
|
|
message.l = object.l ?? false;
|
|
message.G7 = object.G7 ?? 0;
|
|
message.preferVp9 = object.preferVp9 ?? false;
|
|
message.qj = object.qj ?? 0;
|
|
message.Hx = object.Hx ?? 0;
|
|
message.isPrefetch = object.isPrefetch ?? false;
|
|
message.sabrSupportQualityConstraints = object.sabrSupportQualityConstraints ?? 0;
|
|
message.sabrLicenseConstraint = object.sabrLicenseConstraint ?? new Uint8Array(0);
|
|
message.allowProximaLiveLatency = object.allowProximaLiveLatency ?? 0;
|
|
message.sabrForceProxima = object.sabrForceProxima ?? 0;
|
|
message.Tqb = object.Tqb ?? 0;
|
|
message.sabrForceMaxNetworkInterruptionDurationMs = object.sabrForceMaxNetworkInterruptionDurationMs ?? 0;
|
|
return message;
|
|
},
|
|
};
|
|
|
|
function bytesFromBase64(b64: string): Uint8Array {
|
|
const bin = globalThis.atob(b64);
|
|
const arr = new Uint8Array(bin.length);
|
|
for (let i = 0; i < bin.length; ++i) {
|
|
arr[i] = bin.charCodeAt(i);
|
|
}
|
|
return arr;
|
|
}
|
|
|
|
function base64FromBytes(arr: Uint8Array): string {
|
|
const bin: string[] = [];
|
|
arr.forEach((byte) => {
|
|
bin.push(globalThis.String.fromCharCode(byte));
|
|
});
|
|
return globalThis.btoa(bin.join(""));
|
|
}
|
|
|
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
|
|
export type DeepPartial<T> = T extends Builtin ? T
|
|
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
: Partial<T>;
|
|
|
|
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
|
|
function longToNumber(int64: { toString(): string }): number {
|
|
const num = globalThis.Number(int64.toString());
|
|
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
|
|
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
}
|
|
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
|
|
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
}
|
|
return num;
|
|
}
|
|
|
|
function isSet(value: any): boolean {
|
|
return value !== null && value !== undefined;
|
|
}
|
|
|
|
export interface MessageFns<T> {
|
|
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
fromJSON(object: any): T;
|
|
toJSON(message: T): unknown;
|
|
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
}
|