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=bda6f1c15445d32a8f86b0c62724c01e6a014208$
|
2020-03-19 16:34:15 +01:00
|
|
|
//
|
|
|
|
|
|
|
|
#include "libcef_dll/cpptoc/media_observer_cpptoc.h"
|
2024-04-30 17:45:07 +02:00
|
|
|
|
2020-03-19 16:34:15 +01:00
|
|
|
#include "libcef_dll/ctocpp/media_route_ctocpp.h"
|
|
|
|
#include "libcef_dll/ctocpp/media_sink_ctocpp.h"
|
|
|
|
#include "libcef_dll/shutdown_checker.h"
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
|
|
|
void CEF_CALLBACK
|
|
|
|
media_observer_on_sinks(struct _cef_media_observer_t* self,
|
|
|
|
size_t sinksCount,
|
|
|
|
struct _cef_media_sink_t* const* sinks) {
|
|
|
|
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: sinks; type: refptr_vec_diff_byref_const
|
|
|
|
DCHECK(sinksCount == 0 || sinks);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (sinksCount > 0 && !sinks) {
|
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
|
|
|
|
|
|
|
// Translate param: sinks; type: refptr_vec_diff_byref_const
|
|
|
|
std::vector<CefRefPtr<CefMediaSink>> sinksList;
|
|
|
|
if (sinksCount > 0) {
|
|
|
|
for (size_t i = 0; i < sinksCount; ++i) {
|
|
|
|
CefRefPtr<CefMediaSink> sinksVal = CefMediaSinkCToCpp::Wrap(sinks[i]);
|
|
|
|
sinksList.push_back(sinksVal);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefMediaObserverCppToC::Get(self)->OnSinks(sinksList);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK
|
|
|
|
media_observer_on_routes(struct _cef_media_observer_t* self,
|
|
|
|
size_t routesCount,
|
|
|
|
struct _cef_media_route_t* const* routes) {
|
|
|
|
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: routes; type: refptr_vec_diff_byref_const
|
|
|
|
DCHECK(routesCount == 0 || routes);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (routesCount > 0 && !routes) {
|
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
|
|
|
|
|
|
|
// Translate param: routes; type: refptr_vec_diff_byref_const
|
|
|
|
std::vector<CefRefPtr<CefMediaRoute>> routesList;
|
|
|
|
if (routesCount > 0) {
|
|
|
|
for (size_t i = 0; i < routesCount; ++i) {
|
|
|
|
CefRefPtr<CefMediaRoute> routesVal = CefMediaRouteCToCpp::Wrap(routes[i]);
|
|
|
|
routesList.push_back(routesVal);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefMediaObserverCppToC::Get(self)->OnRoutes(routesList);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK media_observer_on_route_state_changed(
|
|
|
|
struct _cef_media_observer_t* self,
|
|
|
|
struct _cef_media_route_t* route,
|
|
|
|
cef_media_route_connection_state_t state) {
|
|
|
|
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: route; type: refptr_diff
|
|
|
|
DCHECK(route);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!route) {
|
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
|
|
|
|
CefMediaObserverCppToC::Get(self)->OnRouteStateChanged(
|
|
|
|
CefMediaRouteCToCpp::Wrap(route), state);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK
|
|
|
|
media_observer_on_route_message_received(struct _cef_media_observer_t* self,
|
|
|
|
struct _cef_media_route_t* route,
|
|
|
|
const void* message,
|
|
|
|
size_t message_size) {
|
|
|
|
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: route; type: refptr_diff
|
|
|
|
DCHECK(route);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!route) {
|
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: message; type: simple_byaddr
|
|
|
|
DCHECK(message);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!message) {
|
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
|
|
|
|
CefMediaObserverCppToC::Get(self)->OnRouteMessageReceived(
|
|
|
|
CefMediaRouteCToCpp::Wrap(route), message, message_size);
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefMediaObserverCppToC::CefMediaObserverCppToC() {
|
|
|
|
GetStruct()->on_sinks = media_observer_on_sinks;
|
|
|
|
GetStruct()->on_routes = media_observer_on_routes;
|
|
|
|
GetStruct()->on_route_state_changed = media_observer_on_route_state_changed;
|
|
|
|
GetStruct()->on_route_message_received =
|
|
|
|
media_observer_on_route_message_received;
|
|
|
|
}
|
|
|
|
|
|
|
|
// DESTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefMediaObserverCppToC::~CefMediaObserverCppToC() {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
CefRefPtr<CefMediaObserver> CefCppToCRefCounted<
|
|
|
|
CefMediaObserverCppToC,
|
|
|
|
CefMediaObserver,
|
|
|
|
cef_media_observer_t>::UnwrapDerived(CefWrapperType type,
|
|
|
|
cef_media_observer_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<CefMediaObserverCppToC,
|
|
|
|
CefMediaObserver,
|
|
|
|
cef_media_observer_t>::kWrapperType =
|
|
|
|
WT_MEDIA_OBSERVER;
|