Files
googlevideo/protos/generated/video_streaming/media_info.ts
2024-09-21 13:51:23 -03:00

736 lines
24 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/media_info.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { MediaCapabilities } from "./media_capabilities.js";
export const protobufPackage = "video_streaming";
export interface MediaInfo {
timeSinceLastManualFormatSelectionMs?: number | undefined;
lastManualDirection?: number | undefined;
quality?: number | undefined;
detailedNetworkType?: number | undefined;
maxWidth?: number | undefined;
maxHeight?: number | undefined;
iea?: number | undefined;
r7?: number | undefined;
startTimeMs?: number | undefined;
timeSinceLastSeek?: number | undefined;
visibility?: number | undefined;
d8?: number | undefined;
mediaCapabilities?: MediaCapabilities | undefined;
lact?:
| number
| undefined;
/** optional int32 Gw = 40; */
mediaType?: MediaInfo_MediaType | undefined;
playerState?: number | undefined;
a8?: boolean | undefined;
Jda?: number | undefined;
qw?: number | undefined;
Ky?: number | undefined;
Eq?: number | undefined;
l?: boolean | undefined;
G7?: number | undefined;
No?: boolean | undefined;
qj?: number | undefined;
Hx?: number | undefined;
isPrefetch?: boolean | undefined;
Iz?: number | undefined;
sabrLicenseConstraint?: Uint8Array | undefined;
allowProximaLiveLatency?: number | undefined;
sabrForceProxima?: number | undefined;
Tqb?: number | undefined;
c?: number | undefined;
}
export enum MediaInfo_MediaType {
MEDIA_TYPE_DEFAULT = 0,
MEDIA_TYPE_AUDIO = 1,
MEDIA_TYPE_VIDEO = 2,
USE_SERVER_FORMAT_FILTER = 3,
UNRECOGNIZED = -1,
}
export function mediaInfo_MediaTypeFromJSON(object: any): MediaInfo_MediaType {
switch (object) {
case 0:
case "MEDIA_TYPE_DEFAULT":
return MediaInfo_MediaType.MEDIA_TYPE_DEFAULT;
case 1:
case "MEDIA_TYPE_AUDIO":
return MediaInfo_MediaType.MEDIA_TYPE_AUDIO;
case 2:
case "MEDIA_TYPE_VIDEO":
return MediaInfo_MediaType.MEDIA_TYPE_VIDEO;
case 3:
case "USE_SERVER_FORMAT_FILTER":
return MediaInfo_MediaType.USE_SERVER_FORMAT_FILTER;
case -1:
case "UNRECOGNIZED":
default:
return MediaInfo_MediaType.UNRECOGNIZED;
}
}
export function mediaInfo_MediaTypeToJSON(object: MediaInfo_MediaType): string {
switch (object) {
case MediaInfo_MediaType.MEDIA_TYPE_DEFAULT:
return "MEDIA_TYPE_DEFAULT";
case MediaInfo_MediaType.MEDIA_TYPE_AUDIO:
return "MEDIA_TYPE_AUDIO";
case MediaInfo_MediaType.MEDIA_TYPE_VIDEO:
return "MEDIA_TYPE_VIDEO";
case MediaInfo_MediaType.USE_SERVER_FORMAT_FILTER:
return "USE_SERVER_FORMAT_FILTER";
case MediaInfo_MediaType.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
function createBaseMediaInfo(): MediaInfo {
return {
timeSinceLastManualFormatSelectionMs: 0,
lastManualDirection: 0,
quality: 0,
detailedNetworkType: 0,
maxWidth: 0,
maxHeight: 0,
iea: 0,
r7: 0,
startTimeMs: 0,
timeSinceLastSeek: 0,
visibility: 0,
d8: 0,
mediaCapabilities: undefined,
lact: 0,
mediaType: 0,
playerState: 0,
a8: false,
Jda: 0,
qw: 0,
Ky: 0,
Eq: 0,
l: false,
G7: 0,
No: false,
qj: 0,
Hx: 0,
isPrefetch: false,
Iz: 0,
sabrLicenseConstraint: new Uint8Array(0),
allowProximaLiveLatency: 0,
sabrForceProxima: 0,
Tqb: 0,
c: 0,
};
}
export const MediaInfo: MessageFns<MediaInfo> = {
encode(message: MediaInfo, 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.iea !== undefined && message.iea !== 0) {
writer.uint32(168).int32(message.iea);
}
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.d8 !== undefined && message.d8 !== 0) {
writer.uint32(288).int64(message.d8);
}
if (message.mediaCapabilities !== undefined) {
MediaCapabilities.encode(message.mediaCapabilities, writer.uint32(306).fork()).join();
}
if (message.lact !== undefined && message.lact !== 0) {
writer.uint32(312).int32(message.lact);
}
if (message.mediaType !== undefined && message.mediaType !== 0) {
writer.uint32(320).int32(message.mediaType);
}
if (message.playerState !== undefined && message.playerState !== 0) {
writer.uint32(352).int32(message.playerState);
}
if (message.a8 !== undefined && message.a8 !== false) {
writer.uint32(368).bool(message.a8);
}
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.Eq !== undefined && message.Eq !== 0) {
writer.uint32(432).int32(message.Eq);
}
if (message.l !== undefined && message.l !== false) {
writer.uint32(448).bool(message.l);
}
if (message.G7 !== undefined && message.G7 !== 0) {
writer.uint32(456).int32(message.G7);
}
if (message.No !== undefined && message.No !== false) {
writer.uint32(464).bool(message.No);
}
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.Iz !== undefined && message.Iz !== 0) {
writer.uint32(496).int32(message.Iz);
}
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.c !== undefined && message.c !== 0) {
writer.uint32(544).int32(message.c);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): MediaInfo {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMediaInfo();
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.iea = 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.d8 = 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.lact = reader.int32();
continue;
case 40:
if (tag !== 320) {
break;
}
message.mediaType = reader.int32() as any;
continue;
case 44:
if (tag !== 352) {
break;
}
message.playerState = reader.int32();
continue;
case 46:
if (tag !== 368) {
break;
}
message.a8 = 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.Eq = reader.int32();
continue;
case 56:
if (tag !== 448) {
break;
}
message.l = reader.bool();
continue;
case 57:
if (tag !== 456) {
break;
}
message.G7 = reader.int32();
continue;
case 58:
if (tag !== 464) {
break;
}
message.No = 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.Iz = 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.c = reader.int32();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): MediaInfo {
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,
iea: isSet(object.iea) ? globalThis.Number(object.iea) : 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,
d8: isSet(object.d8) ? globalThis.Number(object.d8) : 0,
mediaCapabilities: isSet(object.mediaCapabilities)
? MediaCapabilities.fromJSON(object.mediaCapabilities)
: undefined,
lact: isSet(object.lact) ? globalThis.Number(object.lact) : 0,
mediaType: isSet(object.mediaType) ? mediaInfo_MediaTypeFromJSON(object.mediaType) : 0,
playerState: isSet(object.playerState) ? globalThis.Number(object.playerState) : 0,
a8: isSet(object.a8) ? globalThis.Boolean(object.a8) : 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,
Eq: isSet(object.Eq) ? globalThis.Number(object.Eq) : 0,
l: isSet(object.l) ? globalThis.Boolean(object.l) : false,
G7: isSet(object.G7) ? globalThis.Number(object.G7) : 0,
No: isSet(object.No) ? globalThis.Boolean(object.No) : 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,
Iz: isSet(object.Iz) ? globalThis.Number(object.Iz) : 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,
c: isSet(object.c) ? globalThis.Number(object.c) : 0,
};
},
toJSON(message: MediaInfo): 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.iea !== undefined && message.iea !== 0) {
obj.iea = Math.round(message.iea);
}
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.d8 !== undefined && message.d8 !== 0) {
obj.d8 = Math.round(message.d8);
}
if (message.mediaCapabilities !== undefined) {
obj.mediaCapabilities = MediaCapabilities.toJSON(message.mediaCapabilities);
}
if (message.lact !== undefined && message.lact !== 0) {
obj.lact = Math.round(message.lact);
}
if (message.mediaType !== undefined && message.mediaType !== 0) {
obj.mediaType = mediaInfo_MediaTypeToJSON(message.mediaType);
}
if (message.playerState !== undefined && message.playerState !== 0) {
obj.playerState = Math.round(message.playerState);
}
if (message.a8 !== undefined && message.a8 !== false) {
obj.a8 = message.a8;
}
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.Eq !== undefined && message.Eq !== 0) {
obj.Eq = Math.round(message.Eq);
}
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.No !== undefined && message.No !== false) {
obj.No = message.No;
}
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.Iz !== undefined && message.Iz !== 0) {
obj.Iz = Math.round(message.Iz);
}
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.c !== undefined && message.c !== 0) {
obj.c = Math.round(message.c);
}
return obj;
},
create<I extends Exact<DeepPartial<MediaInfo>, I>>(base?: I): MediaInfo {
return MediaInfo.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<MediaInfo>, I>>(object: I): MediaInfo {
const message = createBaseMediaInfo();
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.iea = object.iea ?? 0;
message.r7 = object.r7 ?? 0;
message.startTimeMs = object.startTimeMs ?? 0;
message.timeSinceLastSeek = object.timeSinceLastSeek ?? 0;
message.visibility = object.visibility ?? 0;
message.d8 = object.d8 ?? 0;
message.mediaCapabilities = (object.mediaCapabilities !== undefined && object.mediaCapabilities !== null)
? MediaCapabilities.fromPartial(object.mediaCapabilities)
: undefined;
message.lact = object.lact ?? 0;
message.mediaType = object.mediaType ?? 0;
message.playerState = object.playerState ?? 0;
message.a8 = object.a8 ?? false;
message.Jda = object.Jda ?? 0;
message.qw = object.qw ?? 0;
message.Ky = object.Ky ?? 0;
message.Eq = object.Eq ?? 0;
message.l = object.l ?? false;
message.G7 = object.G7 ?? 0;
message.No = object.No ?? false;
message.qj = object.qj ?? 0;
message.Hx = object.Hx ?? 0;
message.isPrefetch = object.isPrefetch ?? false;
message.Iz = object.Iz ?? 0;
message.sabrLicenseConstraint = object.sabrLicenseConstraint ?? new Uint8Array(0);
message.allowProximaLiveLatency = object.allowProximaLiveLatency ?? 0;
message.sabrForceProxima = object.sabrForceProxima ?? 0;
message.Tqb = object.Tqb ?? 0;
message.c = object.c ?? 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;
}