mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-01-14 19:06:47 +01:00
03fd5b15da
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.
117 lines
3.0 KiB
C++
117 lines
3.0 KiB
C++
// 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;
|