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

Unified Diff: services/media/framework/stages/output.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/output.h
diff --git a/services/media/framework/stages/output.h b/services/media/framework/stages/output.h
new file mode 100644
index 0000000000000000000000000000000000000000..4cebeb57b7c75406154b39d9fb7ecc7e28d5c264
--- /dev/null
+++ b/services/media/framework/stages/output.h
@@ -0,0 +1,68 @@
+// 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_OUTPUT_H_
+#define SERVICES_MEDIA_FRAMEWORK_STAGES_OUTPUT_H_
+
+#include "services/media/framework/packet.h"
+#include "services/media/framework/payload_allocator.h"
+#include "services/media/framework/refs.h"
+
+namespace mojo {
+namespace media {
+
+class Stage;
+class Engine;
+class Input;
+
+// Represents a stage's connector to an adjacent downstream stage.
+class Output {
+ public:
+ Output();
+
+ ~Output();
+
+ // The input to which this output is connected.
+ const InputRef& mate() const { return mate_; }
+
+ // Establishes a connection.
+ void Connect(const InputRef& input);
+
+ // Breaks a connection. Called only by the engine.
+ void Disconnect() { mate_ = nullptr; }
+
+ // Determines whether the output is connected to an input.
+ bool connected() const { return static_cast<bool>(mate_); }
+
+ // The connected input.
+ Input& actual_mate() const;
+
+ // Sets the allocator the output must use to copy the payload of output
+ // packets. This is used when the connected input insists that a specific
+ // allocator be used, but the stage can't use it.
+ void SetCopyAllocator(PayloadAllocator* copy_allocator);
+
+ // Demand signalled from downstream, or kNegative if the downstream input
+ // is currently holding a packet.
+ Demand demand() const;
+
+ // Supplies a packet to mate. Called only by Stage::Update implementations.
+ void SupplyPacket(PacketPtr packet, Engine* engine) const;
+
+ // Updates packet demand. Called only by Input instances.
+ bool UpdateDemandFromInput(Demand demand);
+
+ // Flushes retained media.
+ void Flush();
+
+ private:
+ InputRef mate_;
+ Demand demand_;
+ PayloadAllocator* copy_allocator_;
+};
+
+} // namespace media
+} // namespace mojo
+
+#endif // SERVICES_MEDIA_FRAMEWORK_STAGES_OUTPUT_H_
« no previous file with comments | « services/media/framework/stages/multistream_source_stage.cc ('k') | services/media/framework/stages/output.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698