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

Side by Side Diff: media/audio/cras/cras_input.h

Issue 2516813002: Enable pinning stream output routing for webapp request on ChromeOS (Closed)
Patch Set: comment Created 4 years 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
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_CRAS_CRAS_INPUT_H_ 5 #ifndef MEDIA_AUDIO_CRAS_CRAS_INPUT_H_
6 #define MEDIA_AUDIO_CRAS_CRAS_INPUT_H_ 6 #define MEDIA_AUDIO_CRAS_CRAS_INPUT_H_
7 7
8 #include <cras_client.h> 8 #include <cras_client.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 bool Open() override; 42 bool Open() override;
43 void Start(AudioInputCallback* callback) override; 43 void Start(AudioInputCallback* callback) override;
44 void Stop() override; 44 void Stop() override;
45 void Close() override; 45 void Close() override;
46 double GetMaxVolume() override; 46 double GetMaxVolume() override;
47 void SetVolume(double volume) override; 47 void SetVolume(double volume) override;
48 double GetVolume() override; 48 double GetVolume() override;
49 bool IsMuted() override; 49 bool IsMuted() override;
50 50
51 private: 51 private:
52 // Checks if |device_id| corresponds to 'Default' choice.
53 bool IsDefault(const std::string& device_id) const;
54
55 // Handles requests to get samples from the provided buffer. This will be 52 // Handles requests to get samples from the provided buffer. This will be
56 // called by the audio server when it has samples ready. 53 // called by the audio server when it has samples ready.
57 static int SamplesReady(cras_client* client, 54 static int SamplesReady(cras_client* client,
58 cras_stream_id_t stream_id, 55 cras_stream_id_t stream_id,
59 uint8_t* samples, 56 uint8_t* samples,
60 size_t frames, 57 size_t frames,
61 const timespec* sample_ts, 58 const timespec* sample_ts,
62 void* arg); 59 void* arg);
63 60
64 // Handles notification that there was an error with the playback stream. 61 // Handles notification that there was an error with the playback stream.
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 bool mute_done_; 116 bool mute_done_;
120 117
121 std::unique_ptr<AudioBus> audio_bus_; 118 std::unique_ptr<AudioBus> audio_bus_;
122 119
123 DISALLOW_COPY_AND_ASSIGN(CrasInputStream); 120 DISALLOW_COPY_AND_ASSIGN(CrasInputStream);
124 }; 121 };
125 122
126 } // namespace media 123 } // namespace media
127 124
128 #endif // MEDIA_AUDIO_CRAS_CRAS_INPUT_H_ 125 #endif // MEDIA_AUDIO_CRAS_CRAS_INPUT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698