summaryrefslogtreecommitdiffstats
path: root/media/audio
diff options
context:
space:
mode:
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.h43
-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, 57 insertions, 51 deletions
diff --git a/media/audio/audio_buffers_state.h b/media/audio/audio_buffers_state.h
index e3a2faf..796c081 100644
--- a/media/audio/audio_buffers_state.h
+++ b/media/audio/audio_buffers_state.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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,11 +6,12 @@
#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 AudioBuffersState {
+struct MEDIA_EXPORT 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 164b09f..22f6ffe 100644
--- a/media/audio/audio_input_controller.h
+++ b/media/audio/audio_input_controller.h
@@ -35,7 +35,7 @@
//
namespace media {
-class AudioInputController
+class MEDIA_EXPORT AudioInputController
: public base::RefCountedThreadSafe<AudioInputController>,
public AudioInputStream::AudioInputCallback {
public:
@@ -99,10 +99,8 @@ class 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.
-#if defined(UNIT_TEST)
- static void set_factory(Factory* factory) { factory_ = factory; }
- AudioInputStream* stream() { return stream_; }
-#endif
+ static void set_factory_for_testing(Factory* factory) { factory_ = factory; }
+ AudioInputStream* stream_for_testing() { return stream_; }
// 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 d7ce4db..090d97f4 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();
+ AudioInputStream* stream = controller->stream_for_testing();
stream->Stop();
event.Wait();
diff --git a/media/audio/audio_io.h b/media/audio/audio_io.h
index 787020c..74b5c47 100644
--- a/media/audio/audio_io.h
+++ b/media/audio/audio_io.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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 AudioOutputStream {
+class MEDIA_EXPORT 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 AudioSourceCallback {
+ class MEDIA_EXPORT AudioSourceCallback {
public:
virtual ~AudioSourceCallback() {}
@@ -104,7 +104,7 @@ class AudioOutputStream {
// Models an audio sink receiving recorded audio from the audio driver.
class AudioInputStream {
public:
- class AudioInputCallback {
+ class MEDIA_EXPORT AudioInputCallback {
public:
virtual ~AudioInputCallback() {}
diff --git a/media/audio/audio_manager.h b/media/audio/audio_manager.h
index 29cc23d..d80026d 100644
--- a/media/audio/audio_manager.h
+++ b/media/audio/audio_manager.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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 AudioManager {
+class MEDIA_EXPORT 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 239ac5c..fb4c51e 100644
--- a/media/audio/audio_manager_base.h
+++ b/media/audio/audio_manager_base.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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 AudioManagerBase : public AudioManager {
+class MEDIA_EXPORT 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 29fb0a7..ac4fea7 100644
--- a/media/audio/audio_output_controller.h
+++ b/media/audio/audio_output_controller.h
@@ -49,7 +49,7 @@ class Task;
//
namespace media {
-class AudioOutputController
+class MEDIA_EXPORT 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 18e1b28..7a4d019 100644
--- a/media/audio/audio_output_dispatcher.h
+++ b/media/audio/audio_output_dispatcher.h
@@ -33,7 +33,7 @@
class AudioOutputStream;
class MessageLoop;
-class AudioOutputDispatcher
+class MEDIA_EXPORT 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 4835cc8..c9f7d6f 100644
--- a/media/audio/audio_output_proxy.h
+++ b/media/audio/audio_output_proxy.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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 AudioOutputProxy : public AudioOutputStream {
+class MEDIA_EXPORT 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 26204b0..5c86990 100644
--- a/media/audio/audio_parameters.h
+++ b/media/audio/audio_parameters.h
@@ -7,10 +7,11 @@
#include "base/basictypes.h"
#include "media/base/audio_decoder_config.h"
+#include "media/base/media_export.h"
-struct AudioParameters {
+struct MEDIA_EXPORT AudioParameters {
// Compare is useful when AudioParameters is used as a key in std::map.
- class Compare {
+ class MEDIA_EXPORT Compare {
public:
bool operator()(const AudioParameters& a, const AudioParameters& b) const;
};
@@ -19,7 +20,7 @@ struct 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.
+ AUDIO_LAST_FORMAT // Only used for validation of format.y
};
// Telephone quality sample rate, mostly for speech-only audio.
diff --git a/media/audio/audio_util.h b/media/audio/audio_util.h
index a2fa15e..d95a646 100644
--- a/media/audio/audio_util.h
+++ b/media/audio/audio_util.h
@@ -8,6 +8,7 @@
#include <vector>
#include "base/basictypes.h"
+#include "media/base/media_export.h"
namespace base {
class SharedMemory;
@@ -30,11 +31,11 @@ namespace media {
// formats.
// The buffer is modified in-place to avoid memory management, as this
// function may be called in performance critical code.
-bool AdjustVolume(void* buf,
- size_t buflen,
- int channels,
- int bytes_per_sample,
- float volume);
+MEDIA_EXPORT 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
@@ -49,11 +50,11 @@ 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.
-bool FoldChannels(void* buf,
- size_t buflen,
- int channels,
- int bytes_per_sample,
- float volume);
+MEDIA_EXPORT 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
@@ -74,23 +75,23 @@ 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()
-void InterleaveFloatToInt16(const std::vector<float*>& source,
- int16* destination,
- size_t number_of_frames);
+MEDIA_EXPORT void InterleaveFloatToInt16(const std::vector<float*>& source,
+ int16* destination,
+ size_t number_of_frames);
// Returns the default audio hardware sample-rate.
-double GetAudioHardwareSampleRate();
+MEDIA_EXPORT double GetAudioHardwareSampleRate();
// Functions that handle data buffer passed between processes in the shared
// memory. Called on both IPC sides.
-uint32 TotalSharedMemorySizeInBytes(uint32 packet_size);
-uint32 PacketSizeSizeInBytes(uint32 shared_memory_created_size);
-uint32 GetActualDataSizeInBytes(base::SharedMemory* shared_memory,
- uint32 shared_memory_size);
-void SetActualDataSizeInBytes(base::SharedMemory* shared_memory,
- uint32 shared_memory_size,
- uint32 actual_data_size);
+MEDIA_EXPORT uint32 TotalSharedMemorySizeInBytes(uint32 packet_size);
+MEDIA_EXPORT uint32 PacketSizeSizeInBytes(uint32 shared_memory_created_size);
+MEDIA_EXPORT uint32 GetActualDataSizeInBytes(base::SharedMemory* shared_memory,
+ uint32 shared_memory_size);
+MEDIA_EXPORT void SetActualDataSizeInBytes(base::SharedMemory* shared_memory,
+ uint32 shared_memory_size,
+ uint32 actual_data_size);
} // namespace media
diff --git a/media/audio/fake_audio_output_stream.h b/media/audio/fake_audio_output_stream.h
index 82453ef..ac53db5 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 FakeAudioOutputStream : public AudioOutputStream {
+class MEDIA_EXPORT 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 4f6e8da..8d61148 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 AlsaPcmOutputStream : public AudioOutputStream {
+class MEDIA_EXPORT AlsaPcmOutputStream : public AudioOutputStream {
public:
// String for the generic "default" ALSA device that has the highest
// compatibility and chance of working.
@@ -219,4 +219,7 @@ class 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 1fe1992..efe93d0 100644
--- a/media/audio/linux/alsa_wrapper.h
+++ b/media/audio/linux/alsa_wrapper.h
@@ -9,8 +9,9 @@
#include <alsa/asoundlib.h>
#include "base/basictypes.h"
+#include "media/base/media_export.h"
-class AlsaWrapper {
+class MEDIA_EXPORT AlsaWrapper {
public:
AlsaWrapper();
virtual ~AlsaWrapper();
diff --git a/media/audio/linux/audio_manager_linux.h b/media/audio/linux/audio_manager_linux.h
index c50cabd..5ec6221 100644
--- a/media/audio/linux/audio_manager_linux.h
+++ b/media/audio/linux/audio_manager_linux.h
@@ -13,7 +13,7 @@
class AlsaWrapper;
-class AudioManagerLinux : public AudioManagerBase {
+class MEDIA_EXPORT AudioManagerLinux : public AudioManagerBase {
public:
AudioManagerLinux();
diff --git a/media/audio/simple_sources.h b/media/audio/simple_sources.h
index 5ea1fee..de70601 100644
--- a/media/audio/simple_sources.h
+++ b/media/audio/simple_sources.h
@@ -11,7 +11,8 @@
#include "media/base/seekable_buffer.h"
// An audio source that produces a pure sinusoidal tone.
-class SineWaveAudioSource : public AudioOutputStream::AudioSourceCallback {
+class MEDIA_EXPORT SineWaveAudioSource
+ : public AudioOutputStream::AudioSourceCallback {
public:
enum Format {
FORMAT_8BIT_LINEAR_PCM,
@@ -39,7 +40,7 @@ class SineWaveAudioSource : public AudioOutputStream::AudioSourceCallback {
// Defines an interface for pushing audio output. In contrast, the interfaces
// defined by AudioSourceCallback are pull model only.
-class PushAudioOutput {
+class MEDIA_EXPORT PushAudioOutput {
public:
virtual ~PushAudioOutput() {}
@@ -56,7 +57,7 @@ class 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 PushSource
+class MEDIA_EXPORT PushSource
: public AudioOutputStream::AudioSourceCallback,
public PushAudioOutput {
public: