Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Unified Diff: media/base/decrypt_config.cc

Issue 757953002: Add SubsampleEntry constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/decrypt_config.h ('k') | media/cdm/ppapi/external_clear_key/clear_key_cdm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/decrypt_config.cc
diff --git a/media/base/decrypt_config.cc b/media/base/decrypt_config.cc
index a47806504a77f85e4b8387aa7d4e3b8eaadf7176..7df9216ed98975b9525282994b6aa9c030689249 100644
--- a/media/base/decrypt_config.cc
+++ b/media/base/decrypt_config.cc
@@ -21,4 +21,20 @@ DecryptConfig::DecryptConfig(const std::string& key_id,
DecryptConfig::~DecryptConfig() {}
+bool DecryptConfig::Matches(const DecryptConfig& config) const {
+ if (key_id() != config.key_id() || iv() != config.iv() ||
+ subsamples().size() != config.subsamples().size()) {
+ return false;
+ }
+
+ for (size_t i = 0; i < subsamples().size(); ++i) {
+ if ((subsamples()[i].clear_bytes != config.subsamples()[i].clear_bytes) ||
+ (subsamples()[i].cypher_bytes != config.subsamples()[i].cypher_bytes)) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
} // namespace media
« no previous file with comments | « media/base/decrypt_config.h ('k') | media/cdm/ppapi/external_clear_key/clear_key_cdm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698