| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 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 #include "media/base/encryption_scheme.h" | |
| 6 | |
| 7 namespace media { | |
| 8 | |
| 9 EncryptionScheme::Pattern::Pattern() {} | |
| 10 | |
| 11 EncryptionScheme::Pattern::Pattern(uint32_t encrypt_blocks, | |
| 12 uint32_t skip_blocks) | |
| 13 : encrypt_blocks_(encrypt_blocks), skip_blocks_(skip_blocks) {} | |
| 14 | |
| 15 EncryptionScheme::Pattern::~Pattern() {} | |
| 16 | |
| 17 bool EncryptionScheme::Pattern::Matches(const Pattern& other) const { | |
| 18 return encrypt_blocks_ == other.encrypt_blocks() && | |
| 19 skip_blocks_ == other.skip_blocks(); | |
| 20 } | |
| 21 | |
| 22 bool EncryptionScheme::Pattern::IsInEffect() const { | |
| 23 return encrypt_blocks_ != 0 && skip_blocks_ != 0; | |
| 24 } | |
| 25 | |
| 26 EncryptionScheme::EncryptionScheme() {} | |
| 27 | |
| 28 EncryptionScheme::EncryptionScheme(CipherMode mode, const Pattern& pattern) | |
| 29 : mode_(mode), pattern_(pattern) {} | |
| 30 | |
| 31 EncryptionScheme::~EncryptionScheme() {} | |
| 32 | |
| 33 bool EncryptionScheme::Matches(const EncryptionScheme& other) const { | |
| 34 return mode_ == other.mode_ && pattern_.Matches(other.pattern_); | |
| 35 } | |
| 36 | |
| 37 } // namespace media | |
| OLD | NEW |