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

Unified Diff: chromecast/media/cma/backend/alsa/stream_mixer_alsa_input_impl.h

Issue 2738873002: [Chromecast] Implement new volume control API (Closed)
Patch Set: no need for ALSA volume control Created 3 years, 9 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: chromecast/media/cma/backend/alsa/stream_mixer_alsa_input_impl.h
diff --git a/chromecast/media/cma/backend/alsa/stream_mixer_alsa_input_impl.h b/chromecast/media/cma/backend/alsa/stream_mixer_alsa_input_impl.h
index 2ff54a859e117e942261b598c6f75c491587ece7..73186b03df2f7024c06264f4926998fefe192d59 100644
--- a/chromecast/media/cma/backend/alsa/stream_mixer_alsa_input_impl.h
+++ b/chromecast/media/cma/backend/alsa/stream_mixer_alsa_input_impl.h
@@ -18,6 +18,7 @@
#include "chromecast/media/cma/backend/alsa/slew_volume.h"
#include "chromecast/media/cma/backend/alsa/stream_mixer_alsa.h"
#include "chromecast/media/cma/backend/alsa/stream_mixer_alsa_input.h"
+#include "chromecast/public/volume_control.h"
namespace base {
class SingleThreadTaskRunner;
@@ -94,6 +95,7 @@ class StreamMixerAlsaInputImpl : public StreamMixerAlsa::InputQueue {
int input_samples_per_second,
bool primary,
const std::string& device_id,
+ AudioContentType content_type,
StreamMixerAlsa* mixer);
~StreamMixerAlsaInputImpl() override;
@@ -120,6 +122,7 @@ class StreamMixerAlsaInputImpl : public StreamMixerAlsa::InputQueue {
int input_samples_per_second() const override;
bool primary() const override;
std::string device_id() const override;
+ AudioContentType content_type() const override;
bool IsDeleting() const override;
void Initialize(const MediaPipelineBackendAlsa::RenderingDelay&
mixer_rendering_delay) override;
@@ -136,6 +139,8 @@ class StreamMixerAlsaInputImpl : public StreamMixerAlsa::InputQueue {
mixer_rendering_delay) override;
void SignalError(StreamMixerAlsaInput::MixerError error) override;
void PrepareToDelete(const OnReadyToDeleteCb& delete_cb) override;
+ void SetContentTypeVolume(float volume) override;
+ void SetMuted(bool muted) override;
// Tells the mixer to delete |this|. Makes sure not to call |delete_cb_| more
// than once for |this|.
@@ -154,7 +159,8 @@ class StreamMixerAlsaInputImpl : public StreamMixerAlsa::InputQueue {
StreamMixerAlsaInput::Delegate* const delegate_;
const int input_samples_per_second_;
const bool primary_;
- std::string device_id_;
+ const std::string device_id_;
+ const AudioContentType content_type_;
StreamMixerAlsa* const mixer_;
FilterGroup* filter_group_;
const scoped_refptr<base::SingleThreadTaskRunner> mixer_task_runner_;
@@ -163,6 +169,10 @@ class StreamMixerAlsaInputImpl : public StreamMixerAlsa::InputQueue {
double resample_ratio_;
State state_;
+
+ float stream_volume_multiplier_;
+ float type_volume_multiplier_;
+ float mute_volume_multiplier_;
SlewVolume slew_volume_;
base::Lock queue_lock_; // Lock for the following queue-related members.

Powered by Google App Engine
This is Rietveld 408576698