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,10 +9,11 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=6ffdd140e2cb688f1d7db2eb1e2356a62ac08e5e$
// $hash=8f3906cf08a292e81bf59629cf073c93cf388725$
//
#include "libcef_dll/ctocpp/media_sink_ctocpp.h"
#include "libcef_dll/cpptoc/media_sink_device_info_callback_cpptoc.h"
#include "libcef_dll/ctocpp/media_source_ctocpp.h"
#include "libcef_dll/shutdown_checker.h"
@@ -89,6 +90,27 @@ CefMediaSink::IconType CefMediaSinkCToCpp::GetIconType() {
return _retval;
}
NO_SANITIZE("cfi-icall")
void CefMediaSinkCToCpp::GetDeviceInfo(
CefRefPtr<CefMediaSinkDeviceInfoCallback> callback) {
shutdown_checker::AssertNotShutdown();
cef_media_sink_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_device_info))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: callback; type: refptr_diff
DCHECK(callback.get());
if (!callback.get())
return;
// Execute
_struct->get_device_info(
_struct, CefMediaSinkDeviceInfoCallbackCppToC::Wrap(callback));
}
NO_SANITIZE("cfi-icall") bool CefMediaSinkCToCpp::IsCastSink() {
shutdown_checker::AssertNotShutdown();

View File

@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=9d3af9897a857a63abec8327f84f5d809be603da$
// $hash=d5ab2dbf52c45129296b1ee156ead2f1e3182db8$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_MEDIA_SINK_CTOCPP_H_
@@ -38,6 +38,8 @@ class CefMediaSinkCToCpp : public CefCToCppRefCounted<CefMediaSinkCToCpp,
CefString GetName() OVERRIDE;
CefString GetDescription() OVERRIDE;
IconType GetIconType() OVERRIDE;
void GetDeviceInfo(
CefRefPtr<CefMediaSinkDeviceInfoCallback> callback) OVERRIDE;
bool IsCastSink() OVERRIDE;
bool IsDialSink() OVERRIDE;
bool IsCompatibleWith(CefRefPtr<CefMediaSource> source) OVERRIDE;

View File

@@ -0,0 +1,60 @@
// 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=c56362ea79609562dacc4bf8303f2bd920ddeada$
//
#include "libcef_dll/ctocpp/media_sink_device_info_callback_ctocpp.h"
#include "libcef_dll/shutdown_checker.h"
// VIRTUAL METHODS - Body may be edited by hand.
NO_SANITIZE("cfi-icall")
void CefMediaSinkDeviceInfoCallbackCToCpp::OnMediaSinkDeviceInfo(
const CefMediaSinkDeviceInfo& device_info) {
shutdown_checker::AssertNotShutdown();
cef_media_sink_device_info_callback_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, on_media_sink_device_info))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
_struct->on_media_sink_device_info(_struct, &device_info);
}
// CONSTRUCTOR - Do not edit by hand.
CefMediaSinkDeviceInfoCallbackCToCpp::CefMediaSinkDeviceInfoCallbackCToCpp() {}
// DESTRUCTOR - Do not edit by hand.
CefMediaSinkDeviceInfoCallbackCToCpp::~CefMediaSinkDeviceInfoCallbackCToCpp() {
shutdown_checker::AssertNotShutdown();
}
template <>
cef_media_sink_device_info_callback_t*
CefCToCppRefCounted<CefMediaSinkDeviceInfoCallbackCToCpp,
CefMediaSinkDeviceInfoCallback,
cef_media_sink_device_info_callback_t>::
UnwrapDerived(CefWrapperType type, CefMediaSinkDeviceInfoCallback* c) {
NOTREACHED() << "Unexpected class type: " << type;
return nullptr;
}
template <>
CefWrapperType
CefCToCppRefCounted<CefMediaSinkDeviceInfoCallbackCToCpp,
CefMediaSinkDeviceInfoCallback,
cef_media_sink_device_info_callback_t>::kWrapperType =
WT_MEDIA_SINK_DEVICE_INFO_CALLBACK;

View 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=e48d0b8482168d355e04460ea6ea5b7662dbe4fd$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_MEDIA_SINK_DEVICE_INFO_CALLBACK_CTOCPP_H_
#define CEF_LIBCEF_DLL_CTOCPP_MEDIA_SINK_DEVICE_INFO_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 CefMediaSinkDeviceInfoCallbackCToCpp
: public CefCToCppRefCounted<CefMediaSinkDeviceInfoCallbackCToCpp,
CefMediaSinkDeviceInfoCallback,
cef_media_sink_device_info_callback_t> {
public:
CefMediaSinkDeviceInfoCallbackCToCpp();
virtual ~CefMediaSinkDeviceInfoCallbackCToCpp();
// CefMediaSinkDeviceInfoCallback methods.
void OnMediaSinkDeviceInfo(
const CefMediaSinkDeviceInfo& device_info) override;
};
#endif // CEF_LIBCEF_DLL_CTOCPP_MEDIA_SINK_DEVICE_INFO_CALLBACK_CTOCPP_H_