Expose MediaSink device ip/port and model name (see issue #2900)

This commit is contained in:
Marshall Greenblatt
2020-07-14 16:43:57 -04:00
parent 13e3c8b42a
commit e8573173dd
18 changed files with 578 additions and 35 deletions

View File

@ -9,11 +9,12 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=53dca3d842bb3d2f8a329a38759eb623620439a2$
// $hash=67d4596d3230067ea7dfe3c8150e3cf87ac526a5$
//
#include "libcef_dll/cpptoc/media_sink_cpptoc.h"
#include "libcef_dll/cpptoc/media_source_cpptoc.h"
#include "libcef_dll/ctocpp/media_sink_device_info_callback_ctocpp.h"
#include "libcef_dll/shutdown_checker.h"
namespace {
@ -89,6 +90,26 @@ media_sink_get_icon_type(struct _cef_media_sink_t* self) {
return _retval;
}
void CEF_CALLBACK media_sink_get_device_info(
struct _cef_media_sink_t* self,
struct _cef_media_sink_device_info_callback_t* callback) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Verify param: callback; type: refptr_diff
DCHECK(callback);
if (!callback)
return;
// Execute
CefMediaSinkCppToC::Get(self)->GetDeviceInfo(
CefMediaSinkDeviceInfoCallbackCToCpp::Wrap(callback));
}
int CEF_CALLBACK media_sink_is_cast_sink(struct _cef_media_sink_t* self) {
shutdown_checker::AssertNotShutdown();
@ -153,6 +174,7 @@ CefMediaSinkCppToC::CefMediaSinkCppToC() {
GetStruct()->get_name = media_sink_get_name;
GetStruct()->get_description = media_sink_get_description;
GetStruct()->get_icon_type = media_sink_get_icon_type;
GetStruct()->get_device_info = media_sink_get_device_info;
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;

View File

@ -0,0 +1,78 @@
// 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=c22023ad9e7d7d80d72729dbebdf03f0b60f4dc9$
//
#include "libcef_dll/cpptoc/media_sink_device_info_callback_cpptoc.h"
#include "libcef_dll/shutdown_checker.h"
namespace {
// MEMBER FUNCTIONS - Body may be edited by hand.
void CEF_CALLBACK media_sink_device_info_callback_on_media_sink_device_info(
struct _cef_media_sink_device_info_callback_t* self,
const struct _cef_media_sink_device_info_t* device_info) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Verify param: device_info; type: struct_byref_const
DCHECK(device_info);
if (!device_info)
return;
// Translate param: device_info; type: struct_byref_const
CefMediaSinkDeviceInfo device_infoObj;
if (device_info)
device_infoObj.Set(*device_info, false);
// Execute
CefMediaSinkDeviceInfoCallbackCppToC::Get(self)->OnMediaSinkDeviceInfo(
device_infoObj);
}
} // namespace
// CONSTRUCTOR - Do not edit by hand.
CefMediaSinkDeviceInfoCallbackCppToC::CefMediaSinkDeviceInfoCallbackCppToC() {
GetStruct()->on_media_sink_device_info =
media_sink_device_info_callback_on_media_sink_device_info;
}
// DESTRUCTOR - Do not edit by hand.
CefMediaSinkDeviceInfoCallbackCppToC::~CefMediaSinkDeviceInfoCallbackCppToC() {
shutdown_checker::AssertNotShutdown();
}
template <>
CefRefPtr<CefMediaSinkDeviceInfoCallback>
CefCppToCRefCounted<CefMediaSinkDeviceInfoCallbackCppToC,
CefMediaSinkDeviceInfoCallback,
cef_media_sink_device_info_callback_t>::
UnwrapDerived(CefWrapperType type,
cef_media_sink_device_info_callback_t* s) {
NOTREACHED() << "Unexpected class type: " << type;
return nullptr;
}
template <>
CefWrapperType
CefCppToCRefCounted<CefMediaSinkDeviceInfoCallbackCppToC,
CefMediaSinkDeviceInfoCallback,
cef_media_sink_device_info_callback_t>::kWrapperType =
WT_MEDIA_SINK_DEVICE_INFO_CALLBACK;

View 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=5313c2346d5db18dca956f2dac98b73e049a4995$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_MEDIA_SINK_DEVICE_INFO_CALLBACK_CPPTOC_H_
#define CEF_LIBCEF_DLL_CPPTOC_MEDIA_SINK_DEVICE_INFO_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 CefMediaSinkDeviceInfoCallbackCppToC
: public CefCppToCRefCounted<CefMediaSinkDeviceInfoCallbackCppToC,
CefMediaSinkDeviceInfoCallback,
cef_media_sink_device_info_callback_t> {
public:
CefMediaSinkDeviceInfoCallbackCppToC();
virtual ~CefMediaSinkDeviceInfoCallbackCppToC();
};
#endif // CEF_LIBCEF_DLL_CPPTOC_MEDIA_SINK_DEVICE_INFO_CALLBACK_CPPTOC_H_