Skip to content

Commit 59755e7

Browse files
committed
Remove IAudioHandler
The Chromium implementation has changed so dramatically that CEF has removed support see https://bitbucket.org/chromiumembedded/cef/commits/1f893c76a97eaa88e3ff782b8e2e47dd0f5d27b2 Track https://bitbucket.org/chromiumembedded/cef/issues/2755/reimplement-audio-mirroring-for for details on when it will be reimplemented Original Issue #2727
1 parent 34e15f1 commit 59755e7

File tree

13 files changed

+5
-359
lines changed

13 files changed

+5
-359
lines changed

CefSharp.Core/Internals/ClientAdapter.cpp

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -978,42 +978,6 @@ namespace CefSharp
978978
}
979979
}
980980

981-
void ClientAdapter::OnAudioStreamStarted(CefRefPtr<CefBrowser> browser, int audio_stream_id, int channels, ChannelLayout channel_layout, int sample_rate, int frames_per_buffer)
982-
{
983-
auto handler = _browserControl->AudioHandler;
984-
985-
if (handler != nullptr)
986-
{
987-
auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup());
988-
989-
handler->OnAudioStreamStarted(_browserControl, browserWrapper, audio_stream_id, channels, (CefSharp::Enums::ChannelLayout)channel_layout, sample_rate, frames_per_buffer);
990-
}
991-
}
992-
993-
void ClientAdapter::OnAudioStreamPacket(CefRefPtr<CefBrowser> browser, int audio_stream_id, const float** data, int frames, int64 pts)
994-
{
995-
auto handler = _browserControl->AudioHandler;
996-
997-
if (handler != nullptr)
998-
{
999-
auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup());
1000-
1001-
handler->OnAudioStreamPacket(_browserControl, browserWrapper, audio_stream_id, IntPtr((void *)data), frames, pts);
1002-
}
1003-
}
1004-
1005-
void ClientAdapter::OnAudioStreamStopped(CefRefPtr<CefBrowser> browser, int audio_stream_id)
1006-
{
1007-
auto handler = _browserControl->AudioHandler;
1008-
1009-
if (handler != nullptr)
1010-
{
1011-
auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup());
1012-
1013-
handler->OnAudioStreamStopped(_browserControl, browserWrapper, audio_stream_id);
1014-
}
1015-
}
1016-
1017981
bool ClientAdapter::OnProcessMessageReceived(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefProcessId source_process, CefRefPtr<CefProcessMessage> message)
1018982
{
1019983
auto handled = false;

CefSharp.Core/Internals/ClientAdapter.h

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ namespace CefSharp
3232
public CefDialogHandler,
3333
public CefDragHandler,
3434
public CefDownloadHandler,
35-
public CefFindHandler,
36-
public CefAudioHandler
35+
public CefFindHandler
3736
{
3837
private:
3938
gcroot<IWebBrowserInternal^> _browserControl;
@@ -101,17 +100,6 @@ namespace CefSharp
101100
virtual DECL CefRefPtr<CefDialogHandler> GetDialogHandler() OVERRIDE { return this; }
102101
virtual DECL CefRefPtr<CefDragHandler> GetDragHandler() OVERRIDE { return this; }
103102
virtual DECL CefRefPtr<CefFindHandler> GetFindHandler() OVERRIDE { return this; }
104-
virtual DECL CefRefPtr<CefAudioHandler> GetAudioHandler() OVERRIDE
105-
{
106-
//Audio Mirroring in CEF is only enabled when we a handler is returned
107-
//We return NULL if no handler is specified for performance reasons
108-
if (_browserControl->AudioHandler == nullptr)
109-
{
110-
return NULL;
111-
}
112-
113-
return this;
114-
}
115103
virtual DECL bool OnProcessMessageReceived(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefProcessId source_process, CefRefPtr<CefProcessMessage> message) OVERRIDE;
116104

117105

@@ -202,11 +190,6 @@ namespace CefSharp
202190
//CefFindHandler
203191
virtual DECL void OnFindResult(CefRefPtr<CefBrowser> browser, int identifier, int count, const CefRect& selectionRect, int activeMatchOrdinal, bool finalUpdate) OVERRIDE;
204192

205-
//CefAudioHandler
206-
virtual DECL void OnAudioStreamStarted(CefRefPtr<CefBrowser> browser, int audio_stream_id, int channels, ChannelLayout channel_layout, int sample_rate, int frames_per_buffer) OVERRIDE;
207-
virtual DECL void OnAudioStreamPacket(CefRefPtr<CefBrowser> browser, int audio_stream_id, const float** data, int frames, int64 pts) OVERRIDE;
208-
virtual DECL void OnAudioStreamStopped(CefRefPtr<CefBrowser> browser, int audio_stream_id) OVERRIDE;
209-
210193
IMPLEMENT_REFCOUNTING(ClientAdapter);
211194
};
212195
}

