Move HlsParams to hls_params.h

Change-Id: I25189623512834da8bd998c388c4cb0edebc6f47
This commit is contained in:
KongQun Yang 2017-08-02 13:37:47 -07:00
parent 556ff56559
commit 675f2631b8
10 changed files with 47 additions and 53 deletions

View File

@ -19,7 +19,6 @@
#include "packager/media/chunking/chunking_handler.h"
#include "packager/media/crypto/encryption_handler.h"
#include "packager/mpd/base/mpd_options.h"
#include "packager/packager.h"
#include "packager/status.h"
namespace shaka {

View File

@ -10,7 +10,7 @@
#include <string>
#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"
namespace shaka {

View File

@ -12,7 +12,7 @@
#include <string>
#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"
namespace shaka {

View File

@ -18,7 +18,7 @@
#include "packager/hls/base/hls_notifier.h"
#include "packager/hls/base/master_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 hls {

View File

@ -79,12 +79,6 @@ const char kSampleAesProtectionScheme[] = "cbca";
} // namespace
// : notifier_(profile,
// kTestTimeShiftBufferDepth,
// kTestPrefix,
// kAnyOutputDir,
// kMasterPlaylistName),
class SimpleHlsNotifierTest : public ::testing::Test {
protected:
SimpleHlsNotifierTest() : SimpleHlsNotifierTest(kVodPlaylist) {}

View File

@ -20,7 +20,7 @@
'base/media_playlist.h',
'base/simple_hls_notifier.cc',
'base/simple_hls_notifier.h',
'public/hls_playlist_type.h',
'public/hls_params.h',
],
'dependencies': [
'../base/base.gyp:base',

View File

@ -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_

View File

@ -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_

View File

@ -582,11 +582,6 @@ Status Packager::Initialize(
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.
if (packaging_params.encryption_params.key_provider != KeyProvider::kNone) {
internal->encryption_key_source = CreateEncryptionKeySource(
@ -599,6 +594,10 @@ Status Packager::Initialize(
const MpdParams& mpd_params = packaging_params.mpd_params;
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) {
internal->mpd_notifier.reset(new DashIopMpdNotifier(mpd_options));
} else {

View File

@ -11,7 +11,7 @@
#include <string>
#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/crypto_params.h"
#include "packager/media/public/mp4_output_params.h"
@ -20,20 +20,6 @@
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.
struct TestParams {
/// Whether to dump input stream info.