2014-05-08 21:02:36 +00:00
|
|
|
// Copyright 2014 Google Inc. All rights reserved.
|
|
|
|
//
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file or at
|
|
|
|
// https://developers.google.com/open-source/licenses/bsd
|
|
|
|
//
|
2014-06-11 00:33:40 +00:00
|
|
|
// Packager utility functions.
|
2014-05-08 21:02:36 +00:00
|
|
|
|
2017-02-21 18:36:50 +00:00
|
|
|
#ifndef PACKAGER_APP_PACKAGER_UTIL_H_
|
|
|
|
#define PACKAGER_APP_PACKAGER_UTIL_H_
|
2014-05-08 21:02:36 +00:00
|
|
|
|
2016-08-17 17:41:40 +00:00
|
|
|
#include <memory>
|
2017-07-27 18:49:50 +00:00
|
|
|
#include <vector>
|
2014-05-08 21:02:36 +00:00
|
|
|
|
2017-04-05 20:53:58 +00:00
|
|
|
#include "packager/media/base/fourccs.h"
|
|
|
|
|
2016-05-20 21:19:33 +00:00
|
|
|
namespace shaka {
|
2014-09-19 20:41:13 +00:00
|
|
|
|
2017-07-27 18:49:50 +00:00
|
|
|
class Status;
|
2017-05-22 20:31:41 +00:00
|
|
|
struct DecryptionParams;
|
|
|
|
struct EncryptionParams;
|
2014-06-26 01:33:09 +00:00
|
|
|
struct MpdOptions;
|
2017-05-22 20:31:41 +00:00
|
|
|
struct MpdParams;
|
2014-06-26 01:33:09 +00:00
|
|
|
|
2014-05-08 21:02:36 +00:00
|
|
|
namespace media {
|
|
|
|
|
2017-03-21 23:14:46 +00:00
|
|
|
class MediaHandler;
|
2014-08-20 23:51:15 +00:00
|
|
|
class KeySource;
|
2014-05-08 21:02:36 +00:00
|
|
|
|
2017-07-27 18:49:50 +00:00
|
|
|
/// Create KeySource based on provided params for content encryption. Also
|
|
|
|
/// fetches keys.
|
2017-04-05 20:53:58 +00:00
|
|
|
/// @param protection_scheme specifies the protection scheme to be used for
|
|
|
|
/// encryption.
|
2016-08-17 17:41:40 +00:00
|
|
|
/// @return A std::unique_ptr containing a new KeySource, or nullptr if
|
2014-05-08 21:02:36 +00:00
|
|
|
/// encryption is not required.
|
2017-05-22 20:31:41 +00:00
|
|
|
std::unique_ptr<KeySource> CreateEncryptionKeySource(
|
|
|
|
FourCC protection_scheme,
|
|
|
|
const EncryptionParams& encryption_params);
|
2014-08-20 23:51:15 +00:00
|
|
|
|
2017-07-27 18:49:50 +00:00
|
|
|
/// Create KeySource based on provided params for content decryption. Does not
|
|
|
|
/// fetch keys.
|
2016-08-17 17:41:40 +00:00
|
|
|
/// @return A std::unique_ptr containing a new KeySource, or nullptr if
|
|
|
|
/// decryption is not required.
|
2017-05-22 20:31:41 +00:00
|
|
|
std::unique_ptr<KeySource> CreateDecryptionKeySource(
|
|
|
|
const DecryptionParams& decryption_params);
|
2014-05-08 21:02:36 +00:00
|
|
|
|
2017-07-27 18:49:50 +00:00
|
|
|
/// @return MpdOptions from provided inputs.
|
2018-11-14 20:47:48 +00:00
|
|
|
MpdOptions GetMpdOptions(bool on_demand_profile, const MpdParams& mpd_params);
|
2014-06-26 01:33:09 +00:00
|
|
|
|
2014-05-08 21:02:36 +00:00
|
|
|
} // namespace media
|
2016-05-20 21:19:33 +00:00
|
|
|
} // namespace shaka
|
2014-05-08 21:02:36 +00:00
|
|
|
|
2017-02-21 18:36:50 +00:00
|
|
|
#endif // PACKAGER_APP_PACKAGER_UTIL_H_
|