CefSharp.Example/CefSharp.Example.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
</ItemGroup>
7373
<ItemGroup>
7474
<Compile Include="Callback\RunFileDialogCallback.cs" />
75-
<Compile Include="Handlers\AudioHandler.cs" />
7675
<Compile Include="Handlers\ExampleResourceRequestHandler.cs" />
7776
<Compile Include="Handlers\ExtensionHandler.cs" />
7877
<Compile Include="JavascriptBinding\AsyncBoundObject.cs" />

CefSharp.Example/Handlers/AudioHandler.cs

Lines changed: 0 additions & 35 deletions
This file was deleted.

CefSharp.OffScreen/ChromiumWebBrowser.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,13 @@ public bool IsDisposed
184184
/// </summary>
185185
/// <value>The find handler.</value>
186186
public IFindHandler FindHandler { get; set; }
187-
/// <summary>
188-
/// Implement <see cref="IAudioHandler" /> to handle audio events.
189-
/// </summary>
190-
public IAudioHandler AudioHandler { get; set; }
187+
191188
/// <summary>
192189
/// Implement <see cref="IAccessibilityHandler" /> to handle events related to accessibility.
193190
/// </summary>
194191
/// <value>The accessibility handler.</value>
195192
public IAccessibilityHandler AccessibilityHandler { get; set; }
193+
196194
/// <summary>
197195
/// Event handler that will get called when the resource load for a navigation fails or is canceled.
198196
/// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI

CefSharp.WinForms/ChromiumWebBrowser.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,6 @@ public IRequestContext RequestContext
230230
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), DefaultValue(null)]
231231
public IFindHandler FindHandler { get; set; }
232232
/// <summary>
233-
/// Implement <see cref="IAudioHandler" /> to handle audio events.
234-
/// </summary>
235-
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), DefaultValue(null)]
236-
public IAudioHandler AudioHandler { get; set; }
237-
/// <summary>
238233
/// The <see cref="IFocusHandler" /> for this ChromiumWebBrowser.
239234
/// </summary>
240235
/// <value>The focus handler.</value>

CefSharp.Wpf.Example/Views/BrowserTabView.xaml.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ public BrowserTabView()
9999
downloadHandler.OnBeforeDownloadFired += OnBeforeDownloadFired;
100100
downloadHandler.OnDownloadUpdatedFired += OnDownloadUpdatedFired;
101101
browser.DownloadHandler = downloadHandler;
102-
browser.AudioHandler = new AudioHandler();
103102

104103
//Read an embedded bitmap into a memory stream then register it as a resource you can then load custom://cefsharp/images/beach.jpg
105104
var beachImageStream = new MemoryStream();
@@ -148,7 +147,7 @@ public BrowserTabView()
148147
var errorBody = string.Format("<html><body bgcolor=\"white\"><h2>Failed to load URL {0} with error {1} ({2}).</h2></body></html>",
149148
args.FailedUrl, args.ErrorText, args.ErrorCode);
150149

151-
args.Frame.LoadHtml(errorBody, base64Encode: true);
150+
args.Frame.LoadHtml(errorBody, base64Encode:true);
152151
};
153152

154153
CefExample.RegisterTestResources(browser);

CefSharp.Wpf/ChromiumWebBrowser.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,7 @@ public IRequestContext RequestContext
288288
/// </summary>
289289
/// <value>The find handler.</value>
290290
public IFindHandler FindHandler { get; set; }
291-
/// <summary>
292-
/// Implement <see cref="IAudioHandler" /> to handle audio events.
293-
/// </summary>
294-
public IAudioHandler AudioHandler { get; set; }
291+
295292
/// <summary>
296293
/// Implement <see cref="IAccessibilityHandler" /> to handle events related to accessibility.
297294
/// </summary>

CefSharp/CefSharp.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@
107107
<Compile Include="ResourceRequestHandlerFactory.cs" />
108108
<Compile Include="ResourceRequestHandlerFactoryItem.cs" />
109109
<Compile Include="Enums\AlphaType.cs" />
110-
<Compile Include="Enums\ChannelLayout.cs" />
111110
<Compile Include="Enums\PointerType.cs" />
112111
<Compile Include="Enums\TextInputMode.cs" />
113112
<Compile Include="Enums\TouchEventType.cs" />
@@ -127,7 +126,6 @@
127126
<Compile Include="Handler\ICookieAccessFilter.cs" />
128127
<Compile Include="Handler\IResourceRequestHandler.cs" />
129128
<Compile Include="IApp.cs" />
130-
<Compile Include="Handler\IAudioHandler.cs" />
131129
<Compile Include="IExtension.cs" />
132130
<Compile Include="Internals\IMethodRunnerQueue.cs" />
133131
<Compile Include="Internals\ConcurrentMethodRunnerQueue.cs" />

CefSharp/Enums/ChannelLayout.cs

Lines changed: 0 additions & 187 deletions
This file was deleted.

0 commit comments

Comments
 (0)