| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_BASE_DECRYPT_CONFIG_H_ | 5 #ifndef MEDIA_BASE_DECRYPT_CONFIG_H_ |
| 6 #define MEDIA_BASE_DECRYPT_CONFIG_H_ | 6 #define MEDIA_BASE_DECRYPT_CONFIG_H_ |
| 7 | 7 |
| 8 #include <iosfwd> |
| 8 #include <string> | 9 #include <string> |
| 9 #include <vector> | 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 13 #include "media/base/media_export.h" | 14 #include "media/base/media_export.h" |
| 14 | 15 |
| 15 namespace media { | 16 namespace media { |
| 16 | 17 |
| 17 // The Common Encryption spec provides for subsample encryption, where portions | 18 // The Common Encryption spec provides for subsample encryption, where portions |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 const std::vector<SubsampleEntry>& subsamples); | 50 const std::vector<SubsampleEntry>& subsamples); |
| 50 ~DecryptConfig(); | 51 ~DecryptConfig(); |
| 51 | 52 |
| 52 const std::string& key_id() const { return key_id_; } | 53 const std::string& key_id() const { return key_id_; } |
| 53 const std::string& iv() const { return iv_; } | 54 const std::string& iv() const { return iv_; } |
| 54 const std::vector<SubsampleEntry>& subsamples() const { return subsamples_; } | 55 const std::vector<SubsampleEntry>& subsamples() const { return subsamples_; } |
| 55 | 56 |
| 56 // Returns true if all fields in |config| match this config. | 57 // Returns true if all fields in |config| match this config. |
| 57 bool Matches(const DecryptConfig& config) const; | 58 bool Matches(const DecryptConfig& config) const; |
| 58 | 59 |
| 60 // Prints to std::ostream. |
| 61 std::ostream& Print(std::ostream& os) const; |
| 62 |
| 59 private: | 63 private: |
| 60 const std::string key_id_; | 64 const std::string key_id_; |
| 61 | 65 |
| 62 // Initialization vector. | 66 // Initialization vector. |
| 63 const std::string iv_; | 67 const std::string iv_; |
| 64 | 68 |
| 65 // Subsample information. May be empty for some formats, meaning entire frame | 69 // Subsample information. May be empty for some formats, meaning entire frame |
| 66 // (less data ignored by data_offset_) is encrypted. | 70 // (less data ignored by data_offset_) is encrypted. |
| 67 const std::vector<SubsampleEntry> subsamples_; | 71 const std::vector<SubsampleEntry> subsamples_; |
| 68 | 72 |
| 69 DISALLOW_COPY_AND_ASSIGN(DecryptConfig); | 73 DISALLOW_COPY_AND_ASSIGN(DecryptConfig); |
| 70 }; | 74 }; |
| 71 | 75 |
| 72 } // namespace media | 76 } // namespace media |
| 73 | 77 |
| 78 inline std::ostream& operator<<(std::ostream& os, |
| 79 const media::DecryptConfig& obj) { |
| 80 return obj.Print(os); |
| 81 } |
| 82 |
| 74 #endif // MEDIA_BASE_DECRYPT_CONFIG_H_ | 83 #endif // MEDIA_BASE_DECRYPT_CONFIG_H_ |
| OLD | NEW |