OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 [DartPackage="mojo_services"] | 5 [DartPackage="mojo_services"] |
6 module mojo.media; | 6 module mojo.media; |
7 | 7 |
8 import "mojo/services/media/common/interfaces/media_common.mojom"; | 8 import "mojo/services/media/common/interfaces/media_common.mojom"; |
9 | 9 |
10 // MediaPacketRegion | 10 // MediaPacketRegion |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // the shared buffer via the GetState method. They may then send packet to the | 69 // the shared buffer via the GetState method. They may then send packet to the |
70 // other side of the pipe using the SendPacket method and be informed about when | 70 // other side of the pipe using the SendPacket method and be informed about when |
71 // the media has been consumed via the SendPacket callback they provide. | 71 // the media has been consumed via the SendPacket callback they provide. |
72 // Finally, the pipeline may be flushed using the Flush method. | 72 // Finally, the pipeline may be flushed using the Flush method. |
73 interface MediaPipe { | 73 interface MediaPipe { |
74 const uint64 kMaxBufferLen = 0x3FFFFFFFFFFFFFFF; | 74 const uint64 kMaxBufferLen = 0x3FFFFFFFFFFFFFFF; |
75 | 75 |
76 // An enumeration used to indicate the ultimate fate of packets sent across | 76 // An enumeration used to indicate the ultimate fate of packets sent across |
77 // the pipe using the SendPacket method. | 77 // the pipe using the SendPacket method. |
78 enum SendResult { | 78 enum SendResult { |
79 CONSUMED, // Media was completely consumed. | 79 CONSUMED, // Media was completely consumed. |
80 FLUSHED, // Some or all of the media was flushed before being consumed. | 80 FLUSHED, // Some or all of the media was flushed before being consumed. |
81 }; | 81 }; |
82 | 82 |
83 // Sets the shared buffer in which sent Packet payloads will be located. | 83 // Sets the shared buffer in which sent Packet payloads will be located. |
84 SetBuffer(handle<shared_buffer> buffer, uint64 size); | 84 SetBuffer(handle<shared_buffer> buffer, uint64 size); |
85 | 85 |
86 // Place a media packet into the pipeline to be consumed. When the consumer | 86 // Place a media packet into the pipeline to be consumed. When the consumer |
87 // is finished with the packet, it will invoke the supplied callback to | 87 // is finished with the packet, it will invoke the supplied callback to |
88 // indicate that the region of the shared buffer indicated by the MediaPacket | 88 // indicate that the region of the shared buffer indicated by the MediaPacket |
89 // object is now available for new data. In addition, a SendResult will be | 89 // object is now available for new data. In addition, a SendResult will be |
90 // providid indicating whether or not the packet was consumed or flushed. | 90 // providid indicating whether or not the packet was consumed or flushed. |
91 SendPacket(MediaPacket packet) => (SendResult result); | 91 SendPacket(MediaPacket packet) => (SendResult result); |
92 | 92 |
93 // Flush the pipe, discarding all queued packets in order (from front to back) | 93 // Flush the pipe, discarding all queued packets in order (from front to back) |
94 // as we go. When the flush operation is complete, the provided callback will | 94 // as we go. When the flush operation is complete, the provided callback will |
95 // be invoked to indicate that the consumer end of the pipe has finished | 95 // be invoked to indicate that the consumer end of the pipe has finished |
96 // flushing and that the pipeline is now empty. | 96 // flushing and that the pipeline is now empty. |
97 Flush() => (); | 97 Flush() => (); |
98 }; | 98 }; |
OLD | NEW |