Chromium Code Reviews| Index: services/media/framework/stages/multistream_source_stage.h |
| diff --git a/services/media/framework/stages/multistream_source_stage.h b/services/media/framework/stages/multistream_source_stage.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a6f488b52855303f7496b948edb323bf12b79831 |
| --- /dev/null |
| +++ b/services/media/framework/stages/multistream_source_stage.h |
| @@ -0,0 +1,60 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef SERVICES_MEDIA_FRAMEWORK_STAGES_MULTISTREAM_SOURCE_STAGE_H_ |
| +#define SERVICES_MEDIA_FRAMEWORK_STAGES_MULTISTREAM_SOURCE_STAGE_H_ |
| + |
| +#include <vector> |
| + |
| +#include "services/media/framework/models/multistream_source.h" |
| +#include "services/media/framework/stages/stage.h" |
| + |
| +namespace mojo { |
| +namespace media { |
| + |
| +// A stage that hosts a MultistreamSource. |
| +class MultistreamSourceStage : public Stage { |
| + public: |
| + MultistreamSourceStage(std::shared_ptr<MultistreamSource> source); |
| + |
| + ~MultistreamSourceStage() override; |
| + |
| + // Stage implementation. |
| + size_t input_count() const override; |
| + |
| + Input& input(size_t index) override; |
| + |
| + size_t output_count() const override; |
| + |
| + Output& output(size_t index) override; |
| + |
| + PayloadAllocator* PrepareInput(size_t index) override; |
| + |
| + void PrepareOutput( |
| + size_t index, |
| + PayloadAllocator* allocator, |
| + const PrepareCallback& callback) override; |
| + |
| + void UnprepareOutput(size_t index) override; |
| + |
| + void Update(Engine* engine) override; |
| + |
| + void FlushInput( |
| + size_t index, |
| + const FlushCallback& callback) override; |
| + |
| + void FlushOutput(size_t index) override; |
| + |
| + private: |
| + std::vector<Output> outputs_; |
|
johngro
2016/02/08 22:33:37
Why the asymmetry between the MultistreameSink and
dalesat
2016/02/09 00:34:11
So far, there's no need to dynamically add outputs
johngro
2016/02/09 21:00:36
What about a demux? For example, what about an MP
dalesat
2016/02/10 21:37:24
I agree this may be needed in the future. I'm not
|
| + std::shared_ptr<MultistreamSource> source_; |
| + PacketPtr cached_packet_; |
| + size_t cached_packet_output_index_; |
| + size_t ended_streams_; |
| +}; |
| + |
| +} // namespace media |
| +} // namespace mojo |
| + |
| +#endif // SERVICES_MEDIA_FRAMEWORK_STAGES_MULTISTREAM_SOURCE_STAGE_H_ |