| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 library media_demux_mojom; | 5 library media_demux_mojom; |
| 6 import 'dart:async'; | 6 import 'dart:async'; |
| 7 import 'package:mojo/bindings.dart' as bindings; | 7 import 'package:mojo/bindings.dart' as bindings; |
| 8 import 'package:mojo/core.dart' as core; | 8 import 'package:mojo/core.dart' as core; |
| 9 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; | 9 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; |
| 10 import 'package:mojo_services/mojo/media/media_metadata.mojom.dart' as media_met
adata_mojom; | 10 import 'package:mojo_services/mojo/media/media_metadata.mojom.dart' as media_met
adata_mojom; |
| (...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 static const String serviceName = null; | 785 static const String serviceName = null; |
| 786 dynamic describe([Function responseFactory = null]); | 786 dynamic describe([Function responseFactory = null]); |
| 787 void getProducer(int streamIndex, Object producer); | 787 void getProducer(int streamIndex, Object producer); |
| 788 dynamic getMetadata(int versionLastSeen,[Function responseFactory = null]); | 788 dynamic getMetadata(int versionLastSeen,[Function responseFactory = null]); |
| 789 dynamic prime([Function responseFactory = null]); | 789 dynamic prime([Function responseFactory = null]); |
| 790 dynamic flush([Function responseFactory = null]); | 790 dynamic flush([Function responseFactory = null]); |
| 791 dynamic seek(int position,[Function responseFactory = null]); | 791 dynamic seek(int position,[Function responseFactory = null]); |
| 792 static const int kInitialMetadata = 0; | 792 static const int kInitialMetadata = 0; |
| 793 } | 793 } |
| 794 | 794 |
| 795 | 795 class _MediaDemuxProxyControl |
| 796 class _MediaDemuxProxyControl extends bindings.ProxyMessageHandler | 796 extends bindings.ProxyMessageHandler |
| 797 implements bindings.ProxyControl { | 797 implements bindings.ProxyControl { |
| 798 _MediaDemuxProxyControl.fromEndpoint( | 798 _MediaDemuxProxyControl.fromEndpoint( |
| 799 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 799 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 800 | 800 |
| 801 _MediaDemuxProxyControl.fromHandle( | 801 _MediaDemuxProxyControl.fromHandle( |
| 802 core.MojoHandle handle) : super.fromHandle(handle); | 802 core.MojoHandle handle) : super.fromHandle(handle); |
| 803 | 803 |
| 804 _MediaDemuxProxyControl.unbound() : super.unbound(); | 804 _MediaDemuxProxyControl.unbound() : super.unbound(); |
| 805 | 805 |
| 806 service_describer.ServiceDescription get serviceDescription => | 806 service_describer.ServiceDescription get serviceDescription => |
| 807 new _MediaDemuxServiceDescription(); | 807 new _MediaDemuxServiceDescription(); |
| 808 | 808 |
| 809 String get serviceName => MediaDemux.serviceName; | 809 String get serviceName => MediaDemux.serviceName; |
| 810 | 810 |
| 811 @override | |
| 812 void handleResponse(bindings.ServiceMessage message) { | 811 void handleResponse(bindings.ServiceMessage message) { |
| 813 switch (message.header.type) { | 812 switch (message.header.type) { |
| 814 case _mediaDemuxMethodDescribeName: | 813 case _mediaDemuxMethodDescribeName: |
| 815 var r = MediaDemuxDescribeResponseParams.deserialize( | 814 var r = MediaDemuxDescribeResponseParams.deserialize( |
| 816 message.payload); | 815 message.payload); |
| 817 if (!message.header.hasRequestId) { | 816 if (!message.header.hasRequestId) { |
| 818 proxyError("Expected a message with a valid request Id."); | 817 proxyError("Expected a message with a valid request Id."); |
| 819 return; | 818 return; |
| 820 } | 819 } |
| 821 Completer c = completerMap[message.header.requestId]; | 820 Completer c = completerMap[message.header.requestId]; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 918 } | 917 } |
| 919 } | 918 } |
| 920 | 919 |
| 921 @override | 920 @override |
| 922 String toString() { | 921 String toString() { |
| 923 var superString = super.toString(); | 922 var superString = super.toString(); |
| 924 return "_MediaDemuxProxyControl($superString)"; | 923 return "_MediaDemuxProxyControl($superString)"; |
| 925 } | 924 } |
| 926 } | 925 } |
| 927 | 926 |
| 928 | 927 class MediaDemuxProxy |
| 929 class MediaDemuxProxy extends bindings.Proxy | 928 extends bindings.Proxy |
| 930 implements MediaDemux { | 929 implements MediaDemux { |
| 931 MediaDemuxProxy.fromEndpoint( | 930 MediaDemuxProxy.fromEndpoint( |
| 932 core.MojoMessagePipeEndpoint endpoint) | 931 core.MojoMessagePipeEndpoint endpoint) |
| 933 : super(new _MediaDemuxProxyControl.fromEndpoint(endpoint)); | 932 : super(new _MediaDemuxProxyControl.fromEndpoint(endpoint)); |
| 934 | 933 |
| 935 MediaDemuxProxy.fromHandle(core.MojoHandle handle) | 934 MediaDemuxProxy.fromHandle(core.MojoHandle handle) |
| 936 : super(new _MediaDemuxProxyControl.fromHandle(handle)); | 935 : super(new _MediaDemuxProxyControl.fromHandle(handle)); |
| 937 | 936 |
| 938 MediaDemuxProxy.unbound() | 937 MediaDemuxProxy.unbound() |
| 939 : super(new _MediaDemuxProxyControl.unbound()); | 938 : super(new _MediaDemuxProxyControl.unbound()); |
| 940 | 939 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1000 var params = new _MediaDemuxSeekParams(); | 999 var params = new _MediaDemuxSeekParams(); |
| 1001 params.position = position; | 1000 params.position = position; |
| 1002 return ctrl.sendMessageWithRequestId( | 1001 return ctrl.sendMessageWithRequestId( |
| 1003 params, | 1002 params, |
| 1004 _mediaDemuxMethodSeekName, | 1003 _mediaDemuxMethodSeekName, |
| 1005 -1, | 1004 -1, |
| 1006 bindings.MessageHeader.kMessageExpectsResponse); | 1005 bindings.MessageHeader.kMessageExpectsResponse); |
| 1007 } | 1006 } |
| 1008 } | 1007 } |
| 1009 | 1008 |
| 1010 | 1009 class _MediaDemuxStubControl |
| 1011 class MediaDemuxStub extends bindings.Stub { | 1010 extends bindings.StubMessageHandler |
| 1011 implements bindings.StubControl<MediaDemux> { |
| 1012 MediaDemux _impl; | 1012 MediaDemux _impl; |
| 1013 | 1013 |
| 1014 MediaDemuxStub.fromEndpoint( | 1014 _MediaDemuxStubControl.fromEndpoint( |
| 1015 core.MojoMessagePipeEndpoint endpoint, [MediaDemux impl]) | 1015 core.MojoMessagePipeEndpoint endpoint, [MediaDemux impl]) |
| 1016 : super.fromEndpoint(endpoint, autoBegin: impl != null) { | 1016 : super.fromEndpoint(endpoint, autoBegin: impl != null) { |
| 1017 _impl = impl; | 1017 _impl = impl; |
| 1018 } | 1018 } |
| 1019 | 1019 |
| 1020 MediaDemuxStub.fromHandle( | 1020 _MediaDemuxStubControl.fromHandle( |
| 1021 core.MojoHandle handle, [MediaDemux impl]) | 1021 core.MojoHandle handle, [MediaDemux impl]) |
| 1022 : super.fromHandle(handle, autoBegin: impl != null) { | 1022 : super.fromHandle(handle, autoBegin: impl != null) { |
| 1023 _impl = impl; | 1023 _impl = impl; |
| 1024 } | 1024 } |
| 1025 | 1025 |
| 1026 MediaDemuxStub.unbound([this._impl]) : super.unbound(); | 1026 _MediaDemuxStubControl.unbound([this._impl]) : super.unbound(); |
| 1027 | |
| 1028 static MediaDemuxStub newFromEndpoint( | |
| 1029 core.MojoMessagePipeEndpoint endpoint) { | |
| 1030 assert(endpoint.setDescription("For MediaDemuxStub")); | |
| 1031 return new MediaDemuxStub.fromEndpoint(endpoint); | |
| 1032 } | |
| 1033 | 1027 |
| 1034 | 1028 |
| 1035 MediaDemuxDescribeResponseParams _mediaDemuxDescribeResponseParamsFactory(List
<media_types_mojom.MediaType> streamTypes) { | 1029 MediaDemuxDescribeResponseParams _mediaDemuxDescribeResponseParamsFactory(List
<media_types_mojom.MediaType> streamTypes) { |
| 1036 var result = new MediaDemuxDescribeResponseParams(); | 1030 var result = new MediaDemuxDescribeResponseParams(); |
| 1037 result.streamTypes = streamTypes; | 1031 result.streamTypes = streamTypes; |
| 1038 return result; | 1032 return result; |
| 1039 } | 1033 } |
| 1040 MediaDemuxGetMetadataResponseParams _mediaDemuxGetMetadataResponseParamsFactor
y(int version, media_metadata_mojom.MediaMetadata metadata) { | 1034 MediaDemuxGetMetadataResponseParams _mediaDemuxGetMetadataResponseParamsFactor
y(int version, media_metadata_mojom.MediaMetadata metadata) { |
| 1041 var result = new MediaDemuxGetMetadataResponseParams(); | 1035 var result = new MediaDemuxGetMetadataResponseParams(); |
| 1042 result.version = version; | 1036 result.version = version; |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1194 } | 1188 } |
| 1195 | 1189 |
| 1196 @override | 1190 @override |
| 1197 void bind(core.MojoMessagePipeEndpoint endpoint) { | 1191 void bind(core.MojoMessagePipeEndpoint endpoint) { |
| 1198 super.bind(endpoint); | 1192 super.bind(endpoint); |
| 1199 if (!isOpen && (_impl != null)) { | 1193 if (!isOpen && (_impl != null)) { |
| 1200 beginHandlingEvents(); | 1194 beginHandlingEvents(); |
| 1201 } | 1195 } |
| 1202 } | 1196 } |
| 1203 | 1197 |
| 1198 @override |
| 1204 String toString() { | 1199 String toString() { |
| 1205 var superString = super.toString(); | 1200 var superString = super.toString(); |
| 1206 return "MediaDemuxStub($superString)"; | 1201 return "_MediaDemuxStubControl($superString)"; |
| 1207 } | 1202 } |
| 1208 | 1203 |
| 1209 int get version => 0; | 1204 int get version => 0; |
| 1210 | 1205 |
| 1211 static service_describer.ServiceDescription _cachedServiceDescription; | 1206 static service_describer.ServiceDescription _cachedServiceDescription; |
| 1212 static service_describer.ServiceDescription get serviceDescription { | 1207 static service_describer.ServiceDescription get serviceDescription { |
| 1213 if (_cachedServiceDescription == null) { | 1208 if (_cachedServiceDescription == null) { |
| 1214 _cachedServiceDescription = new _MediaDemuxServiceDescription(); | 1209 _cachedServiceDescription = new _MediaDemuxServiceDescription(); |
| 1215 } | 1210 } |
| 1216 return _cachedServiceDescription; | 1211 return _cachedServiceDescription; |
| 1217 } | 1212 } |
| 1218 } | 1213 } |
| 1219 | 1214 |
| 1215 class MediaDemuxStub |
| 1216 extends bindings.Stub<MediaDemux> |
| 1217 implements MediaDemux { |
| 1218 MediaDemuxStub.fromEndpoint( |
| 1219 core.MojoMessagePipeEndpoint endpoint, [MediaDemux impl]) |
| 1220 : super(new _MediaDemuxStubControl.fromEndpoint(endpoint, impl)); |
| 1221 |
| 1222 MediaDemuxStub.fromHandle( |
| 1223 core.MojoHandle handle, [MediaDemux impl]) |
| 1224 : super(new _MediaDemuxStubControl.fromHandle(handle, impl)); |
| 1225 |
| 1226 MediaDemuxStub.unbound([MediaDemux impl]) |
| 1227 : super(new _MediaDemuxStubControl.unbound(impl)); |
| 1228 |
| 1229 static MediaDemuxStub newFromEndpoint( |
| 1230 core.MojoMessagePipeEndpoint endpoint) { |
| 1231 assert(endpoint.setDescription("For MediaDemuxStub")); |
| 1232 return new MediaDemuxStub.fromEndpoint(endpoint); |
| 1233 } |
| 1234 |
| 1235 static service_describer.ServiceDescription get serviceDescription => |
| 1236 _MediaDemuxStubControl.serviceDescription; |
| 1237 |
| 1238 |
| 1239 dynamic describe([Function responseFactory = null]) { |
| 1240 return impl.describe(responseFactory); |
| 1241 } |
| 1242 void getProducer(int streamIndex, Object producer) { |
| 1243 return impl.getProducer(streamIndex, producer); |
| 1244 } |
| 1245 dynamic getMetadata(int versionLastSeen,[Function responseFactory = null]) { |
| 1246 return impl.getMetadata(versionLastSeen,responseFactory); |
| 1247 } |
| 1248 dynamic prime([Function responseFactory = null]) { |
| 1249 return impl.prime(responseFactory); |
| 1250 } |
| 1251 dynamic flush([Function responseFactory = null]) { |
| 1252 return impl.flush(responseFactory); |
| 1253 } |
| 1254 dynamic seek(int position,[Function responseFactory = null]) { |
| 1255 return impl.seek(position,responseFactory); |
| 1256 } |
| 1257 } |
| 1258 |
| 1220 | 1259 |
| 1221 | 1260 |
| OLD | NEW |