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=ded90e79e3f8b2c2657b013dc90a2305692ea565$
|
2020-05-01 20:18:18 +02:00
|
|
|
//
|
|
|
|
|
|
|
|
#include "libcef_dll/ctocpp/audio_handler_ctocpp.h"
|
2024-04-30 17:45:07 +02:00
|
|
|
|
2020-05-01 20:18:18 +02:00
|
|
|
#include "libcef_dll/cpptoc/browser_cpptoc.h"
|
|
|
|
#include "libcef_dll/shutdown_checker.h"
|
|
|
|
|
|
|
|
// VIRTUAL METHODS - Body may be edited by hand.
|
|
|
|
|
|
|
|
NO_SANITIZE("cfi-icall")
|
|
|
|
bool CefAudioHandlerCToCpp::GetAudioParameters(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefAudioParameters& params) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
cef_audio_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_audio_parameters)) {
|
2020-05-01 20:18:18 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2020-05-01 20:18:18 +02:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser.get()) {
|
2020-05-01 20:18:18 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2020-05-01 20:18:18 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
int _retval = _struct->get_audio_parameters(
|
|
|
|
_struct, CefBrowserCppToC::Wrap(browser), ¶ms);
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval ? true : false;
|
|
|
|
}
|
|
|
|
|
|
|
|
NO_SANITIZE("cfi-icall")
|
|
|
|
void CefAudioHandlerCToCpp::OnAudioStreamStarted(
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
const CefAudioParameters& params,
|
|
|
|
int channels) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
cef_audio_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_audio_stream_started)) {
|
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
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser.get()) {
|
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
|
|
|
|
_struct->on_audio_stream_started(_struct, CefBrowserCppToC::Wrap(browser),
|
|
|
|
¶ms, channels);
|
|
|
|
}
|
|
|
|
|
|
|
|
NO_SANITIZE("cfi-icall")
|
|
|
|
void CefAudioHandlerCToCpp::OnAudioStreamPacket(CefRefPtr<CefBrowser> 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();
|
|
|
|
|
|
|
|
cef_audio_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_audio_stream_packet)) {
|
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
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser.get()) {
|
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
|
|
|
|
_struct->on_audio_stream_packet(_struct, CefBrowserCppToC::Wrap(browser),
|
|
|
|
data, frames, pts);
|
|
|
|
}
|
|
|
|
|
|
|
|
NO_SANITIZE("cfi-icall")
|
|
|
|
void CefAudioHandlerCToCpp::OnAudioStreamStopped(
|
|
|
|
CefRefPtr<CefBrowser> browser) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
cef_audio_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_audio_stream_stopped)) {
|
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
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser.get()) {
|
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
|
|
|
|
_struct->on_audio_stream_stopped(_struct, CefBrowserCppToC::Wrap(browser));
|
|
|
|
}
|
|
|
|
|
|
|
|
NO_SANITIZE("cfi-icall")
|
|
|
|
void CefAudioHandlerCToCpp::OnAudioStreamError(CefRefPtr<CefBrowser> browser,
|
|
|
|
const CefString& message) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
cef_audio_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_audio_stream_error)) {
|
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
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser.get()) {
|
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.empty());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (message.empty()) {
|
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
|
|
|
|
_struct->on_audio_stream_error(_struct, CefBrowserCppToC::Wrap(browser),
|
|
|
|
message.GetStruct());
|
|
|
|
}
|
|
|
|
|
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefAudioHandlerCToCpp::CefAudioHandlerCToCpp() {}
|
|
|
|
|
|
|
|
// DESTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefAudioHandlerCToCpp::~CefAudioHandlerCToCpp() {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
cef_audio_handler_t*
|
|
|
|
CefCToCppRefCounted<CefAudioHandlerCToCpp,
|
|
|
|
CefAudioHandler,
|
|
|
|
cef_audio_handler_t>::UnwrapDerived(CefWrapperType type,
|
|
|
|
CefAudioHandler* c) {
|
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 CefCToCppRefCounted<CefAudioHandlerCToCpp,
|
|
|
|
CefAudioHandler,
|
|
|
|
cef_audio_handler_t>::kWrapperType =
|
|
|
|
WT_AUDIO_HANDLER;
|