mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Re-implement audio capturing based on the AudioService API (fixes issue #2755)
This commit is contained in:
committed by
Marshall Greenblatt
parent
d65483ae16
commit
8d01442d75
@ -48,6 +48,7 @@ class Widget;
|
||||
}
|
||||
#endif // defined(USE_AURA)
|
||||
|
||||
class CefAudioCapturer;
|
||||
class CefBrowserInfo;
|
||||
class CefBrowserPlatformDelegate;
|
||||
class CefDevToolsFrontend;
|
||||
@ -486,6 +487,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
||||
base::ProcessId plugin_pid) override;
|
||||
void DidUpdateFaviconURL(
|
||||
const std::vector<blink::mojom::FaviconURLPtr>& candidates) override;
|
||||
void OnAudioStateChanged(bool audible) override;
|
||||
bool OnMessageReceived(const IPC::Message& message) override;
|
||||
bool OnMessageReceived(const IPC::Message& message,
|
||||
content::RenderFrameHost* render_frame_host) override;
|
||||
@ -505,6 +507,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
||||
void AddObserver(Observer* observer);
|
||||
void RemoveObserver(Observer* observer);
|
||||
bool HasObserver(Observer* observer) const;
|
||||
|
||||
class NavigationLock final {
|
||||
private:
|
||||
friend class CefBrowserHostImpl;
|
||||
@ -585,6 +588,10 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
||||
|
||||
void ConfigureAutoResize();
|
||||
|
||||
void StartAudioCapturer();
|
||||
|
||||
void OnRecentlyAudibleTimerFired();
|
||||
|
||||
CefBrowserSettings settings_;
|
||||
CefRefPtr<CefClient> client_;
|
||||
scoped_refptr<CefBrowserInfo> browser_info_;
|
||||
@ -667,6 +674,14 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
||||
CefRefPtr<CefExtension> extension_;
|
||||
bool is_background_host_ = false;
|
||||
|
||||
// Used for capturing audio for CefAudioHandler.
|
||||
std::unique_ptr<CefAudioCapturer> audio_capturer_;
|
||||
|
||||
// Timer for determining when "recently audible" transitions to false. This
|
||||
// starts running when a tab stops being audible, and is canceled if it starts
|
||||
// being audible again before it fires.
|
||||
base::OneShotTimer recently_audible_timer_;
|
||||
|
||||
// Used with auto-resize.
|
||||
bool auto_resize_enabled_ = false;
|
||||
gfx::Size auto_resize_min_;
|
||||
|
Reference in New Issue
Block a user