googlevideo
Version:
A set of utilities for working with Google Video APIs.
66 lines (65 loc) • 2.62 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/crypto_params.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
export const protobufPackage = "video_streaming";
export var CryptoParams_CompressionType;
(function (CryptoParams_CompressionType) {
CryptoParams_CompressionType[CryptoParams_CompressionType["VAL_0"] = 0] = "VAL_0";
CryptoParams_CompressionType[CryptoParams_CompressionType["VAL_1"] = 1] = "VAL_1";
CryptoParams_CompressionType[CryptoParams_CompressionType["VAL_2"] = 2] = "VAL_2";
CryptoParams_CompressionType[CryptoParams_CompressionType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(CryptoParams_CompressionType || (CryptoParams_CompressionType = {}));
function createBaseCryptoParams() {
return { hmac: new Uint8Array(0), iv: new Uint8Array(0), compressionType: 0 };
}
export const CryptoParams = {
encode(message, writer = new BinaryWriter()) {
if (message.hmac !== undefined && message.hmac.length !== 0) {
writer.uint32(34).bytes(message.hmac);
}
if (message.iv !== undefined && message.iv.length !== 0) {
writer.uint32(42).bytes(message.iv);
}
if (message.compressionType !== undefined && message.compressionType !== 0) {
writer.uint32(48).int32(message.compressionType);
}
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 = createBaseCryptoParams();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 4:
if (tag !== 34) {
break;
}
message.hmac = reader.bytes();
continue;
case 5:
if (tag !== 42) {
break;
}
message.iv = reader.bytes();
continue;
case 6:
if (tag !== 48) {
break;
}
message.compressionType = reader.int32();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
};