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

Unified 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, 10 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
Index: media/audio/audio_input_ipc.h
diff --git a/media/audio/audio_input_ipc.h b/media/audio/audio_input_ipc.h
index eb4e72dfae0b31145e1fbd869b7553f92f97a23f..aaa4a870e39e2cbe8f6c53fcdc21b3b2283b061d 100644
--- a/media/audio/audio_input_ipc.h
+++ b/media/audio/audio_input_ipc.h
@@ -48,55 +48,47 @@ class MEDIA_EXPORT AudioInputIPCDelegate {
// Called when the AudioInputIPC object is going away and/or when the
// IPC channel has been closed and no more IPC requests can be made.
- // Implementations must clear any references to the AudioInputIPC object
- // at this point.
+ // Implementations should delete their owned AudioInputIPC instance
+ // immediately.
virtual void OnIPCClosed() = 0;
protected:
virtual ~AudioInputIPCDelegate();
};
-// Provides IPC functionality for an AudioInputDevice. The implementation
-// should asynchronously deliver the messages to an AudioInputController object
-// (or create one in the case of CreateStream()), that may live in a separate
-// process.
+// Provides IPC functionality for an AudioInputIPCDelegate (e.g., and
+// AudioInputDevice. The implementation should asynchronously deliver the
+// messages to an AudioInputController object (or create one in the case of
+// CreateStream()), that may live in a separate process.
class MEDIA_EXPORT AudioInputIPC {
public:
- // Registers an AudioInputIPCDelegate and returns a |stream_id| that
- // must be used with all other IPC functions in this interface.
- virtual int AddDelegate(AudioInputIPCDelegate* delegate) = 0;
-
- // Unregisters a delegate that was previously registered via a call to
- // AddDelegate(). The audio stream should be in a closed state prior to
- // calling this function.
- virtual void RemoveDelegate(int stream_id) = 0;
+ virtual ~AudioInputIPC();
// Sends a request to create an AudioInputController object in the peer
- // process, identify it by |stream_id| and configure it to use the specified
- // audio |params|. Once the stream has been created, the implementation must
- // generate a notification to the AudioInputIPCDelegate and call
- // OnStreamCreated().
- virtual void CreateStream(int stream_id, const AudioParameters& params,
- const std::string& device_id, bool automatic_gain_control) = 0;
+ // process and configures it to use the specified audio |params|. Once the
+ // stream has been created, the implementation will notify |delegate| by
+ // calling OnStreamCreated().
+ virtual void CreateStream(AudioInputIPCDelegate* delegate,
+ const AudioParameters& params,
+ const std::string& device_id,
palmer 2013/03/05 21:09:32 Same, no string.
DaleCurtis 2013/03/05 23:29:54 I think this is a change for a separate CL if it e
miu 2013/03/06 22:36:52 Definitely falls within the scope of http://crbug.
+ bool automatic_gain_control) = 0;
// Starts the device on the server side. Once the device has started,
// or failed to start, a callback to
- // AudioInputIPCDelegate::OnDeviceReady() must be made.
- virtual void StartDevice(int stream_id, int session_id) = 0;
+ // AudioInputIPCDelegate::OnDeviceReady() will be made.
+ //
+ // TODO(miu): Merge StartDevice into CreateStream (http://crbug.com/179597).
+ virtual void StartDevice(AudioInputIPCDelegate* delegate, int session_id) = 0;
// Corresponds to a call to AudioInputController::Record() on the server side.
- virtual void RecordStream(int stream_id) = 0;
+ virtual void RecordStream() = 0;
// Sets the volume of the audio stream.
- virtual void SetVolume(int stream_id, double volume) = 0;
-
- // Closes the audio stream and deletes the matching AudioInputController
- // instance. Prior to deleting the AudioInputController object, a call to
- // AudioInputController::Close must be made.
- virtual void CloseStream(int stream_id) = 0;
+ virtual void SetVolume(double volume) = 0;
- protected:
- virtual ~AudioInputIPC();
+ // Closes the audio stream which should shut down the corresponding
+ // AudioInputController in the peer process.
+ virtual void CloseStream() = 0;
};
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698