| 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"; | |
| 9 import "mojo/services/media/common/interfaces/media_transport.mojom"; | |
| 10 import "mojo/services/media/common/interfaces/media_types.mojom"; | |
| 11 import "mojo/services/media/core/interfaces/timeline_controller.mojom"; | |
| 12 | |
| 13 struct AudioTrackDescriptor { | |
| 14 // The track supports the union of all these media type sets. | |
| 15 array<MediaTypeSet> supported_media_types; | |
| 16 }; | |
| 17 | |
| 18 struct AudioTrackConfiguration { | |
| 19 // The media type to use. | |
| 20 MediaType media_type; | |
| 21 | |
| 22 // Ratio of audio frames to media time ticks. | |
| 23 // | |
| 24 // Presentation time stamps on audio packets are expressed in units of media | |
| 25 // time ticks. Many users will choose to use units of audio frames to express | |
| 26 // their media time, and can simply leave this ratio at the default of 1:1. | |
| 27 // For some, however, it may be more convenient to use different units for | |
| 28 // media time. For example, if the audio frame rate was 48KHz, and the time | |
| 29 // stamps are expressed in 90KHz units (the units used by MPEG-2 Program | |
| 30 // Stream timestamps), the ratio should be set to 48000:90000 (aka, 8:15). | |
| 31 // IOW - audio_frame_ratio would be set to 8 and media_time_ratio would be set | |
| 32 // to 15. | |
| 33 // | |
| 34 // Neither of these values may be 0. A configuration error will occur if they | |
| 35 // are. | |
| 36 uint32 audio_frame_ratio = 1; | |
| 37 uint32 media_time_ratio = 1; | |
| 38 }; | |
| 39 | |
| 40 interface AudioTrack { | 8 interface AudioTrack { |
| 41 // A special value which will always cause a track to become explicitly muted. | 9 // A special value which will always cause a track to become explicitly muted. |
| 42 const float kMutedGain = -160.0; | 10 const float kMutedGain = -160.0; |
| 43 | 11 |
| 44 // The maximum permitted above-unity gain. | 12 // The maximum permitted above-unity gain. |
| 45 const float kMaxGain = 20.0; | 13 const float kMaxGain = 20.0; |
| 46 | 14 |
| 47 // Get the descriptor. | |
| 48 Describe() => (AudioTrackDescriptor descriptor); | |
| 49 | |
| 50 // Set the configuration, receive a pipe to send data to in return. | |
| 51 Configure(AudioTrackConfiguration configuration, MediaConsumer& pipe); | |
| 52 | |
| 53 // Request the timeline control site for this AudioTrack | |
| 54 GetTimelineControlSite(MediaTimelineControlSite& timeline_control_site); | |
| 55 | |
| 56 // Sets the current gain/attenuation of the track, expressed in dB. Legal | 15 // Sets the current gain/attenuation of the track, expressed in dB. Legal |
| 57 // values are in the range [-inf, 20.0]. Any value less than or equal to the | 16 // values are in the range [-inf, 20.0]. Any value less than or equal to the |
| 58 // constant kMutedGain will result in the track becoming explicitly muted | 17 // constant kMutedGain will result in the track becoming explicitly muted |
| 59 // (regardless of its underlying resolution or intensity). | 18 // (regardless of its underlying resolution or intensity). |
| 60 SetGain(float db_gain); | 19 SetGain(float db_gain); |
| 61 }; | 20 }; |
| OLD | NEW |