| 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_clock.mojom"; | 8 import "mojo/services/media/common/interfaces/media_clock.mojom"; |
| 9 import "mojo/services/media/common/interfaces/media_common.mojom"; | 9 import "mojo/services/media/common/interfaces/media_common.mojom"; |
| 10 import "mojo/services/media/common/interfaces/media_metadata.mojom"; | 10 import "mojo/services/media/common/interfaces/media_metadata.mojom"; |
| 11 import "mojo/services/media/common/interfaces/media_state.mojom"; | 11 import "mojo/services/media/common/interfaces/media_state.mojom"; |
| 12 import "mojo/services/media/common/interfaces/media_transport.mojom"; | 12 import "mojo/services/media/common/interfaces/media_transport.mojom"; |
| 13 import "mojo/services/media/common/interfaces/media_types.mojom"; | 13 import "mojo/services/media/common/interfaces/media_types.mojom"; |
| 14 | 14 |
| 15 // Produces media streams delivered from a specified origin. | 15 // Produces media streams delivered from a specified origin. |
| 16 interface MediaSource { | 16 interface MediaSource { |
| 17 // Special value for GetStatus version_last_seen parameter to get the current |
| 18 // status immediately. |
| 19 const uint64 kInitialStatus = 0; |
| 20 |
| 17 // Gets the streams produced by this source. | 21 // Gets the streams produced by this source. |
| 18 GetStreams() => (array<MediaSourceStreamDescriptor> streams); | 22 GetStreams() => (array<MediaSourceStreamDescriptor> streams); |
| 19 | 23 |
| 20 // Gets the clock disposition from the source. | 24 // Gets the clock disposition from the source. |
| 21 GetClockDisposition() => (ClockDisposition clock_disposition); | 25 GetClockDisposition() => (ClockDisposition clock_disposition); |
| 22 | 26 |
| 23 // Gets a master clock if the source can be master, null otherwise. | 27 // Gets a master clock if the source can be master, null otherwise. |
| 24 GetMasterClock(Clock& master_clock); | 28 GetMasterClock(Clock& master_clock); |
| 25 | 29 |
| 26 // Sets a master clock. | 30 // Sets a master clock. |
| 27 SetMasterClock(Clock? master_clock); | 31 SetMasterClock(Clock? master_clock); |
| 28 | 32 |
| 29 // Gets the producer for the specified stream. | 33 // Gets the producer for the specified stream. |
| 30 GetProducer(uint32 stream_index, MediaProducer& producer); | 34 GetProducer(uint32 stream_index, MediaProducer& producer); |
| 31 | 35 |
| 32 // Gets the pull mode producer for the specified stream. | 36 // Gets the pull mode producer for the specified stream. |
| 33 GetPullModeProducer(uint32 stream_index, MediaPullModeProducer& producer); | 37 GetPullModeProducer(uint32 stream_index, MediaPullModeProducer& producer); |
| 34 | 38 |
| 35 // Gets the status. To get the status immediately, call GetStatus(0). To | 39 // Gets the status. To get the status immediately, call |
| 36 // get updates thereafter, pass the version sent in the previous callback. | 40 // GetStatus(kInitialStatus). To get updates thereafter, pass the version |
| 41 // sent in the previous callback. |
| 37 GetStatus(uint64 version_last_seen) => | 42 GetStatus(uint64 version_last_seen) => |
| 38 (uint64 version, MediaSourceStatus status); | 43 (uint64 version, MediaSourceStatus status); |
| 39 | 44 |
| 40 // Prepares the source. | 45 // Prepares the source. |
| 41 Prepare() => (); | 46 Prepare() => (); |
| 42 | 47 |
| 43 // Primes the source and downstream components. | 48 // Primes the source and downstream components. |
| 44 Prime() => (); | 49 Prime() => (); |
| 45 | 50 |
| 46 // Flushes the source and downstream components. | 51 // Flushes the source and downstream components. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 63 }; | 68 }; |
| 64 | 69 |
| 65 // Describes the media source. | 70 // Describes the media source. |
| 66 struct MediaSourceStatus { | 71 struct MediaSourceStatus { |
| 67 // Current state of the source. | 72 // Current state of the source. |
| 68 MediaState state; | 73 MediaState state; |
| 69 | 74 |
| 70 // Describes the media. | 75 // Describes the media. |
| 71 MediaMetadata? metadata; | 76 MediaMetadata? metadata; |
| 72 }; | 77 }; |
| OLD | NEW |