mirror of
https://github.com/LuanRT/googlevideo.git
synced 2026-06-19 11:41:17 +00:00
90 lines
2.4 KiB
TypeScript
90 lines
2.4 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/format_selection_config.proto
|
|
|
|
/* eslint-disable */
|
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
|
|
export const protobufPackage = "video_streaming";
|
|
|
|
export interface FormatSelectionConfig {
|
|
itags: number[];
|
|
videoId?: string | undefined;
|
|
resolution?: number | undefined;
|
|
}
|
|
|
|
function createBaseFormatSelectionConfig(): FormatSelectionConfig {
|
|
return { itags: [], videoId: "", resolution: 0 };
|
|
}
|
|
|
|
export const FormatSelectionConfig: MessageFns<FormatSelectionConfig> = {
|
|
encode(message: FormatSelectionConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
writer.uint32(18).fork();
|
|
for (const v of message.itags) {
|
|
writer.int32(v);
|
|
}
|
|
writer.join();
|
|
if (message.videoId !== undefined && message.videoId !== "") {
|
|
writer.uint32(26).string(message.videoId);
|
|
}
|
|
if (message.resolution !== undefined && message.resolution !== 0) {
|
|
writer.uint32(32).int32(message.resolution);
|
|
}
|
|
return writer;
|
|
},
|
|
|
|
decode(input: BinaryReader | Uint8Array, length?: number): FormatSelectionConfig {
|
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
const message = createBaseFormatSelectionConfig();
|
|
while (reader.pos < end) {
|
|
const tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 2:
|
|
if (tag === 16) {
|
|
message.itags.push(reader.int32());
|
|
|
|
continue;
|
|
}
|
|
|
|
if (tag === 18) {
|
|
const end2 = reader.uint32() + reader.pos;
|
|
while (reader.pos < end2) {
|
|
message.itags.push(reader.int32());
|
|
}
|
|
|
|
continue;
|
|
}
|
|
|
|
break;
|
|
case 3:
|
|
if (tag !== 26) {
|
|
break;
|
|
}
|
|
|
|
message.videoId = reader.string();
|
|
continue;
|
|
case 4:
|
|
if (tag !== 32) {
|
|
break;
|
|
}
|
|
|
|
message.resolution = reader.int32();
|
|
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;
|
|
}
|