| 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 audio_track_mojom; | 5 library audio_track_mojom; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:mojo/bindings.dart' as bindings; | 9 import 'package:mojo/bindings.dart' as bindings; |
| 10 import 'package:mojo/core.dart' as core; | 10 import 'package:mojo/core.dart' as core; |
| 11 import 'package:mojo/mojo/bindings/types/mojom_types.mojom.dart' as mojom_types; |
| 12 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; |
| 11 import 'package:mojo_services/mojo/media/media_common.mojom.dart' as media_commo
n_mojom; | 13 import 'package:mojo_services/mojo/media/media_common.mojom.dart' as media_commo
n_mojom; |
| 12 import 'package:mojo_services/mojo/media/media_pipe.mojom.dart' as media_pipe_mo
jom; | 14 import 'package:mojo_services/mojo/media/media_pipe.mojom.dart' as media_pipe_mo
jom; |
| 13 import 'package:mojo_services/mojo/media/media_types.mojom.dart' as media_types_
mojom; | 15 import 'package:mojo_services/mojo/media/media_types.mojom.dart' as media_types_
mojom; |
| 14 import 'package:mojo_services/mojo/media/rate_control.mojom.dart' as rate_contro
l_mojom; | 16 import 'package:mojo_services/mojo/media/rate_control.mojom.dart' as rate_contro
l_mojom; |
| 15 | 17 |
| 16 | 18 |
| 17 | 19 |
| 18 class AudioTrackDescriptor extends bindings.Struct { | 20 class AudioTrackDescriptor extends bindings.Struct { |
| 19 static const List<bindings.StructDataHeader> kVersions = const [ | 21 static const List<bindings.StructDataHeader> kVersions = const [ |
| 20 const bindings.StructDataHeader(16, 0) | 22 const bindings.StructDataHeader(16, 0) |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 } | 94 } |
| 93 | 95 |
| 94 Map toJson() { | 96 Map toJson() { |
| 95 Map map = new Map(); | 97 Map map = new Map(); |
| 96 map["supportedMediaTypes"] = supportedMediaTypes; | 98 map["supportedMediaTypes"] = supportedMediaTypes; |
| 97 return map; | 99 return map; |
| 98 } | 100 } |
| 99 } | 101 } |
| 100 | 102 |
| 101 | 103 |
| 104 |
| 105 |
| 102 class AudioTrackConfiguration extends bindings.Struct { | 106 class AudioTrackConfiguration extends bindings.Struct { |
| 103 static const List<bindings.StructDataHeader> kVersions = const [ | 107 static const List<bindings.StructDataHeader> kVersions = const [ |
| 104 const bindings.StructDataHeader(32, 0) | 108 const bindings.StructDataHeader(32, 0) |
| 105 ]; | 109 ]; |
| 106 media_types_mojom.MediaType mediaType = null; | 110 media_types_mojom.MediaType mediaType = null; |
| 107 int maxFrames = 0; | 111 int maxFrames = 0; |
| 108 int audioFrameRatio = 1; | 112 int audioFrameRatio = 1; |
| 109 int mediaTimeRatio = 1; | 113 int mediaTimeRatio = 1; |
| 110 | 114 |
| 111 AudioTrackConfiguration() : super(kVersions.last.size); | 115 AudioTrackConfiguration() : super(kVersions.last.size); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 Map map = new Map(); | 191 Map map = new Map(); |
| 188 map["mediaType"] = mediaType; | 192 map["mediaType"] = mediaType; |
| 189 map["maxFrames"] = maxFrames; | 193 map["maxFrames"] = maxFrames; |
| 190 map["audioFrameRatio"] = audioFrameRatio; | 194 map["audioFrameRatio"] = audioFrameRatio; |
| 191 map["mediaTimeRatio"] = mediaTimeRatio; | 195 map["mediaTimeRatio"] = mediaTimeRatio; |
| 192 return map; | 196 return map; |
| 193 } | 197 } |
| 194 } | 198 } |
| 195 | 199 |
| 196 | 200 |
| 201 |
| 202 |
| 197 class _AudioTrackDescribeParams extends bindings.Struct { | 203 class _AudioTrackDescribeParams extends bindings.Struct { |
| 198 static const List<bindings.StructDataHeader> kVersions = const [ | 204 static const List<bindings.StructDataHeader> kVersions = const [ |
| 199 const bindings.StructDataHeader(8, 0) | 205 const bindings.StructDataHeader(8, 0) |
| 200 ]; | 206 ]; |
| 201 | 207 |
| 202 _AudioTrackDescribeParams() : super(kVersions.last.size); | 208 _AudioTrackDescribeParams() : super(kVersions.last.size); |
| 203 | 209 |
| 204 static _AudioTrackDescribeParams deserialize(bindings.Message message) { | 210 static _AudioTrackDescribeParams deserialize(bindings.Message message) { |
| 205 var decoder = new bindings.Decoder(message); | 211 var decoder = new bindings.Decoder(message); |
| 206 var result = decode(decoder); | 212 var result = decode(decoder); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 return "_AudioTrackDescribeParams("")"; | 251 return "_AudioTrackDescribeParams("")"; |
| 246 } | 252 } |
| 247 | 253 |
| 248 Map toJson() { | 254 Map toJson() { |
| 249 Map map = new Map(); | 255 Map map = new Map(); |
| 250 return map; | 256 return map; |
| 251 } | 257 } |
| 252 } | 258 } |
| 253 | 259 |
| 254 | 260 |
| 261 |
| 262 |
| 255 class AudioTrackDescribeResponseParams extends bindings.Struct { | 263 class AudioTrackDescribeResponseParams extends bindings.Struct { |
| 256 static const List<bindings.StructDataHeader> kVersions = const [ | 264 static const List<bindings.StructDataHeader> kVersions = const [ |
| 257 const bindings.StructDataHeader(16, 0) | 265 const bindings.StructDataHeader(16, 0) |
| 258 ]; | 266 ]; |
| 259 AudioTrackDescriptor descriptor = null; | 267 AudioTrackDescriptor descriptor = null; |
| 260 | 268 |
| 261 AudioTrackDescribeResponseParams() : super(kVersions.last.size); | 269 AudioTrackDescribeResponseParams() : super(kVersions.last.size); |
| 262 | 270 |
| 263 static AudioTrackDescribeResponseParams deserialize(bindings.Message message)
{ | 271 static AudioTrackDescribeResponseParams deserialize(bindings.Message message)
{ |
| 264 var decoder = new bindings.Decoder(message); | 272 var decoder = new bindings.Decoder(message); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 } | 321 } |
| 314 | 322 |
| 315 Map toJson() { | 323 Map toJson() { |
| 316 Map map = new Map(); | 324 Map map = new Map(); |
| 317 map["descriptor"] = descriptor; | 325 map["descriptor"] = descriptor; |
| 318 return map; | 326 return map; |
| 319 } | 327 } |
| 320 } | 328 } |
| 321 | 329 |
| 322 | 330 |
| 331 |
| 332 |
| 323 class _AudioTrackConfigureParams extends bindings.Struct { | 333 class _AudioTrackConfigureParams extends bindings.Struct { |
| 324 static const List<bindings.StructDataHeader> kVersions = const [ | 334 static const List<bindings.StructDataHeader> kVersions = const [ |
| 325 const bindings.StructDataHeader(24, 0) | 335 const bindings.StructDataHeader(24, 0) |
| 326 ]; | 336 ]; |
| 327 AudioTrackConfiguration configuration = null; | 337 AudioTrackConfiguration configuration = null; |
| 328 Object pipe = null; | 338 Object pipe = null; |
| 329 | 339 |
| 330 _AudioTrackConfigureParams() : super(kVersions.last.size); | 340 _AudioTrackConfigureParams() : super(kVersions.last.size); |
| 331 | 341 |
| 332 static _AudioTrackConfigureParams deserialize(bindings.Message message) { | 342 static _AudioTrackConfigureParams deserialize(bindings.Message message) { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 "pipe: $pipe" ")"; | 398 "pipe: $pipe" ")"; |
| 389 } | 399 } |
| 390 | 400 |
| 391 Map toJson() { | 401 Map toJson() { |
| 392 throw new bindings.MojoCodecError( | 402 throw new bindings.MojoCodecError( |
| 393 'Object containing handles cannot be encoded to JSON.'); | 403 'Object containing handles cannot be encoded to JSON.'); |
| 394 } | 404 } |
| 395 } | 405 } |
| 396 | 406 |
| 397 | 407 |
| 408 |
| 409 |
| 398 class _AudioTrackGetRateControlParams extends bindings.Struct { | 410 class _AudioTrackGetRateControlParams extends bindings.Struct { |
| 399 static const List<bindings.StructDataHeader> kVersions = const [ | 411 static const List<bindings.StructDataHeader> kVersions = const [ |
| 400 const bindings.StructDataHeader(16, 0) | 412 const bindings.StructDataHeader(16, 0) |
| 401 ]; | 413 ]; |
| 402 Object rateControl = null; | 414 Object rateControl = null; |
| 403 | 415 |
| 404 _AudioTrackGetRateControlParams() : super(kVersions.last.size); | 416 _AudioTrackGetRateControlParams() : super(kVersions.last.size); |
| 405 | 417 |
| 406 static _AudioTrackGetRateControlParams deserialize(bindings.Message message) { | 418 static _AudioTrackGetRateControlParams deserialize(bindings.Message message) { |
| 407 var decoder = new bindings.Decoder(message); | 419 var decoder = new bindings.Decoder(message); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 return "_AudioTrackGetRateControlParams(" | 465 return "_AudioTrackGetRateControlParams(" |
| 454 "rateControl: $rateControl" ")"; | 466 "rateControl: $rateControl" ")"; |
| 455 } | 467 } |
| 456 | 468 |
| 457 Map toJson() { | 469 Map toJson() { |
| 458 throw new bindings.MojoCodecError( | 470 throw new bindings.MojoCodecError( |
| 459 'Object containing handles cannot be encoded to JSON.'); | 471 'Object containing handles cannot be encoded to JSON.'); |
| 460 } | 472 } |
| 461 } | 473 } |
| 462 | 474 |
| 475 |
| 476 |
| 477 |
| 463 const int _AudioTrack_describeName = 0; | 478 const int _AudioTrack_describeName = 0; |
| 464 const int _AudioTrack_configureName = 1; | 479 const int _AudioTrack_configureName = 1; |
| 465 const int _AudioTrack_getRateControlName = 2; | 480 const int _AudioTrack_getRateControlName = 2; |
| 466 | 481 |
| 482 |
| 483 |
| 484 class _AudioTrackServiceDescription implements service_describer.ServiceDescript
ion { |
| 485 dynamic getTopLevelInterface([Function responseFactory]) => null; |
| 486 |
| 487 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => null; |
| 488 |
| 489 dynamic getAllTypeDefinitions([Function responseFactory]) => null; |
| 490 } |
| 491 |
| 467 abstract class AudioTrack { | 492 abstract class AudioTrack { |
| 468 static const String serviceName = null; | 493 static const String serviceName = null; |
| 469 dynamic describe([Function responseFactory = null]); | 494 dynamic describe([Function responseFactory = null]); |
| 470 void configure(AudioTrackConfiguration configuration, Object pipe); | 495 void configure(AudioTrackConfiguration configuration, Object pipe); |
| 471 void getRateControl(Object rateControl); | 496 void getRateControl(Object rateControl); |
| 472 } | 497 } |
| 473 | 498 |
| 474 | 499 |
| 475 class _AudioTrackProxyImpl extends bindings.Proxy { | 500 class _AudioTrackProxyImpl extends bindings.Proxy { |
| 476 _AudioTrackProxyImpl.fromEndpoint( | 501 _AudioTrackProxyImpl.fromEndpoint( |
| 477 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 502 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 478 | 503 |
| 479 _AudioTrackProxyImpl.fromHandle(core.MojoHandle handle) : | 504 _AudioTrackProxyImpl.fromHandle(core.MojoHandle handle) : |
| 480 super.fromHandle(handle); | 505 super.fromHandle(handle); |
| 481 | 506 |
| 482 _AudioTrackProxyImpl.unbound() : super.unbound(); | 507 _AudioTrackProxyImpl.unbound() : super.unbound(); |
| 483 | 508 |
| 484 static _AudioTrackProxyImpl newFromEndpoint( | 509 static _AudioTrackProxyImpl newFromEndpoint( |
| 485 core.MojoMessagePipeEndpoint endpoint) { | 510 core.MojoMessagePipeEndpoint endpoint) { |
| 486 assert(endpoint.setDescription("For _AudioTrackProxyImpl")); | 511 assert(endpoint.setDescription("For _AudioTrackProxyImpl")); |
| 487 return new _AudioTrackProxyImpl.fromEndpoint(endpoint); | 512 return new _AudioTrackProxyImpl.fromEndpoint(endpoint); |
| 488 } | 513 } |
| 489 | 514 |
| 515 service_describer.ServiceDescription get serviceDescription => |
| 516 new _AudioTrackServiceDescription(); |
| 517 |
| 490 void handleResponse(bindings.ServiceMessage message) { | 518 void handleResponse(bindings.ServiceMessage message) { |
| 491 switch (message.header.type) { | 519 switch (message.header.type) { |
| 492 case _AudioTrack_describeName: | 520 case _AudioTrack_describeName: |
| 493 var r = AudioTrackDescribeResponseParams.deserialize( | 521 var r = AudioTrackDescribeResponseParams.deserialize( |
| 494 message.payload); | 522 message.payload); |
| 495 if (!message.header.hasRequestId) { | 523 if (!message.header.hasRequestId) { |
| 496 proxyError("Expected a message with a valid request Id."); | 524 proxyError("Expected a message with a valid request Id."); |
| 497 return; | 525 return; |
| 498 } | 526 } |
| 499 Completer c = completerMap[message.header.requestId]; | 527 Completer c = completerMap[message.header.requestId]; |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 assert(_impl == null); | 721 assert(_impl == null); |
| 694 _impl = d; | 722 _impl = d; |
| 695 } | 723 } |
| 696 | 724 |
| 697 String toString() { | 725 String toString() { |
| 698 var superString = super.toString(); | 726 var superString = super.toString(); |
| 699 return "AudioTrackStub($superString)"; | 727 return "AudioTrackStub($superString)"; |
| 700 } | 728 } |
| 701 | 729 |
| 702 int get version => 0; | 730 int get version => 0; |
| 731 |
| 732 service_describer.ServiceDescription get serviceDescription => |
| 733 new _AudioTrackServiceDescription(); |
| 703 } | 734 } |
| 704 | 735 |
| 705 | 736 |
| 737 |
| OLD | NEW |