blob: 2e5532a070d1c060deff40f5ba2d0f93010dfd49 [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 int64 MAX_ENCRYPTION_SCHEME_SIZE = 4;
/// The maximum size of a `EncryptionKeyId` blob.
const int64 MAX_KEY_ID_SIZE = 16;
/// The maximum size of a `EncryptionInitVector` blob.
const int64 MAX_INIT_VECTOR_SIZE = 16;
/// Identifies an encryption scheme.
alias EncryptionScheme = string:MAX_ENCRYPTION_SCHEME_SIZE;
const string ENCRYPTION_SCHEME_CENC = "cenc";
const string ENCRYPTION_SCHEME_CBC1 = "cbc1";
const string ENCRYPTION_SCHEME_CENS = "cens";
const string ENCRYPTION_SCHEME_CBCS = "cbcs";
alias EncryptionKeyId = bytes:MAX_KEY_ID_SIZE;
alias EncryptionInitVector = bytes:MAX_INIT_VECTOR_SIZE;
struct EncryptionSubsampleEntry {
uint32 clear_bytes;
uint32 encrypted_bytes;
};
struct EncryptionPattern {
uint32 clear_blocks;
uint32 encrypted_blocks;
};
struct Encryption {
EncryptionScheme scheme;
EncryptionKeyId? default_key_id;
EncryptionInitVector? default_init_vector;
EncryptionPattern? default_pattern;
};