blob: 0b730abed891a0a3dd5a1b56e365219a0cf594f8 [file] [log] [blame]
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "media/base/decrypt_config.h"
#include "base/logging.h"
namespace media {
#if defined(__LB_SHELL__) || defined(COBALT)
DecryptConfig::DecryptConfig(const std::string& key_id,
const std::string& iv,
const std::vector<SubsampleEntry>& subsamples)
: key_id_(key_id),
iv_(iv),
subsamples_(subsamples) {
CHECK_GT(key_id.size(), 0u);
CHECK(iv.size() == static_cast<size_t>(DecryptConfig::kDecryptionKeySize) ||
iv.empty());
}
#else // defined(__LB_SHELL__) || defined(COBALT)
DecryptConfig::DecryptConfig(const std::string& key_id,
const std::string& iv,
const int data_offset,
const std::vector<SubsampleEntry>& subsamples)
: key_id_(key_id),
iv_(iv),
data_offset_(data_offset),
subsamples_(subsamples) {
CHECK_GT(key_id.size(), 0u);
CHECK(iv.size() == static_cast<size_t>(DecryptConfig::kDecryptionKeySize) ||
iv.empty());
CHECK_GE(data_offset, 0);
}
#endif // defined(__LB_SHELL__) || defined(COBALT)
DecryptConfig::~DecryptConfig() {}
} // namespace media