Shaka Packager SDK
Loading...
Searching...
No Matches
webm_content_encodings.h
1// Copyright 2014 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef PACKAGER_MEDIA_FORMATS_WEBM_WEBM_CONTENT_ENCODINGS_H_
6#define PACKAGER_MEDIA_FORMATS_WEBM_WEBM_CONTENT_ENCODINGS_H_
7
8#include <cstdint>
9#include <string>
10
11namespace shaka {
12namespace media {
13
15 public:
18
19 static const int kOrderInvalid = -1;
20
21 enum Scope {
22 kScopeInvalid = 0,
23 kScopeAllFrameContents = 1,
24 kScopeTrackPrivateData = 2,
25 kScopeNextContentEncodingData = 4,
26 kScopeMax = 7,
27 };
28
29 enum Type {
30 kTypeInvalid = -1,
31 kTypeCompression = 0,
32 kTypeEncryption = 1,
33 };
34
35 enum EncryptionAlgo {
36 kEncAlgoInvalid = -1,
37 kEncAlgoNotEncrypted = 0,
38 kEncAlgoDes = 1,
39 kEncAlgo3des = 2,
40 kEncAlgoTwofish = 3,
41 kEncAlgoBlowfish = 4,
42 kEncAlgoAes = 5,
43 };
44
45 enum CipherMode {
46 kCipherModeInvalid = 0,
47 kCipherModeCtr = 1,
48 };
49
50 ContentEncoding();
51 ~ContentEncoding();
52
53 int64_t order() const { return order_; }
54 void set_order(int64_t order) { order_ = order; }
55
56 Scope scope() const { return scope_; }
57 void set_scope(Scope scope) { scope_ = scope; }
58
59 Type type() const { return type_; }
60 void set_type(Type type) { type_ = type; }
61
62 EncryptionAlgo encryption_algo() const { return encryption_algo_; }
63 void set_encryption_algo(EncryptionAlgo encryption_algo) {
64 encryption_algo_ = encryption_algo;
65 }
66
67 const std::string& encryption_key_id() const { return encryption_key_id_; }
68 void SetEncryptionKeyId(const uint8_t* encryption_key_id, int size);
69
70 CipherMode cipher_mode() const { return cipher_mode_; }
71 void set_cipher_mode(CipherMode mode) { cipher_mode_ = mode; }
72
73 private:
74 ContentEncoding(const ContentEncoding&) = delete;
75 ContentEncoding& operator=(const ContentEncoding&) = delete;
76
77 int64_t order_;
78 Scope scope_;
79 Type type_;
80 EncryptionAlgo encryption_algo_;
81 std::string encryption_key_id_;
82 CipherMode cipher_mode_;
83};
84
85} // namespace media
86} // namespace shaka
87
88#endif // PACKAGER_MEDIA_FORMATS_WEBM_WEBM_CONTENT_ENCODINGS_H_
All the methods that are virtual are virtual for mocking.