DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
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 MEDIA_FORMATS_WEBM_WEBM_CONTENT_ENCODINGS_H_
6 #define MEDIA_FORMATS_WEBM_WEBM_CONTENT_ENCODINGS_H_
7 
8 #include <stdint.h>
9 #include <memory>
10 #include <string>
11 
12 namespace shaka {
13 namespace media {
14 
16  public:
19 
20  static const int kOrderInvalid = -1;
21 
22  enum Scope {
23  kScopeInvalid = 0,
24  kScopeAllFrameContents = 1,
25  kScopeTrackPrivateData = 2,
26  kScopeNextContentEncodingData = 4,
27  kScopeMax = 7,
28  };
29 
30  enum Type {
31  kTypeInvalid = -1,
32  kTypeCompression = 0,
33  kTypeEncryption = 1,
34  };
35 
36  enum EncryptionAlgo {
37  kEncAlgoInvalid = -1,
38  kEncAlgoNotEncrypted = 0,
39  kEncAlgoDes = 1,
40  kEncAlgo3des = 2,
41  kEncAlgoTwofish = 3,
42  kEncAlgoBlowfish = 4,
43  kEncAlgoAes = 5,
44  };
45 
46  enum CipherMode {
47  kCipherModeInvalid = 0,
48  kCipherModeCtr = 1,
49  };
50 
51  ContentEncoding();
52  ~ContentEncoding();
53 
54  int64_t order() const { return order_; }
55  void set_order(int64_t order) { order_ = order; }
56 
57  Scope scope() const { return scope_; }
58  void set_scope(Scope scope) { scope_ = scope; }
59 
60  Type type() const { return type_; }
61  void set_type(Type type) { type_ = type; }
62 
63  EncryptionAlgo encryption_algo() const { return encryption_algo_; }
64  void set_encryption_algo(EncryptionAlgo encryption_algo) {
65  encryption_algo_ = encryption_algo;
66  }
67 
68  const std::string& encryption_key_id() const { return encryption_key_id_; }
69  void SetEncryptionKeyId(const uint8_t* encryption_key_id, int size);
70 
71  CipherMode cipher_mode() const { return cipher_mode_; }
72  void set_cipher_mode(CipherMode mode) { cipher_mode_ = mode; }
73 
74  private:
75  int64_t order_;
76  Scope scope_;
77  Type type_;
78  EncryptionAlgo encryption_algo_;
79  std::string encryption_key_id_;
80  CipherMode cipher_mode_;
81 
82  DISALLOW_COPY_AND_ASSIGN(ContentEncoding);
83 };
84 
85 } // namespace media
86 } // namespace shaka
87 
88 #endif // MEDIA_FORMATS_WEBM_WEBM_CONTENT_ENCODINGS_H_