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

Unified Diff: media/audio/audio_output_controller.h

Issue 9121062: Remove "high"-latency audio code path (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more to delete! Created 8 years, 11 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_output_controller.h
diff --git a/media/audio/audio_output_controller.h b/media/audio/audio_output_controller.h
index f6e5722cd4d1a91b7e1f9e50736aa34b652baf24..42f9fc2c4cebfb27c7e7fabc94b7bcc27c7351a9 100644
--- a/media/audio/audio_output_controller.h
+++ b/media/audio/audio_output_controller.h
@@ -30,9 +30,7 @@ class MessageLoop;
// All the public methods of AudioOutputController are non-blocking.
// The actual operations are performed on the audio thread.
//
-// Here is a state diagram for the AudioOutputController for default low
-// latency mode; in normal latency mode there is no "starting" or "paused when
-// starting" states, "created" immediately switches to "playing":
+// Here is a state diagram for the AudioOutputController:
//
// .-----------------------> [ Closed / Error ] <------.
// | ^ |
@@ -48,15 +46,9 @@ class MessageLoop;
//
// * Initial state
//
-// There are two modes of buffering operations supported by this class.
-//
-// Regular latency mode:
-// In this mode we receive signals from AudioOutputController and then we
-// enqueue data into it.
-//
-// Low latency mode:
-// In this mode a DataSource object is given to the AudioOutputController
-// and AudioOutputController reads from it synchronously.
+// The AudioOutputStream can request data from the AudioOutputController via the
+// AudioSourceCallback interface. AudioOutputController uses the SyncReader
henrika (OOO until Aug 14) 2012/01/29 20:54:00 I think we call the same interface on the render s
vrk (LEFT CHROMIUM) 2012/01/31 23:53:08 Yeah, I am planning to go through and rename some
henrika (OOO until Aug 14) 2012/02/01 13:11:29 Sounds fine.
+// passed to it via construction to synchronously fulfill this read request.
//
// The audio thread itself is owned by the AudioManager that the
// AudioOutputController holds a reference to. When performing tasks on the
@@ -89,12 +81,6 @@ class MEDIA_EXPORT AudioOutputController
virtual void OnPlaying(AudioOutputController* controller) = 0;
virtual void OnPaused(AudioOutputController* controller) = 0;
virtual void OnError(AudioOutputController* controller, int error_code) = 0;
-
- // Audio controller asks for more data.
- // |pending_bytes| is the number of bytes still on the controller.
- // |timestamp| is then time when |pending_bytes| is recorded.
- virtual void OnMoreData(AudioOutputController* controller,
- AudioBuffersState buffers_state) = 0;
};
// A synchronous reader interface used by AudioOutputController for
@@ -131,15 +117,6 @@ class MEDIA_EXPORT AudioOutputController
AudioManager* audio_manager,
EventHandler* event_handler,
const AudioParameters& params,
- // Soft limit for buffer capacity in this controller. This parameter
- // is used only in regular latency mode.
- uint32 buffer_capacity);
-
- // Factory method for creating a low latency audio stream.
- static scoped_refptr<AudioOutputController> CreateLowLatency(
- AudioManager* audio_manager,
- EventHandler* event_handler,
- const AudioParameters& params,
// External synchronous reader for audio controller.
SyncReader* sync_reader);
@@ -167,13 +144,6 @@ class MEDIA_EXPORT AudioOutputController
// Sets the volume of the audio output stream.
void SetVolume(double volume);
- // Enqueue audio |data| into the controller. This method is used only in
- // the regular latency mode and it is illegal to call this method when
- // SyncReader is present.
- void EnqueueData(const uint8* data, uint32 size);
-
- bool LowLatencyMode() const { return sync_reader_ != NULL; }
-
///////////////////////////////////////////////////////////////////////////
// AudioSourceCallback methods.
virtual uint32 OnMoreData(AudioOutputStream* stream,
@@ -206,7 +176,7 @@ class MEDIA_EXPORT AudioOutputController
AudioOutputController(AudioManager* audio_manager,
EventHandler* handler,
- uint32 capacity, SyncReader* sync_reader);
+ SyncReader* sync_reader);
// The following methods are executed on the audio controller thread.
void DoCreate(const AudioParameters& params);
@@ -218,9 +188,6 @@ class MEDIA_EXPORT AudioOutputController
void DoSetVolume(double volume);
void DoReportError(int code);
- // Helper method to submit a OnMoreData() call to the event handler.
- void SubmitOnMoreData_Locked();
-
// Helper method that starts physical stream.
void StartStream();
@@ -241,15 +208,10 @@ class MEDIA_EXPORT AudioOutputController
// is not required for reading on the audio controller thread.
State state_;
- AudioBuffersState buffers_state_;
-
- // The |lock_| must be acquired whenever we access |buffer_|.
+ // The |lock_| must be acquired whenever we access |state_| from a thread
+ // other than the audio controller thread.
henrika (OOO until Aug 14) 2012/01/29 20:54:00 Rename to audio-manager thread?
vrk (LEFT CHROMIUM) 2012/01/31 23:53:08 Done.
base::Lock lock_;
- media::SeekableBuffer buffer_;
-
- bool pending_request_;
-
// SyncReader is used only in low latency mode for synchronous reading.
SyncReader* sync_reader_;

Powered by Google App Engine
This is Rietveld 408576698