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

Side by Side 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: sync Created 4 years, 11 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 [DartPackage="mojo_services"]
6 module mojo.media;
7
8 import "mojo/services/media/common/interfaces/media_common.mojom";
9 import "mojo/services/media/common/interfaces/media_pipe.mojom";
10 import "mojo/services/media/common/interfaces/media_types.mojom";
11
12 // Models a stream producer. A MediaProducer allows a client to connect the
13 // producer to a MediaConsumer so packets flow from the producer to the
14 // consumer. Clients who want to receive packets directly from the producer
15 // should use MediaPullModeProducer instead.
16 //
17 // The client calls Connect to connect producer and consumer. The producer then
18 // calls PushPacket on the consumer to deliver packets.
19 interface MediaProducer {
20 // Connects this MediaProducer to a MediaConsumer.
21 Connect(MediaConsumer consumer) => ();
22
23 // Disconnects this MediaProducer from a previously-connected MediaConsumer.
24 Disconnect();
25 };
26
27 // Models a stream producer. A MediaPullModeProducer allows a client to receive
28 // packets directly from the producer. Clients who want to connect the producer
29 // to a MediaConsumer should use MediaProducer instead.
30 //
31 // The client calls PullPacket to get a packet. Once the client is done with
32 // the packet, it calls ReleasePacket to let the producer know that the packet
33 // buffer region can be reused. Alternatively, the client can piggyback a
34 // release on a PullPacket call using the to_release parameter.
35 interface MediaPullModeProducer {
36 // Gets the shared buffer in which packet payload will be located.
37 GetBuffer() => (handle<shared_buffer> buffer);
38
39 // Pulls a packet from the producer. When the client is done with the
40 // packet buffer region, it should call ReleasePacket or PullPacket passing
41 // the locator. Note that the optional locator passed in PullPacket is
42 // a locator to be released and probably won't be the same locator passed
43 // back in the callback.
44 PullPacket(MediaPacket? to_release) => (MediaPacket packet);
45
46 // Signals the producer that the client is done with the buffer region.
47 ReleasePacket(MediaPacket to_release);
48 };
49
50 // Models a stream consumer. A MediaConsumer allows a client to send packets
51 // directly to the consumer or to connect the consumer to a MediaProducer so
52 // packets flow from the producer to the consumer.
53 //
54 // In the former scenario, the client calls PushPacket to deliver a packet. The
55 // callback notifies the client that the consumer is done with the packet
56 // buffer region.
57 //
58 // In the latter scenario, the client calls Connect on the producer to connect
59 // producer and consumer. The producer then calls PushPacket on the consumer to
60 // deliver packets.
61 interface MediaConsumer {
62 // Sets the shared buffer in which packet payload will be located.
63 SetBuffer(handle<shared_buffer> buffer, uint64 size) => ();
64
65 // Pushes a packet to the consumer. The callback signals that the consumer
66 // is done with the packet buffer region.
67 PushPacket(MediaPacket packet) => ();
68 };
OLDNEW
« no previous file with comments | « mojo/services/media/common/interfaces/media_state.mojom ('k') | mojo/services/media/common/interfaces/media_types.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698