Remove Old Cue Insertion Code
When we built the cue alignment media handler, we did not remove the old solution. This change removes all the code for the old solution. Change-Id: I851b284c449c7d25aaabc2f55df5579ba7b5aad1
This commit is contained in:
parent
5a9a49034b
commit
0734ba998b
|
@ -1,64 +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
|
|
||||||
|
|
||||||
#include "packager/media/ad_cue_generator/ad_cue_generator.h"
|
|
||||||
|
|
||||||
namespace shaka {
|
|
||||||
namespace media {
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
// The AdCuGenerator only supports single input and single output.
|
|
||||||
const size_t kStreamIndex = 0;
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
AdCueGenerator::AdCueGenerator(
|
|
||||||
const AdCueGeneratorParams& ad_cue_generator_params)
|
|
||||||
: ad_cue_generator_params_(ad_cue_generator_params) {}
|
|
||||||
|
|
||||||
AdCueGenerator::~AdCueGenerator() {}
|
|
||||||
|
|
||||||
Status AdCueGenerator::InitializeInternal() {
|
|
||||||
if (num_input_streams() != 1 || next_output_stream_index() != 1) {
|
|
||||||
return Status(error::INVALID_ARGUMENT,
|
|
||||||
"Expects exactly one input and one output.");
|
|
||||||
}
|
|
||||||
return Status::OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
Status AdCueGenerator::Process(std::unique_ptr<StreamData> stream_data) {
|
|
||||||
switch (stream_data->stream_data_type) {
|
|
||||||
case StreamDataType::kStreamInfo: {
|
|
||||||
const uint32_t time_scale = stream_data->stream_info->time_scale();
|
|
||||||
Status status = Dispatch(std::move(stream_data));
|
|
||||||
if (!status.ok()) {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
return DispatchScte35Events(kStreamIndex, time_scale);
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
return Dispatch(std::move(stream_data));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Status AdCueGenerator::DispatchScte35Events(size_t stream_index,
|
|
||||||
uint32_t time_scale) {
|
|
||||||
Status status;
|
|
||||||
for (const auto& cue_point : ad_cue_generator_params_.cue_points) {
|
|
||||||
std::shared_ptr<Scte35Event> scte35_event = std::make_shared<Scte35Event>();
|
|
||||||
scte35_event->start_time_in_seconds = cue_point.start_time_in_seconds;
|
|
||||||
scte35_event->duration_in_seconds = cue_point.duration_in_seconds;
|
|
||||||
status.Update(DispatchScte35Event(stream_index, std::move(scte35_event)));
|
|
||||||
if (!status.ok()) {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Status::OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace media
|
|
||||||
} // namespace shaka
|
|
|
@ -1,26 +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
|
|
||||||
|
|
||||||
{
|
|
||||||
'variables': {
|
|
||||||
'shaka_code': 1,
|
|
||||||
},
|
|
||||||
'targets': [
|
|
||||||
{
|
|
||||||
'target_name': 'ad_cue_generator',
|
|
||||||
'type': '<(component)',
|
|
||||||
'sources': [
|
|
||||||
'ad_cue_generator.cc',
|
|
||||||
'ad_cue_generator.h',
|
|
||||||
],
|
|
||||||
'dependencies': [
|
|
||||||
'../base/media_base.gyp:media_base',
|
|
||||||
'../public/public.gyp:public',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,38 +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_MEDIA_AD_CUE_GENERATOR_AD_CUE_GENERATOR_H_
|
|
||||||
#define PACKAGER_MEDIA_AD_CUE_GENERATOR_AD_CUE_GENERATOR_H_
|
|
||||||
|
|
||||||
#include "packager/media/base/media_handler.h"
|
|
||||||
#include "packager/media/public/ad_cue_generator_params.h"
|
|
||||||
|
|
||||||
namespace shaka {
|
|
||||||
namespace media {
|
|
||||||
|
|
||||||
/// AdCueGenerator converts out of band cuepoint markers into SCTE-35 events.
|
|
||||||
class AdCueGenerator : public MediaHandler {
|
|
||||||
public:
|
|
||||||
explicit AdCueGenerator(const AdCueGeneratorParams& ad_cue_generator_params);
|
|
||||||
~AdCueGenerator() override;
|
|
||||||
|
|
||||||
private:
|
|
||||||
AdCueGenerator(const AdCueGenerator&) = delete;
|
|
||||||
AdCueGenerator& operator=(const AdCueGenerator&) = delete;
|
|
||||||
|
|
||||||
Status InitializeInternal() override;
|
|
||||||
Status Process(std::unique_ptr<StreamData> stream_data) override;
|
|
||||||
|
|
||||||
// Dispatches SCTE35 events that are built from AdCueGenerator params.
|
|
||||||
Status DispatchScte35Events(size_t stream_index, uint32_t time_scale);
|
|
||||||
|
|
||||||
const AdCueGeneratorParams ad_cue_generator_params_;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace media
|
|
||||||
} // namespace shaka
|
|
||||||
|
|
||||||
#endif // PACKAGER_MEDIA_AD_CUE_GENERATOR_AD_CUE_GENERATOR_H_
|
|
|
@ -25,7 +25,6 @@
|
||||||
#include "packager/file/file.h"
|
#include "packager/file/file.h"
|
||||||
#include "packager/hls/base/hls_notifier.h"
|
#include "packager/hls/base/hls_notifier.h"
|
||||||
#include "packager/hls/base/simple_hls_notifier.h"
|
#include "packager/hls/base/simple_hls_notifier.h"
|
||||||
#include "packager/media/ad_cue_generator/ad_cue_generator.h"
|
|
||||||
#include "packager/media/base/container_names.h"
|
#include "packager/media/base/container_names.h"
|
||||||
#include "packager/media/base/fourccs.h"
|
#include "packager/media/base/fourccs.h"
|
||||||
#include "packager/media/base/key_source.h"
|
#include "packager/media/base/key_source.h"
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
'dependencies': [
|
'dependencies': [
|
||||||
'file/file.gyp:file',
|
'file/file.gyp:file',
|
||||||
'hls/hls.gyp:hls_builder',
|
'hls/hls.gyp:hls_builder',
|
||||||
'media/ad_cue_generator/ad_cue_generator.gyp:ad_cue_generator',
|
|
||||||
'media/chunking/chunking.gyp:chunking',
|
'media/chunking/chunking.gyp:chunking',
|
||||||
'media/codecs/codecs.gyp:codecs',
|
'media/codecs/codecs.gyp:codecs',
|
||||||
'media/crypto/crypto.gyp:crypto',
|
'media/crypto/crypto.gyp:crypto',
|
||||||
|
|
Loading…
Reference in New Issue