Files
googlevideo/protos/generated/video_streaming/sabr_seek.ts
2025-07-24 10:00:27 -03:00

93 lines
2.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_seek.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { SeekSource } from "../misc/common.js";
export const protobufPackage = "video_streaming";
export interface SabrSeek {
seekMediaTime?: number | undefined;
seekMediaTimescale?: number | undefined;
seekSource?: SeekSource | undefined;
}
function createBaseSabrSeek(): SabrSeek {
return { seekMediaTime: 0, seekMediaTimescale: 0, seekSource: 0 };
}
export const SabrSeek: MessageFns<SabrSeek> = {
encode(message: SabrSeek, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.seekMediaTime !== undefined && message.seekMediaTime !== 0) {
writer.uint32(8).int64(message.seekMediaTime);
}
if (message.seekMediaTimescale !== undefined && message.seekMediaTimescale !== 0) {
writer.uint32(16).int32(message.seekMediaTimescale);
}
if (message.seekSource !== undefined && message.seekSource !== 0) {
writer.uint32(24).int32(message.seekSource);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): SabrSeek {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
const end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseSabrSeek();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.seekMediaTime = longToNumber(reader.int64());
continue;
}
case 2: {
if (tag !== 16) {
break;
}
message.seekMediaTimescale = reader.int32();
continue;
}
case 3: {
if (tag !== 24) {
break;
}
message.seekSource = reader.int32() as any;
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
};
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;
}
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
}