2015-10-08 21:48:07 +00:00
|
|
|
// Copyright 2014 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.
|
|
|
|
|
2017-12-20 00:56:36 +00:00
|
|
|
#ifndef PACKAGER_MEDIA_FORMATS_WEBM_WEBM_CRYPTO_HELPERS_H_
|
|
|
|
#define PACKAGER_MEDIA_FORMATS_WEBM_WEBM_CRYPTO_HELPERS_H_
|
2015-10-08 21:48:07 +00:00
|
|
|
|
2015-10-14 22:46:23 +00:00
|
|
|
#include <stdint.h>
|
2016-08-17 17:41:40 +00:00
|
|
|
#include <memory>
|
2015-10-14 23:12:10 +00:00
|
|
|
#include "packager/media/base/decrypt_config.h"
|
2015-10-14 22:46:23 +00:00
|
|
|
|
2016-05-20 21:19:33 +00:00
|
|
|
namespace shaka {
|
2015-10-08 21:48:07 +00:00
|
|
|
namespace media {
|
|
|
|
|
2015-10-15 22:39:16 +00:00
|
|
|
/// Fills an initialized DecryptConfig, which can be sent to the Decryptor if
|
|
|
|
/// the stream has potentially encrypted frames. Also sets |data_offset| which
|
|
|
|
/// indicates where the encrypted data starts. Leaving the IV empty will tell
|
|
|
|
/// the decryptor that the frame is unencrypted.
|
|
|
|
/// Current encrypted WebM request for comments specification is here
|
|
|
|
/// http://wiki.webmproject.org/encryption/webm-encryption-rfc
|
|
|
|
/// @return true if |data| is valid, false otherwise, in which case
|
|
|
|
/// |decrypt_config| and |data_offset| will not be changed.
|
2015-10-14 22:46:23 +00:00
|
|
|
bool WebMCreateDecryptConfig(const uint8_t* data,
|
|
|
|
int data_size,
|
|
|
|
const uint8_t* key_id,
|
2016-11-09 02:11:13 +00:00
|
|
|
size_t key_id_size,
|
2016-08-17 17:41:40 +00:00
|
|
|
std::unique_ptr<DecryptConfig>* decrypt_config,
|
2015-10-08 21:48:07 +00:00
|
|
|
int* data_offset);
|
|
|
|
|
|
|
|
} // namespace media
|
2016-05-20 21:19:33 +00:00
|
|
|
} // namespace shaka
|
2015-10-08 21:48:07 +00:00
|
|
|
|
2017-12-20 00:56:36 +00:00
|
|
|
#endif // PACKAGER_MEDIA_FORMATS_WEBM_WEBM_CRYPT_HELPERS_H_
|