• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
2 // reserved. Use of this source code is governed by a BSD-style license that
3 // can be found in the LICENSE file.
4 
5 #ifndef CEF_LIBCEF_BROWSER_MEDIA_ROUTER_MEDIA_SINK_IMPL_H_
6 #define CEF_LIBCEF_BROWSER_MEDIA_ROUTER_MEDIA_SINK_IMPL_H_
7 #pragma once
8 
9 #include "include/cef_media_router.h"
10 
11 #include "components/media_router/common/media_sink.h"
12 
13 // Implementation of the CefMediaSink interface. May be created on any thread.
14 class CefMediaSinkImpl : public CefMediaSink {
15  public:
16   explicit CefMediaSinkImpl(const media_router::MediaSink& sink);
17   CefMediaSinkImpl(const media_router::MediaSink::Id& sink_id,
18                    const std::string& sink_name,
19                    media_router::mojom::MediaRouteProviderId provider_id);
20 
21   CefMediaSinkImpl(const CefMediaSinkImpl&) = delete;
22   CefMediaSinkImpl& operator=(const CefMediaSinkImpl&) = delete;
23 
24   // CefMediaSink methods.
25   CefString GetId() override;
26   CefString GetName() override;
27   CefString GetDescription() override;
28   IconType GetIconType() override;
29   void GetDeviceInfo(
30       CefRefPtr<CefMediaSinkDeviceInfoCallback> callback) override;
31   bool IsCastSink() override;
32   bool IsDialSink() override;
33   bool IsCompatibleWith(CefRefPtr<CefMediaSource> source) override;
34 
sink()35   const media_router::MediaSink& sink() const { return sink_; }
36 
37  private:
38   // Read-only after creation.
39   const media_router::MediaSink sink_;
40 
41   IMPLEMENT_REFCOUNTING(CefMediaSinkImpl);
42 };
43 
44 #endif  // CEF_LIBCEF_BROWSER_MEDIA_ROUTER_MEDIA_SINK_IMPL_H_
45