blob: 3bd8f9cf390b070c07ac141a186ab6723c324c8a [file] [log] [blame]
// Copyright 2021 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.mediastreams;
/// The maximum size of an `EncryptionScheme` string.
const MAX_ENCRYPTION_SCHEME_SIZE int64 = 4;
/// The maximum size of a `EncryptionKeyId` blob.
const MAX_KEY_ID_SIZE int64 = 16;
/// The maximum size of a `EncryptionInitVector` blob.
const MAX_INIT_VECTOR_SIZE int64 = 16;
/// Identifies an encryption scheme.
alias EncryptionScheme = string:MAX_ENCRYPTION_SCHEME_SIZE;
const ENCRYPTION_SCHEME_CENC string = "cenc";
const ENCRYPTION_SCHEME_CBC1 string = "cbc1";
const ENCRYPTION_SCHEME_CENS string = "cens";
const ENCRYPTION_SCHEME_CBCS string = "cbcs";
alias EncryptionKeyId = vector<uint8>:MAX_KEY_ID_SIZE;
alias EncryptionInitVector = vector<uint8>:MAX_INIT_VECTOR_SIZE;
type EncryptionSubsampleEntry = struct {
clear_bytes uint32;
encrypted_bytes uint32;
};
type EncryptionPattern = struct {
clear_blocks uint32;
encrypted_blocks uint32;
};
type Encryption = struct {
scheme EncryptionScheme;
default_key_id EncryptionKeyId:optional;
default_init_vector EncryptionInitVector:optional;
default_pattern box<EncryptionPattern>;
};