Move HlsParams to hls_params.h
Change-Id: I25189623512834da8bd998c388c4cb0edebc6f47
This commit is contained in:
parent
556ff56559
commit
675f2631b8
|
@ -19,7 +19,6 @@
|
||||||
#include "packager/media/chunking/chunking_handler.h"
|
#include "packager/media/chunking/chunking_handler.h"
|
||||||
#include "packager/media/crypto/encryption_handler.h"
|
#include "packager/media/crypto/encryption_handler.h"
|
||||||
#include "packager/mpd/base/mpd_options.h"
|
#include "packager/mpd/base/mpd_options.h"
|
||||||
#include "packager/packager.h"
|
|
||||||
#include "packager/status.h"
|
#include "packager/status.h"
|
||||||
|
|
||||||
namespace shaka {
|
namespace shaka {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "packager/hls/public/hls_playlist_type.h"
|
#include "packager/hls/public/hls_params.h"
|
||||||
#include "packager/mpd/base/media_info.pb.h"
|
#include "packager/mpd/base/media_info.pb.h"
|
||||||
|
|
||||||
namespace shaka {
|
namespace shaka {
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "packager/base/macros.h"
|
#include "packager/base/macros.h"
|
||||||
#include "packager/hls/public/hls_playlist_type.h"
|
#include "packager/hls/public/hls_params.h"
|
||||||
#include "packager/mpd/base/media_info.pb.h"
|
#include "packager/mpd/base/media_info.pb.h"
|
||||||
|
|
||||||
namespace shaka {
|
namespace shaka {
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
#include "packager/hls/base/hls_notifier.h"
|
#include "packager/hls/base/hls_notifier.h"
|
||||||
#include "packager/hls/base/master_playlist.h"
|
#include "packager/hls/base/master_playlist.h"
|
||||||
#include "packager/hls/base/media_playlist.h"
|
#include "packager/hls/base/media_playlist.h"
|
||||||
#include "packager/hls/public/hls_playlist_type.h"
|
#include "packager/hls/public/hls_params.h"
|
||||||
|
|
||||||
namespace shaka {
|
namespace shaka {
|
||||||
namespace hls {
|
namespace hls {
|
||||||
|
|
|
@ -79,12 +79,6 @@ const char kSampleAesProtectionScheme[] = "cbca";
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
// : notifier_(profile,
|
|
||||||
// kTestTimeShiftBufferDepth,
|
|
||||||
// kTestPrefix,
|
|
||||||
// kAnyOutputDir,
|
|
||||||
// kMasterPlaylistName),
|
|
||||||
|
|
||||||
class SimpleHlsNotifierTest : public ::testing::Test {
|
class SimpleHlsNotifierTest : public ::testing::Test {
|
||||||
protected:
|
protected:
|
||||||
SimpleHlsNotifierTest() : SimpleHlsNotifierTest(kVodPlaylist) {}
|
SimpleHlsNotifierTest() : SimpleHlsNotifierTest(kVodPlaylist) {}
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
'base/media_playlist.h',
|
'base/media_playlist.h',
|
||||||
'base/simple_hls_notifier.cc',
|
'base/simple_hls_notifier.cc',
|
||||||
'base/simple_hls_notifier.h',
|
'base/simple_hls_notifier.h',
|
||||||
'public/hls_playlist_type.h',
|
'public/hls_params.h',
|
||||||
],
|
],
|
||||||
'dependencies': [
|
'dependencies': [
|
||||||
'../base/base.gyp:base',
|
'../base/base.gyp:base',
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
// Copyright 2017 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
|
||||||
|
|
||||||
|
#ifndef PACKAGER_HLS_PUBLIC_HLS_PARAMS_H_
|
||||||
|
#define PACKAGER_HLS_PUBLIC_HLS_PARAMS_H_
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace shaka {
|
||||||
|
|
||||||
|
/// Defines the EXT-X-PLAYLIST-TYPE in the HLS specification. For
|
||||||
|
/// HlsPlaylistType of kLive, EXT-X-PLAYLIST-TYPE tag is omitted.
|
||||||
|
enum class HlsPlaylistType {
|
||||||
|
kVod,
|
||||||
|
kEvent,
|
||||||
|
kLive,
|
||||||
|
};
|
||||||
|
|
||||||
|
/// HLS related parameters.
|
||||||
|
struct HlsParams {
|
||||||
|
/// HLS playlist type. See HLS specification for details.
|
||||||
|
HlsPlaylistType playlist_type = HlsPlaylistType::kVod;
|
||||||
|
/// HLS master playlist output path.
|
||||||
|
std::string master_playlist_output;
|
||||||
|
/// The base URL for the Media Playlists and media files listed in the
|
||||||
|
/// playlists. This is the prefix for the files.
|
||||||
|
std::string base_url;
|
||||||
|
/// Defines the live window, or the guaranteed duration of the time shifting
|
||||||
|
/// buffer for 'live' playlists.
|
||||||
|
double time_shift_buffer_depth = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace shaka
|
||||||
|
|
||||||
|
#endif // PACKAGER_HLS_PUBLIC_HLS_PARAMS_H_
|
|
@ -1,22 +0,0 @@
|
||||||
// Copyright 2017 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
|
|
||||||
|
|
||||||
#ifndef PACKAGER_HLS_PUBLIC_HLS_PLAYLIST_TYPE_H_
|
|
||||||
#define PACKAGER_HLS_PUBLIC_HLS_PLAYLIST_TYPE_H_
|
|
||||||
|
|
||||||
namespace shaka {
|
|
||||||
|
|
||||||
/// Defines the EXT-X-PLAYLIST-TYPE in the HLS specification. For
|
|
||||||
/// HlsPlaylistType of kLive, EXT-X-PLAYLIST-TYPE tag is omitted.
|
|
||||||
enum class HlsPlaylistType {
|
|
||||||
kVod,
|
|
||||||
kEvent,
|
|
||||||
kLive,
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace shaka
|
|
||||||
|
|
||||||
#endif // PACKAGER_HLS_PUBLIC_HLS_PLAYLIST_TYPE_H_
|
|
|
@ -582,11 +582,6 @@ Status Packager::Initialize(
|
||||||
|
|
||||||
std::unique_ptr<PackagerInternal> internal(new PackagerInternal);
|
std::unique_ptr<PackagerInternal> internal(new PackagerInternal);
|
||||||
|
|
||||||
const bool on_demand_dash_profile =
|
|
||||||
stream_descriptors.begin()->segment_template.empty();
|
|
||||||
MpdOptions mpd_options =
|
|
||||||
media::GetMpdOptions(on_demand_dash_profile, packaging_params.mpd_params);
|
|
||||||
|
|
||||||
// Create encryption key source if needed.
|
// Create encryption key source if needed.
|
||||||
if (packaging_params.encryption_params.key_provider != KeyProvider::kNone) {
|
if (packaging_params.encryption_params.key_provider != KeyProvider::kNone) {
|
||||||
internal->encryption_key_source = CreateEncryptionKeySource(
|
internal->encryption_key_source = CreateEncryptionKeySource(
|
||||||
|
@ -599,6 +594,10 @@ Status Packager::Initialize(
|
||||||
|
|
||||||
const MpdParams& mpd_params = packaging_params.mpd_params;
|
const MpdParams& mpd_params = packaging_params.mpd_params;
|
||||||
if (!mpd_params.mpd_output.empty()) {
|
if (!mpd_params.mpd_output.empty()) {
|
||||||
|
const bool on_demand_dash_profile =
|
||||||
|
stream_descriptors.begin()->segment_template.empty();
|
||||||
|
MpdOptions mpd_options = media::GetMpdOptions(on_demand_dash_profile,
|
||||||
|
packaging_params.mpd_params);
|
||||||
if (mpd_params.generate_dash_if_iop_compliant_mpd) {
|
if (mpd_params.generate_dash_if_iop_compliant_mpd) {
|
||||||
internal->mpd_notifier.reset(new DashIopMpdNotifier(mpd_options));
|
internal->mpd_notifier.reset(new DashIopMpdNotifier(mpd_options));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "packager/hls/public/hls_playlist_type.h"
|
#include "packager/hls/public/hls_params.h"
|
||||||
#include "packager/media/public/chunking_params.h"
|
#include "packager/media/public/chunking_params.h"
|
||||||
#include "packager/media/public/crypto_params.h"
|
#include "packager/media/public/crypto_params.h"
|
||||||
#include "packager/media/public/mp4_output_params.h"
|
#include "packager/media/public/mp4_output_params.h"
|
||||||
|
@ -20,20 +20,6 @@
|
||||||
|
|
||||||
namespace shaka {
|
namespace shaka {
|
||||||
|
|
||||||
/// HLS related parameters.
|
|
||||||
struct HlsParams {
|
|
||||||
/// HLS playlist type. See HLS specification for details.
|
|
||||||
HlsPlaylistType playlist_type = HlsPlaylistType::kVod;
|
|
||||||
/// HLS master playlist output path.
|
|
||||||
std::string master_playlist_output;
|
|
||||||
/// The base URL for the Media Playlists and media files listed in the
|
|
||||||
/// playlists. This is the prefix for the files.
|
|
||||||
std::string base_url;
|
|
||||||
/// Defines the live window, or the guaranteed duration of the time shifting
|
|
||||||
/// buffer for 'live' playlists.
|
|
||||||
double time_shift_buffer_depth = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
/// Parameters used for testing.
|
/// Parameters used for testing.
|
||||||
struct TestParams {
|
struct TestParams {
|
||||||
/// Whether to dump input stream info.
|
/// Whether to dump input stream info.
|
||||||
|
|
Loading…
Reference in New Issue