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

Side by Side Diff: content/renderer/media/audio_input_device.h

Issue 8539014: Export the AudioDevice and AudioDeviceInput classes so that unit tests have access to them in sha... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: added missing file Created 9 years, 1 month 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
OLDNEW
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 // Low-latency audio capturing unit utilizing audio input stream provided 5 // Low-latency audio capturing unit utilizing audio input stream provided
6 // by browser process through IPC. 6 // by browser process through IPC.
7 // 7 //
8 // Relationship of classes: 8 // Relationship of classes:
9 // 9 //
10 // AudioInputController AudioInputDevice 10 // AudioInputController AudioInputDevice
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 #ifndef CONTENT_RENDERER_MEDIA_AUDIO_INPUT_DEVICE_H_ 68 #ifndef CONTENT_RENDERER_MEDIA_AUDIO_INPUT_DEVICE_H_
69 #define CONTENT_RENDERER_MEDIA_AUDIO_INPUT_DEVICE_H_ 69 #define CONTENT_RENDERER_MEDIA_AUDIO_INPUT_DEVICE_H_
70 #pragma once 70 #pragma once
71 71
72 #include <vector> 72 #include <vector>
73 73
74 #include "base/basictypes.h" 74 #include "base/basictypes.h"
75 #include "base/memory/scoped_ptr.h" 75 #include "base/memory/scoped_ptr.h"
76 #include "base/shared_memory.h" 76 #include "base/shared_memory.h"
77 #include "base/threading/simple_thread.h" 77 #include "base/threading/simple_thread.h"
78 #include "content/common/content_export.h"
78 #include "content/renderer/media/audio_input_message_filter.h" 79 #include "content/renderer/media/audio_input_message_filter.h"
79 #include "media/audio/audio_parameters.h" 80 #include "media/audio/audio_parameters.h"
80 81
81 // TODO(henrika): This class is based on the AudioDevice class and it has 82 // TODO(henrika): This class is based on the AudioDevice class and it has
82 // many components in common. Investigate potential for re-factoring. 83 // many components in common. Investigate potential for re-factoring.
83 // TODO(henrika): Add support for event handling (e.g. OnStateChanged, 84 // TODO(henrika): Add support for event handling (e.g. OnStateChanged,
84 // OnCaptureStopped etc.) and ensure that we can deliver these notifications 85 // OnCaptureStopped etc.) and ensure that we can deliver these notifications
85 // to any clients using this class. 86 // to any clients using this class.
86 class AudioInputDevice 87 class CONTENT_EXPORT AudioInputDevice
87 : public AudioInputMessageFilter::Delegate, 88 : public AudioInputMessageFilter::Delegate,
88 public base::DelegateSimpleThread::Delegate, 89 public base::DelegateSimpleThread::Delegate,
89 public base::RefCountedThreadSafe<AudioInputDevice> { 90 public base::RefCountedThreadSafe<AudioInputDevice> {
90 public: 91 public:
91 class CaptureCallback { 92 class CaptureCallback {
92 public: 93 public:
93 virtual void Capture(const std::vector<float*>& audio_data, 94 virtual void Capture(const std::vector<float*>& audio_data,
94 size_t number_of_frames, 95 size_t number_of_frames,
95 size_t audio_delay_milliseconds) = 0; 96 size_t audio_delay_milliseconds) = 0;
96 protected: 97 protected:
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 // callback. Only modified on the IO thread. 212 // callback. Only modified on the IO thread.
212 bool pending_device_ready_; 213 bool pending_device_ready_;
213 214
214 scoped_ptr<base::SharedMemory> shared_memory_; 215 scoped_ptr<base::SharedMemory> shared_memory_;
215 scoped_ptr<base::SyncSocket> socket_; 216 scoped_ptr<base::SyncSocket> socket_;
216 217
217 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputDevice); 218 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputDevice);
218 }; 219 };
219 220
220 #endif // CONTENT_RENDERER_MEDIA_AUDIO_INPUT_DEVICE_H_ 221 #endif // CONTENT_RENDERER_MEDIA_AUDIO_INPUT_DEVICE_H_
OLDNEW
« no previous file with comments | « content/renderer/media/audio_device.h ('k') | content/renderer/media/audio_input_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698