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

Unified Diff: mojo/dart/packages/mojo_services/lib/mojo/media/media_sink.mojom.dart

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 side-by-side diff with in-line comments
Download patch
Index: mojo/dart/packages/mojo_services/lib/mojo/media/media_sink.mojom.dart
diff --git a/mojo/dart/packages/_mojo_for_test_only/lib/test/pingpong_service.mojom.dart b/mojo/dart/packages/mojo_services/lib/mojo/media/media_sink.mojom.dart
similarity index 54%
copy from mojo/dart/packages/_mojo_for_test_only/lib/test/pingpong_service.mojom.dart
copy to mojo/dart/packages/mojo_services/lib/mojo/media/media_sink.mojom.dart
index ba9d67d22c64ee12db3d9043ec0d037819accf12..3ee521ee4c896820fe73cb254b01ac83e3137929 100644
--- a/mojo/dart/packages/_mojo_for_test_only/lib/test/pingpong_service.mojom.dart
+++ b/mojo/dart/packages/mojo_services/lib/mojo/media/media_sink.mojom.dart
@@ -2,24 +2,31 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-library pingpong_service_mojom;
+library media_sink_mojom;
import 'dart:async';
import 'package:mojo/bindings.dart' as bindings;
import 'package:mojo/core.dart' as core;
+import 'package:mojo_services/mojo/media/media_clock.mojom.dart' as media_clock_mojom;
+import 'package:mojo_services/mojo/media/media_common.mojom.dart' as media_common_mojom;
+import 'package:mojo_services/mojo/media/media_state.mojom.dart' as media_state_mojom;
+import 'package:mojo_services/mojo/media/media_transport.mojom.dart' as media_transport_mojom;
+import 'package:mojo_services/mojo/media/media_types.mojom.dart' as media_types_mojom;
+import 'package:mojo_services/mojo/media/rate_control.mojom.dart' as rate_control_mojom;
-class _PingPongServiceSetClientParams extends bindings.Struct {
+class MediaSinkStatus extends bindings.Struct {
static const List<bindings.StructDataHeader> kVersions = const [
- const bindings.StructDataHeader(16, 0)
+ const bindings.StructDataHeader(24, 0)
];
- Object client = null;
+ media_state_mojom.MediaState state = null;
+ rate_control_mojom.TimelineTransform timelineTransform = null;
- _PingPongServiceSetClientParams() : super(kVersions.last.size);
+ MediaSinkStatus() : super(kVersions.last.size);
- static _PingPongServiceSetClientParams deserialize(bindings.Message message) {
+ static MediaSinkStatus deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
@@ -28,11 +35,11 @@ class _PingPongServiceSetClientParams extends bindings.Struct {
return result;
}
- static _PingPongServiceSetClientParams decode(bindings.Decoder decoder0) {
+ static MediaSinkStatus decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
- _PingPongServiceSetClientParams result = new _PingPongServiceSetClientParams();
+ MediaSinkStatus result = new MediaSinkStatus();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
@@ -54,7 +61,16 @@ class _PingPongServiceSetClientParams extends bindings.Struct {
}
if (mainDataHeader.version >= 0) {
- result.client = decoder0.decodeServiceInterface(8, false, PingPongClientProxy.newFromEndpoint);
+ result.state = media_state_mojom.MediaState.decode(decoder0, 8);
+ if (result.state == null) {
+ throw new bindings.MojoCodecError(
+ 'Trying to decode null union for non-nullable media_state_mojom.MediaState.');
+ }
+ }
+ if (mainDataHeader.version >= 0) {
+
+ var decoder1 = decoder0.decodePointer(16, true);
+ result.timelineTransform = rate_control_mojom.TimelineTransform.decode(decoder1);
}
return result;
}
@@ -62,30 +78,93 @@ class _PingPongServiceSetClientParams extends bindings.Struct {
void encode(bindings.Encoder encoder) {
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
- encoder0.encodeInterface(client, 8, false);
+ encoder0.encodeEnum(state, 8);
+
+ encoder0.encodeStruct(timelineTransform, 16, true);
}
String toString() {
- return "_PingPongServiceSetClientParams("
- "client: $client" ")";
+ return "MediaSinkStatus("
+ "state: $state" ", "
+ "timelineTransform: $timelineTransform" ")";
}
Map toJson() {
- throw new bindings.MojoCodecError(
- 'Object containing handles cannot be encoded to JSON.');
+ Map map = new Map();
+ map["state"] = state;
+ map["timelineTransform"] = timelineTransform;
+ return map;
}
}
-class _PingPongServicePingParams extends bindings.Struct {
+class _MediaSinkGetClockDispositionParams extends bindings.Struct {
+ static const List<bindings.StructDataHeader> kVersions = const [
+ const bindings.StructDataHeader(8, 0)
+ ];
+
+ _MediaSinkGetClockDispositionParams() : super(kVersions.last.size);
+
+ static _MediaSinkGetClockDispositionParams deserialize(bindings.Message message) {
+ var decoder = new bindings.Decoder(message);
+ var result = decode(decoder);
+ if (decoder.excessHandles != null) {
+ decoder.excessHandles.forEach((h) => h.close());
+ }
+ return result;
+ }
+
+ static _MediaSinkGetClockDispositionParams decode(bindings.Decoder decoder0) {
+ if (decoder0 == null) {
+ return null;
+ }
+ _MediaSinkGetClockDispositionParams result = new _MediaSinkGetClockDispositionParams();
+
+ var mainDataHeader = decoder0.decodeStructDataHeader();
+ if (mainDataHeader.version <= kVersions.last.version) {
+ // Scan in reverse order to optimize for more recent versions.
+ for (int i = kVersions.length - 1; i >= 0; --i) {
+ if (mainDataHeader.version >= kVersions[i].version) {
+ if (mainDataHeader.size == kVersions[i].size) {
+ // Found a match.
+ break;
+ }
+ throw new bindings.MojoCodecError(
+ 'Header size doesn\'t correspond to known version size.');
+ }
+ }
+ } else if (mainDataHeader.size < kVersions.last.size) {
+ throw new bindings.MojoCodecError(
+ 'Message newer than the last known version cannot be shorter than '
+ 'required by the last known version.');
+ }
+ return result;
+ }
+
+ void encode(bindings.Encoder encoder) {
+ encoder.getStructEncoderAtOffset(kVersions.last);
+ }
+
+ String toString() {
+ return "_MediaSinkGetClockDispositionParams("")";
+ }
+
+ Map toJson() {
+ Map map = new Map();
+ return map;
+ }
+}
+
+
+class MediaSinkGetClockDispositionResponseParams extends bindings.Struct {
static const List<bindings.StructDataHeader> kVersions = const [
const bindings.StructDataHeader(16, 0)
];
- int pingValue = 0;
+ media_clock_mojom.ClockDisposition clockDisposition = null;
- _PingPongServicePingParams() : super(kVersions.last.size);
+ MediaSinkGetClockDispositionResponseParams() : super(kVersions.last.size);
- static _PingPongServicePingParams deserialize(bindings.Message message) {
+ static MediaSinkGetClockDispositionResponseParams deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
@@ -94,11 +173,11 @@ class _PingPongServicePingParams extends bindings.Struct {
return result;
}
- static _PingPongServicePingParams decode(bindings.Decoder decoder0) {
+ static MediaSinkGetClockDispositionResponseParams decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
- _PingPongServicePingParams result = new _PingPongServicePingParams();
+ MediaSinkGetClockDispositionResponseParams result = new MediaSinkGetClockDispositionResponseParams();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
@@ -120,7 +199,11 @@ class _PingPongServicePingParams extends bindings.Struct {
}
if (mainDataHeader.version >= 0) {
- result.pingValue = decoder0.decodeUint16(8);
+ result.clockDisposition = media_clock_mojom.ClockDisposition.decode(decoder0, 8);
+ if (result.clockDisposition == null) {
+ throw new bindings.MojoCodecError(
+ 'Trying to decode null union for non-nullable media_clock_mojom.ClockDisposition.');
+ }
}
return result;
}
@@ -128,32 +211,31 @@ class _PingPongServicePingParams extends bindings.Struct {
void encode(bindings.Encoder encoder) {
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
- encoder0.encodeUint16(pingValue, 8);
+ encoder0.encodeEnum(clockDisposition, 8);
}
String toString() {
- return "_PingPongServicePingParams("
- "pingValue: $pingValue" ")";
+ return "MediaSinkGetClockDispositionResponseParams("
+ "clockDisposition: $clockDisposition" ")";
}
Map toJson() {
Map map = new Map();
- map["pingValue"] = pingValue;
+ map["clockDisposition"] = clockDisposition;
return map;
}
}
-class _PingPongServicePingTargetUrlParams extends bindings.Struct {
+class _MediaSinkGetMasterClockParams extends bindings.Struct {
static const List<bindings.StructDataHeader> kVersions = const [
- const bindings.StructDataHeader(24, 0)
+ const bindings.StructDataHeader(16, 0)
];
- String url = null;
- int count = 0;
+ Object masterClock = null;
- _PingPongServicePingTargetUrlParams() : super(kVersions.last.size);
+ _MediaSinkGetMasterClockParams() : super(kVersions.last.size);
- static _PingPongServicePingTargetUrlParams deserialize(bindings.Message message) {
+ static _MediaSinkGetMasterClockParams deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
@@ -162,11 +244,11 @@ class _PingPongServicePingTargetUrlParams extends bindings.Struct {
return result;
}
- static _PingPongServicePingTargetUrlParams decode(bindings.Decoder decoder0) {
+ static _MediaSinkGetMasterClockParams decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
- _PingPongServicePingTargetUrlParams result = new _PingPongServicePingTargetUrlParams();
+ _MediaSinkGetMasterClockParams result = new _MediaSinkGetMasterClockParams();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
@@ -188,11 +270,7 @@ class _PingPongServicePingTargetUrlParams extends bindings.Struct {
}
if (mainDataHeader.version >= 0) {
- result.url = decoder0.decodeString(8, false);
- }
- if (mainDataHeader.version >= 0) {
-
- result.count = decoder0.decodeUint16(16);
+ result.masterClock = decoder0.decodeInterfaceRequest(8, false, media_clock_mojom.ClockStub.newFromEndpoint);
}
return result;
}
@@ -200,35 +278,30 @@ class _PingPongServicePingTargetUrlParams extends bindings.Struct {
void encode(bindings.Encoder encoder) {
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
- encoder0.encodeString(url, 8, false);
-
- encoder0.encodeUint16(count, 16);
+ encoder0.encodeInterfaceRequest(masterClock, 8, false);
}
String toString() {
- return "_PingPongServicePingTargetUrlParams("
- "url: $url" ", "
- "count: $count" ")";
+ return "_MediaSinkGetMasterClockParams("
+ "masterClock: $masterClock" ")";
}
Map toJson() {
- Map map = new Map();
- map["url"] = url;
- map["count"] = count;
- return map;
+ throw new bindings.MojoCodecError(
+ 'Object containing handles cannot be encoded to JSON.');
}
}
-class PingPongServicePingTargetUrlResponseParams extends bindings.Struct {
+class _MediaSinkSetMasterClockParams extends bindings.Struct {
static const List<bindings.StructDataHeader> kVersions = const [
const bindings.StructDataHeader(16, 0)
];
- bool ok = false;
+ Object masterClock = null;
- PingPongServicePingTargetUrlResponseParams() : super(kVersions.last.size);
+ _MediaSinkSetMasterClockParams() : super(kVersions.last.size);
- static PingPongServicePingTargetUrlResponseParams deserialize(bindings.Message message) {
+ static _MediaSinkSetMasterClockParams deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
@@ -237,11 +310,11 @@ class PingPongServicePingTargetUrlResponseParams extends bindings.Struct {
return result;
}
- static PingPongServicePingTargetUrlResponseParams decode(bindings.Decoder decoder0) {
+ static _MediaSinkSetMasterClockParams decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
- PingPongServicePingTargetUrlResponseParams result = new PingPongServicePingTargetUrlResponseParams();
+ _MediaSinkSetMasterClockParams result = new _MediaSinkSetMasterClockParams();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
@@ -263,7 +336,7 @@ class PingPongServicePingTargetUrlResponseParams extends bindings.Struct {
}
if (mainDataHeader.version >= 0) {
- result.ok = decoder0.decodeBool(8, 0);
+ result.masterClock = decoder0.decodeServiceInterface(8, true, media_clock_mojom.ClockProxy.newFromEndpoint);
}
return result;
}
@@ -271,32 +344,30 @@ class PingPongServicePingTargetUrlResponseParams extends bindings.Struct {
void encode(bindings.Encoder encoder) {
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
- encoder0.encodeBool(ok, 8, 0);
+ encoder0.encodeInterface(masterClock, 8, true);
}
String toString() {
- return "PingPongServicePingTargetUrlResponseParams("
- "ok: $ok" ")";
+ return "_MediaSinkSetMasterClockParams("
+ "masterClock: $masterClock" ")";
}
Map toJson() {
- Map map = new Map();
- map["ok"] = ok;
- return map;
+ throw new bindings.MojoCodecError(
+ 'Object containing handles cannot be encoded to JSON.');
}
}
-class _PingPongServicePingTargetServiceParams extends bindings.Struct {
+class _MediaSinkGetConsumerParams extends bindings.Struct {
static const List<bindings.StructDataHeader> kVersions = const [
- const bindings.StructDataHeader(24, 0)
+ const bindings.StructDataHeader(16, 0)
];
- Object service = null;
- int count = 0;
+ Object consumer = null;
- _PingPongServicePingTargetServiceParams() : super(kVersions.last.size);
+ _MediaSinkGetConsumerParams() : super(kVersions.last.size);
- static _PingPongServicePingTargetServiceParams deserialize(bindings.Message message) {
+ static _MediaSinkGetConsumerParams deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
@@ -305,11 +376,11 @@ class _PingPongServicePingTargetServiceParams extends bindings.Struct {
return result;
}
- static _PingPongServicePingTargetServiceParams decode(bindings.Decoder decoder0) {
+ static _MediaSinkGetConsumerParams decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
- _PingPongServicePingTargetServiceParams result = new _PingPongServicePingTargetServiceParams();
+ _MediaSinkGetConsumerParams result = new _MediaSinkGetConsumerParams();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
@@ -331,11 +402,7 @@ class _PingPongServicePingTargetServiceParams extends bindings.Struct {
}
if (mainDataHeader.version >= 0) {
- result.service = decoder0.decodeServiceInterface(8, false, PingPongServiceProxy.newFromEndpoint);
- }
- if (mainDataHeader.version >= 0) {
-
- result.count = decoder0.decodeUint16(16);
+ result.consumer = decoder0.decodeInterfaceRequest(8, false, media_transport_mojom.MediaConsumerStub.newFromEndpoint);
}
return result;
}
@@ -343,15 +410,12 @@ class _PingPongServicePingTargetServiceParams extends bindings.Struct {
void encode(bindings.Encoder encoder) {
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
- encoder0.encodeInterface(service, 8, false);
-
- encoder0.encodeUint16(count, 16);
+ encoder0.encodeInterfaceRequest(consumer, 8, false);
}
String toString() {
- return "_PingPongServicePingTargetServiceParams("
- "service: $service" ", "
- "count: $count" ")";
+ return "_MediaSinkGetConsumerParams("
+ "consumer: $consumer" ")";
}
Map toJson() {
@@ -361,15 +425,15 @@ class _PingPongServicePingTargetServiceParams extends bindings.Struct {
}
-class PingPongServicePingTargetServiceResponseParams extends bindings.Struct {
+class _MediaSinkGetStatusParams extends bindings.Struct {
static const List<bindings.StructDataHeader> kVersions = const [
const bindings.StructDataHeader(16, 0)
];
- bool ok = false;
+ int versionLastSeen = 0;
- PingPongServicePingTargetServiceResponseParams() : super(kVersions.last.size);
+ _MediaSinkGetStatusParams() : super(kVersions.last.size);
- static PingPongServicePingTargetServiceResponseParams deserialize(bindings.Message message) {
+ static _MediaSinkGetStatusParams deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
@@ -378,11 +442,11 @@ class PingPongServicePingTargetServiceResponseParams extends bindings.Struct {
return result;
}
- static PingPongServicePingTargetServiceResponseParams decode(bindings.Decoder decoder0) {
+ static _MediaSinkGetStatusParams decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
- PingPongServicePingTargetServiceResponseParams result = new PingPongServicePingTargetServiceResponseParams();
+ _MediaSinkGetStatusParams result = new _MediaSinkGetStatusParams();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
@@ -404,7 +468,7 @@ class PingPongServicePingTargetServiceResponseParams extends bindings.Struct {
}
if (mainDataHeader.version >= 0) {
- result.ok = decoder0.decodeBool(8, 0);
+ result.versionLastSeen = decoder0.decodeUint64(8);
}
return result;
}
@@ -412,31 +476,32 @@ class PingPongServicePingTargetServiceResponseParams extends bindings.Struct {
void encode(bindings.Encoder encoder) {
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
- encoder0.encodeBool(ok, 8, 0);
+ encoder0.encodeUint64(versionLastSeen, 8);
}
String toString() {
- return "PingPongServicePingTargetServiceResponseParams("
- "ok: $ok" ")";
+ return "_MediaSinkGetStatusParams("
+ "versionLastSeen: $versionLastSeen" ")";
}
Map toJson() {
Map map = new Map();
- map["ok"] = ok;
+ map["versionLastSeen"] = versionLastSeen;
return map;
}
}
-class _PingPongServiceGetPingPongServiceParams extends bindings.Struct {
+class MediaSinkGetStatusResponseParams extends bindings.Struct {
static const List<bindings.StructDataHeader> kVersions = const [
- const bindings.StructDataHeader(16, 0)
+ const bindings.StructDataHeader(24, 0)
];
- Object service = null;
+ int version = 0;
+ MediaSinkStatus status = null;
- _PingPongServiceGetPingPongServiceParams() : super(kVersions.last.size);
+ MediaSinkGetStatusResponseParams() : super(kVersions.last.size);
- static _PingPongServiceGetPingPongServiceParams deserialize(bindings.Message message) {
+ static MediaSinkGetStatusResponseParams deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
@@ -445,11 +510,11 @@ class _PingPongServiceGetPingPongServiceParams extends bindings.Struct {
return result;
}
- static _PingPongServiceGetPingPongServiceParams decode(bindings.Decoder decoder0) {
+ static MediaSinkGetStatusResponseParams decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
- _PingPongServiceGetPingPongServiceParams result = new _PingPongServiceGetPingPongServiceParams();
+ MediaSinkGetStatusResponseParams result = new MediaSinkGetStatusResponseParams();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
@@ -471,7 +536,12 @@ class _PingPongServiceGetPingPongServiceParams extends bindings.Struct {
}
if (mainDataHeader.version >= 0) {
- result.service = decoder0.decodeInterfaceRequest(8, false, PingPongServiceStub.newFromEndpoint);
+ result.version = decoder0.decodeUint64(8);
+ }
+ if (mainDataHeader.version >= 0) {
+
+ var decoder1 = decoder0.decodePointer(16, false);
+ result.status = MediaSinkStatus.decode(decoder1);
}
return result;
}
@@ -479,29 +549,34 @@ class _PingPongServiceGetPingPongServiceParams extends bindings.Struct {
void encode(bindings.Encoder encoder) {
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
- encoder0.encodeInterfaceRequest(service, 8, false);
+ encoder0.encodeUint64(version, 8);
+
+ encoder0.encodeStruct(status, 16, false);
}
String toString() {
- return "_PingPongServiceGetPingPongServiceParams("
- "service: $service" ")";
+ return "MediaSinkGetStatusResponseParams("
+ "version: $version" ", "
+ "status: $status" ")";
}
Map toJson() {
- throw new bindings.MojoCodecError(
- 'Object containing handles cannot be encoded to JSON.');
+ Map map = new Map();
+ map["version"] = version;
+ map["status"] = status;
+ return map;
}
}
-class _PingPongServiceQuitParams extends bindings.Struct {
+class _MediaSinkPlayParams extends bindings.Struct {
static const List<bindings.StructDataHeader> kVersions = const [
const bindings.StructDataHeader(8, 0)
];
- _PingPongServiceQuitParams() : super(kVersions.last.size);
+ _MediaSinkPlayParams() : super(kVersions.last.size);
- static _PingPongServiceQuitParams deserialize(bindings.Message message) {
+ static _MediaSinkPlayParams deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
@@ -510,11 +585,11 @@ class _PingPongServiceQuitParams extends bindings.Struct {
return result;
}
- static _PingPongServiceQuitParams decode(bindings.Decoder decoder0) {
+ static _MediaSinkPlayParams decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
- _PingPongServiceQuitParams result = new _PingPongServiceQuitParams();
+ _MediaSinkPlayParams result = new _MediaSinkPlayParams();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
@@ -542,7 +617,7 @@ class _PingPongServiceQuitParams extends bindings.Struct {
}
String toString() {
- return "_PingPongServiceQuitParams("")";
+ return "_MediaSinkPlayParams("")";
}
Map toJson() {
@@ -552,15 +627,14 @@ class _PingPongServiceQuitParams extends bindings.Struct {
}
-class _PingPongClientPongParams extends bindings.Struct {
+class _MediaSinkPauseParams extends bindings.Struct {
static const List<bindings.StructDataHeader> kVersions = const [
- const bindings.StructDataHeader(16, 0)
+ const bindings.StructDataHeader(8, 0)
];
- int pongValue = 0;
- _PingPongClientPongParams() : super(kVersions.last.size);
+ _MediaSinkPauseParams() : super(kVersions.last.size);
- static _PingPongClientPongParams deserialize(bindings.Message message) {
+ static _MediaSinkPauseParams deserialize(bindings.Message message) {
var decoder = new bindings.Decoder(message);
var result = decode(decoder);
if (decoder.excessHandles != null) {
@@ -569,11 +643,11 @@ class _PingPongClientPongParams extends bindings.Struct {
return result;
}
- static _PingPongClientPongParams decode(bindings.Decoder decoder0) {
+ static _MediaSinkPauseParams decode(bindings.Decoder decoder0) {
if (decoder0 == null) {
return null;
}
- _PingPongClientPongParams result = new _PingPongClientPongParams();
+ _MediaSinkPauseParams result = new _MediaSinkPauseParams();
var mainDataHeader = decoder0.decodeStructDataHeader();
if (mainDataHeader.version <= kVersions.last.version) {
@@ -593,68 +667,62 @@ class _PingPongClientPongParams extends bindings.Struct {
'Message newer than the last known version cannot be shorter than '
'required by the last known version.');
}
- if (mainDataHeader.version >= 0) {
-
- result.pongValue = decoder0.decodeUint16(8);
- }
return result;
}
void encode(bindings.Encoder encoder) {
- var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
-
- encoder0.encodeUint16(pongValue, 8);
+ encoder.getStructEncoderAtOffset(kVersions.last);
}
String toString() {
- return "_PingPongClientPongParams("
- "pongValue: $pongValue" ")";
+ return "_MediaSinkPauseParams("")";
}
Map toJson() {
Map map = new Map();
- map["pongValue"] = pongValue;
return map;
}
}
-const int _PingPongService_setClientName = 0;
-const int _PingPongService_pingName = 1;
-const int _PingPongService_pingTargetUrlName = 2;
-const int _PingPongService_pingTargetServiceName = 3;
-const int _PingPongService_getPingPongServiceName = 4;
-const int _PingPongService_quitName = 5;
-
-abstract class PingPongService {
- static const String serviceName = "test::PingPongService";
- void setClient(Object client);
- void ping(int pingValue);
- dynamic pingTargetUrl(String url,int count,[Function responseFactory = null]);
- dynamic pingTargetService(Object service,int count,[Function responseFactory = null]);
- void getPingPongService(Object service);
- void quit();
+const int _MediaSink_getClockDispositionName = 0;
+const int _MediaSink_getMasterClockName = 1;
+const int _MediaSink_setMasterClockName = 2;
+const int _MediaSink_getConsumerName = 3;
+const int _MediaSink_getStatusName = 4;
+const int _MediaSink_playName = 5;
+const int _MediaSink_pauseName = 6;
+
+abstract class MediaSink {
+ static const String serviceName = null;
+ dynamic getClockDisposition([Function responseFactory = null]);
+ void getMasterClock(Object masterClock);
+ void setMasterClock(Object masterClock);
+ void getConsumer(Object consumer);
+ dynamic getStatus(int versionLastSeen,[Function responseFactory = null]);
+ void play();
+ void pause();
}
-class _PingPongServiceProxyImpl extends bindings.Proxy {
- _PingPongServiceProxyImpl.fromEndpoint(
+class _MediaSinkProxyImpl extends bindings.Proxy {
+ _MediaSinkProxyImpl.fromEndpoint(
core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
- _PingPongServiceProxyImpl.fromHandle(core.MojoHandle handle) :
+ _MediaSinkProxyImpl.fromHandle(core.MojoHandle handle) :
super.fromHandle(handle);
- _PingPongServiceProxyImpl.unbound() : super.unbound();
+ _MediaSinkProxyImpl.unbound() : super.unbound();
- static _PingPongServiceProxyImpl newFromEndpoint(
+ static _MediaSinkProxyImpl newFromEndpoint(
core.MojoMessagePipeEndpoint endpoint) {
- assert(endpoint.setDescription("For _PingPongServiceProxyImpl"));
- return new _PingPongServiceProxyImpl.fromEndpoint(endpoint);
+ assert(endpoint.setDescription("For _MediaSinkProxyImpl"));
+ return new _MediaSinkProxyImpl.fromEndpoint(endpoint);
}
void handleResponse(bindings.ServiceMessage message) {
switch (message.header.type) {
- case _PingPongService_pingTargetUrlName:
- var r = PingPongServicePingTargetUrlResponseParams.deserialize(
+ case _MediaSink_getClockDispositionName:
+ var r = MediaSinkGetClockDispositionResponseParams.deserialize(
message.payload);
if (!message.header.hasRequestId) {
proxyError("Expected a message with a valid request Id.");
@@ -673,8 +741,8 @@ class _PingPongServiceProxyImpl extends bindings.Proxy {
}
c.complete(r);
break;
- case _PingPongService_pingTargetServiceName:
- var r = PingPongServicePingTargetServiceResponseParams.deserialize(
+ case _MediaSink_getStatusName:
+ var r = MediaSinkGetStatusResponseParams.deserialize(
message.payload);
if (!message.header.hasRequestId) {
proxyError("Expected a message with a valid request Id.");
@@ -702,111 +770,116 @@ class _PingPongServiceProxyImpl extends bindings.Proxy {
String toString() {
var superString = super.toString();
- return "_PingPongServiceProxyImpl($superString)";
+ return "_MediaSinkProxyImpl($superString)";
}
}
-class _PingPongServiceProxyCalls implements PingPongService {
- _PingPongServiceProxyImpl _proxyImpl;
+class _MediaSinkProxyCalls implements MediaSink {
+ _MediaSinkProxyImpl _proxyImpl;
- _PingPongServiceProxyCalls(this._proxyImpl);
- void setClient(Object client) {
+ _MediaSinkProxyCalls(this._proxyImpl);
+ dynamic getClockDisposition([Function responseFactory = null]) {
+ var params = new _MediaSinkGetClockDispositionParams();
+ return _proxyImpl.sendMessageWithRequestId(
+ params,
+ _MediaSink_getClockDispositionName,
+ -1,
+ bindings.MessageHeader.kMessageExpectsResponse);
+ }
+ void getMasterClock(Object masterClock) {
if (!_proxyImpl.isBound) {
_proxyImpl.proxyError("The Proxy is closed.");
return;
}
- var params = new _PingPongServiceSetClientParams();
- params.client = client;
- _proxyImpl.sendMessage(params, _PingPongService_setClientName);
+ var params = new _MediaSinkGetMasterClockParams();
+ params.masterClock = masterClock;
+ _proxyImpl.sendMessage(params, _MediaSink_getMasterClockName);
}
- void ping(int pingValue) {
+ void setMasterClock(Object masterClock) {
if (!_proxyImpl.isBound) {
_proxyImpl.proxyError("The Proxy is closed.");
return;
}
- var params = new _PingPongServicePingParams();
- params.pingValue = pingValue;
- _proxyImpl.sendMessage(params, _PingPongService_pingName);
+ var params = new _MediaSinkSetMasterClockParams();
+ params.masterClock = masterClock;
+ _proxyImpl.sendMessage(params, _MediaSink_setMasterClockName);
}
- dynamic pingTargetUrl(String url,int count,[Function responseFactory = null]) {
- var params = new _PingPongServicePingTargetUrlParams();
- params.url = url;
- params.count = count;
- return _proxyImpl.sendMessageWithRequestId(
- params,
- _PingPongService_pingTargetUrlName,
- -1,
- bindings.MessageHeader.kMessageExpectsResponse);
+ void getConsumer(Object consumer) {
+ if (!_proxyImpl.isBound) {
+ _proxyImpl.proxyError("The Proxy is closed.");
+ return;
+ }
+ var params = new _MediaSinkGetConsumerParams();
+ params.consumer = consumer;
+ _proxyImpl.sendMessage(params, _MediaSink_getConsumerName);
}
- dynamic pingTargetService(Object service,int count,[Function responseFactory = null]) {
- var params = new _PingPongServicePingTargetServiceParams();
- params.service = service;
- params.count = count;
+ dynamic getStatus(int versionLastSeen,[Function responseFactory = null]) {
+ var params = new _MediaSinkGetStatusParams();
+ params.versionLastSeen = versionLastSeen;
return _proxyImpl.sendMessageWithRequestId(
params,
- _PingPongService_pingTargetServiceName,
+ _MediaSink_getStatusName,
-1,
bindings.MessageHeader.kMessageExpectsResponse);
}
- void getPingPongService(Object service) {
+ void play() {
if (!_proxyImpl.isBound) {
_proxyImpl.proxyError("The Proxy is closed.");
return;
}
- var params = new _PingPongServiceGetPingPongServiceParams();
- params.service = service;
- _proxyImpl.sendMessage(params, _PingPongService_getPingPongServiceName);
+ var params = new _MediaSinkPlayParams();
+ _proxyImpl.sendMessage(params, _MediaSink_playName);
}
- void quit() {
+ void pause() {
if (!_proxyImpl.isBound) {
_proxyImpl.proxyError("The Proxy is closed.");
return;
}
- var params = new _PingPongServiceQuitParams();
- _proxyImpl.sendMessage(params, _PingPongService_quitName);
+ var params = new _MediaSinkPauseParams();
+ _proxyImpl.sendMessage(params, _MediaSink_pauseName);
}
}
-class PingPongServiceProxy implements bindings.ProxyBase {
+class MediaSinkProxy implements bindings.ProxyBase {
final bindings.Proxy impl;
- PingPongService ptr;
+ MediaSink ptr;
- PingPongServiceProxy(_PingPongServiceProxyImpl proxyImpl) :
+ MediaSinkProxy(_MediaSinkProxyImpl proxyImpl) :
impl = proxyImpl,
- ptr = new _PingPongServiceProxyCalls(proxyImpl);
+ ptr = new _MediaSinkProxyCalls(proxyImpl);
- PingPongServiceProxy.fromEndpoint(
+ MediaSinkProxy.fromEndpoint(
core.MojoMessagePipeEndpoint endpoint) :
- impl = new _PingPongServiceProxyImpl.fromEndpoint(endpoint) {
- ptr = new _PingPongServiceProxyCalls(impl);
+ impl = new _MediaSinkProxyImpl.fromEndpoint(endpoint) {
+ ptr = new _MediaSinkProxyCalls(impl);
}
- PingPongServiceProxy.fromHandle(core.MojoHandle handle) :
- impl = new _PingPongServiceProxyImpl.fromHandle(handle) {
- ptr = new _PingPongServiceProxyCalls(impl);
+ MediaSinkProxy.fromHandle(core.MojoHandle handle) :
+ impl = new _MediaSinkProxyImpl.fromHandle(handle) {
+ ptr = new _MediaSinkProxyCalls(impl);
}
- PingPongServiceProxy.unbound() :
- impl = new _PingPongServiceProxyImpl.unbound() {
- ptr = new _PingPongServiceProxyCalls(impl);
+ MediaSinkProxy.unbound() :
+ impl = new _MediaSinkProxyImpl.unbound() {
+ ptr = new _MediaSinkProxyCalls(impl);
}
- factory PingPongServiceProxy.connectToService(
+ factory MediaSinkProxy.connectToService(
bindings.ServiceConnector s, String url, [String serviceName]) {
- PingPongServiceProxy p = new PingPongServiceProxy.unbound();
+ MediaSinkProxy p = new MediaSinkProxy.unbound();
s.connectToService(url, p, serviceName);
return p;
}
- static PingPongServiceProxy newFromEndpoint(
+ static MediaSinkProxy newFromEndpoint(
core.MojoMessagePipeEndpoint endpoint) {
- assert(endpoint.setDescription("For PingPongServiceProxy"));
- return new PingPongServiceProxy.fromEndpoint(endpoint);
+ assert(endpoint.setDescription("For MediaSinkProxy"));
+ return new MediaSinkProxy.fromEndpoint(endpoint);
}
- String get serviceName => PingPongService.serviceName;
+ String get serviceName => MediaSink.serviceName;
Future close({bool immediate: false}) => impl.close(immediate: immediate);
@@ -823,38 +896,39 @@ class PingPongServiceProxy implements bindings.ProxyBase {
}
String toString() {
- return "PingPongServiceProxy($impl)";
+ return "MediaSinkProxy($impl)";
}
}
-class PingPongServiceStub extends bindings.Stub {
- PingPongService _impl = null;
+class MediaSinkStub extends bindings.Stub {
+ MediaSink _impl = null;
- PingPongServiceStub.fromEndpoint(
+ MediaSinkStub.fromEndpoint(
core.MojoMessagePipeEndpoint endpoint, [this._impl])
: super.fromEndpoint(endpoint);
- PingPongServiceStub.fromHandle(core.MojoHandle handle, [this._impl])
+ MediaSinkStub.fromHandle(core.MojoHandle handle, [this._impl])
: super.fromHandle(handle);
- PingPongServiceStub.unbound() : super.unbound();
+ MediaSinkStub.unbound() : super.unbound();
- static PingPongServiceStub newFromEndpoint(
+ static MediaSinkStub newFromEndpoint(
core.MojoMessagePipeEndpoint endpoint) {
- assert(endpoint.setDescription("For PingPongServiceStub"));
- return new PingPongServiceStub.fromEndpoint(endpoint);
+ assert(endpoint.setDescription("For MediaSinkStub"));
+ return new MediaSinkStub.fromEndpoint(endpoint);
}
- PingPongServicePingTargetUrlResponseParams _PingPongServicePingTargetUrlResponseParamsFactory(bool ok) {
- var mojo_factory_result = new PingPongServicePingTargetUrlResponseParams();
- mojo_factory_result.ok = ok;
+ MediaSinkGetClockDispositionResponseParams _MediaSinkGetClockDispositionResponseParamsFactory(media_clock_mojom.ClockDisposition clockDisposition) {
+ var mojo_factory_result = new MediaSinkGetClockDispositionResponseParams();
+ mojo_factory_result.clockDisposition = clockDisposition;
return mojo_factory_result;
}
- PingPongServicePingTargetServiceResponseParams _PingPongServicePingTargetServiceResponseParamsFactory(bool ok) {
- var mojo_factory_result = new PingPongServicePingTargetServiceResponseParams();
- mojo_factory_result.ok = ok;
+ MediaSinkGetStatusResponseParams _MediaSinkGetStatusResponseParamsFactory(int version, MediaSinkStatus status) {
+ var mojo_factory_result = new MediaSinkGetStatusResponseParams();
+ mojo_factory_result.version = version;
+ mojo_factory_result.status = status;
return mojo_factory_result;
}
@@ -866,26 +940,16 @@ class PingPongServiceStub extends bindings.Stub {
}
assert(_impl != null);
switch (message.header.type) {
- case _PingPongService_setClientName:
- var params = _PingPongServiceSetClientParams.deserialize(
- message.payload);
- _impl.setClient(params.client);
- break;
- case _PingPongService_pingName:
- var params = _PingPongServicePingParams.deserialize(
- message.payload);
- _impl.ping(params.pingValue);
- break;
- case _PingPongService_pingTargetUrlName:
- var params = _PingPongServicePingTargetUrlParams.deserialize(
+ case _MediaSink_getClockDispositionName:
+ var params = _MediaSinkGetClockDispositionParams.deserialize(
message.payload);
- var response = _impl.pingTargetUrl(params.url,params.count,_PingPongServicePingTargetUrlResponseParamsFactory);
+ var response = _impl.getClockDisposition(_MediaSinkGetClockDispositionResponseParamsFactory);
if (response is Future) {
return response.then((response) {
if (response != null) {
return buildResponseWithId(
response,
- _PingPongService_pingTargetUrlName,
+ _MediaSink_getClockDispositionName,
message.header.requestId,
bindings.MessageHeader.kMessageIsResponse);
}
@@ -893,21 +957,36 @@ class PingPongServiceStub extends bindings.Stub {
} else if (response != null) {
return buildResponseWithId(
response,
- _PingPongService_pingTargetUrlName,
+ _MediaSink_getClockDispositionName,
message.header.requestId,
bindings.MessageHeader.kMessageIsResponse);
}
break;
- case _PingPongService_pingTargetServiceName:
- var params = _PingPongServicePingTargetServiceParams.deserialize(
+ case _MediaSink_getMasterClockName:
+ var params = _MediaSinkGetMasterClockParams.deserialize(
message.payload);
- var response = _impl.pingTargetService(params.service,params.count,_PingPongServicePingTargetServiceResponseParamsFactory);
+ _impl.getMasterClock(params.masterClock);
+ break;
+ case _MediaSink_setMasterClockName:
+ var params = _MediaSinkSetMasterClockParams.deserialize(
+ message.payload);
+ _impl.setMasterClock(params.masterClock);
+ break;
+ case _MediaSink_getConsumerName:
+ var params = _MediaSinkGetConsumerParams.deserialize(
+ message.payload);
+ _impl.getConsumer(params.consumer);
+ break;
+ case _MediaSink_getStatusName:
+ var params = _MediaSinkGetStatusParams.deserialize(
+ message.payload);
+ var response = _impl.getStatus(params.versionLastSeen,_MediaSinkGetStatusResponseParamsFactory);
if (response is Future) {
return response.then((response) {
if (response != null) {
return buildResponseWithId(
response,
- _PingPongService_pingTargetServiceName,
+ _MediaSink_getStatusName,
message.header.requestId,
bindings.MessageHeader.kMessageIsResponse);
}
@@ -915,188 +994,20 @@ class PingPongServiceStub extends bindings.Stub {
} else if (response != null) {
return buildResponseWithId(
response,
- _PingPongService_pingTargetServiceName,
+ _MediaSink_getStatusName,
message.header.requestId,
bindings.MessageHeader.kMessageIsResponse);
}
break;
- case _PingPongService_getPingPongServiceName:
- var params = _PingPongServiceGetPingPongServiceParams.deserialize(
- message.payload);
- _impl.getPingPongService(params.service);
- break;
- case _PingPongService_quitName:
- var params = _PingPongServiceQuitParams.deserialize(
+ case _MediaSink_playName:
+ var params = _MediaSinkPlayParams.deserialize(
message.payload);
- _impl.quit();
+ _impl.play();
break;
- default:
- throw new bindings.MojoCodecError("Unexpected message name");
- break;
- }
- return null;
- }
-
- PingPongService get impl => _impl;
- set impl(PingPongService d) {
- assert(_impl == null);
- _impl = d;
- }
-
- String toString() {
- var superString = super.toString();
- return "PingPongServiceStub($superString)";
- }
-
- int get version => 0;
-}
-
-const int _PingPongClient_pongName = 0;
-
-abstract class PingPongClient {
- static const String serviceName = null;
- void pong(int pongValue);
-}
-
-
-class _PingPongClientProxyImpl extends bindings.Proxy {
- _PingPongClientProxyImpl.fromEndpoint(
- core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
-
- _PingPongClientProxyImpl.fromHandle(core.MojoHandle handle) :
- super.fromHandle(handle);
-
- _PingPongClientProxyImpl.unbound() : super.unbound();
-
- static _PingPongClientProxyImpl newFromEndpoint(
- core.MojoMessagePipeEndpoint endpoint) {
- assert(endpoint.setDescription("For _PingPongClientProxyImpl"));
- return new _PingPongClientProxyImpl.fromEndpoint(endpoint);
- }
-
- void handleResponse(bindings.ServiceMessage message) {
- switch (message.header.type) {
- default:
- proxyError("Unexpected message type: ${message.header.type}");
- close(immediate: true);
- break;
- }
- }
-
- String toString() {
- var superString = super.toString();
- return "_PingPongClientProxyImpl($superString)";
- }
-}
-
-
-class _PingPongClientProxyCalls implements PingPongClient {
- _PingPongClientProxyImpl _proxyImpl;
-
- _PingPongClientProxyCalls(this._proxyImpl);
- void pong(int pongValue) {
- if (!_proxyImpl.isBound) {
- _proxyImpl.proxyError("The Proxy is closed.");
- return;
- }
- var params = new _PingPongClientPongParams();
- params.pongValue = pongValue;
- _proxyImpl.sendMessage(params, _PingPongClient_pongName);
- }
-}
-
-
-class PingPongClientProxy implements bindings.ProxyBase {
- final bindings.Proxy impl;
- PingPongClient ptr;
-
- PingPongClientProxy(_PingPongClientProxyImpl proxyImpl) :
- impl = proxyImpl,
- ptr = new _PingPongClientProxyCalls(proxyImpl);
-
- PingPongClientProxy.fromEndpoint(
- core.MojoMessagePipeEndpoint endpoint) :
- impl = new _PingPongClientProxyImpl.fromEndpoint(endpoint) {
- ptr = new _PingPongClientProxyCalls(impl);
- }
-
- PingPongClientProxy.fromHandle(core.MojoHandle handle) :
- impl = new _PingPongClientProxyImpl.fromHandle(handle) {
- ptr = new _PingPongClientProxyCalls(impl);
- }
-
- PingPongClientProxy.unbound() :
- impl = new _PingPongClientProxyImpl.unbound() {
- ptr = new _PingPongClientProxyCalls(impl);
- }
-
- factory PingPongClientProxy.connectToService(
- bindings.ServiceConnector s, String url, [String serviceName]) {
- PingPongClientProxy p = new PingPongClientProxy.unbound();
- s.connectToService(url, p, serviceName);
- return p;
- }
-
- static PingPongClientProxy newFromEndpoint(
- core.MojoMessagePipeEndpoint endpoint) {
- assert(endpoint.setDescription("For PingPongClientProxy"));
- return new PingPongClientProxy.fromEndpoint(endpoint);
- }
-
- String get serviceName => PingPongClient.serviceName;
-
- Future close({bool immediate: false}) => impl.close(immediate: immediate);
-
- Future responseOrError(Future f) => impl.responseOrError(f);
-
- Future get errorFuture => impl.errorFuture;
-
- int get version => impl.version;
-
- Future<int> queryVersion() => impl.queryVersion();
-
- void requireVersion(int requiredVersion) {
- impl.requireVersion(requiredVersion);
- }
-
- String toString() {
- return "PingPongClientProxy($impl)";
- }
-}
-
-
-class PingPongClientStub extends bindings.Stub {
- PingPongClient _impl = null;
-
- PingPongClientStub.fromEndpoint(
- core.MojoMessagePipeEndpoint endpoint, [this._impl])
- : super.fromEndpoint(endpoint);
-
- PingPongClientStub.fromHandle(core.MojoHandle handle, [this._impl])
- : super.fromHandle(handle);
-
- PingPongClientStub.unbound() : super.unbound();
-
- static PingPongClientStub newFromEndpoint(
- core.MojoMessagePipeEndpoint endpoint) {
- assert(endpoint.setDescription("For PingPongClientStub"));
- return new PingPongClientStub.fromEndpoint(endpoint);
- }
-
-
-
- dynamic handleMessage(bindings.ServiceMessage message) {
- if (bindings.ControlMessageHandler.isControlMessage(message)) {
- return bindings.ControlMessageHandler.handleMessage(this,
- 0,
- message);
- }
- assert(_impl != null);
- switch (message.header.type) {
- case _PingPongClient_pongName:
- var params = _PingPongClientPongParams.deserialize(
+ case _MediaSink_pauseName:
+ var params = _MediaSinkPauseParams.deserialize(
message.payload);
- _impl.pong(params.pongValue);
+ _impl.pause();
break;
default:
throw new bindings.MojoCodecError("Unexpected message name");
@@ -1105,15 +1016,15 @@ class PingPongClientStub extends bindings.Stub {
return null;
}
- PingPongClient get impl => _impl;
- set impl(PingPongClient d) {
+ MediaSink get impl => _impl;
+ set impl(MediaSink d) {
assert(_impl == null);
_impl = d;
}
String toString() {
var superString = super.toString();
- return "PingPongClientStub($superString)";
+ return "MediaSinkStub($superString)";
}
int get version => 0;

Powered by Google App Engine
This is Rietveld 408576698