googlevideo
Version:
A set of utilities for working with Google Video APIs.
69 lines (68 loc) • 2.51 kB
JavaScript
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.2.0
// protoc v3.21.12
// source: video_streaming/playback_cookie.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { FormatId } from "../misc/common.js";
export const protobufPackage = "video_streaming";
function createBasePlaybackCookie() {
return { field1: 0, field2: 0, videoFmt: undefined, audioFmt: undefined };
}
export const PlaybackCookie = {
encode(message, writer = new BinaryWriter()) {
if (message.field1 !== undefined && message.field1 !== 0) {
writer.uint32(8).int32(message.field1);
}
if (message.field2 !== undefined && message.field2 !== 0) {
writer.uint32(16).int32(message.field2);
}
if (message.videoFmt !== undefined) {
FormatId.encode(message.videoFmt, writer.uint32(58).fork()).join();
}
if (message.audioFmt !== undefined) {
FormatId.encode(message.audioFmt, writer.uint32(66).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBasePlaybackCookie();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag !== 8) {
break;
}
message.field1 = reader.int32();
continue;
case 2:
if (tag !== 16) {
break;
}
message.field2 = reader.int32();
continue;
case 7:
if (tag !== 58) {
break;
}
message.videoFmt = FormatId.decode(reader, reader.uint32());
continue;
case 8:
if (tag !== 66) {
break;
}
message.audioFmt = FormatId.decode(reader, reader.uint32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
};