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

Unified Diff: media/audio/audio_input_device.h

Issue 10834033: Move AudioDevice and AudioInputDevice to media. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments and fixed a few lint issues Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/audio/audio_device_thread.cc ('k') | media/audio/audio_input_device.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_input_device.h
===================================================================
--- media/audio/audio_input_device.h (revision 148738)
+++ media/audio/audio_input_device.h (working copy)
@@ -11,7 +11,7 @@
// ^ ^
// | |
// v IPC v
-// AudioInputRendererHost <---------> media::AudioInputIPCDelegate
+// AudioInputRendererHost <---------> AudioInputIPCDelegate
// ^ (impl in AudioInputMessageFilter)
// |
// v
@@ -58,8 +58,8 @@
// Implementation notes:
// - The user must call Stop() before deleting the class instance.
-#ifndef CONTENT_RENDERER_MEDIA_AUDIO_INPUT_DEVICE_H_
-#define CONTENT_RENDERER_MEDIA_AUDIO_INPUT_DEVICE_H_
+#ifndef MEDIA_AUDIO_AUDIO_INPUT_DEVICE_H_
+#define MEDIA_AUDIO_AUDIO_INPUT_DEVICE_H_
#include <string>
#include <vector>
@@ -68,23 +68,25 @@
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/shared_memory.h"
-#include "content/common/content_export.h"
-#include "content/renderer/media/audio_device_thread.h"
-#include "content/renderer/media/audio_input_message_filter.h"
-#include "content/renderer/media/scoped_loop_observer.h"
+#include "media/audio/audio_device_thread.h"
+#include "media/audio/audio_input_ipc.h"
#include "media/audio/audio_parameters.h"
+#include "media/audio/scoped_loop_observer.h"
+#include "media/base/media_export.h"
-// TODO(henrika): This class is based on the AudioDevice class and it has
+namespace media {
+
+// TODO(henrika): This class is based on the AudioOutputDevice class and it has
// many components in common. Investigate potential for re-factoring.
// TODO(henrika): Add support for event handling (e.g. OnStateChanged,
// OnCaptureStopped etc.) and ensure that we can deliver these notifications
// to any clients using this class.
-class CONTENT_EXPORT AudioInputDevice
- : NON_EXPORTED_BASE(public media::AudioInputIPCDelegate),
+class MEDIA_EXPORT AudioInputDevice
+ : NON_EXPORTED_BASE(public AudioInputIPCDelegate),
NON_EXPORTED_BASE(public ScopedLoopObserver),
public base::RefCountedThreadSafe<AudioInputDevice> {
public:
- class CONTENT_EXPORT CaptureCallback {
+ class MEDIA_EXPORT CaptureCallback {
public:
virtual void Capture(const std::vector<float*>& audio_data,
int number_of_frames,
@@ -92,10 +94,10 @@
double volume) = 0;
virtual void OnCaptureError() = 0;
protected:
- virtual ~CaptureCallback() {}
+ virtual ~CaptureCallback();
};
- class CONTENT_EXPORT CaptureEventHandler {
+ class MEDIA_EXPORT CaptureEventHandler {
public:
// Notification to the client that the device with the specific |device_id|
// has been started.
@@ -106,15 +108,15 @@
virtual void OnDeviceStopped() = 0;
protected:
- virtual ~CaptureEventHandler() {}
+ virtual ~CaptureEventHandler();
};
- AudioInputDevice(media::AudioInputIPC* ipc,
+ AudioInputDevice(AudioInputIPC* ipc,
const scoped_refptr<base::MessageLoopProxy>& io_loop);
// Initializes the AudioInputDevice. This method must be called before
// any other methods can be used.
- void Initialize(const media::AudioParameters& params,
+ void Initialize(const AudioParameters& params,
CaptureCallback* callback,
CaptureEventHandler* event_handler);
@@ -141,13 +143,13 @@
protected:
// Methods called on IO thread ----------------------------------------------
- // media::AudioInputIPCDelegate implementation.
+ // AudioInputIPCDelegate implementation.
virtual void OnStreamCreated(base::SharedMemoryHandle handle,
base::SyncSocket::Handle socket_handle,
int length) OVERRIDE;
virtual void OnVolume(double volume) OVERRIDE;
virtual void OnStateChanged(
- media::AudioInputIPCDelegate::State state) OVERRIDE;
+ AudioInputIPCDelegate::State state) OVERRIDE;
virtual void OnDeviceReady(const std::string& device_id) OVERRIDE;
virtual void OnIPCClosed() OVERRIDE;
@@ -170,12 +172,12 @@
// If the IO loop dies before we do, we shut down the audio thread from here.
virtual void WillDestroyCurrentMessageLoop() OVERRIDE;
- media::AudioParameters audio_parameters_;
+ AudioParameters audio_parameters_;
CaptureCallback* callback_;
CaptureEventHandler* event_handler_;
- media::AudioInputIPC* ipc_;
+ AudioInputIPC* ipc_;
// Our stream ID on the message filter. Only modified on the IO thread.
int stream_id_;
@@ -204,4 +206,6 @@
DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputDevice);
};
-#endif // CONTENT_RENDERER_MEDIA_AUDIO_INPUT_DEVICE_H_
+} // namespace media
+
+#endif // MEDIA_AUDIO_AUDIO_INPUT_DEVICE_H_
« no previous file with comments | « media/audio/audio_device_thread.cc ('k') | media/audio/audio_input_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698