2022-08-26 15:44:59 +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-10-10 23:51:11 +00:00
|
|
|
#include <packager/media/replicator/replicator.h>
|
2017-08-28 22:27:05 +00:00
|
|
|
|
2023-10-13 19:42:47 +00:00
|
|
|
#include <absl/log/check.h>
|
|
|
|
#include <absl/log/log.h>
|
2023-10-11 08:49:50 +00:00
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2022-11-30 20:01:25 +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
|