mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add CefMediaSink::GetIconType (see issue #2900)
This attribute is useful for identifying different classes of cast devices without first requiring a connection (CAST, CAST_AUDIO, CAST_AUDIO_GROUP, etc).
This commit is contained in:
@@ -27,6 +27,15 @@ CefString CefMediaSinkImpl::GetDescription() {
|
||||
return sink_.description().value_or("");
|
||||
}
|
||||
|
||||
CefMediaSink::IconType CefMediaSinkImpl::GetIconType() {
|
||||
// Verify that our enum matches Chromium's values.
|
||||
static_assert(static_cast<int>(CEF_MSIT_TOTAL_COUNT) ==
|
||||
static_cast<int>(media_router::SinkIconType::TOTAL_COUNT),
|
||||
"enum mismatch");
|
||||
|
||||
return static_cast<CefMediaSink::IconType>(sink_.icon_type());
|
||||
}
|
||||
|
||||
bool CefMediaSinkImpl::IsCastSink() {
|
||||
return sink_.provider_id() == media_router::CAST;
|
||||
}
|
||||
|
@@ -22,6 +22,7 @@ class CefMediaSinkImpl : public CefMediaSink {
|
||||
bool IsValid() override;
|
||||
CefString GetName() override;
|
||||
CefString GetDescription() override;
|
||||
IconType GetIconType() override;
|
||||
bool IsCastSink() override;
|
||||
bool IsDialSink() override;
|
||||
bool IsCompatibleWith(CefRefPtr<CefMediaSource> source) override;
|
||||
|
Reference in New Issue
Block a user