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

Side by Side Diff: media/base/audio_renderer_sink.h

Issue 2836293002: Introduce AudioRendererSink::IsOptimizedForHardwareParameters (Closed)
Patch Set: Revise comment Created 3 years, 7 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
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_BASE_AUDIO_RENDERER_SINK_H_ 5 #ifndef MEDIA_BASE_AUDIO_RENDERER_SINK_H_
6 #define MEDIA_BASE_AUDIO_RENDERER_SINK_H_ 6 #define MEDIA_BASE_AUDIO_RENDERER_SINK_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // Pauses playback. 59 // Pauses playback.
60 virtual void Pause() = 0; 60 virtual void Pause() = 0;
61 61
62 // Resumes playback after calling Pause(). 62 // Resumes playback after calling Pause().
63 virtual void Play() = 0; 63 virtual void Play() = 0;
64 64
65 // Sets the playback volume, with range [0.0, 1.0] inclusive. 65 // Sets the playback volume, with range [0.0, 1.0] inclusive.
66 // Returns |true| on success. 66 // Returns |true| on success.
67 virtual bool SetVolume(double volume) = 0; 67 virtual bool SetVolume(double volume) = 0;
68 68
69 // Returns current output device information. If the information is not 69 // Returns current output device id and status with the optimal parameters
70 // given the sink's internal state. These may be the output device's
71 // parameters or the given |preferred_params|. If the information is not
70 // available yet, this method may block until it becomes available. 72 // available yet, this method may block until it becomes available.
71 // If the sink is not associated with any output device, |device_status| of 73 // If the sink is not associated with any output device, |device_status| of
72 // OutputDeviceInfo should be set to OUTPUT_DEVICE_STATUS_ERROR_INTERNAL. 74 // OutputDeviceInfo should be set to OUTPUT_DEVICE_STATUS_ERROR_INTERNAL.
73 // Must never be called on the IO thread. 75 // Must never be called on the IO thread.
74 virtual OutputDeviceInfo GetOutputDeviceInfo() = 0; 76 virtual OutputDeviceInfo GetOutputDeviceInfo(
77 const AudioParameters& preferred_params = AudioParameters()) = 0;
o1ka 2017/04/28 09:57:18 What happens in the default case? What if |preferr
75 78
76 // If DCHECKs are enabled, this function returns true if called on rendering 79 // If DCHECKs are enabled, this function returns true if called on rendering
77 // thread, otherwise false. With DCHECKs disabled, it returns true. Thus, it 80 // thread, otherwise false. With DCHECKs disabled, it returns true. Thus, it
78 // is intended to be used for DCHECKing. 81 // is intended to be used for DCHECKing.
79 virtual bool CurrentThreadIsRenderingThread() = 0; 82 virtual bool CurrentThreadIsRenderingThread() = 0;
80 83
81 protected: 84 protected:
82 friend class base::RefCountedThreadSafe<AudioRendererSink>; 85 friend class base::RefCountedThreadSafe<AudioRendererSink>;
83 virtual ~AudioRendererSink() {} 86 virtual ~AudioRendererSink() {}
84 }; 87 };
(...skipping 19 matching lines...) Expand all
104 const url::Origin& security_origin, 107 const url::Origin& security_origin,
105 const OutputDeviceStatusCB& callback) = 0; 108 const OutputDeviceStatusCB& callback) = 0;
106 109
107 protected: 110 protected:
108 ~SwitchableAudioRendererSink() override {} 111 ~SwitchableAudioRendererSink() override {}
109 }; 112 };
110 113
111 } // namespace media 114 } // namespace media
112 115
113 #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_ 116 #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698