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

Side by Side Diff: media/audio/audio_input_ipc.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 | « media/audio/audio_input_device.cc ('k') | media/audio/audio_output_device.h » ('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 #ifndef MEDIA_AUDIO_AUDIO_INPUT_IPC_H_ 5 #ifndef MEDIA_AUDIO_AUDIO_INPUT_IPC_H_
6 #define MEDIA_AUDIO_AUDIO_INPUT_IPC_H_ 6 #define MEDIA_AUDIO_AUDIO_INPUT_IPC_H_
7 7
8 #include "base/shared_memory.h" 8 #include "base/shared_memory.h"
9 #include "base/sync_socket.h" 9 #include "base/sync_socket.h"
10 #include "media/audio/audio_parameters.h" 10 #include "media/audio/audio_parameters.h"
(...skipping 27 matching lines...) Expand all
38 int total_segments) = 0; 38 int total_segments) = 0;
39 39
40 // Called when state of an audio stream has changed. 40 // Called when state of an audio stream has changed.
41 virtual void OnStateChanged(State state) = 0; 41 virtual void OnStateChanged(State state) = 0;
42 42
43 // Called when the input stream volume has changed. 43 // Called when the input stream volume has changed.
44 virtual void OnVolume(double volume) = 0; 44 virtual void OnVolume(double volume) = 0;
45 45
46 // Called when the AudioInputIPC object is going away and/or when the 46 // Called when the AudioInputIPC object is going away and/or when the
47 // IPC channel has been closed and no more IPC requests can be made. 47 // IPC channel has been closed and no more IPC requests can be made.
48 // Implementations must clear any references to the AudioInputIPC object 48 // Implementations should delete their owned AudioInputIPC instance
49 // at this point. 49 // immediately.
50 virtual void OnIPCClosed() = 0; 50 virtual void OnIPCClosed() = 0;
51 51
52 protected: 52 protected:
53 virtual ~AudioInputIPCDelegate(); 53 virtual ~AudioInputIPCDelegate();
54 }; 54 };
55 55
56 // Provides IPC functionality for an AudioInputDevice. The implementation 56 // Provides IPC functionality for an AudioInputIPCDelegate (e.g., an
57 // should asynchronously deliver the messages to an AudioInputController object 57 // AudioInputDevice). The implementation should asynchronously deliver the
58 // (or create one in the case of CreateStream()), that may live in a separate 58 // messages to an AudioInputController object (or create one in the case of
59 // process. 59 // CreateStream()), that may live in a separate process.
60 class MEDIA_EXPORT AudioInputIPC { 60 class MEDIA_EXPORT AudioInputIPC {
61 public: 61 public:
62 // Registers an AudioInputIPCDelegate and returns a |stream_id| that 62 virtual ~AudioInputIPC();
63 // must be used with all other IPC functions in this interface.
64 virtual int AddDelegate(AudioInputIPCDelegate* delegate) = 0;
65
66 // Unregisters a delegate that was previously registered via a call to
67 // AddDelegate(). The audio stream should be in a closed state prior to
68 // calling this function.
69 virtual void RemoveDelegate(int stream_id) = 0;
70 63
71 // Sends a request to create an AudioInputController object in the peer 64 // Sends a request to create an AudioInputController object in the peer
72 // process, identify it by |stream_id| and configure it to use the specified 65 // process, and configures it to use the specified audio |params|. The
73 // audio |params|. The |total_segments| indidates number of equal-lengthed 66 // |total_segments| indidates number of equal-lengthed segments in the shared
74 // segments in the shared memory buffer. 67 // memory buffer. Once the stream has been created, the implementation will
75 // Once the stream has been created, the implementation must 68 // notify |delegate| by calling OnStreamCreated().
76 // generate a notification to the AudioInputIPCDelegate and call 69 virtual void CreateStream(AudioInputIPCDelegate* delegate,
77 // OnStreamCreated().
78 virtual void CreateStream(int stream_id,
79 int session_id, 70 int session_id,
80 const AudioParameters& params, 71 const AudioParameters& params,
81 bool automatic_gain_control, 72 bool automatic_gain_control,
82 uint32 total_segments) = 0; 73 uint32 total_segments) = 0;
83 74
84 // Corresponds to a call to AudioInputController::Record() on the server side. 75 // Corresponds to a call to AudioInputController::Record() on the server side.
85 virtual void RecordStream(int stream_id) = 0; 76 virtual void RecordStream() = 0;
86 77
87 // Sets the volume of the audio stream. 78 // Sets the volume of the audio stream.
88 virtual void SetVolume(int stream_id, double volume) = 0; 79 virtual void SetVolume(double volume) = 0;
89 80
90 // Closes the audio stream and deletes the matching AudioInputController 81 // Closes the audio stream, which should shut down the corresponding
91 // instance. Prior to deleting the AudioInputController object, a call to 82 // AudioInputController in the peer process.
92 // AudioInputController::Close must be made. 83 virtual void CloseStream() = 0;
93 virtual void CloseStream(int stream_id) = 0;
94
95 protected:
96 virtual ~AudioInputIPC();
97 }; 84 };
98 85
99 } // namespace media 86 } // namespace media
100 87
101 #endif // MEDIA_AUDIO_AUDIO_INPUT_IPC_H_ 88 #endif // MEDIA_AUDIO_AUDIO_INPUT_IPC_H_
OLDNEW
« no previous file with comments | « media/audio/audio_input_device.cc ('k') | media/audio/audio_output_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698