summaryrefslogtreecommitdiffstats
path: root/media/audio
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-08 18:58:51 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-08 18:58:51 +0000
commitd3c8aa84c5bf94c58b88b35d169694837cb454e5 (patch)
tree658c8300583e4adb5148c0d093677bf14690e28c /media/audio
parent4fbd79f46b1e5c580238c3cf0a8532144019e7d0 (diff)
downloadchromium_src-d3c8aa84c5bf94c58b88b35d169694837cb454e5.zip
chromium_src-d3c8aa84c5bf94c58b88b35d169694837cb454e5.tar.gz
chromium_src-d3c8aa84c5bf94c58b88b35d169694837cb454e5.tar.bz2
Revert r95841 due to failing media_unittests on linux_shared bot.
TBR=fischman@chromium.org Review URL: http://codereview.chromium.org/7601002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95846 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio')
-rw-r--r--media/audio/audio_buffers_state.h5
-rw-r--r--media/audio/audio_input_controller.h8
-rw-r--r--media/audio/audio_input_controller_unittest.cc2
-rw-r--r--media/audio/audio_io.h8
-rw-r--r--media/audio/audio_manager.h4
-rw-r--r--media/audio/audio_manager_base.h4
-rw-r--r--media/audio/audio_output_controller.h2
-rw-r--r--media/audio/audio_output_dispatcher.h2
-rw-r--r--media/audio/audio_output_proxy.h4
-rw-r--r--media/audio/audio_parameters.h7
-rw-r--r--media/audio/audio_util.h29
-rw-r--r--media/audio/fake_audio_output_stream.h2
-rw-r--r--media/audio/linux/alsa_output.h5
-rw-r--r--media/audio/linux/alsa_wrapper.h3
-rw-r--r--media/audio/linux/audio_manager_linux.h2
-rw-r--r--media/audio/simple_sources.h7
16 files changed, 44 insertions, 50 deletions
diff --git a/media/audio/audio_buffers_state.h b/media/audio/audio_buffers_state.h
index 796c081..e3a2faf 100644
--- a/media/audio/audio_buffers_state.h
+++ b/media/audio/audio_buffers_state.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -6,12 +6,11 @@
#define MEDIA_AUDIO_AUDIO_BUFFERS_STATE_H_
#include "base/time.h"
-#include "media/base/media_export.h"
// AudioBuffersState struct stores current state of audio buffers along with
// the timestamp of the moment this state corresponds to. It is used for audio
// synchronization.
-struct MEDIA_EXPORT AudioBuffersState {
+struct AudioBuffersState {
AudioBuffersState();
AudioBuffersState(int pending_bytes, int hardware_delay_bytes);
diff --git a/media/audio/audio_input_controller.h b/media/audio/audio_input_controller.h
index 22f6ffe..164b09f 100644
--- a/media/audio/audio_input_controller.h
+++ b/media/audio/audio_input_controller.h
@@ -35,7 +35,7 @@
//
namespace media {
-class MEDIA_EXPORT AudioInputController
+class AudioInputController
: public base::RefCountedThreadSafe<AudioInputController>,
public AudioInputStream::AudioInputCallback {
public:
@@ -99,8 +99,10 @@ class MEDIA_EXPORT AudioInputController
// Sets the factory used by the static method Create. AudioInputController
// does not take ownership of |factory|. A value of NULL results in an
// AudioInputController being created directly.
- static void set_factory_for_testing(Factory* factory) { factory_ = factory; }
- AudioInputStream* stream_for_testing() { return stream_; }
+#if defined(UNIT_TEST)
+ static void set_factory(Factory* factory) { factory_ = factory; }
+ AudioInputStream* stream() { return stream_; }
+#endif
// Starts recording in this audio input stream.
virtual void Record();
diff --git a/media/audio/audio_input_controller_unittest.cc b/media/audio/audio_input_controller_unittest.cc
index 090d97f4..d7ce4db 100644
--- a/media/audio/audio_input_controller_unittest.cc
+++ b/media/audio/audio_input_controller_unittest.cc
@@ -139,7 +139,7 @@ TEST(AudioInputControllerTest, RecordAndError) {
event.Reset();
// Wait for the stream to be stopped.
- AudioInputStream* stream = controller->stream_for_testing();
+ AudioInputStream* stream = controller->stream();
stream->Stop();
event.Wait();
diff --git a/media/audio/audio_io.h b/media/audio/audio_io.h
index 74b5c47..787020c 100644
--- a/media/audio/audio_io.h
+++ b/media/audio/audio_io.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -45,13 +45,13 @@
// as the data is written to the audio device. Size of each packet is determined
// by |samples_per_packet| specified in AudioParameters when the stream is
// created.
-class MEDIA_EXPORT AudioOutputStream {
+class AudioOutputStream {
public:
// Audio sources must implement AudioSourceCallback. This interface will be
// called in a random thread which very likely is a high priority thread. Do
// not rely on using this thread TLS or make calls that alter the thread
// itself such as creating Windows or initializing COM.
- class MEDIA_EXPORT AudioSourceCallback {
+ class AudioSourceCallback {
public:
virtual ~AudioSourceCallback() {}
@@ -104,7 +104,7 @@ class MEDIA_EXPORT AudioOutputStream {
// Models an audio sink receiving recorded audio from the audio driver.
class AudioInputStream {
public:
- class MEDIA_EXPORT AudioInputCallback {
+ class AudioInputCallback {
public:
virtual ~AudioInputCallback() {}
diff --git a/media/audio/audio_manager.h b/media/audio/audio_manager.h
index d80026d..29cc23d 100644
--- a/media/audio/audio_manager.h
+++ b/media/audio/audio_manager.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -21,7 +21,7 @@ class MessageLoop;
// Manages all audio resources. In particular it owns the AudioOutputStream
// objects. Provides some convenience functions that avoid the need to provide
// iterators over the existing streams.
-class MEDIA_EXPORT AudioManager {
+class AudioManager {
public:
// Returns true if the OS reports existence of audio devices. This does not
// guarantee that the existing devices support all formats and sample rates.
diff --git a/media/audio/audio_manager_base.h b/media/audio/audio_manager_base.h
index fb4c51e..239ac5c 100644
--- a/media/audio/audio_manager_base.h
+++ b/media/audio/audio_manager_base.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -13,7 +13,7 @@
class AudioOutputDispatcher;
// AudioManagerBase provides AudioManager functions common for all platforms.
-class MEDIA_EXPORT AudioManagerBase : public AudioManager {
+class AudioManagerBase : public AudioManager {
public:
// Name of the generic "default" device.
static const char kDefaultDeviceName[];
diff --git a/media/audio/audio_output_controller.h b/media/audio/audio_output_controller.h
index ac4fea7..29fb0a7 100644
--- a/media/audio/audio_output_controller.h
+++ b/media/audio/audio_output_controller.h
@@ -49,7 +49,7 @@ class Task;
//
namespace media {
-class MEDIA_EXPORT AudioOutputController
+class AudioOutputController
: public base::RefCountedThreadSafe<AudioOutputController>,
public AudioOutputStream::AudioSourceCallback {
public:
diff --git a/media/audio/audio_output_dispatcher.h b/media/audio/audio_output_dispatcher.h
index 7a4d019..18e1b28 100644
--- a/media/audio/audio_output_dispatcher.h
+++ b/media/audio/audio_output_dispatcher.h
@@ -33,7 +33,7 @@
class AudioOutputStream;
class MessageLoop;
-class MEDIA_EXPORT AudioOutputDispatcher
+class AudioOutputDispatcher
: public base::RefCountedThreadSafe<AudioOutputDispatcher> {
public:
// |close_delay_ms| specifies delay after the stream is paused until
diff --git a/media/audio/audio_output_proxy.h b/media/audio/audio_output_proxy.h
index c9f7d6f..4835cc8 100644
--- a/media/audio/audio_output_proxy.h
+++ b/media/audio/audio_output_proxy.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -20,7 +20,7 @@ class AudioOutputDispatcher;
//
// AudioOutputProxy uses AudioOutputDispatcher to open and close
// physical output streams.
-class MEDIA_EXPORT AudioOutputProxy : public AudioOutputStream {
+class AudioOutputProxy : public AudioOutputStream {
public:
// Caller keeps ownership of |dispatcher|.
AudioOutputProxy(AudioOutputDispatcher* dispatcher);
diff --git a/media/audio/audio_parameters.h b/media/audio/audio_parameters.h
index 5c86990..26204b0 100644
--- a/media/audio/audio_parameters.h
+++ b/media/audio/audio_parameters.h
@@ -7,11 +7,10 @@
#include "base/basictypes.h"
#include "media/base/audio_decoder_config.h"
-#include "media/base/media_export.h"
-struct MEDIA_EXPORT AudioParameters {
+struct AudioParameters {
// Compare is useful when AudioParameters is used as a key in std::map.
- class MEDIA_EXPORT Compare {
+ class Compare {
public:
bool operator()(const AudioParameters& a, const AudioParameters& b) const;
};
@@ -20,7 +19,7 @@ struct MEDIA_EXPORT AudioParameters {
AUDIO_PCM_LINEAR = 0, // PCM is 'raw' amplitude samples.
AUDIO_PCM_LOW_LATENCY, // Linear PCM, low latency requested.
AUDIO_MOCK, // Creates a dummy AudioOutputStream object.
- AUDIO_LAST_FORMAT // Only used for validation of format.y
+ AUDIO_LAST_FORMAT // Only used for validation of format.
};
// Telephone quality sample rate, mostly for speech-only audio.
diff --git a/media/audio/audio_util.h b/media/audio/audio_util.h
index a78fdf1..0d65e19 100644
--- a/media/audio/audio_util.h
+++ b/media/audio/audio_util.h
@@ -8,7 +8,6 @@
#include <vector>
#include "base/basictypes.h"
-#include "media/base/media_export.h"
namespace media {
@@ -27,11 +26,11 @@ namespace media {
// formats.
// The buffer is modified in-place to avoid memory management, as this
// function may be called in performance critical code.
-MEDIA_EXPORT bool AdjustVolume(void* buf,
- size_t buflen,
- int channels,
- int bytes_per_sample,
- float volume);
+bool AdjustVolume(void* buf,
+ size_t buflen,
+ int channels,
+ int bytes_per_sample,
+ float volume);
// FoldChannels() does a software multichannel folding down to stereo.
// Channel order is assumed to be 5.1 Dolby standard which is
@@ -46,11 +45,11 @@ MEDIA_EXPORT bool AdjustVolume(void* buf,
// volume.
// The buffer is modified in-place to avoid memory management, as this
// function may be called in performance critical code.
-MEDIA_EXPORT bool FoldChannels(void* buf,
- size_t buflen,
- int channels,
- int bytes_per_sample,
- float volume);
+bool FoldChannels(void* buf,
+ size_t buflen,
+ int channels,
+ int bytes_per_sample,
+ float volume);
// DeinterleaveAudioChannel() takes interleaved audio buffer |source|
// of the given |sample_fmt| and |number_of_channels| and extracts
@@ -71,12 +70,12 @@ bool DeinterleaveAudioChannel(void* source,
// The size of the |source| vector determines the number of channels.
// The |destination| buffer is assumed to be large enough to hold the
// result. Thus it must be at least size: number_of_frames * source.size()
-MEDIA_EXPORT void InterleaveFloatToInt16(const std::vector<float*>& source,
- int16* destination,
- size_t number_of_frames);
+void InterleaveFloatToInt16(const std::vector<float*>& source,
+ int16* destination,
+ size_t number_of_frames);
// Returns the default audio hardware sample-rate.
-MEDIA_EXPORT double GetAudioHardwareSampleRate();
+double GetAudioHardwareSampleRate();
} // namespace media
diff --git a/media/audio/fake_audio_output_stream.h b/media/audio/fake_audio_output_stream.h
index ac53db5..82453ef 100644
--- a/media/audio/fake_audio_output_stream.h
+++ b/media/audio/fake_audio_output_stream.h
@@ -15,7 +15,7 @@
#include "media/audio/audio_io.h"
#include "media/audio/audio_parameters.h"
-class MEDIA_EXPORT FakeAudioOutputStream : public AudioOutputStream {
+class FakeAudioOutputStream : public AudioOutputStream {
public:
static AudioOutputStream* MakeFakeStream(const AudioParameters& params);
static FakeAudioOutputStream* GetLastFakeStream();
diff --git a/media/audio/linux/alsa_output.h b/media/audio/linux/alsa_output.h
index 8d61148..4f6e8da 100644
--- a/media/audio/linux/alsa_output.h
+++ b/media/audio/linux/alsa_output.h
@@ -46,7 +46,7 @@ class AlsaWrapper;
class AudioManagerLinux;
class MessageLoop;
-class MEDIA_EXPORT AlsaPcmOutputStream : public AudioOutputStream {
+class AlsaPcmOutputStream : public AudioOutputStream {
public:
// String for the generic "default" ALSA device that has the highest
// compatibility and chance of working.
@@ -219,7 +219,4 @@ class MEDIA_EXPORT AlsaPcmOutputStream : public AudioOutputStream {
DISALLOW_COPY_AND_ASSIGN(AlsaPcmOutputStream);
};
-MEDIA_EXPORT std::ostream& operator<<(std::ostream& os,
- AlsaPcmOutputStream::InternalState);
-
#endif // MEDIA_AUDIO_LINUX_ALSA_OUTPUT_H_
diff --git a/media/audio/linux/alsa_wrapper.h b/media/audio/linux/alsa_wrapper.h
index efe93d0..1fe1992 100644
--- a/media/audio/linux/alsa_wrapper.h
+++ b/media/audio/linux/alsa_wrapper.h
@@ -9,9 +9,8 @@
#include <alsa/asoundlib.h>
#include "base/basictypes.h"
-#include "media/base/media_export.h"
-class MEDIA_EXPORT AlsaWrapper {
+class AlsaWrapper {
public:
AlsaWrapper();
virtual ~AlsaWrapper();
diff --git a/media/audio/linux/audio_manager_linux.h b/media/audio/linux/audio_manager_linux.h
index 1c9cab6..6e06091 100644
--- a/media/audio/linux/audio_manager_linux.h
+++ b/media/audio/linux/audio_manager_linux.h
@@ -14,7 +14,7 @@
class AlsaPcmOutputStream;
class AlsaWrapper;
-class MEDIA_EXPORT AudioManagerLinux : public AudioManagerBase {
+class AudioManagerLinux : public AudioManagerBase {
public:
AudioManagerLinux();
diff --git a/media/audio/simple_sources.h b/media/audio/simple_sources.h
index de70601..5ea1fee 100644
--- a/media/audio/simple_sources.h
+++ b/media/audio/simple_sources.h
@@ -11,8 +11,7 @@
#include "media/base/seekable_buffer.h"
// An audio source that produces a pure sinusoidal tone.
-class MEDIA_EXPORT SineWaveAudioSource
- : public AudioOutputStream::AudioSourceCallback {
+class SineWaveAudioSource : public AudioOutputStream::AudioSourceCallback {
public:
enum Format {
FORMAT_8BIT_LINEAR_PCM,
@@ -40,7 +39,7 @@ class MEDIA_EXPORT SineWaveAudioSource
// Defines an interface for pushing audio output. In contrast, the interfaces
// defined by AudioSourceCallback are pull model only.
-class MEDIA_EXPORT PushAudioOutput {
+class PushAudioOutput {
public:
virtual ~PushAudioOutput() {}
@@ -57,7 +56,7 @@ class MEDIA_EXPORT PushAudioOutput {
// a pull model provider AudioSourceCallback. Fundamentally it manages a series
// of audio buffers and is unaware of the actual audio format.
// Note that the PushSource is not thread safe and user need to provide locking.
-class MEDIA_EXPORT PushSource
+class PushSource
: public AudioOutputStream::AudioSourceCallback,
public PushAudioOutput {
public: