mirror of
https://github.com/LuanRT/googlevideo.git
synced 2026-06-13 00:32:11 +00:00
Noticed YouTube returning very large int64 values, causing the protobuf library to throw.
309 lines
8.7 KiB
TypeScript
309 lines
8.7 KiB
TypeScript
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
// versions:
|
|
// protoc-gen-ts_proto v2.7.5
|
|
// protoc v5.28.0
|
|
// source: video_streaming/sabr_context_update.proto
|
|
|
|
/* eslint-disable */
|
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
|
|
export const protobufPackage = "video_streaming";
|
|
|
|
export interface SabrContextUpdate {
|
|
type?: number | undefined;
|
|
scope?: SabrContextUpdate_SabrContextScope | undefined;
|
|
value?: Uint8Array | undefined;
|
|
sendByDefault?: boolean | undefined;
|
|
writePolicy?: SabrContextUpdate_SabrContextWritePolicy | undefined;
|
|
}
|
|
|
|
export enum SabrContextUpdate_SabrContextScope {
|
|
UNKNOWN = 0,
|
|
PLAYBACK = 1,
|
|
REQUEST = 2,
|
|
WATCH_ENDPOINT = 3,
|
|
CONTENT_ADS = 4,
|
|
UNRECOGNIZED = -1,
|
|
}
|
|
|
|
export enum SabrContextUpdate_SabrContextWritePolicy {
|
|
UNSPECIFIED = 0,
|
|
OVERWRITE = 1,
|
|
KEEP_EXISTING = 2,
|
|
UNRECOGNIZED = -1,
|
|
}
|
|
|
|
/** For debugging */
|
|
export interface SabrContextValue {
|
|
timing?: SabrContextValue_TimingInfo | undefined;
|
|
signature?: Uint8Array | undefined;
|
|
field5?: number | undefined;
|
|
}
|
|
|
|
export interface SabrContextValue_ContentInfo {
|
|
/** Looks like a content identifier of some sort "mQxOaLekHJ2f-LAPtq3hwQ4" */
|
|
contentId?:
|
|
| string
|
|
| undefined;
|
|
/** Value of 1 observed (unsure what it truly means/is) */
|
|
contentType?: number | undefined;
|
|
}
|
|
|
|
export interface SabrContextValue_TimingInfo {
|
|
timestampMs?: string | undefined;
|
|
durationMs?: number | undefined;
|
|
content?: SabrContextValue_ContentInfo | undefined;
|
|
}
|
|
|
|
function createBaseSabrContextUpdate(): SabrContextUpdate {
|
|
return { type: 0, scope: 0, value: new Uint8Array(0), sendByDefault: false, writePolicy: 0 };
|
|
}
|
|
|
|
export const SabrContextUpdate: MessageFns<SabrContextUpdate> = {
|
|
encode(message: SabrContextUpdate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
if (message.type !== undefined && message.type !== 0) {
|
|
writer.uint32(8).int32(message.type);
|
|
}
|
|
if (message.scope !== undefined && message.scope !== 0) {
|
|
writer.uint32(16).int32(message.scope);
|
|
}
|
|
if (message.value !== undefined && message.value.length !== 0) {
|
|
writer.uint32(26).bytes(message.value);
|
|
}
|
|
if (message.sendByDefault !== undefined && message.sendByDefault !== false) {
|
|
writer.uint32(32).bool(message.sendByDefault);
|
|
}
|
|
if (message.writePolicy !== undefined && message.writePolicy !== 0) {
|
|
writer.uint32(40).int32(message.writePolicy);
|
|
}
|
|
return writer;
|
|
},
|
|
|
|
decode(input: BinaryReader | Uint8Array, length?: number): SabrContextUpdate {
|
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
const message = createBaseSabrContextUpdate();
|
|
while (reader.pos < end) {
|
|
const tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
if (tag !== 8) {
|
|
break;
|
|
}
|
|
|
|
message.type = reader.int32();
|
|
continue;
|
|
}
|
|
case 2: {
|
|
if (tag !== 16) {
|
|
break;
|
|
}
|
|
|
|
message.scope = reader.int32() as any;
|
|
continue;
|
|
}
|
|
case 3: {
|
|
if (tag !== 26) {
|
|
break;
|
|
}
|
|
|
|
message.value = reader.bytes();
|
|
continue;
|
|
}
|
|
case 4: {
|
|
if (tag !== 32) {
|
|
break;
|
|
}
|
|
|
|
message.sendByDefault = reader.bool();
|
|
continue;
|
|
}
|
|
case 5: {
|
|
if (tag !== 40) {
|
|
break;
|
|
}
|
|
|
|
message.writePolicy = reader.int32() as any;
|
|
continue;
|
|
}
|
|
}
|
|
if ((tag & 7) === 4 || tag === 0) {
|
|
break;
|
|
}
|
|
reader.skip(tag & 7);
|
|
}
|
|
return message;
|
|
},
|
|
};
|
|
|
|
function createBaseSabrContextValue(): SabrContextValue {
|
|
return { timing: undefined, signature: new Uint8Array(0), field5: 0 };
|
|
}
|
|
|
|
export const SabrContextValue: MessageFns<SabrContextValue> = {
|
|
encode(message: SabrContextValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
if (message.timing !== undefined) {
|
|
SabrContextValue_TimingInfo.encode(message.timing, writer.uint32(10).fork()).join();
|
|
}
|
|
if (message.signature !== undefined && message.signature.length !== 0) {
|
|
writer.uint32(18).bytes(message.signature);
|
|
}
|
|
if (message.field5 !== undefined && message.field5 !== 0) {
|
|
writer.uint32(40).int32(message.field5);
|
|
}
|
|
return writer;
|
|
},
|
|
|
|
decode(input: BinaryReader | Uint8Array, length?: number): SabrContextValue {
|
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
const message = createBaseSabrContextValue();
|
|
while (reader.pos < end) {
|
|
const tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
if (tag !== 10) {
|
|
break;
|
|
}
|
|
|
|
message.timing = SabrContextValue_TimingInfo.decode(reader, reader.uint32());
|
|
continue;
|
|
}
|
|
case 2: {
|
|
if (tag !== 18) {
|
|
break;
|
|
}
|
|
|
|
message.signature = reader.bytes();
|
|
continue;
|
|
}
|
|
case 5: {
|
|
if (tag !== 40) {
|
|
break;
|
|
}
|
|
|
|
message.field5 = reader.int32();
|
|
continue;
|
|
}
|
|
}
|
|
if ((tag & 7) === 4 || tag === 0) {
|
|
break;
|
|
}
|
|
reader.skip(tag & 7);
|
|
}
|
|
return message;
|
|
},
|
|
};
|
|
|
|
function createBaseSabrContextValue_ContentInfo(): SabrContextValue_ContentInfo {
|
|
return { contentId: "", contentType: 0 };
|
|
}
|
|
|
|
export const SabrContextValue_ContentInfo: MessageFns<SabrContextValue_ContentInfo> = {
|
|
encode(message: SabrContextValue_ContentInfo, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
if (message.contentId !== undefined && message.contentId !== "") {
|
|
writer.uint32(10).string(message.contentId);
|
|
}
|
|
if (message.contentType !== undefined && message.contentType !== 0) {
|
|
writer.uint32(16).int32(message.contentType);
|
|
}
|
|
return writer;
|
|
},
|
|
|
|
decode(input: BinaryReader | Uint8Array, length?: number): SabrContextValue_ContentInfo {
|
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
const message = createBaseSabrContextValue_ContentInfo();
|
|
while (reader.pos < end) {
|
|
const tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
if (tag !== 10) {
|
|
break;
|
|
}
|
|
|
|
message.contentId = reader.string();
|
|
continue;
|
|
}
|
|
case 2: {
|
|
if (tag !== 16) {
|
|
break;
|
|
}
|
|
|
|
message.contentType = reader.int32();
|
|
continue;
|
|
}
|
|
}
|
|
if ((tag & 7) === 4 || tag === 0) {
|
|
break;
|
|
}
|
|
reader.skip(tag & 7);
|
|
}
|
|
return message;
|
|
},
|
|
};
|
|
|
|
function createBaseSabrContextValue_TimingInfo(): SabrContextValue_TimingInfo {
|
|
return { timestampMs: "0", durationMs: 0, content: undefined };
|
|
}
|
|
|
|
export const SabrContextValue_TimingInfo: MessageFns<SabrContextValue_TimingInfo> = {
|
|
encode(message: SabrContextValue_TimingInfo, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
if (message.timestampMs !== undefined && message.timestampMs !== "0") {
|
|
writer.uint32(8).int64(message.timestampMs);
|
|
}
|
|
if (message.durationMs !== undefined && message.durationMs !== 0) {
|
|
writer.uint32(16).int32(message.durationMs);
|
|
}
|
|
if (message.content !== undefined) {
|
|
SabrContextValue_ContentInfo.encode(message.content, writer.uint32(26).fork()).join();
|
|
}
|
|
return writer;
|
|
},
|
|
|
|
decode(input: BinaryReader | Uint8Array, length?: number): SabrContextValue_TimingInfo {
|
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
const message = createBaseSabrContextValue_TimingInfo();
|
|
while (reader.pos < end) {
|
|
const tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
if (tag !== 8) {
|
|
break;
|
|
}
|
|
|
|
message.timestampMs = reader.int64().toString();
|
|
continue;
|
|
}
|
|
case 2: {
|
|
if (tag !== 16) {
|
|
break;
|
|
}
|
|
|
|
message.durationMs = reader.int32();
|
|
continue;
|
|
}
|
|
case 3: {
|
|
if (tag !== 26) {
|
|
break;
|
|
}
|
|
|
|
message.content = SabrContextValue_ContentInfo.decode(reader, reader.uint32());
|
|
continue;
|
|
}
|
|
}
|
|
if ((tag & 7) === 4 || tag === 0) {
|
|
break;
|
|
}
|
|
reader.skip(tag & 7);
|
|
}
|
|
return message;
|
|
},
|
|
};
|
|
|
|
export interface MessageFns<T> {
|
|
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
}
|