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

Unified Diff: chromeos/audio/cras_audio_handler.h

Issue 1199413008: Work around for HDMI audio output rediscovering transistion loss. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed to VLOG. Created 5 years, 6 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 | « ash/system/win/audio/tray_audio_delegate_win.cc ('k') | chromeos/audio/cras_audio_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/audio/cras_audio_handler.h
diff --git a/chromeos/audio/cras_audio_handler.h b/chromeos/audio/cras_audio_handler.h
index 633e30a33a7a2d5d9b4729f747479f23c668b79c..10c77a471da34484a652cd488124cccf26c5613d 100644
--- a/chromeos/audio/cras_audio_handler.h
+++ b/chromeos/audio/cras_audio_handler.h
@@ -11,6 +11,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
+#include "base/timer/timer.h"
#include "chromeos/audio/audio_device.h"
#include "chromeos/audio/audio_pref_observer.h"
#include "chromeos/dbus/audio_node.h"
@@ -188,6 +189,15 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer,
// Enables error logging.
virtual void LogErrors();
+ // If necessary, sets the starting point for re-discovering the active HDMI
+ // output device caused by device entering/exiting docking mode, HDMI display
+ // changing resolution, or chromeos device suspend/resume. If
+ // |force_rediscovering| is true, it will force to set the starting point for
+ // re-discovering the active HDMI output device again if it has been in the
+ // middle of rediscovering the HDMI active output device.
+ virtual void SetActiveHDMIOutoutRediscoveringIfNecessary(
+ bool force_rediscovering);
+
protected:
explicit CrasAudioHandler(
scoped_refptr<AudioDevicesPrefHandler> audio_pref_handler);
@@ -293,6 +303,16 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer,
// Removes |node_id| from additional active nodes.
void RemoveActiveNodeInternal(uint64_t node_id, bool notify);
+ void UpdateAudioAfterHDMIRediscoverGracePeriod();
+
+ bool IsHDMIPrimaryOutputDevice() const;
+
+ void StartHDMIRediscoverGracePeriod();
+
+ bool hdmi_rediscovering() const { return hdmi_rediscovering_; }
+
+ void SetHDMIRediscoverGracePeriodForTesting(int duration_in_ms);
+
enum DeviceStatus {
OLD_DEVICE,
NEW_DEVICE,
@@ -328,6 +348,11 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer,
// Failures are not logged at startup, since CRAS may not be running yet.
bool log_errors_;
+ // Timer for HDMI re-discovering grace period.
+ base::OneShotTimer<CrasAudioHandler> hdmi_rediscover_timer_;
+ int hdmi_rediscover_grace_period_duration_in_ms_;
+ bool hdmi_rediscovering_;
+
base::WeakPtrFactory<CrasAudioHandler> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(CrasAudioHandler);
« no previous file with comments | « ash/system/win/audio/tray_audio_delegate_win.cc ('k') | chromeos/audio/cras_audio_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698