mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add support for media device discovery and messaging (fixes issue #2900)
Chromium supports communication with media devices on the local network via the Cast and DIAL protocols. This takes two primary forms: 1. Messaging, where strings representing state information are passed between the client and a dedicated receiver app on the media device. The receiver app communicates directly with an app-specific backend service to retrieve and possibly control media playback. 2. Tab/desktop mirroring, where the media contents are streamed directly from the browser to a generic streaming app on the media device and playback is controlled by the browser. This change adds support for device discovery and messaging (but not mirroring) with functionality exposed via the new CefMediaRouter interface. To test: Navigate to http://tests/media_router in cefclient and follow the on-screen instructions.
This commit is contained in:
161
libcef_dll/cpptoc/media_observer_cpptoc.cc
Normal file
161
libcef_dll/cpptoc/media_observer_cpptoc.cc
Normal file
@@ -0,0 +1,161 @@
|
||||
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=35f0e881b5a98c1da73789ecb72254fbe254a350$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/media_observer_cpptoc.h"
|
||||
#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);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: sinks; type: refptr_vec_diff_byref_const
|
||||
DCHECK(sinksCount == 0 || sinks);
|
||||
if (sinksCount > 0 && !sinks)
|
||||
return;
|
||||
|
||||
// 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);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: routes; type: refptr_vec_diff_byref_const
|
||||
DCHECK(routesCount == 0 || routes);
|
||||
if (routesCount > 0 && !routes)
|
||||
return;
|
||||
|
||||
// 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);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: route; type: refptr_diff
|
||||
DCHECK(route);
|
||||
if (!route)
|
||||
return;
|
||||
|
||||
// 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);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: route; type: refptr_diff
|
||||
DCHECK(route);
|
||||
if (!route)
|
||||
return;
|
||||
// Verify param: message; type: simple_byaddr
|
||||
DCHECK(message);
|
||||
if (!message)
|
||||
return;
|
||||
|
||||
// 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) {
|
||||
NOTREACHED() << "Unexpected class type: " << type;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
CefWrapperType CefCppToCRefCounted<CefMediaObserverCppToC,
|
||||
CefMediaObserver,
|
||||
cef_media_observer_t>::kWrapperType =
|
||||
WT_MEDIA_OBSERVER;
|
38
libcef_dll/cpptoc/media_observer_cpptoc.h
Normal file
38
libcef_dll/cpptoc/media_observer_cpptoc.h
Normal file
@@ -0,0 +1,38 @@
|
||||
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=14ef1b6f920a375e585174e4057c66221f3e1c05$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CPPTOC_MEDIA_OBSERVER_CPPTOC_H_
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_MEDIA_OBSERVER_CPPTOC_H_
|
||||
#pragma once
|
||||
|
||||
#if !defined(WRAPPING_CEF_SHARED)
|
||||
#error This file can be included wrapper-side only
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_media_router_capi.h"
|
||||
#include "include/cef_media_router.h"
|
||||
#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
|
||||
|
||||
// Wrap a C++ class with a C structure.
|
||||
// This class may be instantiated and accessed wrapper-side only.
|
||||
class CefMediaObserverCppToC
|
||||
: public CefCppToCRefCounted<CefMediaObserverCppToC,
|
||||
CefMediaObserver,
|
||||
cef_media_observer_t> {
|
||||
public:
|
||||
CefMediaObserverCppToC();
|
||||
virtual ~CefMediaObserverCppToC();
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_MEDIA_OBSERVER_CPPTOC_H_
|
139
libcef_dll/cpptoc/media_route_cpptoc.cc
Normal file
139
libcef_dll/cpptoc/media_route_cpptoc.cc
Normal file
@@ -0,0 +1,139 @@
|
||||
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=47181b936b29037dd4ff5169d7175ac538f5be56$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/media_route_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/media_sink_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/media_source_cpptoc.h"
|
||||
#include "libcef_dll/shutdown_checker.h"
|
||||
|
||||
namespace {
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK
|
||||
media_route_get_id(struct _cef_media_route_t* self) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefString _retval = CefMediaRouteCppToC::Get(self)->GetId();
|
||||
|
||||
// Return type: string
|
||||
return _retval.DetachToUserFree();
|
||||
}
|
||||
|
||||
struct _cef_media_source_t* CEF_CALLBACK
|
||||
media_route_get_source(struct _cef_media_route_t* self) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefMediaSource> _retval =
|
||||
CefMediaRouteCppToC::Get(self)->GetSource();
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefMediaSourceCppToC::Wrap(_retval);
|
||||
}
|
||||
|
||||
struct _cef_media_sink_t* CEF_CALLBACK
|
||||
media_route_get_sink(struct _cef_media_route_t* self) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefMediaSink> _retval = CefMediaRouteCppToC::Get(self)->GetSink();
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefMediaSinkCppToC::Wrap(_retval);
|
||||
}
|
||||
|
||||
void CEF_CALLBACK
|
||||
media_route_send_route_message(struct _cef_media_route_t* self,
|
||||
const void* message,
|
||||
size_t message_size) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: message; type: simple_byaddr
|
||||
DCHECK(message);
|
||||
if (!message)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefMediaRouteCppToC::Get(self)->SendRouteMessage(message, message_size);
|
||||
}
|
||||
|
||||
void CEF_CALLBACK media_route_terminate(struct _cef_media_route_t* self) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefMediaRouteCppToC::Get(self)->Terminate();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefMediaRouteCppToC::CefMediaRouteCppToC() {
|
||||
GetStruct()->get_id = media_route_get_id;
|
||||
GetStruct()->get_source = media_route_get_source;
|
||||
GetStruct()->get_sink = media_route_get_sink;
|
||||
GetStruct()->send_route_message = media_route_send_route_message;
|
||||
GetStruct()->terminate = media_route_terminate;
|
||||
}
|
||||
|
||||
// DESTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefMediaRouteCppToC::~CefMediaRouteCppToC() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
}
|
||||
|
||||
template <>
|
||||
CefRefPtr<CefMediaRoute>
|
||||
CefCppToCRefCounted<CefMediaRouteCppToC, CefMediaRoute, cef_media_route_t>::
|
||||
UnwrapDerived(CefWrapperType type, cef_media_route_t* s) {
|
||||
NOTREACHED() << "Unexpected class type: " << type;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
CefWrapperType CefCppToCRefCounted<CefMediaRouteCppToC,
|
||||
CefMediaRoute,
|
||||
cef_media_route_t>::kWrapperType =
|
||||
WT_MEDIA_ROUTE;
|
37
libcef_dll/cpptoc/media_route_cpptoc.h
Normal file
37
libcef_dll/cpptoc/media_route_cpptoc.h
Normal file
@@ -0,0 +1,37 @@
|
||||
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=26fe0f9bd956318d0e6c7e0216024b5b839429c2$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CPPTOC_MEDIA_ROUTE_CPPTOC_H_
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_MEDIA_ROUTE_CPPTOC_H_
|
||||
#pragma once
|
||||
|
||||
#if !defined(BUILDING_CEF_SHARED)
|
||||
#error This file can be included DLL-side only
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_media_router_capi.h"
|
||||
#include "include/cef_media_router.h"
|
||||
#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
|
||||
|
||||
// Wrap a C++ class with a C structure.
|
||||
// This class may be instantiated and accessed DLL-side only.
|
||||
class CefMediaRouteCppToC : public CefCppToCRefCounted<CefMediaRouteCppToC,
|
||||
CefMediaRoute,
|
||||
cef_media_route_t> {
|
||||
public:
|
||||
CefMediaRouteCppToC();
|
||||
virtual ~CefMediaRouteCppToC();
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_MEDIA_ROUTE_CPPTOC_H_
|
72
libcef_dll/cpptoc/media_route_create_callback_cpptoc.cc
Normal file
72
libcef_dll/cpptoc/media_route_create_callback_cpptoc.cc
Normal file
@@ -0,0 +1,72 @@
|
||||
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=a27462c4bcc0ef4856230997718f95edae5c1ef1$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/media_route_create_callback_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/media_route_ctocpp.h"
|
||||
#include "libcef_dll/shutdown_checker.h"
|
||||
|
||||
namespace {
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
void CEF_CALLBACK media_route_create_callback_on_media_route_create_finished(
|
||||
struct _cef_media_route_create_callback_t* self,
|
||||
cef_media_route_create_result_t result,
|
||||
const cef_string_t* error,
|
||||
cef_media_route_t* route) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Unverified params: error, route
|
||||
|
||||
// Execute
|
||||
CefMediaRouteCreateCallbackCppToC::Get(self)->OnMediaRouteCreateFinished(
|
||||
result, CefString(error), CefMediaRouteCToCpp::Wrap(route));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefMediaRouteCreateCallbackCppToC::CefMediaRouteCreateCallbackCppToC() {
|
||||
GetStruct()->on_media_route_create_finished =
|
||||
media_route_create_callback_on_media_route_create_finished;
|
||||
}
|
||||
|
||||
// DESTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefMediaRouteCreateCallbackCppToC::~CefMediaRouteCreateCallbackCppToC() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
}
|
||||
|
||||
template <>
|
||||
CefRefPtr<CefMediaRouteCreateCallback>
|
||||
CefCppToCRefCounted<CefMediaRouteCreateCallbackCppToC,
|
||||
CefMediaRouteCreateCallback,
|
||||
cef_media_route_create_callback_t>::
|
||||
UnwrapDerived(CefWrapperType type, cef_media_route_create_callback_t* s) {
|
||||
NOTREACHED() << "Unexpected class type: " << type;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
CefWrapperType
|
||||
CefCppToCRefCounted<CefMediaRouteCreateCallbackCppToC,
|
||||
CefMediaRouteCreateCallback,
|
||||
cef_media_route_create_callback_t>::kWrapperType =
|
||||
WT_MEDIA_ROUTE_CREATE_CALLBACK;
|
38
libcef_dll/cpptoc/media_route_create_callback_cpptoc.h
Normal file
38
libcef_dll/cpptoc/media_route_create_callback_cpptoc.h
Normal file
@@ -0,0 +1,38 @@
|
||||
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=8085b195054f43f67d4ee21d8b69b9e0ee8e2ac3$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CPPTOC_MEDIA_ROUTE_CREATE_CALLBACK_CPPTOC_H_
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_MEDIA_ROUTE_CREATE_CALLBACK_CPPTOC_H_
|
||||
#pragma once
|
||||
|
||||
#if !defined(WRAPPING_CEF_SHARED)
|
||||
#error This file can be included wrapper-side only
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_media_router_capi.h"
|
||||
#include "include/cef_media_router.h"
|
||||
#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
|
||||
|
||||
// Wrap a C++ class with a C structure.
|
||||
// This class may be instantiated and accessed wrapper-side only.
|
||||
class CefMediaRouteCreateCallbackCppToC
|
||||
: public CefCppToCRefCounted<CefMediaRouteCreateCallbackCppToC,
|
||||
CefMediaRouteCreateCallback,
|
||||
cef_media_route_create_callback_t> {
|
||||
public:
|
||||
CefMediaRouteCreateCallbackCppToC();
|
||||
virtual ~CefMediaRouteCreateCallbackCppToC();
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_MEDIA_ROUTE_CREATE_CALLBACK_CPPTOC_H_
|
177
libcef_dll/cpptoc/media_router_cpptoc.cc
Normal file
177
libcef_dll/cpptoc/media_router_cpptoc.cc
Normal file
@@ -0,0 +1,177 @@
|
||||
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=6b52fceffec99c0f274b5031266c20da5480d0c1$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/media_router_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/media_sink_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/media_source_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/registration_cpptoc.h"
|
||||
#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.
|
||||
|
||||
CEF_EXPORT cef_media_router_t* cef_media_router_get_global() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefMediaRouter> _retval = CefMediaRouter::GetGlobalMediaRouter();
|
||||
|
||||
// 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);
|
||||
if (!self)
|
||||
return NULL;
|
||||
// Verify param: observer; type: refptr_diff
|
||||
DCHECK(observer);
|
||||
if (!observer)
|
||||
return NULL;
|
||||
|
||||
// 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);
|
||||
if (!self)
|
||||
return NULL;
|
||||
// Verify param: urn; type: string_byref_const
|
||||
DCHECK(urn);
|
||||
if (!urn)
|
||||
return NULL;
|
||||
|
||||
// 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);
|
||||
if (!self)
|
||||
return;
|
||||
|
||||
// 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);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: source; type: refptr_same
|
||||
DCHECK(source);
|
||||
if (!source)
|
||||
return;
|
||||
// Verify param: sink; type: refptr_same
|
||||
DCHECK(sink);
|
||||
if (!sink)
|
||||
return;
|
||||
// Verify param: callback; type: refptr_diff
|
||||
DCHECK(callback);
|
||||
if (!callback)
|
||||
return;
|
||||
|
||||
// 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);
|
||||
if (!self)
|
||||
return;
|
||||
|
||||
// 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) {
|
||||
NOTREACHED() << "Unexpected class type: " << type;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
CefWrapperType CefCppToCRefCounted<CefMediaRouterCppToC,
|
||||
CefMediaRouter,
|
||||
cef_media_router_t>::kWrapperType =
|
||||
WT_MEDIA_ROUTER;
|
37
libcef_dll/cpptoc/media_router_cpptoc.h
Normal file
37
libcef_dll/cpptoc/media_router_cpptoc.h
Normal file
@@ -0,0 +1,37 @@
|
||||
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=cea747c7202b95684b7208a312da818ddb094c0a$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CPPTOC_MEDIA_ROUTER_CPPTOC_H_
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_MEDIA_ROUTER_CPPTOC_H_
|
||||
#pragma once
|
||||
|
||||
#if !defined(BUILDING_CEF_SHARED)
|
||||
#error This file can be included DLL-side only
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_media_router_capi.h"
|
||||
#include "include/cef_media_router.h"
|
||||
#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
|
||||
|
||||
// Wrap a C++ class with a C structure.
|
||||
// This class may be instantiated and accessed DLL-side only.
|
||||
class CefMediaRouterCppToC : public CefCppToCRefCounted<CefMediaRouterCppToC,
|
||||
CefMediaRouter,
|
||||
cef_media_router_t> {
|
||||
public:
|
||||
CefMediaRouterCppToC();
|
||||
virtual ~CefMediaRouterCppToC();
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_MEDIA_ROUTER_CPPTOC_H_
|
177
libcef_dll/cpptoc/media_sink_cpptoc.cc
Normal file
177
libcef_dll/cpptoc/media_sink_cpptoc.cc
Normal file
@@ -0,0 +1,177 @@
|
||||
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=cbbac244f39cc1d644b0db80a3f7234399286368$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/media_sink_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/media_source_cpptoc.h"
|
||||
#include "libcef_dll/shutdown_checker.h"
|
||||
|
||||
namespace {
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK
|
||||
media_sink_get_id(struct _cef_media_sink_t* self) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefString _retval = CefMediaSinkCppToC::Get(self)->GetId();
|
||||
|
||||
// Return type: string
|
||||
return _retval.DetachToUserFree();
|
||||
}
|
||||
|
||||
int CEF_CALLBACK media_sink_is_valid(struct _cef_media_sink_t* self) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefMediaSinkCppToC::Get(self)->IsValid();
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK
|
||||
media_sink_get_name(struct _cef_media_sink_t* self) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefString _retval = CefMediaSinkCppToC::Get(self)->GetName();
|
||||
|
||||
// Return type: string
|
||||
return _retval.DetachToUserFree();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK
|
||||
media_sink_get_description(struct _cef_media_sink_t* self) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefString _retval = CefMediaSinkCppToC::Get(self)->GetDescription();
|
||||
|
||||
// Return type: string
|
||||
return _retval.DetachToUserFree();
|
||||
}
|
||||
|
||||
int CEF_CALLBACK media_sink_is_cast_sink(struct _cef_media_sink_t* self) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefMediaSinkCppToC::Get(self)->IsCastSink();
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
int CEF_CALLBACK media_sink_is_dial_sink(struct _cef_media_sink_t* self) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefMediaSinkCppToC::Get(self)->IsDialSink();
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
int CEF_CALLBACK
|
||||
media_sink_is_compatible_with(struct _cef_media_sink_t* self,
|
||||
struct _cef_media_source_t* source) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
// Verify param: source; type: refptr_same
|
||||
DCHECK(source);
|
||||
if (!source)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefMediaSinkCppToC::Get(self)->IsCompatibleWith(
|
||||
CefMediaSourceCppToC::Unwrap(source));
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefMediaSinkCppToC::CefMediaSinkCppToC() {
|
||||
GetStruct()->get_id = media_sink_get_id;
|
||||
GetStruct()->is_valid = media_sink_is_valid;
|
||||
GetStruct()->get_name = media_sink_get_name;
|
||||
GetStruct()->get_description = media_sink_get_description;
|
||||
GetStruct()->is_cast_sink = media_sink_is_cast_sink;
|
||||
GetStruct()->is_dial_sink = media_sink_is_dial_sink;
|
||||
GetStruct()->is_compatible_with = media_sink_is_compatible_with;
|
||||
}
|
||||
|
||||
// DESTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefMediaSinkCppToC::~CefMediaSinkCppToC() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
}
|
||||
|
||||
template <>
|
||||
CefRefPtr<CefMediaSink>
|
||||
CefCppToCRefCounted<CefMediaSinkCppToC, CefMediaSink, cef_media_sink_t>::
|
||||
UnwrapDerived(CefWrapperType type, cef_media_sink_t* s) {
|
||||
NOTREACHED() << "Unexpected class type: " << type;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
CefWrapperType CefCppToCRefCounted<CefMediaSinkCppToC,
|
||||
CefMediaSink,
|
||||
cef_media_sink_t>::kWrapperType =
|
||||
WT_MEDIA_SINK;
|
37
libcef_dll/cpptoc/media_sink_cpptoc.h
Normal file
37
libcef_dll/cpptoc/media_sink_cpptoc.h
Normal file
@@ -0,0 +1,37 @@
|
||||
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=409478c735898bd4e13315183e185a80ae570b74$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CPPTOC_MEDIA_SINK_CPPTOC_H_
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_MEDIA_SINK_CPPTOC_H_
|
||||
#pragma once
|
||||
|
||||
#if !defined(BUILDING_CEF_SHARED)
|
||||
#error This file can be included DLL-side only
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_media_router_capi.h"
|
||||
#include "include/cef_media_router.h"
|
||||
#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
|
||||
|
||||
// Wrap a C++ class with a C structure.
|
||||
// This class may be instantiated and accessed DLL-side only.
|
||||
class CefMediaSinkCppToC : public CefCppToCRefCounted<CefMediaSinkCppToC,
|
||||
CefMediaSink,
|
||||
cef_media_sink_t> {
|
||||
public:
|
||||
CefMediaSinkCppToC();
|
||||
virtual ~CefMediaSinkCppToC();
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_MEDIA_SINK_CPPTOC_H_
|
116
libcef_dll/cpptoc/media_source_cpptoc.cc
Normal file
116
libcef_dll/cpptoc/media_source_cpptoc.cc
Normal file
@@ -0,0 +1,116 @@
|
||||
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=ddd51b3c8020de1b10b00eef06d745a498168323$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/media_source_cpptoc.h"
|
||||
#include "libcef_dll/shutdown_checker.h"
|
||||
|
||||
namespace {
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK
|
||||
media_source_get_id(struct _cef_media_source_t* self) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefString _retval = CefMediaSourceCppToC::Get(self)->GetId();
|
||||
|
||||
// Return type: string
|
||||
return _retval.DetachToUserFree();
|
||||
}
|
||||
|
||||
int CEF_CALLBACK media_source_is_valid(struct _cef_media_source_t* self) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefMediaSourceCppToC::Get(self)->IsValid();
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
int CEF_CALLBACK media_source_is_cast_source(struct _cef_media_source_t* self) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefMediaSourceCppToC::Get(self)->IsCastSource();
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
int CEF_CALLBACK media_source_is_dial_source(struct _cef_media_source_t* self) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefMediaSourceCppToC::Get(self)->IsDialSource();
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefMediaSourceCppToC::CefMediaSourceCppToC() {
|
||||
GetStruct()->get_id = media_source_get_id;
|
||||
GetStruct()->is_valid = media_source_is_valid;
|
||||
GetStruct()->is_cast_source = media_source_is_cast_source;
|
||||
GetStruct()->is_dial_source = media_source_is_dial_source;
|
||||
}
|
||||
|
||||
// DESTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefMediaSourceCppToC::~CefMediaSourceCppToC() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
}
|
||||
|
||||
template <>
|
||||
CefRefPtr<CefMediaSource>
|
||||
CefCppToCRefCounted<CefMediaSourceCppToC, CefMediaSource, cef_media_source_t>::
|
||||
UnwrapDerived(CefWrapperType type, cef_media_source_t* s) {
|
||||
NOTREACHED() << "Unexpected class type: " << type;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
CefWrapperType CefCppToCRefCounted<CefMediaSourceCppToC,
|
||||
CefMediaSource,
|
||||
cef_media_source_t>::kWrapperType =
|
||||
WT_MEDIA_SOURCE;
|
37
libcef_dll/cpptoc/media_source_cpptoc.h
Normal file
37
libcef_dll/cpptoc/media_source_cpptoc.h
Normal file
@@ -0,0 +1,37 @@
|
||||
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=aceafab724145242461fc9f5e7c76a365bb6d54c$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CPPTOC_MEDIA_SOURCE_CPPTOC_H_
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_MEDIA_SOURCE_CPPTOC_H_
|
||||
#pragma once
|
||||
|
||||
#if !defined(BUILDING_CEF_SHARED)
|
||||
#error This file can be included DLL-side only
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_media_router_capi.h"
|
||||
#include "include/cef_media_router.h"
|
||||
#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
|
||||
|
||||
// Wrap a C++ class with a C structure.
|
||||
// This class may be instantiated and accessed DLL-side only.
|
||||
class CefMediaSourceCppToC : public CefCppToCRefCounted<CefMediaSourceCppToC,
|
||||
CefMediaSource,
|
||||
cef_media_source_t> {
|
||||
public:
|
||||
CefMediaSourceCppToC();
|
||||
virtual ~CefMediaSourceCppToC();
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_MEDIA_SOURCE_CPPTOC_H_
|
42
libcef_dll/cpptoc/registration_cpptoc.cc
Normal file
42
libcef_dll/cpptoc/registration_cpptoc.cc
Normal file
@@ -0,0 +1,42 @@
|
||||
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=37c8c576c5bccd43f6124095e4ad55e88bc1a185$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/registration_cpptoc.h"
|
||||
#include "libcef_dll/shutdown_checker.h"
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefRegistrationCppToC::CefRegistrationCppToC() {}
|
||||
|
||||
// DESTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefRegistrationCppToC::~CefRegistrationCppToC() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
}
|
||||
|
||||
template <>
|
||||
CefRefPtr<CefRegistration>
|
||||
CefCppToCRefCounted<CefRegistrationCppToC,
|
||||
CefRegistration,
|
||||
cef_registration_t>::UnwrapDerived(CefWrapperType type,
|
||||
cef_registration_t* s) {
|
||||
NOTREACHED() << "Unexpected class type: " << type;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
CefWrapperType CefCppToCRefCounted<CefRegistrationCppToC,
|
||||
CefRegistration,
|
||||
cef_registration_t>::kWrapperType =
|
||||
WT_REGISTRATION;
|
37
libcef_dll/cpptoc/registration_cpptoc.h
Normal file
37
libcef_dll/cpptoc/registration_cpptoc.h
Normal file
@@ -0,0 +1,37 @@
|
||||
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=e27d69c1509e74c7f5d69f5829c27fa65e47fc2d$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CPPTOC_REGISTRATION_CPPTOC_H_
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_REGISTRATION_CPPTOC_H_
|
||||
#pragma once
|
||||
|
||||
#if !defined(BUILDING_CEF_SHARED)
|
||||
#error This file can be included DLL-side only
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_registration_capi.h"
|
||||
#include "include/cef_registration.h"
|
||||
#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
|
||||
|
||||
// Wrap a C++ class with a C structure.
|
||||
// This class may be instantiated and accessed DLL-side only.
|
||||
class CefRegistrationCppToC : public CefCppToCRefCounted<CefRegistrationCppToC,
|
||||
CefRegistration,
|
||||
cef_registration_t> {
|
||||
public:
|
||||
CefRegistrationCppToC();
|
||||
virtual ~CefRegistrationCppToC();
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_REGISTRATION_CPPTOC_H_
|
@@ -9,13 +9,14 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=4af6d074b7de62b759a9555a0b0246e57c290328$
|
||||
// $hash=5168000f75f7911dce0bffcf47341e4ee1c2a275$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/request_context_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/cookie_manager_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/dictionary_value_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/extension_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/media_router_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/value_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/completion_callback_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/extension_handler_ctocpp.h"
|
||||
@@ -540,6 +541,22 @@ request_context_get_extension(struct _cef_request_context_t* self,
|
||||
return CefExtensionCppToC::Wrap(_retval);
|
||||
}
|
||||
|
||||
cef_media_router_t* CEF_CALLBACK
|
||||
request_context_get_media_router(struct _cef_request_context_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefMediaRouter> _retval =
|
||||
CefRequestContextCppToC::Get(self)->GetMediaRouter();
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefMediaRouterCppToC::Wrap(_retval);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
@@ -573,6 +590,7 @@ CefRequestContextCppToC::CefRequestContextCppToC() {
|
||||
GetStruct()->has_extension = request_context_has_extension;
|
||||
GetStruct()->get_extensions = request_context_get_extensions;
|
||||
GetStruct()->get_extension = request_context_get_extension;
|
||||
GetStruct()->get_media_router = request_context_get_media_router;
|
||||
}
|
||||
|
||||
// DESTRUCTOR - Do not edit by hand.
|
||||
|
158
libcef_dll/ctocpp/media_observer_ctocpp.cc
Normal file
158
libcef_dll/ctocpp/media_observer_ctocpp.cc
Normal file
@@ -0,0 +1,158 @@
|
||||
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=6eed652a4bd13cf685980f7ea0b838d73e6071ba$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/media_observer_ctocpp.h"
|
||||
#include "libcef_dll/cpptoc/media_route_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/media_sink_cpptoc.h"
|
||||
#include "libcef_dll/shutdown_checker.h"
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
void CefMediaObserverCToCpp::OnSinks(
|
||||
const std::vector<CefRefPtr<CefMediaSink>>& sinks) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_media_observer_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, on_sinks))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Translate param: sinks; type: refptr_vec_diff_byref_const
|
||||
const size_t sinksCount = sinks.size();
|
||||
cef_media_sink_t** sinksList = NULL;
|
||||
if (sinksCount > 0) {
|
||||
sinksList = new cef_media_sink_t*[sinksCount];
|
||||
DCHECK(sinksList);
|
||||
if (sinksList) {
|
||||
for (size_t i = 0; i < sinksCount; ++i) {
|
||||
sinksList[i] = CefMediaSinkCppToC::Wrap(sinks[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Execute
|
||||
_struct->on_sinks(_struct, sinksCount, sinksList);
|
||||
|
||||
// Restore param:sinks; type: refptr_vec_diff_byref_const
|
||||
if (sinksList)
|
||||
delete[] sinksList;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
void CefMediaObserverCToCpp::OnRoutes(
|
||||
const std::vector<CefRefPtr<CefMediaRoute>>& routes) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_media_observer_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, on_routes))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Translate param: routes; type: refptr_vec_diff_byref_const
|
||||
const size_t routesCount = routes.size();
|
||||
cef_media_route_t** routesList = NULL;
|
||||
if (routesCount > 0) {
|
||||
routesList = new cef_media_route_t*[routesCount];
|
||||
DCHECK(routesList);
|
||||
if (routesList) {
|
||||
for (size_t i = 0; i < routesCount; ++i) {
|
||||
routesList[i] = CefMediaRouteCppToC::Wrap(routes[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Execute
|
||||
_struct->on_routes(_struct, routesCount, routesList);
|
||||
|
||||
// Restore param:routes; type: refptr_vec_diff_byref_const
|
||||
if (routesList)
|
||||
delete[] routesList;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
void CefMediaObserverCToCpp::OnRouteStateChanged(CefRefPtr<CefMediaRoute> route,
|
||||
ConnectionState state) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_media_observer_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, on_route_state_changed))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: route; type: refptr_diff
|
||||
DCHECK(route.get());
|
||||
if (!route.get())
|
||||
return;
|
||||
|
||||
// Execute
|
||||
_struct->on_route_state_changed(_struct, CefMediaRouteCppToC::Wrap(route),
|
||||
state);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
void CefMediaObserverCToCpp::OnRouteMessageReceived(
|
||||
CefRefPtr<CefMediaRoute> route,
|
||||
const void* message,
|
||||
size_t message_size) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_media_observer_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, on_route_message_received))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: route; type: refptr_diff
|
||||
DCHECK(route.get());
|
||||
if (!route.get())
|
||||
return;
|
||||
// Verify param: message; type: simple_byaddr
|
||||
DCHECK(message);
|
||||
if (!message)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
_struct->on_route_message_received(_struct, CefMediaRouteCppToC::Wrap(route),
|
||||
message, message_size);
|
||||
}
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefMediaObserverCToCpp::CefMediaObserverCToCpp() {}
|
||||
|
||||
// DESTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefMediaObserverCToCpp::~CefMediaObserverCToCpp() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
}
|
||||
|
||||
template <>
|
||||
cef_media_observer_t*
|
||||
CefCToCppRefCounted<CefMediaObserverCToCpp,
|
||||
CefMediaObserver,
|
||||
cef_media_observer_t>::UnwrapDerived(CefWrapperType type,
|
||||
CefMediaObserver* c) {
|
||||
NOTREACHED() << "Unexpected class type: " << type;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
CefWrapperType CefCToCppRefCounted<CefMediaObserverCToCpp,
|
||||
CefMediaObserver,
|
||||
cef_media_observer_t>::kWrapperType =
|
||||
WT_MEDIA_OBSERVER;
|
48
libcef_dll/ctocpp/media_observer_ctocpp.h
Normal file
48
libcef_dll/ctocpp/media_observer_ctocpp.h
Normal file
@@ -0,0 +1,48 @@
|
||||
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=4c2e71870e5f8a31052431a5242f91392607502d$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_MEDIA_OBSERVER_CTOCPP_H_
|
||||
#define CEF_LIBCEF_DLL_CTOCPP_MEDIA_OBSERVER_CTOCPP_H_
|
||||
#pragma once
|
||||
|
||||
#if !defined(BUILDING_CEF_SHARED)
|
||||
#error This file can be included DLL-side only
|
||||
#endif
|
||||
|
||||
#include <vector>
|
||||
#include "include/capi/cef_media_router_capi.h"
|
||||
#include "include/cef_media_router.h"
|
||||
#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
|
||||
|
||||
// Wrap a C structure with a C++ class.
|
||||
// This class may be instantiated and accessed DLL-side only.
|
||||
class CefMediaObserverCToCpp
|
||||
: public CefCToCppRefCounted<CefMediaObserverCToCpp,
|
||||
CefMediaObserver,
|
||||
cef_media_observer_t> {
|
||||
public:
|
||||
CefMediaObserverCToCpp();
|
||||
virtual ~CefMediaObserverCToCpp();
|
||||
|
||||
// CefMediaObserver methods.
|
||||
void OnSinks(const std::vector<CefRefPtr<CefMediaSink>>& sinks) override;
|
||||
void OnRoutes(const std::vector<CefRefPtr<CefMediaRoute>>& routes) override;
|
||||
void OnRouteStateChanged(CefRefPtr<CefMediaRoute> route,
|
||||
ConnectionState state) override;
|
||||
void OnRouteMessageReceived(CefRefPtr<CefMediaRoute> route,
|
||||
const void* message,
|
||||
size_t message_size) override;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_MEDIA_OBSERVER_CTOCPP_H_
|
66
libcef_dll/ctocpp/media_route_create_callback_ctocpp.cc
Normal file
66
libcef_dll/ctocpp/media_route_create_callback_ctocpp.cc
Normal file
@@ -0,0 +1,66 @@
|
||||
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=93dd08de00931b1c00ec0307cc70496455936b0c$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/media_route_create_callback_ctocpp.h"
|
||||
#include "libcef_dll/cpptoc/media_route_cpptoc.h"
|
||||
#include "libcef_dll/shutdown_checker.h"
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
void CefMediaRouteCreateCallbackCToCpp::OnMediaRouteCreateFinished(
|
||||
RouteCreateResult result,
|
||||
const CefString& error,
|
||||
CefRefPtr<CefMediaRoute> route) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_media_route_create_callback_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, on_media_route_create_finished))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Unverified params: error, route
|
||||
|
||||
// Execute
|
||||
_struct->on_media_route_create_finished(_struct, result, error.GetStruct(),
|
||||
CefMediaRouteCppToC::Wrap(route));
|
||||
}
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefMediaRouteCreateCallbackCToCpp::CefMediaRouteCreateCallbackCToCpp() {}
|
||||
|
||||
// DESTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefMediaRouteCreateCallbackCToCpp::~CefMediaRouteCreateCallbackCToCpp() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
}
|
||||
|
||||
template <>
|
||||
cef_media_route_create_callback_t*
|
||||
CefCToCppRefCounted<CefMediaRouteCreateCallbackCToCpp,
|
||||
CefMediaRouteCreateCallback,
|
||||
cef_media_route_create_callback_t>::
|
||||
UnwrapDerived(CefWrapperType type, CefMediaRouteCreateCallback* c) {
|
||||
NOTREACHED() << "Unexpected class type: " << type;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
CefWrapperType
|
||||
CefCToCppRefCounted<CefMediaRouteCreateCallbackCToCpp,
|
||||
CefMediaRouteCreateCallback,
|
||||
cef_media_route_create_callback_t>::kWrapperType =
|
||||
WT_MEDIA_ROUTE_CREATE_CALLBACK;
|
43
libcef_dll/ctocpp/media_route_create_callback_ctocpp.h
Normal file
43
libcef_dll/ctocpp/media_route_create_callback_ctocpp.h
Normal file
@@ -0,0 +1,43 @@
|
||||
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=ac5657bccd7830fde1d3dddfad69d87dff2ae684$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_MEDIA_ROUTE_CREATE_CALLBACK_CTOCPP_H_
|
||||
#define CEF_LIBCEF_DLL_CTOCPP_MEDIA_ROUTE_CREATE_CALLBACK_CTOCPP_H_
|
||||
#pragma once
|
||||
|
||||
#if !defined(BUILDING_CEF_SHARED)
|
||||
#error This file can be included DLL-side only
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_media_router_capi.h"
|
||||
#include "include/cef_media_router.h"
|
||||
#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
|
||||
|
||||
// Wrap a C structure with a C++ class.
|
||||
// This class may be instantiated and accessed DLL-side only.
|
||||
class CefMediaRouteCreateCallbackCToCpp
|
||||
: public CefCToCppRefCounted<CefMediaRouteCreateCallbackCToCpp,
|
||||
CefMediaRouteCreateCallback,
|
||||
cef_media_route_create_callback_t> {
|
||||
public:
|
||||
CefMediaRouteCreateCallbackCToCpp();
|
||||
virtual ~CefMediaRouteCreateCallbackCToCpp();
|
||||
|
||||
// CefMediaRouteCreateCallback methods.
|
||||
void OnMediaRouteCreateFinished(RouteCreateResult result,
|
||||
const CefString& error,
|
||||
CefRefPtr<CefMediaRoute> route) override;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_MEDIA_ROUTE_CREATE_CALLBACK_CTOCPP_H_
|
129
libcef_dll/ctocpp/media_route_ctocpp.cc
Normal file
129
libcef_dll/ctocpp/media_route_ctocpp.cc
Normal file
@@ -0,0 +1,129 @@
|
||||
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=7fe34c4b79d10a88bfcf5ec46a54cf52d3657e87$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/media_route_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/media_sink_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/media_source_ctocpp.h"
|
||||
#include "libcef_dll/shutdown_checker.h"
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
NO_SANITIZE("cfi-icall") CefString CefMediaRouteCToCpp::GetId() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_media_route_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, get_id))
|
||||
return CefString();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_string_userfree_t _retval = _struct->get_id(_struct);
|
||||
|
||||
// Return type: string
|
||||
CefString _retvalStr;
|
||||
_retvalStr.AttachToUserFree(_retval);
|
||||
return _retvalStr;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
CefRefPtr<CefMediaSource> CefMediaRouteCToCpp::GetSource() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_media_route_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, get_source))
|
||||
return nullptr;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_media_source_t* _retval = _struct->get_source(_struct);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefMediaSourceCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
CefRefPtr<CefMediaSink> CefMediaRouteCToCpp::GetSink() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_media_route_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, get_sink))
|
||||
return nullptr;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_media_sink_t* _retval = _struct->get_sink(_struct);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefMediaSinkCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
void CefMediaRouteCToCpp::SendRouteMessage(const void* message,
|
||||
size_t message_size) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_media_route_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, send_route_message))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: message; type: simple_byaddr
|
||||
DCHECK(message);
|
||||
if (!message)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
_struct->send_route_message(_struct, message, message_size);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall") void CefMediaRouteCToCpp::Terminate() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_media_route_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, terminate))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
_struct->terminate(_struct);
|
||||
}
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefMediaRouteCToCpp::CefMediaRouteCToCpp() {}
|
||||
|
||||
// DESTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefMediaRouteCToCpp::~CefMediaRouteCToCpp() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
}
|
||||
|
||||
template <>
|
||||
cef_media_route_t*
|
||||
CefCToCppRefCounted<CefMediaRouteCToCpp, CefMediaRoute, cef_media_route_t>::
|
||||
UnwrapDerived(CefWrapperType type, CefMediaRoute* c) {
|
||||
NOTREACHED() << "Unexpected class type: " << type;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
CefWrapperType CefCToCppRefCounted<CefMediaRouteCToCpp,
|
||||
CefMediaRoute,
|
||||
cef_media_route_t>::kWrapperType =
|
||||
WT_MEDIA_ROUTE;
|
44
libcef_dll/ctocpp/media_route_ctocpp.h
Normal file
44
libcef_dll/ctocpp/media_route_ctocpp.h
Normal file
@@ -0,0 +1,44 @@
|
||||
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=cb792f909646d1ccd3644877ce2393080465471a$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_MEDIA_ROUTE_CTOCPP_H_
|
||||
#define CEF_LIBCEF_DLL_CTOCPP_MEDIA_ROUTE_CTOCPP_H_
|
||||
#pragma once
|
||||
|
||||
#if !defined(WRAPPING_CEF_SHARED)
|
||||
#error This file can be included wrapper-side only
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_media_router_capi.h"
|
||||
#include "include/cef_media_router.h"
|
||||
#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
|
||||
|
||||
// Wrap a C structure with a C++ class.
|
||||
// This class may be instantiated and accessed wrapper-side only.
|
||||
class CefMediaRouteCToCpp : public CefCToCppRefCounted<CefMediaRouteCToCpp,
|
||||
CefMediaRoute,
|
||||
cef_media_route_t> {
|
||||
public:
|
||||
CefMediaRouteCToCpp();
|
||||
virtual ~CefMediaRouteCToCpp();
|
||||
|
||||
// CefMediaRoute methods.
|
||||
CefString GetId() OVERRIDE;
|
||||
CefRefPtr<CefMediaSource> GetSource() OVERRIDE;
|
||||
CefRefPtr<CefMediaSink> GetSink() OVERRIDE;
|
||||
void SendRouteMessage(const void* message, size_t message_size) OVERRIDE;
|
||||
void Terminate() OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_MEDIA_ROUTE_CTOCPP_H_
|
167
libcef_dll/ctocpp/media_router_ctocpp.cc
Normal file
167
libcef_dll/ctocpp/media_router_ctocpp.cc
Normal file
@@ -0,0 +1,167 @@
|
||||
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=4b8ab6373fcb0a84a818c2c5ef8982600346f34b$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/media_router_ctocpp.h"
|
||||
#include "libcef_dll/cpptoc/media_observer_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/media_route_create_callback_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/media_sink_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/media_source_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/registration_ctocpp.h"
|
||||
#include "libcef_dll/shutdown_checker.h"
|
||||
|
||||
// STATIC METHODS - Body may be edited by hand.
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
CefRefPtr<CefMediaRouter> CefMediaRouter::GetGlobalMediaRouter() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_media_router_t* _retval = cef_media_router_get_global();
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefMediaRouterCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
CefRefPtr<CefRegistration> CefMediaRouterCToCpp::AddObserver(
|
||||
CefRefPtr<CefMediaObserver> observer) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_media_router_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, add_observer))
|
||||
return nullptr;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: observer; type: refptr_diff
|
||||
DCHECK(observer.get());
|
||||
if (!observer.get())
|
||||
return nullptr;
|
||||
|
||||
// Execute
|
||||
cef_registration_t* _retval =
|
||||
_struct->add_observer(_struct, CefMediaObserverCppToC::Wrap(observer));
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefRegistrationCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
CefRefPtr<CefMediaSource> CefMediaRouterCToCpp::GetSource(
|
||||
const CefString& urn) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_media_router_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, get_source))
|
||||
return nullptr;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: urn; type: string_byref_const
|
||||
DCHECK(!urn.empty());
|
||||
if (urn.empty())
|
||||
return nullptr;
|
||||
|
||||
// Execute
|
||||
cef_media_source_t* _retval = _struct->get_source(_struct, urn.GetStruct());
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefMediaSourceCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall") void CefMediaRouterCToCpp::NotifyCurrentSinks() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_media_router_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, notify_current_sinks))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
_struct->notify_current_sinks(_struct);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
void CefMediaRouterCToCpp::CreateRoute(
|
||||
CefRefPtr<CefMediaSource> source,
|
||||
CefRefPtr<CefMediaSink> sink,
|
||||
CefRefPtr<CefMediaRouteCreateCallback> callback) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_media_router_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, create_route))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: source; type: refptr_same
|
||||
DCHECK(source.get());
|
||||
if (!source.get())
|
||||
return;
|
||||
// Verify param: sink; type: refptr_same
|
||||
DCHECK(sink.get());
|
||||
if (!sink.get())
|
||||
return;
|
||||
// Verify param: callback; type: refptr_diff
|
||||
DCHECK(callback.get());
|
||||
if (!callback.get())
|
||||
return;
|
||||
|
||||
// Execute
|
||||
_struct->create_route(_struct, CefMediaSourceCToCpp::Unwrap(source),
|
||||
CefMediaSinkCToCpp::Unwrap(sink),
|
||||
CefMediaRouteCreateCallbackCppToC::Wrap(callback));
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall") void CefMediaRouterCToCpp::NotifyCurrentRoutes() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_media_router_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, notify_current_routes))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
_struct->notify_current_routes(_struct);
|
||||
}
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefMediaRouterCToCpp::CefMediaRouterCToCpp() {}
|
||||
|
||||
// DESTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefMediaRouterCToCpp::~CefMediaRouterCToCpp() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
}
|
||||
|
||||
template <>
|
||||
cef_media_router_t*
|
||||
CefCToCppRefCounted<CefMediaRouterCToCpp, CefMediaRouter, cef_media_router_t>::
|
||||
UnwrapDerived(CefWrapperType type, CefMediaRouter* c) {
|
||||
NOTREACHED() << "Unexpected class type: " << type;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
CefWrapperType CefCToCppRefCounted<CefMediaRouterCToCpp,
|
||||
CefMediaRouter,
|
||||
cef_media_router_t>::kWrapperType =
|
||||
WT_MEDIA_ROUTER;
|
47
libcef_dll/ctocpp/media_router_ctocpp.h
Normal file
47
libcef_dll/ctocpp/media_router_ctocpp.h
Normal file
@@ -0,0 +1,47 @@
|
||||
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=e3d62de09a699415a839cadda52cca2582d90063$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_MEDIA_ROUTER_CTOCPP_H_
|
||||
#define CEF_LIBCEF_DLL_CTOCPP_MEDIA_ROUTER_CTOCPP_H_
|
||||
#pragma once
|
||||
|
||||
#if !defined(WRAPPING_CEF_SHARED)
|
||||
#error This file can be included wrapper-side only
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_media_router_capi.h"
|
||||
#include "include/cef_media_router.h"
|
||||
#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
|
||||
|
||||
// Wrap a C structure with a C++ class.
|
||||
// This class may be instantiated and accessed wrapper-side only.
|
||||
class CefMediaRouterCToCpp : public CefCToCppRefCounted<CefMediaRouterCToCpp,
|
||||
CefMediaRouter,
|
||||
cef_media_router_t> {
|
||||
public:
|
||||
CefMediaRouterCToCpp();
|
||||
virtual ~CefMediaRouterCToCpp();
|
||||
|
||||
// CefMediaRouter methods.
|
||||
CefRefPtr<CefRegistration> AddObserver(
|
||||
CefRefPtr<CefMediaObserver> observer) OVERRIDE;
|
||||
CefRefPtr<CefMediaSource> GetSource(const CefString& urn) OVERRIDE;
|
||||
void NotifyCurrentSinks() OVERRIDE;
|
||||
void CreateRoute(CefRefPtr<CefMediaSource> source,
|
||||
CefRefPtr<CefMediaSink> sink,
|
||||
CefRefPtr<CefMediaRouteCreateCallback> callback) OVERRIDE;
|
||||
void NotifyCurrentRoutes() OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_MEDIA_ROUTER_CTOCPP_H_
|
168
libcef_dll/ctocpp/media_sink_ctocpp.cc
Normal file
168
libcef_dll/ctocpp/media_sink_ctocpp.cc
Normal file
@@ -0,0 +1,168 @@
|
||||
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=bb39ec5e546482b707c1e01a83fc1b064d96a4e6$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/media_sink_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/media_source_ctocpp.h"
|
||||
#include "libcef_dll/shutdown_checker.h"
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
NO_SANITIZE("cfi-icall") CefString CefMediaSinkCToCpp::GetId() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_media_sink_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, get_id))
|
||||
return CefString();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_string_userfree_t _retval = _struct->get_id(_struct);
|
||||
|
||||
// Return type: string
|
||||
CefString _retvalStr;
|
||||
_retvalStr.AttachToUserFree(_retval);
|
||||
return _retvalStr;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall") bool CefMediaSinkCToCpp::IsValid() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_media_sink_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, is_valid))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = _struct->is_valid(_struct);
|
||||
|
||||
// Return type: bool
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall") CefString CefMediaSinkCToCpp::GetName() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_media_sink_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, get_name))
|
||||
return CefString();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_string_userfree_t _retval = _struct->get_name(_struct);
|
||||
|
||||
// Return type: string
|
||||
CefString _retvalStr;
|
||||
_retvalStr.AttachToUserFree(_retval);
|
||||
return _retvalStr;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall") CefString CefMediaSinkCToCpp::GetDescription() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_media_sink_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, get_description))
|
||||
return CefString();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_string_userfree_t _retval = _struct->get_description(_struct);
|
||||
|
||||
// Return type: string
|
||||
CefString _retvalStr;
|
||||
_retvalStr.AttachToUserFree(_retval);
|
||||
return _retvalStr;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall") bool CefMediaSinkCToCpp::IsCastSink() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_media_sink_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, is_cast_sink))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = _struct->is_cast_sink(_struct);
|
||||
|
||||
// Return type: bool
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall") bool CefMediaSinkCToCpp::IsDialSink() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_media_sink_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, is_dial_sink))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = _struct->is_dial_sink(_struct);
|
||||
|
||||
// Return type: bool
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
bool CefMediaSinkCToCpp::IsCompatibleWith(CefRefPtr<CefMediaSource> source) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_media_sink_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, is_compatible_with))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: source; type: refptr_same
|
||||
DCHECK(source.get());
|
||||
if (!source.get())
|
||||
return false;
|
||||
|
||||
// Execute
|
||||
int _retval = _struct->is_compatible_with(
|
||||
_struct, CefMediaSourceCToCpp::Unwrap(source));
|
||||
|
||||
// Return type: bool
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefMediaSinkCToCpp::CefMediaSinkCToCpp() {}
|
||||
|
||||
// DESTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefMediaSinkCToCpp::~CefMediaSinkCToCpp() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
}
|
||||
|
||||
template <>
|
||||
cef_media_sink_t*
|
||||
CefCToCppRefCounted<CefMediaSinkCToCpp, CefMediaSink, cef_media_sink_t>::
|
||||
UnwrapDerived(CefWrapperType type, CefMediaSink* c) {
|
||||
NOTREACHED() << "Unexpected class type: " << type;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
CefWrapperType CefCToCppRefCounted<CefMediaSinkCToCpp,
|
||||
CefMediaSink,
|
||||
cef_media_sink_t>::kWrapperType =
|
||||
WT_MEDIA_SINK;
|
46
libcef_dll/ctocpp/media_sink_ctocpp.h
Normal file
46
libcef_dll/ctocpp/media_sink_ctocpp.h
Normal file
@@ -0,0 +1,46 @@
|
||||
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=d69c0bdadc802bc7cb970c316f3a0ed8529c5f9c$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_MEDIA_SINK_CTOCPP_H_
|
||||
#define CEF_LIBCEF_DLL_CTOCPP_MEDIA_SINK_CTOCPP_H_
|
||||
#pragma once
|
||||
|
||||
#if !defined(WRAPPING_CEF_SHARED)
|
||||
#error This file can be included wrapper-side only
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_media_router_capi.h"
|
||||
#include "include/cef_media_router.h"
|
||||
#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
|
||||
|
||||
// Wrap a C structure with a C++ class.
|
||||
// This class may be instantiated and accessed wrapper-side only.
|
||||
class CefMediaSinkCToCpp : public CefCToCppRefCounted<CefMediaSinkCToCpp,
|
||||
CefMediaSink,
|
||||
cef_media_sink_t> {
|
||||
public:
|
||||
CefMediaSinkCToCpp();
|
||||
virtual ~CefMediaSinkCToCpp();
|
||||
|
||||
// CefMediaSink methods.
|
||||
CefString GetId() OVERRIDE;
|
||||
bool IsValid() OVERRIDE;
|
||||
CefString GetName() OVERRIDE;
|
||||
CefString GetDescription() OVERRIDE;
|
||||
bool IsCastSink() OVERRIDE;
|
||||
bool IsDialSink() OVERRIDE;
|
||||
bool IsCompatibleWith(CefRefPtr<CefMediaSource> source) OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_MEDIA_SINK_CTOCPP_H_
|
108
libcef_dll/ctocpp/media_source_ctocpp.cc
Normal file
108
libcef_dll/ctocpp/media_source_ctocpp.cc
Normal file
@@ -0,0 +1,108 @@
|
||||
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=2b4f20db4eccd1429c748f39db19852cd1644b4a$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/media_source_ctocpp.h"
|
||||
#include "libcef_dll/shutdown_checker.h"
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
NO_SANITIZE("cfi-icall") CefString CefMediaSourceCToCpp::GetId() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_media_source_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, get_id))
|
||||
return CefString();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_string_userfree_t _retval = _struct->get_id(_struct);
|
||||
|
||||
// Return type: string
|
||||
CefString _retvalStr;
|
||||
_retvalStr.AttachToUserFree(_retval);
|
||||
return _retvalStr;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall") bool CefMediaSourceCToCpp::IsValid() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_media_source_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, is_valid))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = _struct->is_valid(_struct);
|
||||
|
||||
// Return type: bool
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall") bool CefMediaSourceCToCpp::IsCastSource() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_media_source_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, is_cast_source))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = _struct->is_cast_source(_struct);
|
||||
|
||||
// Return type: bool
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall") bool CefMediaSourceCToCpp::IsDialSource() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_media_source_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, is_dial_source))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = _struct->is_dial_source(_struct);
|
||||
|
||||
// Return type: bool
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefMediaSourceCToCpp::CefMediaSourceCToCpp() {}
|
||||
|
||||
// DESTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefMediaSourceCToCpp::~CefMediaSourceCToCpp() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
}
|
||||
|
||||
template <>
|
||||
cef_media_source_t*
|
||||
CefCToCppRefCounted<CefMediaSourceCToCpp, CefMediaSource, cef_media_source_t>::
|
||||
UnwrapDerived(CefWrapperType type, CefMediaSource* c) {
|
||||
NOTREACHED() << "Unexpected class type: " << type;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
CefWrapperType CefCToCppRefCounted<CefMediaSourceCToCpp,
|
||||
CefMediaSource,
|
||||
cef_media_source_t>::kWrapperType =
|
||||
WT_MEDIA_SOURCE;
|
43
libcef_dll/ctocpp/media_source_ctocpp.h
Normal file
43
libcef_dll/ctocpp/media_source_ctocpp.h
Normal file
@@ -0,0 +1,43 @@
|
||||
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=73aeb0f58611c0d7a9fa13f1d9268912e0fba0bd$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_MEDIA_SOURCE_CTOCPP_H_
|
||||
#define CEF_LIBCEF_DLL_CTOCPP_MEDIA_SOURCE_CTOCPP_H_
|
||||
#pragma once
|
||||
|
||||
#if !defined(WRAPPING_CEF_SHARED)
|
||||
#error This file can be included wrapper-side only
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_media_router_capi.h"
|
||||
#include "include/cef_media_router.h"
|
||||
#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
|
||||
|
||||
// Wrap a C structure with a C++ class.
|
||||
// This class may be instantiated and accessed wrapper-side only.
|
||||
class CefMediaSourceCToCpp : public CefCToCppRefCounted<CefMediaSourceCToCpp,
|
||||
CefMediaSource,
|
||||
cef_media_source_t> {
|
||||
public:
|
||||
CefMediaSourceCToCpp();
|
||||
virtual ~CefMediaSourceCToCpp();
|
||||
|
||||
// CefMediaSource methods.
|
||||
CefString GetId() OVERRIDE;
|
||||
bool IsValid() OVERRIDE;
|
||||
bool IsCastSource() OVERRIDE;
|
||||
bool IsDialSource() OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_MEDIA_SOURCE_CTOCPP_H_
|
42
libcef_dll/ctocpp/registration_ctocpp.cc
Normal file
42
libcef_dll/ctocpp/registration_ctocpp.cc
Normal file
@@ -0,0 +1,42 @@
|
||||
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=89f0f0c0ae2485adbf8140a419969901e5766b51$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/registration_ctocpp.h"
|
||||
#include "libcef_dll/shutdown_checker.h"
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefRegistrationCToCpp::CefRegistrationCToCpp() {}
|
||||
|
||||
// DESTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefRegistrationCToCpp::~CefRegistrationCToCpp() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
}
|
||||
|
||||
template <>
|
||||
cef_registration_t*
|
||||
CefCToCppRefCounted<CefRegistrationCToCpp,
|
||||
CefRegistration,
|
||||
cef_registration_t>::UnwrapDerived(CefWrapperType type,
|
||||
CefRegistration* c) {
|
||||
NOTREACHED() << "Unexpected class type: " << type;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
CefWrapperType CefCToCppRefCounted<CefRegistrationCToCpp,
|
||||
CefRegistration,
|
||||
cef_registration_t>::kWrapperType =
|
||||
WT_REGISTRATION;
|
39
libcef_dll/ctocpp/registration_ctocpp.h
Normal file
39
libcef_dll/ctocpp/registration_ctocpp.h
Normal file
@@ -0,0 +1,39 @@
|
||||
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=6d458b0a8e42e3f3347d5101f8d3f1f88264ecc7$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_REGISTRATION_CTOCPP_H_
|
||||
#define CEF_LIBCEF_DLL_CTOCPP_REGISTRATION_CTOCPP_H_
|
||||
#pragma once
|
||||
|
||||
#if !defined(WRAPPING_CEF_SHARED)
|
||||
#error This file can be included wrapper-side only
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_registration_capi.h"
|
||||
#include "include/cef_registration.h"
|
||||
#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
|
||||
|
||||
// Wrap a C structure with a C++ class.
|
||||
// This class may be instantiated and accessed wrapper-side only.
|
||||
class CefRegistrationCToCpp : public CefCToCppRefCounted<CefRegistrationCToCpp,
|
||||
CefRegistration,
|
||||
cef_registration_t> {
|
||||
public:
|
||||
CefRegistrationCToCpp();
|
||||
virtual ~CefRegistrationCToCpp();
|
||||
|
||||
// CefRegistration methods.
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_REGISTRATION_CTOCPP_H_
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=dd21194253186ee403d7ffe5098e87b030eeb4c8$
|
||||
// $hash=a29d8f9e49143e42a0ae0204c7d439c76b3c371c$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/request_context_ctocpp.h"
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "libcef_dll/ctocpp/cookie_manager_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/dictionary_value_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/extension_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/media_router_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/value_ctocpp.h"
|
||||
#include "libcef_dll/transfer_util.h"
|
||||
|
||||
@@ -525,6 +526,21 @@ CefRefPtr<CefExtension> CefRequestContextCToCpp::GetExtension(
|
||||
return CefExtensionCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
CefRefPtr<CefMediaRouter> CefRequestContextCToCpp::GetMediaRouter() {
|
||||
cef_request_context_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, get_media_router))
|
||||
return nullptr;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_media_router_t* _retval = _struct->get_media_router(_struct);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefMediaRouterCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefRequestContextCToCpp::CefRequestContextCToCpp() {}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=d962f641e63a8dd86bdb44eb058c39d97db7f880$
|
||||
// $hash=7841eec57c44171080b5d958ca03760cbe23f22b$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_REQUEST_CONTEXT_CTOCPP_H_
|
||||
@@ -75,6 +75,7 @@ class CefRequestContextCToCpp
|
||||
bool HasExtension(const CefString& extension_id) OVERRIDE;
|
||||
bool GetExtensions(std::vector<CefString>& extension_ids) OVERRIDE;
|
||||
CefRefPtr<CefExtension> GetExtension(const CefString& extension_id) OVERRIDE;
|
||||
CefRefPtr<CefMediaRouter> GetMediaRouter() OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_REQUEST_CONTEXT_CTOCPP_H_
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=5e0a3a27b41b550a1dd4985eec9034a6f7c2b7d7$
|
||||
// $hash=bf82965f02cafae5a1afc80ab0c976436be9712e$
|
||||
//
|
||||
|
||||
#include <dlfcn.h>
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "include/capi/cef_drag_data_capi.h"
|
||||
#include "include/capi/cef_file_util_capi.h"
|
||||
#include "include/capi/cef_image_capi.h"
|
||||
#include "include/capi/cef_media_router_capi.h"
|
||||
#include "include/capi/cef_menu_model_capi.h"
|
||||
#include "include/capi/cef_origin_whitelist_capi.h"
|
||||
#include "include/capi/cef_parser_capi.h"
|
||||
@@ -201,6 +202,7 @@ typedef struct _cef_cookie_manager_t* (
|
||||
struct _cef_completion_callback_t*);
|
||||
typedef struct _cef_drag_data_t* (*cef_drag_data_create_ptr)();
|
||||
typedef struct _cef_image_t* (*cef_image_create_ptr)();
|
||||
typedef struct _cef_media_router_t* (*cef_media_router_get_global_ptr)();
|
||||
typedef struct _cef_menu_model_t* (*cef_menu_model_create_ptr)(
|
||||
struct _cef_menu_model_delegate_t*);
|
||||
typedef struct _cef_print_settings_t* (*cef_print_settings_create_ptr)();
|
||||
@@ -575,6 +577,7 @@ struct libcef_pointers {
|
||||
cef_cookie_manager_get_global_manager;
|
||||
cef_drag_data_create_ptr cef_drag_data_create;
|
||||
cef_image_create_ptr cef_image_create;
|
||||
cef_media_router_get_global_ptr cef_media_router_get_global;
|
||||
cef_menu_model_create_ptr cef_menu_model_create;
|
||||
cef_print_settings_create_ptr cef_print_settings_create;
|
||||
cef_process_message_create_ptr cef_process_message_create;
|
||||
@@ -788,6 +791,7 @@ int libcef_init_pointers(const char* path) {
|
||||
INIT_ENTRY(cef_cookie_manager_get_global_manager);
|
||||
INIT_ENTRY(cef_drag_data_create);
|
||||
INIT_ENTRY(cef_image_create);
|
||||
INIT_ENTRY(cef_media_router_get_global);
|
||||
INIT_ENTRY(cef_menu_model_create);
|
||||
INIT_ENTRY(cef_print_settings_create);
|
||||
INIT_ENTRY(cef_process_message_create);
|
||||
@@ -1301,6 +1305,11 @@ NO_SANITIZE("cfi-icall") struct _cef_image_t* cef_image_create() {
|
||||
return g_libcef_pointers.cef_image_create();
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
struct _cef_media_router_t* cef_media_router_get_global() {
|
||||
return g_libcef_pointers.cef_media_router_get_global();
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
struct _cef_menu_model_t* cef_menu_model_create(
|
||||
struct _cef_menu_model_delegate_t* delegate) {
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=946864e8254e77f0555d607d1d99a8ba3f1c45db$
|
||||
// $hash=089392d929a9f7a3ca4fe7f53d63b98536505261$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_WRAPPER_TYPES_H_
|
||||
@@ -73,6 +73,12 @@ enum CefWrapperType {
|
||||
WT_LIFE_SPAN_HANDLER,
|
||||
WT_LIST_VALUE,
|
||||
WT_LOAD_HANDLER,
|
||||
WT_MEDIA_OBSERVER,
|
||||
WT_MEDIA_ROUTE,
|
||||
WT_MEDIA_ROUTE_CREATE_CALLBACK,
|
||||
WT_MEDIA_ROUTER,
|
||||
WT_MEDIA_SINK,
|
||||
WT_MEDIA_SOURCE,
|
||||
WT_MENU_BUTTON,
|
||||
WT_MENU_BUTTON_DELEGATE,
|
||||
WT_MENU_BUTTON_PRESSED_LOCK,
|
||||
@@ -92,6 +98,7 @@ enum CefWrapperType {
|
||||
WT_PROCESS_MESSAGE,
|
||||
WT_READ_HANDLER,
|
||||
WT_REGISTER_CDM_CALLBACK,
|
||||
WT_REGISTRATION,
|
||||
WT_RENDER_HANDLER,
|
||||
WT_RENDER_PROCESS_HANDLER,
|
||||
WT_REQUEST,
|
||||
|
Reference in New Issue
Block a user