Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Side by Side Diff: media/audio/audio_output_mixer.h

Issue 10466007: Fix wrong timing when audio is muted. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | media/audio/audio_output_mixer.cc » ('j') | media/audio/audio_output_mixer.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // AudioOutputMixer is a class that implements browser-side audio mixer. 5 // AudioOutputMixer is a class that implements browser-side audio mixer.
6 // AudioOutputMixer implements both AudioOutputDispatcher and 6 // AudioOutputMixer implements both AudioOutputDispatcher and
7 // AudioSourceCallback interfaces. 7 // AudioSourceCallback interfaces.
8 8
9 #ifndef MEDIA_AUDIO_AUDIO_OUTPUT_MIXER_H_ 9 #ifndef MEDIA_AUDIO_AUDIO_OUTPUT_MIXER_H_
10 #define MEDIA_AUDIO_AUDIO_OUTPUT_MIXER_H_ 10 #define MEDIA_AUDIO_AUDIO_OUTPUT_MIXER_H_
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 int pending_bytes; 70 int pending_bytes;
71 }; 71 };
72 typedef std::map<AudioOutputProxy*, ProxyData> ProxyMap; 72 typedef std::map<AudioOutputProxy*, ProxyData> ProxyMap;
73 ProxyMap proxies_; 73 ProxyMap proxies_;
74 74
75 // Physical stream for this mixer. 75 // Physical stream for this mixer.
76 scoped_ptr<AudioOutputStream> physical_stream_; 76 scoped_ptr<AudioOutputStream> physical_stream_;
77 77
78 // Temporary buffer used when mixing. Allocated in the constructor 78 // Temporary buffer used when mixing. Allocated in the constructor
79 // to avoid constant allocation/deallocation in the callback. 79 // to avoid constant allocation/deallocation in the callback.
80 // Low-level multimedia code may work better when data is aligned, as it can
81 // use SSEx/AVX intrinsics. We don't want to use platform-specific aligned
82 // memory allocator, it does not work well with scoped_ptr. Just allocate
83 // slightly more and use raw pointer to the aligned data.
80 scoped_array<uint8> mixer_data_; 84 scoped_array<uint8> mixer_data_;
85 uint8* aligned_mixer_data_;
81 86
82 // Used to post delayed tasks to ourselves that we cancel inside Shutdown(). 87 // Used to post delayed tasks to ourselves that we cancel inside Shutdown().
83 base::WeakPtrFactory<AudioOutputMixer> weak_this_; 88 base::WeakPtrFactory<AudioOutputMixer> weak_this_;
84 base::DelayTimer<AudioOutputMixer> close_timer_; 89 base::DelayTimer<AudioOutputMixer> close_timer_;
85 90
86 // Size of data in all in-flight buffers. 91 // Size of data in all in-flight buffers.
87 int pending_bytes_; 92 int pending_bytes_;
88 93
89 DISALLOW_COPY_AND_ASSIGN(AudioOutputMixer); 94 DISALLOW_COPY_AND_ASSIGN(AudioOutputMixer);
90 }; 95 };
91 96
92 } // namespace media 97 } // namespace media
93 98
94 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_MIXER_H_ 99 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_MIXER_H_
OLDNEW
« no previous file with comments | « no previous file | media/audio/audio_output_mixer.cc » ('j') | media/audio/audio_output_mixer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698