| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Audio rendering unit utilizing audio output stream provided by browser | 5 // Audio rendering unit utilizing audio output stream provided by browser |
| 6 // process through IPC. | 6 // process through IPC. |
| 7 // | 7 // |
| 8 // Relationship of classes. | 8 // Relationship of classes. |
| 9 // | 9 // |
| 10 // AudioRendererHost AudioRendererImpl | 10 // AudioRendererHost AudioRendererImpl |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 #include "media/base/filters.h" | 49 #include "media/base/filters.h" |
| 50 #include "media/filters/audio_renderer_base.h" | 50 #include "media/filters/audio_renderer_base.h" |
| 51 | 51 |
| 52 class AudioMessageFilter; | 52 class AudioMessageFilter; |
| 53 | 53 |
| 54 class AudioRendererImpl : public media::AudioRendererBase, | 54 class AudioRendererImpl : public media::AudioRendererBase, |
| 55 public AudioMessageFilter::Delegate, | 55 public AudioMessageFilter::Delegate, |
| 56 public MessageLoop::DestructionObserver { | 56 public MessageLoop::DestructionObserver { |
| 57 public: | 57 public: |
| 58 // Methods called on Render thread ------------------------------------------ | 58 // Methods called on Render thread ------------------------------------------ |
| 59 explicit AudioRendererImpl(AudioMessageFilter* filter); | 59 AudioRendererImpl(); |
| 60 virtual ~AudioRendererImpl(); | 60 virtual ~AudioRendererImpl(); |
| 61 | 61 |
| 62 // Methods called on IO thread ---------------------------------------------- | 62 // Methods called on IO thread ---------------------------------------------- |
| 63 // AudioMessageFilter::Delegate methods, called by AudioMessageFilter. | 63 // AudioMessageFilter::Delegate methods, called by AudioMessageFilter. |
| 64 virtual void OnRequestPacket(AudioBuffersState buffers_state); | 64 virtual void OnRequestPacket(AudioBuffersState buffers_state); |
| 65 virtual void OnStateChanged(AudioStreamState state); | 65 virtual void OnStateChanged(AudioStreamState state); |
| 66 virtual void OnCreated(base::SharedMemoryHandle handle, uint32 length); | 66 virtual void OnCreated(base::SharedMemoryHandle handle, uint32 length); |
| 67 virtual void OnLowLatencyCreated(base::SharedMemoryHandle handle, | 67 virtual void OnLowLatencyCreated(base::SharedMemoryHandle handle, |
| 68 base::SyncSocket::Handle socket_handle, | 68 base::SyncSocket::Handle socket_handle, |
| 69 uint32 length); | 69 uint32 length); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 void PlayTask(); | 107 void PlayTask(); |
| 108 void PauseTask(); | 108 void PauseTask(); |
| 109 void SeekTask(); | 109 void SeekTask(); |
| 110 void SetVolumeTask(double volume); | 110 void SetVolumeTask(double volume); |
| 111 void NotifyPacketReadyTask(); | 111 void NotifyPacketReadyTask(); |
| 112 void DestroyTask(); | 112 void DestroyTask(); |
| 113 | 113 |
| 114 // Called on IO thread when message loop is dying. | 114 // Called on IO thread when message loop is dying. |
| 115 virtual void WillDestroyCurrentMessageLoop(); | 115 virtual void WillDestroyCurrentMessageLoop(); |
| 116 | 116 |
| 117 void Send(IPC::Message* message); |
| 118 |
| 117 // Used to calculate audio delay given bytes. | 119 // Used to calculate audio delay given bytes. |
| 118 uint32 bytes_per_second_; | 120 uint32 bytes_per_second_; |
| 119 | 121 |
| 120 scoped_refptr<AudioMessageFilter> filter_; | |
| 121 | |
| 122 // ID of the stream created in the browser process. | 122 // ID of the stream created in the browser process. |
| 123 int32 stream_id_; | 123 int32 stream_id_; |
| 124 | 124 |
| 125 // Memory shared by the browser process for audio buffer. | 125 // Memory shared by the browser process for audio buffer. |
| 126 scoped_ptr<base::SharedMemory> shared_memory_; | 126 scoped_ptr<base::SharedMemory> shared_memory_; |
| 127 uint32 shared_memory_size_; | 127 uint32 shared_memory_size_; |
| 128 | 128 |
| 129 // Message loop for the IO thread. | 129 // Message loop for the IO thread. |
| 130 MessageLoop* io_loop_; | 130 MessageLoop* io_loop_; |
| 131 | 131 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 147 // State variables for prerolling. | 147 // State variables for prerolling. |
| 148 bool prerolling_; | 148 bool prerolling_; |
| 149 | 149 |
| 150 // Remaining bytes for prerolling to complete. | 150 // Remaining bytes for prerolling to complete. |
| 151 uint32 preroll_bytes_; | 151 uint32 preroll_bytes_; |
| 152 | 152 |
| 153 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); | 153 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); |
| 154 }; | 154 }; |
| 155 | 155 |
| 156 #endif // CONTENT_RENDERER_MEDIA_AUDIO_RENDERER_IMPL_H_ | 156 #endif // CONTENT_RENDERER_MEDIA_AUDIO_RENDERER_IMPL_H_ |
| OLD | NEW |