| 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 #ifndef SERVICES_MEDIA_AUDIO_AUDIO_TRACK_IMPL_H_ | 5 #ifndef SERVICES_MEDIA_AUDIO_AUDIO_TRACK_IMPL_H_ |
| 6 #define SERVICES_MEDIA_AUDIO_AUDIO_TRACK_IMPL_H_ | 6 #define SERVICES_MEDIA_AUDIO_AUDIO_TRACK_IMPL_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // important for the mixing process. | 43 // important for the mixing process. |
| 44 void SnapshotRateTrans(LinearTransform* out, uint32_t* generation = nullptr) { | 44 void SnapshotRateTrans(LinearTransform* out, uint32_t* generation = nullptr) { |
| 45 rate_control_.SnapshotCurrentTransform(out, generation); | 45 rate_control_.SnapshotCurrentTransform(out, generation); |
| 46 } | 46 } |
| 47 | 47 |
| 48 const LinearTransform::Ratio& FractionalFrameToMediaTimeRatio() const { | 48 const LinearTransform::Ratio& FractionalFrameToMediaTimeRatio() const { |
| 49 return frame_to_media_ratio_; | 49 return frame_to_media_ratio_; |
| 50 } | 50 } |
| 51 | 51 |
| 52 uint32_t BytesPerFrame() const { return bytes_per_frame_; } | 52 uint32_t BytesPerFrame() const { return bytes_per_frame_; } |
| 53 const LpcmMediaTypeDetailsPtr& Format() const { return format_; } | 53 const AudioMediaTypeDetailsPtr& Format() const { return format_; } |
| 54 float DbGain() const { return db_gain_; } | 54 float DbGain() const { return db_gain_; } |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 friend class AudioPipe; | 57 friend class AudioPipe; |
| 58 | 58 |
| 59 AudioTrackImpl(InterfaceRequest<AudioTrack> track, | 59 AudioTrackImpl(InterfaceRequest<AudioTrack> track, |
| 60 AudioServerImpl* owner); | 60 AudioServerImpl* owner); |
| 61 | 61 |
| 62 // Implementation of AudioTrack interface. | 62 // Implementation of AudioTrack interface. |
| 63 void Describe(const DescribeCallback& cbk) override; | 63 void Describe(const DescribeCallback& cbk) override; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 76 void OnPacketReceived(AudioPipe::AudioPacketRefPtr packet); | 76 void OnPacketReceived(AudioPipe::AudioPacketRefPtr packet); |
| 77 bool OnFlushRequested(const MediaConsumer::FlushCallback& cbk); | 77 bool OnFlushRequested(const MediaConsumer::FlushCallback& cbk); |
| 78 | 78 |
| 79 AudioTrackImplWeakPtr weak_this_; | 79 AudioTrackImplWeakPtr weak_this_; |
| 80 AudioServerImpl* owner_; | 80 AudioServerImpl* owner_; |
| 81 Binding<AudioTrack> binding_; | 81 Binding<AudioTrack> binding_; |
| 82 AudioPipe pipe_; | 82 AudioPipe pipe_; |
| 83 RateControlBase rate_control_; | 83 RateControlBase rate_control_; |
| 84 LinearTransform::Ratio frame_to_media_ratio_; | 84 LinearTransform::Ratio frame_to_media_ratio_; |
| 85 uint32_t bytes_per_frame_ = 1; | 85 uint32_t bytes_per_frame_ = 1; |
| 86 LpcmMediaTypeDetailsPtr format_; | 86 AudioMediaTypeDetailsPtr format_; |
| 87 AudioTrackToOutputLinkSet outputs_; | 87 AudioTrackToOutputLinkSet outputs_; |
| 88 float db_gain_ = 0.0; | 88 float db_gain_ = 0.0; |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 } // namespace audio | 91 } // namespace audio |
| 92 } // namespace media | 92 } // namespace media |
| 93 } // namespace mojo | 93 } // namespace mojo |
| 94 | 94 |
| 95 #endif // SERVICES_MEDIA_AUDIO_AUDIO_TRACK_IMPL_H_ | 95 #endif // SERVICES_MEDIA_AUDIO_AUDIO_TRACK_IMPL_H_ |
| OLD | NEW |