2024-01-05 19:03:36 +01:00
|
|
|
// Copyright (c) 2024 The Chromium Embedded Framework Authors. All rights
|
2020-05-01 20:18:18 +02:00
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
//
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// This file was generated by the CEF translator tool. If making changes by
|
|
|
|
// hand only do so within the body of existing method and function
|
|
|
|
// implementations. See the translator.README.txt file in the tools directory
|
|
|
|
// for more information.
|
|
|
|
//
|
2024-01-05 19:03:36 +01:00
|
|
|
// $hash=63f55ceeec4a649ad2331bb0304557b7c0e4cb31$
|
2020-05-01 20:18:18 +02:00
|
|
|
//
|
|
|
|
|
|
|
|
#include "libcef_dll/cpptoc/audio_handler_cpptoc.h"
|
|
|
|
#include "libcef_dll/ctocpp/browser_ctocpp.h"
|
|
|
|
#include "libcef_dll/shutdown_checker.h"
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
|
|
|
int CEF_CALLBACK
|
|
|
|
audio_handler_get_audio_parameters(struct _cef_audio_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser,
|
|
|
|
cef_audio_parameters_t* params) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2020-05-01 20:18:18 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2020-05-01 20:18:18 +02:00
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser) {
|
2020-05-01 20:18:18 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2020-05-01 20:18:18 +02:00
|
|
|
// Verify param: params; type: simple_byref
|
|
|
|
DCHECK(params);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!params) {
|
2020-05-01 20:18:18 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2020-05-01 20:18:18 +02:00
|
|
|
|
|
|
|
// Translate param: params; type: simple_byref
|
|
|
|
CefAudioParameters paramsVal = params ? *params : CefAudioParameters();
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefAudioHandlerCppToC::Get(self)->GetAudioParameters(
|
|
|
|
CefBrowserCToCpp::Wrap(browser), paramsVal);
|
|
|
|
|
|
|
|
// Restore param: params; type: simple_byref
|
2023-01-02 23:47:15 +01:00
|
|
|
if (params) {
|
2020-05-01 20:18:18 +02:00
|
|
|
*params = paramsVal;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2020-05-01 20:18:18 +02:00
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK
|
|
|
|
audio_handler_on_audio_stream_started(struct _cef_audio_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser,
|
|
|
|
const cef_audio_parameters_t* params,
|
|
|
|
int channels) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2020-05-01 20:18:18 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2020-05-01 20:18:18 +02:00
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser) {
|
2020-05-01 20:18:18 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2020-05-01 20:18:18 +02:00
|
|
|
// Verify param: params; type: simple_byref_const
|
|
|
|
DCHECK(params);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!params) {
|
2020-05-01 20:18:18 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2020-05-01 20:18:18 +02:00
|
|
|
|
|
|
|
// Translate param: params; type: simple_byref_const
|
|
|
|
CefAudioParameters paramsVal = params ? *params : CefAudioParameters();
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefAudioHandlerCppToC::Get(self)->OnAudioStreamStarted(
|
|
|
|
CefBrowserCToCpp::Wrap(browser), paramsVal, channels);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK
|
|
|
|
audio_handler_on_audio_stream_packet(struct _cef_audio_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser,
|
|
|
|
const float** data,
|
|
|
|
int frames,
|
2023-06-01 16:07:20 +02:00
|
|
|
int64_t pts) {
|
2020-05-01 20:18:18 +02:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2020-05-01 20:18:18 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2020-05-01 20:18:18 +02:00
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser) {
|
2020-05-01 20:18:18 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2020-05-01 20:18:18 +02:00
|
|
|
// Verify param: data; type: simple_byaddr
|
|
|
|
DCHECK(data);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!data) {
|
2020-05-01 20:18:18 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2020-05-01 20:18:18 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefAudioHandlerCppToC::Get(self)->OnAudioStreamPacket(
|
|
|
|
CefBrowserCToCpp::Wrap(browser), data, frames, pts);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK
|
|
|
|
audio_handler_on_audio_stream_stopped(struct _cef_audio_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2020-05-01 20:18:18 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2020-05-01 20:18:18 +02:00
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser) {
|
2020-05-01 20:18:18 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2020-05-01 20:18:18 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefAudioHandlerCppToC::Get(self)->OnAudioStreamStopped(
|
|
|
|
CefBrowserCToCpp::Wrap(browser));
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK
|
|
|
|
audio_handler_on_audio_stream_error(struct _cef_audio_handler_t* self,
|
|
|
|
struct _cef_browser_t* browser,
|
|
|
|
const cef_string_t* message) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2020-05-01 20:18:18 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2020-05-01 20:18:18 +02:00
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser) {
|
2020-05-01 20:18:18 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2020-05-01 20:18:18 +02:00
|
|
|
// Verify param: message; type: string_byref_const
|
|
|
|
DCHECK(message);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!message) {
|
2020-05-01 20:18:18 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2020-05-01 20:18:18 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefAudioHandlerCppToC::Get(self)->OnAudioStreamError(
|
|
|
|
CefBrowserCToCpp::Wrap(browser), CefString(message));
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefAudioHandlerCppToC::CefAudioHandlerCppToC() {
|
|
|
|
GetStruct()->get_audio_parameters = audio_handler_get_audio_parameters;
|
|
|
|
GetStruct()->on_audio_stream_started = audio_handler_on_audio_stream_started;
|
|
|
|
GetStruct()->on_audio_stream_packet = audio_handler_on_audio_stream_packet;
|
|
|
|
GetStruct()->on_audio_stream_stopped = audio_handler_on_audio_stream_stopped;
|
|
|
|
GetStruct()->on_audio_stream_error = audio_handler_on_audio_stream_error;
|
|
|
|
}
|
|
|
|
|
|
|
|
// DESTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefAudioHandlerCppToC::~CefAudioHandlerCppToC() {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
CefRefPtr<CefAudioHandler> CefCppToCRefCounted<
|
|
|
|
CefAudioHandlerCppToC,
|
|
|
|
CefAudioHandler,
|
|
|
|
cef_audio_handler_t>::UnwrapDerived(CefWrapperType type,
|
|
|
|
cef_audio_handler_t* s) {
|
2023-05-08 17:15:02 +02:00
|
|
|
DCHECK(false) << "Unexpected class type: " << type;
|
2020-05-01 20:18:18 +02:00
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
CefWrapperType CefCppToCRefCounted<CefAudioHandlerCppToC,
|
|
|
|
CefAudioHandler,
|
|
|
|
cef_audio_handler_t>::kWrapperType =
|
|
|
|
WT_AUDIO_HANDLER;
|