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

Side by Side Diff: content/browser/renderer_host/media/audio_input_renderer_host.h

Issue 12383016: Merge AssociateStreamWithProducer message into CreateStream message for both audio output and input. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 8 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 | content/browser/renderer_host/media/audio_input_renderer_host.cc » ('j') | no next file with comments »
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 // AudioInputRendererHost serves audio related requests from audio capturer 5 // AudioInputRendererHost serves audio related requests from audio capturer
6 // which lives inside the render process and provide access to audio hardware. 6 // which lives inside the render process and provide access to audio hardware.
7 // 7 //
8 // Create stream sequence (AudioInputController = AIC): 8 // Create stream sequence (AudioInputController = AIC):
9 // 9 //
10 // AudioInputHostMsg_CreateStream -> OnCreateStream -> AIC::CreateLowLatency -> 10 // AudioInputHostMsg_CreateStream -> OnCreateStream -> AIC::CreateLowLatency ->
(...skipping 16 matching lines...) Expand all
27 #include <map> 27 #include <map>
28 #include <string> 28 #include <string>
29 29
30 #include "base/compiler_specific.h" 30 #include "base/compiler_specific.h"
31 #include "base/gtest_prod_util.h" 31 #include "base/gtest_prod_util.h"
32 #include "base/memory/ref_counted.h" 32 #include "base/memory/ref_counted.h"
33 #include "base/memory/scoped_ptr.h" 33 #include "base/memory/scoped_ptr.h"
34 #include "base/process.h" 34 #include "base/process.h"
35 #include "base/sequenced_task_runner_helpers.h" 35 #include "base/sequenced_task_runner_helpers.h"
36 #include "base/shared_memory.h" 36 #include "base/shared_memory.h"
37 #include "content/common/media/audio_messages.h"
37 #include "content/public/browser/browser_message_filter.h" 38 #include "content/public/browser/browser_message_filter.h"
38 #include "content/public/browser/browser_thread.h" 39 #include "content/public/browser/browser_thread.h"
39 #include "media/audio/audio_input_controller.h" 40 #include "media/audio/audio_input_controller.h"
40 #include "media/audio/audio_io.h" 41 #include "media/audio/audio_io.h"
41 #include "media/audio/simple_sources.h" 42 #include "media/audio/simple_sources.h"
42 43
43 namespace media { 44 namespace media {
44 class AudioManager; 45 class AudioManager;
45 class AudioParameters; 46 class AudioParameters;
46 } 47 }
(...skipping 30 matching lines...) Expand all
77 friend class base::DeleteHelper<AudioInputRendererHost>; 78 friend class base::DeleteHelper<AudioInputRendererHost>;
78 79
79 struct AudioEntry; 80 struct AudioEntry;
80 typedef std::map<int, AudioEntry*> AudioEntryMap; 81 typedef std::map<int, AudioEntry*> AudioEntryMap;
81 82
82 virtual ~AudioInputRendererHost(); 83 virtual ~AudioInputRendererHost();
83 84
84 // Methods called on IO thread ---------------------------------------------- 85 // Methods called on IO thread ----------------------------------------------
85 86
86 // Audio related IPC message handlers. 87 // Audio related IPC message handlers.
87 // Creates an audio input stream with the specified session id and format. 88
88 // |session_id| is used to find out which device to be used for the stream, 89 // Creates an audio input stream with the specified format whose data is
89 // when it is AudioInputDeviceManager::kFakeOpenSessionId, it uses the 90 // consumed by an entity in the render view referenced by |render_view_id|.
90 // the default device. If this call is successful this object would keep an 91 // |session_id| is used to find out which device to be used for the stream.
91 // internal entry of the stream for the required properties. 92 // When it is AudioInputDeviceManager::kFakeOpenSessionId, it uses the the
93 // default device. Upon success/failure, the peer is notified via the
94 // NotifyStreamCreated message.
92 void OnCreateStream(int stream_id, 95 void OnCreateStream(int stream_id,
96 int render_view_id,
93 int session_id, 97 int session_id,
94 const media::AudioParameters& params, 98 const AudioInputHostMsg_CreateStream_Config& config);
95 bool automatic_gain_control,
96 int shared_memory_count);
97
98 // Track that the data for the audio stream referenced by |stream_id| is
99 // consumed by an entity in the render view referenced by |render_view_id|.
100 void OnAssociateStreamWithConsumer(int stream_id, int render_view_id);
101 99
102 // Record the audio input stream referenced by |stream_id|. 100 // Record the audio input stream referenced by |stream_id|.
103 void OnRecordStream(int stream_id); 101 void OnRecordStream(int stream_id);
104 102
105 // Close the audio stream referenced by |stream_id|. 103 // Close the audio stream referenced by |stream_id|.
106 void OnCloseStream(int stream_id); 104 void OnCloseStream(int stream_id);
107 105
108 // Set the volume of the audio stream referenced by |stream_id|. 106 // Set the volume of the audio stream referenced by |stream_id|.
109 void OnSetVolume(int stream_id, double volume); 107 void OnSetVolume(int stream_id, double volume);
110 108
111 // Complete the process of creating an audio input stream. This will set up 109 // Complete the process of creating an audio input stream. This will set up
112 // the shared memory or shared socket in low latency mode. 110 // the shared memory or shared socket in low latency mode and send the
111 // NotifyStreamCreated message to the peer.
113 void DoCompleteCreation(media::AudioInputController* controller); 112 void DoCompleteCreation(media::AudioInputController* controller);
114 113
115 // Send a state change message to the renderer. 114 // Send a state change message to the renderer.
116 void DoSendRecordingMessage(media::AudioInputController* controller); 115 void DoSendRecordingMessage(media::AudioInputController* controller);
117 116
118 // Handle error coming from audio stream. 117 // Handle error coming from audio stream.
119 void DoHandleError(media::AudioInputController* controller); 118 void DoHandleError(media::AudioInputController* controller);
120 119
121 // Send an error message to the renderer. 120 // Send an error message to the renderer.
122 void SendErrorMessage(int stream_id); 121 void SendErrorMessage(int stream_id);
(...skipping 28 matching lines...) Expand all
151 150
152 // A map of stream IDs to audio sources. 151 // A map of stream IDs to audio sources.
153 AudioEntryMap audio_entries_; 152 AudioEntryMap audio_entries_;
154 153
155 DISALLOW_COPY_AND_ASSIGN(AudioInputRendererHost); 154 DISALLOW_COPY_AND_ASSIGN(AudioInputRendererHost);
156 }; 155 };
157 156
158 } // namespace content 157 } // namespace content
159 158
160 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_RENDERER_HOST_H_ 159 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_RENDERER_HOST_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/media/audio_input_renderer_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698