2023-12-01 17:32:19 +00:00
|
|
|
// Copyright 2017 Google LLC. All rights reserved.
|
2017-08-28 22:27:05 +00:00
|
|
|
//
|
|
|
|
// 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
|
|
|
|
|
2023-12-01 17:32:19 +00:00
|
|
|
#include <packager/media/replicator/replicator.h>
|
|
|
|
|
|
|
|
#include <absl/log/check.h>
|
|
|
|
#include <absl/log/log.h>
|
2017-08-28 22:27:05 +00:00
|
|
|
|
|
|
|
namespace shaka {
|
|
|
|
namespace media {
|
|
|
|
|
|
|
|
Status Replicator::InitializeInternal() {
|
|
|
|
return Status::OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
Status Replicator::Process(std::unique_ptr<StreamData> stream_data) {
|
|
|
|
Status status;
|
|
|
|
|
|
|
|
for (auto& out : output_handlers()) {
|
|
|
|
std::unique_ptr<StreamData> copy(new StreamData(*stream_data));
|
|
|
|
copy->stream_index = out.first;
|
|
|
|
|
|
|
|
status.Update(Dispatch(std::move(copy)));
|
|
|
|
}
|
|
|
|
|
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2023-12-01 17:32:19 +00:00
|
|
|
bool Replicator::ValidateOutputStreamIndex(size_t /* ignored */) const {
|
2017-08-28 22:27:05 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
Status Replicator::OnFlushRequest(size_t input_stream_index) {
|
|
|
|
DCHECK_EQ(input_stream_index, 0u);
|
|
|
|
return FlushAllDownstreams();
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace media
|
|
|
|
} // namespace shaka
|