2024-01-05 19:03:36 +01:00
|
|
|
// Copyright (c) 2024 The Chromium Embedded Framework Authors. All rights
|
2020-03-19 16:34:15 +01: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=c95159440be2da67d89298167f047aaea0c254e8$
|
2020-03-19 16:34:15 +01:00
|
|
|
//
|
|
|
|
|
|
|
|
#include "libcef_dll/cpptoc/media_router_cpptoc.h"
|
2024-04-30 17:45:07 +02:00
|
|
|
|
2020-03-19 16:34:15 +01:00
|
|
|
#include "libcef_dll/cpptoc/media_sink_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/media_source_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/registration_cpptoc.h"
|
2021-04-15 01:28:22 +02:00
|
|
|
#include "libcef_dll/ctocpp/completion_callback_ctocpp.h"
|
2020-03-19 16:34:15 +01:00
|
|
|
#include "libcef_dll/ctocpp/media_observer_ctocpp.h"
|
|
|
|
#include "libcef_dll/ctocpp/media_route_create_callback_ctocpp.h"
|
|
|
|
#include "libcef_dll/shutdown_checker.h"
|
|
|
|
|
|
|
|
// GLOBAL FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
2021-04-15 01:28:22 +02:00
|
|
|
CEF_EXPORT cef_media_router_t* cef_media_router_get_global(
|
|
|
|
cef_completion_callback_t* callback) {
|
2020-03-19 16:34:15 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
2021-04-15 01:28:22 +02:00
|
|
|
// Unverified params: callback
|
|
|
|
|
2020-03-19 16:34:15 +01:00
|
|
|
// Execute
|
2021-04-15 01:28:22 +02:00
|
|
|
CefRefPtr<CefMediaRouter> _retval = CefMediaRouter::GetGlobalMediaRouter(
|
|
|
|
CefCompletionCallbackCToCpp::Wrap(callback));
|
2020-03-19 16:34:15 +01:00
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefMediaRouterCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
|
|
|
struct _cef_registration_t* CEF_CALLBACK
|
|
|
|
media_router_add_observer(struct _cef_media_router_t* self,
|
|
|
|
struct _cef_media_observer_t* observer) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2020-03-19 16:34:15 +01:00
|
|
|
return NULL;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2020-03-19 16:34:15 +01:00
|
|
|
// Verify param: observer; type: refptr_diff
|
|
|
|
DCHECK(observer);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!observer) {
|
2020-03-19 16:34:15 +01:00
|
|
|
return NULL;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2020-03-19 16:34:15 +01:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefRefPtr<CefRegistration> _retval =
|
|
|
|
CefMediaRouterCppToC::Get(self)->AddObserver(
|
|
|
|
CefMediaObserverCToCpp::Wrap(observer));
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefRegistrationCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
struct _cef_media_source_t* CEF_CALLBACK
|
|
|
|
media_router_get_source(struct _cef_media_router_t* self,
|
|
|
|
const cef_string_t* urn) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2020-03-19 16:34:15 +01:00
|
|
|
return NULL;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2020-03-19 16:34:15 +01:00
|
|
|
// Verify param: urn; type: string_byref_const
|
|
|
|
DCHECK(urn);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!urn) {
|
2020-03-19 16:34:15 +01:00
|
|
|
return NULL;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2020-03-19 16:34:15 +01:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefRefPtr<CefMediaSource> _retval =
|
|
|
|
CefMediaRouterCppToC::Get(self)->GetSource(CefString(urn));
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefMediaSourceCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK
|
|
|
|
media_router_notify_current_sinks(struct _cef_media_router_t* self) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2020-03-19 16:34:15 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2020-03-19 16:34:15 +01:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefMediaRouterCppToC::Get(self)->NotifyCurrentSinks();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK
|
|
|
|
media_router_create_route(struct _cef_media_router_t* self,
|
|
|
|
struct _cef_media_source_t* source,
|
|
|
|
struct _cef_media_sink_t* sink,
|
|
|
|
struct _cef_media_route_create_callback_t* callback) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2020-03-19 16:34:15 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2020-03-19 16:34:15 +01:00
|
|
|
// Verify param: source; type: refptr_same
|
|
|
|
DCHECK(source);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!source) {
|
2020-03-19 16:34:15 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2020-03-19 16:34:15 +01:00
|
|
|
// Verify param: sink; type: refptr_same
|
|
|
|
DCHECK(sink);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!sink) {
|
2020-03-19 16:34:15 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2020-03-19 16:34:15 +01:00
|
|
|
// Verify param: callback; type: refptr_diff
|
|
|
|
DCHECK(callback);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!callback) {
|
2020-03-19 16:34:15 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2020-03-19 16:34:15 +01:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefMediaRouterCppToC::Get(self)->CreateRoute(
|
|
|
|
CefMediaSourceCppToC::Unwrap(source), CefMediaSinkCppToC::Unwrap(sink),
|
|
|
|
CefMediaRouteCreateCallbackCToCpp::Wrap(callback));
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK
|
|
|
|
media_router_notify_current_routes(struct _cef_media_router_t* self) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2020-03-19 16:34:15 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2020-03-19 16:34:15 +01:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefMediaRouterCppToC::Get(self)->NotifyCurrentRoutes();
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefMediaRouterCppToC::CefMediaRouterCppToC() {
|
|
|
|
GetStruct()->add_observer = media_router_add_observer;
|
|
|
|
GetStruct()->get_source = media_router_get_source;
|
|
|
|
GetStruct()->notify_current_sinks = media_router_notify_current_sinks;
|
|
|
|
GetStruct()->create_route = media_router_create_route;
|
|
|
|
GetStruct()->notify_current_routes = media_router_notify_current_routes;
|
|
|
|
}
|
|
|
|
|
|
|
|
// DESTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefMediaRouterCppToC::~CefMediaRouterCppToC() {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
CefRefPtr<CefMediaRouter>
|
|
|
|
CefCppToCRefCounted<CefMediaRouterCppToC, CefMediaRouter, cef_media_router_t>::
|
|
|
|
UnwrapDerived(CefWrapperType type, cef_media_router_t* s) {
|
2023-05-08 17:15:02 +02:00
|
|
|
DCHECK(false) << "Unexpected class type: " << type;
|
2020-03-19 16:34:15 +01:00
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
CefWrapperType CefCppToCRefCounted<CefMediaRouterCppToC,
|
|
|
|
CefMediaRouter,
|
|
|
|
cef_media_router_t>::kWrapperType =
|
|
|
|
WT_MEDIA_ROUTER;
|