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

Unified Diff: media/audio/pulse/pulse_unified.h

Issue 163343002: Reland 153623004: Remove the unified IO code on the browser (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixed the cras bot Created 6 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
« no previous file with comments | « media/audio/pulse/audio_manager_pulse.cc ('k') | media/audio/pulse/pulse_unified.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/pulse/pulse_unified.h
diff --git a/media/audio/pulse/pulse_unified.h b/media/audio/pulse/pulse_unified.h
deleted file mode 100644
index a800d099a109ff0d2941a32b9865930ff76ebaf5..0000000000000000000000000000000000000000
--- a/media/audio/pulse/pulse_unified.h
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef MEDIA_AUDIO_PULSE_PULSE_UNIFIED_H_
-#define MEDIA_AUDIO_PULSE_PULSE_UNIFIED_H_
-
-#include <pulse/pulseaudio.h>
-#include <string>
-
-#include "base/memory/scoped_ptr.h"
-#include "media/audio/audio_io.h"
-#include "media/audio/audio_parameters.h"
-#include "media/base/audio_fifo.h"
-
-namespace media {
-
-class AudioManagerBase;
-class SeekableBuffer;
-
-class PulseAudioUnifiedStream : public AudioOutputStream {
- public:
- PulseAudioUnifiedStream(const AudioParameters& params,
- const std::string& input_device_id,
- AudioManagerBase* manager);
-
- virtual ~PulseAudioUnifiedStream();
-
- // Implementation of PulseAudioUnifiedStream.
- virtual bool Open() OVERRIDE;
- virtual void Close() OVERRIDE;
- virtual void Start(AudioSourceCallback* callback) OVERRIDE;
- virtual void Stop() OVERRIDE;
- virtual void SetVolume(double volume) OVERRIDE;
- virtual void GetVolume(double* volume) OVERRIDE;
-
- private:
- // Called by PulseAudio when |pa_stream_| change state. If an unexpected
- // failure state change happens and |source_callback_| is set
- // this method will forward the error via OnError().
- static void StreamNotifyCallback(pa_stream* s, void* user_data);
-
- // Called by PulseAudio recording stream when it has data.
- static void ReadCallback(pa_stream* s, size_t length, void* user_data);
-
- // Helpers for ReadCallback() to read and write data.
- void WriteData(size_t requested_bytes);
- void ReadData();
-
- // Close() helper function to free internal structs.
- void Reset();
-
- // AudioParameters from the constructor.
- const AudioParameters params_;
-
- // Device unique ID of the input device.
- const std::string input_device_id_;
-
- // Audio manager that created us. Used to report that we've closed.
- AudioManagerBase* manager_;
-
- // PulseAudio API structs.
- pa_context* pa_context_;
- pa_threaded_mainloop* pa_mainloop_;
- pa_stream* input_stream_;
- pa_stream* output_stream_;
-
- // Float representation of volume from 0.0 to 1.0.
- float volume_;
-
- // Callback to audio data source. Must only be modified while holding a lock
- // on |pa_mainloop_| via pa_threaded_mainloop_lock().
- AudioSourceCallback* source_callback_;
-
- scoped_ptr<AudioBus> input_bus_;
- scoped_ptr<AudioBus> output_bus_;
-
- // Used for input to output buffering.
- scoped_ptr<media::SeekableBuffer> fifo_;
-
- // Temporary storage for recorded data. It gets a packet of data from
- // |fifo_| and deliver the data to OnMoreIOData() callback.
- scoped_ptr<uint8[]> input_data_buffer_;
-
- DISALLOW_COPY_AND_ASSIGN(PulseAudioUnifiedStream);
-};
-
-} // namespace media
-
-#endif // MEDIA_AUDIO_PULSE_PULSE_UNIFIED_H_
« no previous file with comments | « media/audio/pulse/audio_manager_pulse.cc ('k') | media/audio/pulse/pulse_unified.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698