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

@ -46,6 +46,7 @@ class CefMediaObserver;
class CefMediaRoute;
class CefMediaRouteCreateCallback;
class CefMediaSink;
class CefMediaSinkDeviceInfoCallback;
class CefMediaSource;
///
@ -247,6 +248,13 @@ class CefMediaSink : public virtual CefBaseRefCounted {
/*--cef(default_retval=CEF_MSIT_GENERIC)--*/
virtual IconType GetIconType() = 0;
///
// Asynchronously retrieves device info.
///
/*--cef()--*/
virtual void GetDeviceInfo(
CefRefPtr<CefMediaSinkDeviceInfoCallback> callback) = 0;
///
// Returns true if this sink accepts content via Cast.
///
@ -266,6 +274,22 @@ class CefMediaSink : public virtual CefBaseRefCounted {
virtual bool IsCompatibleWith(CefRefPtr<CefMediaSource> source) = 0;
};
///
// Callback interface for CefMediaSink::GetDeviceInfo. The methods of this
// class will be called on the browser process UI thread.
///
/*--cef(source=client)--*/
class CefMediaSinkDeviceInfoCallback : public virtual CefBaseRefCounted {
public:
///
// Method that will be executed asyncronously once device information has been
// retrieved.
///
/*--cef()--*/
virtual void OnMediaSinkDeviceInfo(
const CefMediaSinkDeviceInfo& device_info) = 0;
};
///
// Represents a source from which media can be routed. Instances of this object
// are retrieved via CefMediaRouter::GetSource. The methods of this class may be