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

Unified Diff: mojo/services/media/common/interfaces/media_transport.mojom

Issue 1509323002: Mojom updates for Motown. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years 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: mojo/services/media/common/interfaces/media_transport.mojom
diff --git a/mojo/services/media/common/interfaces/media_transport.mojom b/mojo/services/media/common/interfaces/media_transport.mojom
new file mode 100644
index 0000000000000000000000000000000000000000..be0df67c49ddc2cb346f1e5dd9fc0baa5c743f49
--- /dev/null
+++ b/mojo/services/media/common/interfaces/media_transport.mojom
@@ -0,0 +1,67 @@
+// Copyright 2015 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.
+
+[DartPackage="mojo_services"]
+module mojo.media;
+
+import "mojo/services/media/common/interfaces/media_common.mojom";
+import "mojo/services/media/common/interfaces/media_pipe.mojom";
+import "mojo/services/media/common/interfaces/media_types.mojom";
+
+// Models a stream producer. A MediaProducer allows a client to connect the
+// producer to a MediaConsumer so packets flow from the producer to the
+// consumer. Clients who want to receive packets directly from the producer
+// should use MediaPullModeProducer instead.
+//
+// The client calls Connect to connect producer and consumer. The producer then
+// calls PushPacket on the consumer to deliver packets.
+interface MediaProducer {
+ // Connects this MediaProducer to a MediaConsumer.
+ Connect(MediaConsumer consumer) => ();
+
+ // Disconnects this MediaProducer from a previously-connected MediaConsumer.
+ Disconnect();
+};
+
+// Models a stream producer. A MediaPullModeProducer allows a client to receive
+// packets directly from the producer. Clients who want to connect the producer
+// to a MediaConsumer should use MediaProducer instead.
+//
+// The client calls PullPacket to get a packet. Once the client is done with
+// the packet, it calls ReleasePacket to let the producer know that the packet
+// buffer region can be reused.
+interface MediaPullModeProducer {
+ // Gets the shared buffer in which packet payload will be located.
+ GetBuffer() => (handle<shared_buffer> buffer);
+
+ // Pulls a packet from the producer. When the client is done with the
+ // packet buffer region, it should call ReleasePacket or PullPacket passing
+ // the locator. Note that the optional locator passed in PullPacket is
+ // a locator to be released and probably won't be the same locator passed
+ // back in the callback.
+ PullPacket(MediaPacket? to_release) => (MediaPacket packet);
+
+ // Signals the producer that the client is done with the buffer region.
+ ReleasePacket(MediaPacket to_release);
+};
+
+// Models a stream consumer. A MediaConsumer allows a client to send packets
+// directly to the consumer or to connect the consumer to a MediaProducer so
+// packets flow from the producer to the consumer.
+//
+// In the former scenario, the client calls PushPacket to deliver a packet. The
+// callback notifies the client that the consumer is done with the packet
+// buffer region.
+//
+// In the latter scenario, the client calls Connect on the producer to connect
+// producer and consumer. The producer then calls PushPacket on the consumer to
+// deliver packets.
+interface MediaConsumer {
+ // Sets the shared buffer in which packet payload will be located.
+ SetBuffer(handle<shared_buffer> buffer, uint64 size) => ();
+
+ // Pushes a packet to the consumer. The callback signals that the consumer
+ // is done with the packet buffer region.
+ PushPacket(MediaPacket packet) => ();
+};

Powered by Google App Engine
This is Rietveld 408576698