Shaka Packager SDK
Loading...
Searching...
No Matches
replicator.cc
1// Copyright 2017 Google LLC. All rights reserved.
2//
3// Use of this source code is governed by a BSD-style
4// license that can be found in the LICENSE file or at
5// https://developers.google.com/open-source/licenses/bsd
6
7#include <packager/media/replicator/replicator.h>
8
9#include <absl/log/check.h>
10#include <absl/log/log.h>
11
12namespace shaka {
13namespace media {
14
15Status Replicator::InitializeInternal() {
16 return Status::OK;
17}
18
19Status Replicator::Process(std::unique_ptr<StreamData> stream_data) {
20 Status status;
21
22 for (auto& out : output_handlers()) {
23 std::unique_ptr<StreamData> copy(new StreamData(*stream_data));
24 copy->stream_index = out.first;
25
26 status.Update(Dispatch(std::move(copy)));
27 }
28
29 return status;
30}
31
32bool Replicator::ValidateOutputStreamIndex(size_t /* ignored */) const {
33 return true;
34}
35
36Status Replicator::OnFlushRequest(size_t input_stream_index) {
37 DCHECK_EQ(input_stream_index, 0u);
38 return FlushAllDownstreams();
39}
40
41} // namespace media
42} // namespace shaka
Status FlushAllDownstreams()
Flush all connected downstream handlers.
Status Dispatch(std::unique_ptr< StreamData > stream_data) const
All the methods that are virtual are virtual for mocking.