Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(540)

Unified Diff: services/media/framework/stages/multistream_source_stage.h

Issue 1678433002: Motown: Remove LPCM optimizations, fix prepare, add flush, add ActiveMultistreamSink model/stage (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Sync Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..d7af7a21fedcbb2113741d75dee7986020c5bb82
--- /dev/null
+++ b/services/media/framework/stages/multistream_source_stage.h
@@ -0,0 +1,63 @@
+// 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.
+// TODO(dalesat): May need to grow the list of outputs dynamically.
+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 UpstreamCallback& callback) override;
+
+ void UnprepareOutput(
+ size_t index,
+ const UpstreamCallback& callback) override;
+
+ void Update(Engine* engine) override;
+
+ void FlushInput(
+ size_t index,
+ const DownstreamCallback& callback) override;
+
+ void FlushOutput(size_t index) override;
+
+ private:
+ std::vector<Output> outputs_;
+ 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_
« no previous file with comments | « services/media/framework/stages/lpcm_transform_stage.cc ('k') | services/media/framework/stages/multistream_source_stage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698