mirror of
https://github.com/LuanRT/googlevideo.git
synced 2026-06-19 03:31:37 +00:00
765 lines
27 KiB
TypeScript
765 lines
27 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";
|
|
import { MediaCapabilities } from "./media_capabilities.js";
|
|
|
|
export const protobufPackage = "video_streaming";
|
|
|
|
export interface ClientAbrState {
|
|
timeSinceLastManualFormatSelectionMs?: number | undefined;
|
|
lastManualDirection?: number | undefined;
|
|
quality?: number | undefined;
|
|
detailedNetworkType?: number | undefined;
|
|
maxWidth?: number | undefined;
|
|
maxHeight?: number | undefined;
|
|
selectedQualityHeight?: number | undefined;
|
|
r7?: number | undefined;
|
|
startTimeMs?: number | undefined;
|
|
timeSinceLastSeek?: number | undefined;
|
|
visibility?: number | undefined;
|
|
timeSinceLastReq?: number | undefined;
|
|
mediaCapabilities?: MediaCapabilities | undefined;
|
|
timeSinceLastAction?:
|
|
| number
|
|
| undefined;
|
|
/** optional int32 Gw = 40; */
|
|
mediaType?: ClientAbrState_MediaType | undefined;
|
|
playerState?: number | undefined;
|
|
rangeCompression?: 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;
|
|
playbackRate?: number | undefined;
|
|
}
|
|
|
|
export enum ClientAbrState_MediaType {
|
|
MEDIA_TYPE_DEFAULT = 0,
|
|
MEDIA_TYPE_AUDIO = 1,
|
|
MEDIA_TYPE_VIDEO = 2,
|
|
USE_SERVER_FORMAT_FILTER = 3,
|
|
UNRECOGNIZED = -1,
|
|
}
|
|
|
|
export function clientAbrState_MediaTypeFromJSON(object: any): ClientAbrState_MediaType {
|
|
switch (object) {
|
|
case 0:
|
|
case "MEDIA_TYPE_DEFAULT":
|
|
return ClientAbrState_MediaType.MEDIA_TYPE_DEFAULT;
|
|
case 1:
|
|
case "MEDIA_TYPE_AUDIO":
|
|
return ClientAbrState_MediaType.MEDIA_TYPE_AUDIO;
|
|
case 2:
|
|
case "MEDIA_TYPE_VIDEO":
|
|
return ClientAbrState_MediaType.MEDIA_TYPE_VIDEO;
|
|
case 3:
|
|
case "USE_SERVER_FORMAT_FILTER":
|
|
return ClientAbrState_MediaType.USE_SERVER_FORMAT_FILTER;
|
|
case -1:
|
|
case "UNRECOGNIZED":
|
|
default:
|
|
return ClientAbrState_MediaType.UNRECOGNIZED;
|
|
}
|
|
}
|
|
|
|
export function clientAbrState_MediaTypeToJSON(object: ClientAbrState_MediaType): string {
|
|
switch (object) {
|
|
case ClientAbrState_MediaType.MEDIA_TYPE_DEFAULT:
|
|
return "MEDIA_TYPE_DEFAULT";
|
|
case ClientAbrState_MediaType.MEDIA_TYPE_AUDIO:
|
|
return "MEDIA_TYPE_AUDIO";
|
|
case ClientAbrState_MediaType.MEDIA_TYPE_VIDEO:
|
|
return "MEDIA_TYPE_VIDEO";
|
|
case ClientAbrState_MediaType.USE_SERVER_FORMAT_FILTER:
|
|
return "USE_SERVER_FORMAT_FILTER";
|
|
case ClientAbrState_MediaType.UNRECOGNIZED:
|
|
default:
|
|
return "UNRECOGNIZED";
|
|
}
|
|
}
|
|
|
|
function createBaseClientAbrState(): ClientAbrState {
|
|
return {
|
|
timeSinceLastManualFormatSelectionMs: 0,
|
|
lastManualDirection: 0,
|
|
quality: 0,
|
|
detailedNetworkType: 0,
|
|
maxWidth: 0,
|
|
maxHeight: 0,
|
|
selectedQualityHeight: 0,
|
|
r7: 0,
|
|
startTimeMs: 0,
|
|
timeSinceLastSeek: 0,
|
|
visibility: 0,
|
|
timeSinceLastReq: 0,
|
|
mediaCapabilities: undefined,
|
|
timeSinceLastAction: 0,
|
|
mediaType: 0,
|
|
playerState: 0,
|
|
rangeCompression: 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,
|
|
playbackRate: 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.quality !== undefined && message.quality !== 0) {
|
|
writer.uint32(128).int32(message.quality);
|
|
}
|
|
if (message.detailedNetworkType !== undefined && message.detailedNetworkType !== 0) {
|
|
writer.uint32(136).int32(message.detailedNetworkType);
|
|
}
|
|
if (message.maxWidth !== undefined && message.maxWidth !== 0) {
|
|
writer.uint32(144).int32(message.maxWidth);
|
|
}
|
|
if (message.maxHeight !== undefined && message.maxHeight !== 0) {
|
|
writer.uint32(152).int32(message.maxHeight);
|
|
}
|
|
if (message.selectedQualityHeight !== undefined && message.selectedQualityHeight !== 0) {
|
|
writer.uint32(168).int32(message.selectedQualityHeight);
|
|
}
|
|
if (message.r7 !== undefined && message.r7 !== 0) {
|
|
writer.uint32(184).int32(message.r7);
|
|
}
|
|
if (message.startTimeMs !== undefined && message.startTimeMs !== 0) {
|
|
writer.uint32(224).int64(message.startTimeMs);
|
|
}
|
|
if (message.timeSinceLastSeek !== undefined && message.timeSinceLastSeek !== 0) {
|
|
writer.uint32(232).int64(message.timeSinceLastSeek);
|
|
}
|
|
if (message.visibility !== undefined && message.visibility !== 0) {
|
|
writer.uint32(272).int32(message.visibility);
|
|
}
|
|
if (message.timeSinceLastReq !== undefined && message.timeSinceLastReq !== 0) {
|
|
writer.uint32(288).int64(message.timeSinceLastReq);
|
|
}
|
|
if (message.mediaCapabilities !== undefined) {
|
|
MediaCapabilities.encode(message.mediaCapabilities, writer.uint32(306).fork()).join();
|
|
}
|
|
if (message.timeSinceLastAction !== undefined && message.timeSinceLastAction !== 0) {
|
|
writer.uint32(312).int64(message.timeSinceLastAction);
|
|
}
|
|
if (message.mediaType !== undefined && message.mediaType !== 0) {
|
|
writer.uint32(320).int32(message.mediaType);
|
|
}
|
|
if (message.playerState !== undefined && message.playerState !== 0) {
|
|
writer.uint32(352).int64(message.playerState);
|
|
}
|
|
if (message.rangeCompression !== undefined && message.rangeCompression !== false) {
|
|
writer.uint32(368).bool(message.rangeCompression);
|
|
}
|
|
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);
|
|
}
|
|
if (message.playbackRate !== undefined && message.playbackRate !== 0) {
|
|
writer.uint32(2285).float(message.playbackRate);
|
|
}
|
|
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.quality = reader.int32();
|
|
continue;
|
|
case 17:
|
|
if (tag !== 136) {
|
|
break;
|
|
}
|
|
|
|
message.detailedNetworkType = reader.int32();
|
|
continue;
|
|
case 18:
|
|
if (tag !== 144) {
|
|
break;
|
|
}
|
|
|
|
message.maxWidth = reader.int32();
|
|
continue;
|
|
case 19:
|
|
if (tag !== 152) {
|
|
break;
|
|
}
|
|
|
|
message.maxHeight = reader.int32();
|
|
continue;
|
|
case 21:
|
|
if (tag !== 168) {
|
|
break;
|
|
}
|
|
|
|
message.selectedQualityHeight = reader.int32();
|
|
continue;
|
|
case 23:
|
|
if (tag !== 184) {
|
|
break;
|
|
}
|
|
|
|
message.r7 = reader.int32();
|
|
continue;
|
|
case 28:
|
|
if (tag !== 224) {
|
|
break;
|
|
}
|
|
|
|
message.startTimeMs = longToNumber(reader.int64());
|
|
continue;
|
|
case 29:
|
|
if (tag !== 232) {
|
|
break;
|
|
}
|
|
|
|
message.timeSinceLastSeek = longToNumber(reader.int64());
|
|
continue;
|
|
case 34:
|
|
if (tag !== 272) {
|
|
break;
|
|
}
|
|
|
|
message.visibility = reader.int32();
|
|
continue;
|
|
case 36:
|
|
if (tag !== 288) {
|
|
break;
|
|
}
|
|
|
|
message.timeSinceLastReq = longToNumber(reader.int64());
|
|
continue;
|
|
case 38:
|
|
if (tag !== 306) {
|
|
break;
|
|
}
|
|
|
|
message.mediaCapabilities = MediaCapabilities.decode(reader, reader.uint32());
|
|
continue;
|
|
case 39:
|
|
if (tag !== 312) {
|
|
break;
|
|
}
|
|
|
|
message.timeSinceLastAction = longToNumber(reader.int64());
|
|
continue;
|
|
case 40:
|
|
if (tag !== 320) {
|
|
break;
|
|
}
|
|
|
|
message.mediaType = reader.int32() as any;
|
|
continue;
|
|
case 44:
|
|
if (tag !== 352) {
|
|
break;
|
|
}
|
|
|
|
message.playerState = longToNumber(reader.int64());
|
|
continue;
|
|
case 46:
|
|
if (tag !== 368) {
|
|
break;
|
|
}
|
|
|
|
message.rangeCompression = 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;
|
|
case 285:
|
|
if (tag !== 2285) {
|
|
break;
|
|
}
|
|
|
|
message.playbackRate = reader.float();
|
|
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,
|
|
quality: isSet(object.quality) ? globalThis.Number(object.quality) : 0,
|
|
detailedNetworkType: isSet(object.detailedNetworkType) ? globalThis.Number(object.detailedNetworkType) : 0,
|
|
maxWidth: isSet(object.maxWidth) ? globalThis.Number(object.maxWidth) : 0,
|
|
maxHeight: isSet(object.maxHeight) ? globalThis.Number(object.maxHeight) : 0,
|
|
selectedQualityHeight: isSet(object.selectedQualityHeight) ? globalThis.Number(object.selectedQualityHeight) : 0,
|
|
r7: isSet(object.r7) ? globalThis.Number(object.r7) : 0,
|
|
startTimeMs: isSet(object.startTimeMs) ? globalThis.Number(object.startTimeMs) : 0,
|
|
timeSinceLastSeek: isSet(object.timeSinceLastSeek) ? globalThis.Number(object.timeSinceLastSeek) : 0,
|
|
visibility: isSet(object.visibility) ? globalThis.Number(object.visibility) : 0,
|
|
timeSinceLastReq: isSet(object.timeSinceLastReq) ? globalThis.Number(object.timeSinceLastReq) : 0,
|
|
mediaCapabilities: isSet(object.mediaCapabilities)
|
|
? MediaCapabilities.fromJSON(object.mediaCapabilities)
|
|
: undefined,
|
|
timeSinceLastAction: isSet(object.timeSinceLastAction) ? globalThis.Number(object.timeSinceLastAction) : 0,
|
|
mediaType: isSet(object.mediaType) ? clientAbrState_MediaTypeFromJSON(object.mediaType) : 0,
|
|
playerState: isSet(object.playerState) ? globalThis.Number(object.playerState) : 0,
|
|
rangeCompression: isSet(object.rangeCompression) ? globalThis.Boolean(object.rangeCompression) : 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,
|
|
playbackRate: isSet(object.playbackRate) ? globalThis.Number(object.playbackRate) : 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.quality !== undefined && message.quality !== 0) {
|
|
obj.quality = Math.round(message.quality);
|
|
}
|
|
if (message.detailedNetworkType !== undefined && message.detailedNetworkType !== 0) {
|
|
obj.detailedNetworkType = Math.round(message.detailedNetworkType);
|
|
}
|
|
if (message.maxWidth !== undefined && message.maxWidth !== 0) {
|
|
obj.maxWidth = Math.round(message.maxWidth);
|
|
}
|
|
if (message.maxHeight !== undefined && message.maxHeight !== 0) {
|
|
obj.maxHeight = Math.round(message.maxHeight);
|
|
}
|
|
if (message.selectedQualityHeight !== undefined && message.selectedQualityHeight !== 0) {
|
|
obj.selectedQualityHeight = Math.round(message.selectedQualityHeight);
|
|
}
|
|
if (message.r7 !== undefined && message.r7 !== 0) {
|
|
obj.r7 = Math.round(message.r7);
|
|
}
|
|
if (message.startTimeMs !== undefined && message.startTimeMs !== 0) {
|
|
obj.startTimeMs = Math.round(message.startTimeMs);
|
|
}
|
|
if (message.timeSinceLastSeek !== undefined && message.timeSinceLastSeek !== 0) {
|
|
obj.timeSinceLastSeek = Math.round(message.timeSinceLastSeek);
|
|
}
|
|
if (message.visibility !== undefined && message.visibility !== 0) {
|
|
obj.visibility = Math.round(message.visibility);
|
|
}
|
|
if (message.timeSinceLastReq !== undefined && message.timeSinceLastReq !== 0) {
|
|
obj.timeSinceLastReq = Math.round(message.timeSinceLastReq);
|
|
}
|
|
if (message.mediaCapabilities !== undefined) {
|
|
obj.mediaCapabilities = MediaCapabilities.toJSON(message.mediaCapabilities);
|
|
}
|
|
if (message.timeSinceLastAction !== undefined && message.timeSinceLastAction !== 0) {
|
|
obj.timeSinceLastAction = Math.round(message.timeSinceLastAction);
|
|
}
|
|
if (message.mediaType !== undefined && message.mediaType !== 0) {
|
|
obj.mediaType = clientAbrState_MediaTypeToJSON(message.mediaType);
|
|
}
|
|
if (message.playerState !== undefined && message.playerState !== 0) {
|
|
obj.playerState = Math.round(message.playerState);
|
|
}
|
|
if (message.rangeCompression !== undefined && message.rangeCompression !== false) {
|
|
obj.rangeCompression = message.rangeCompression;
|
|
}
|
|
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);
|
|
}
|
|
if (message.playbackRate !== undefined && message.playbackRate !== 0) {
|
|
obj.playbackRate = message.playbackRate;
|
|
}
|
|
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.quality = object.quality ?? 0;
|
|
message.detailedNetworkType = object.detailedNetworkType ?? 0;
|
|
message.maxWidth = object.maxWidth ?? 0;
|
|
message.maxHeight = object.maxHeight ?? 0;
|
|
message.selectedQualityHeight = object.selectedQualityHeight ?? 0;
|
|
message.r7 = object.r7 ?? 0;
|
|
message.startTimeMs = object.startTimeMs ?? 0;
|
|
message.timeSinceLastSeek = object.timeSinceLastSeek ?? 0;
|
|
message.visibility = object.visibility ?? 0;
|
|
message.timeSinceLastReq = object.timeSinceLastReq ?? 0;
|
|
message.mediaCapabilities = (object.mediaCapabilities !== undefined && object.mediaCapabilities !== null)
|
|
? MediaCapabilities.fromPartial(object.mediaCapabilities)
|
|
: undefined;
|
|
message.timeSinceLastAction = object.timeSinceLastAction ?? 0;
|
|
message.mediaType = object.mediaType ?? 0;
|
|
message.playerState = object.playerState ?? 0;
|
|
message.rangeCompression = object.rangeCompression ?? 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;
|
|
message.playbackRate = object.playbackRate ?? 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;
|
|
}
|