DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs
decrypt_config.h
1 // Copyright (c) 2012 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_BASE_DECRYPT_CONFIG_H_
6 #define MEDIA_BASE_DECRYPT_CONFIG_H_
7 
8 #include <stdint.h>
9 
10 #include <string>
11 #include <vector>
12 
13 #include "packager/base/memory/scoped_ptr.h"
14 
15 namespace edash_packager {
16 namespace media {
17 
28  uint16_t clear_bytes;
29  uint32_t cipher_bytes;
30 };
31 
35  public:
37  static const size_t kDecryptionKeySize = 16;
38 
48  DecryptConfig(const std::vector<uint8_t>& key_id,
49  const std::vector<uint8_t>& iv,
50  const int data_offset,
51  const std::vector<SubsampleEntry>& subsamples);
52  ~DecryptConfig();
53 
54  const std::vector<uint8_t>& key_id() const { return key_id_; }
55  const std::vector<uint8_t>& iv() const { return iv_; }
56  int data_offset() const { return data_offset_; }
57  const std::vector<SubsampleEntry>& subsamples() const { return subsamples_; }
58 
59  private:
60  const std::vector<uint8_t> key_id_;
61 
62  // Initialization vector.
63  const std::vector<uint8_t> iv_;
64 
65  // Amount of data to be discarded before applying subsample information.
66  const int data_offset_;
67 
68  // Subsample information. May be empty for some formats, meaning entire frame
69  // (less data ignored by data_offset_) is encrypted.
70  const std::vector<SubsampleEntry> subsamples_;
71 
72  DISALLOW_COPY_AND_ASSIGN(DecryptConfig);
73 };
74 
75 } // namespace media
76 } // namespace edash_packager
77 
78 #endif // MEDIA_BASE_DECRYPT_CONFIG_H_
static const size_t kDecryptionKeySize
Keys are always 128 bits.
DecryptConfig(const std::vector< uint8_t > &key_id, const std::vector< uint8_t > &iv, const int data_offset, const std::vector< SubsampleEntry > &subsamples)