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
|
|
|
|
2014-06-11 00:33:40 +00:00
|
|
|
#ifndef APP_PACKAGER_UTIL_H_
|
|
|
|
#define APP_PACKAGER_UTIL_H_
|
2014-05-08 21:02:36 +00:00
|
|
|
|
|
|
|
#include <gflags/gflags.h>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2014-10-01 22:10:21 +00:00
|
|
|
#include "packager/base/memory/scoped_ptr.h"
|
2014-05-08 21:02:36 +00:00
|
|
|
|
|
|
|
DECLARE_bool(dump_stream_info);
|
|
|
|
|
2014-09-19 20:41:13 +00:00
|
|
|
namespace edash_packager {
|
|
|
|
|
2014-06-26 01:33:09 +00:00
|
|
|
struct MpdOptions;
|
|
|
|
|
2014-05-08 21:02:36 +00:00
|
|
|
namespace media {
|
|
|
|
|
2014-08-20 23:51:15 +00:00
|
|
|
class KeySource;
|
2014-05-08 21:02:36 +00:00
|
|
|
class MediaStream;
|
|
|
|
class Muxer;
|
2014-05-28 00:55:36 +00:00
|
|
|
struct MuxerOptions;
|
2014-05-08 21:02:36 +00:00
|
|
|
|
|
|
|
/// Print all the stream info for the provided strings to standard output.
|
|
|
|
void DumpStreamInfo(const std::vector<MediaStream*>& streams);
|
|
|
|
|
2014-08-20 23:51:15 +00:00
|
|
|
/// Create KeySource based on provided command line options for content
|
|
|
|
/// encryption. Also fetches keys.
|
|
|
|
/// @return A scoped_ptr containing a new KeySource, or NULL if
|
2014-05-08 21:02:36 +00:00
|
|
|
/// encryption is not required.
|
2014-08-20 23:51:15 +00:00
|
|
|
scoped_ptr<KeySource> CreateEncryptionKeySource();
|
|
|
|
|
|
|
|
/// Create KeySource based on provided command line options for content
|
|
|
|
/// decryption. Does not fetch keys.
|
|
|
|
/// @return A scoped_ptr containing a new KeySource, or NULL if decryption
|
|
|
|
/// is not required.
|
|
|
|
scoped_ptr<KeySource> CreateDecryptionKeySource();
|
2014-05-08 21:02:36 +00:00
|
|
|
|
2014-06-26 17:42:12 +00:00
|
|
|
/// Set flags according to profile.
|
|
|
|
bool AssignFlagsFromProfile();
|
|
|
|
|
2014-05-08 21:02:36 +00:00
|
|
|
/// Fill MuxerOptions members using provided command line options.
|
|
|
|
bool GetMuxerOptions(MuxerOptions* muxer_options);
|
|
|
|
|
2014-06-26 01:33:09 +00:00
|
|
|
/// Fill MpdOptions members using provided command line options.
|
2016-05-19 21:38:15 +00:00
|
|
|
bool GetMpdOptions(MpdOptions* mpd_options);
|
2014-06-26 01:33:09 +00:00
|
|
|
|
2014-05-08 21:02:36 +00:00
|
|
|
/// Select and add a stream from a provided set to a muxer.
|
|
|
|
/// @param streams contains the set of MediaStreams from which to select.
|
|
|
|
/// @param stream_selector is a string containing one of the following values:
|
|
|
|
/// "audio" to select the first audio track, "video" to select the first
|
|
|
|
/// video track, or a decimal number indicating which track number to
|
|
|
|
/// select (start at "1").
|
2015-02-02 19:27:32 +00:00
|
|
|
/// @param language_override is a string which, if non-empty, overrides the
|
|
|
|
/// stream's language metadata.
|
2014-05-08 21:02:36 +00:00
|
|
|
/// @return true if successful, false otherwise.
|
|
|
|
bool AddStreamToMuxer(const std::vector<MediaStream*>& streams,
|
|
|
|
const std::string& stream_selector,
|
2015-02-02 19:27:32 +00:00
|
|
|
const std::string& language_override,
|
2014-05-08 21:02:36 +00:00
|
|
|
Muxer* muxer);
|
|
|
|
|
|
|
|
} // namespace media
|
2014-09-19 20:41:13 +00:00
|
|
|
} // namespace edash_packager
|
2014-05-08 21:02:36 +00:00
|
|
|
|
2014-06-11 00:33:40 +00:00
|
|
|
#endif // APP_PACKAGER_UTIL_H_
|