Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: chromecast/common/media/cast_media_client.h

Issue 2156193003: [Chromecast] Add a custom CastMediaClient for Chromecast (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@codecs
Patch Set: rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chromecast/common/media/cast_media_client.h
diff --git a/chromecast/common/media/cast_media_client.h b/chromecast/common/media/cast_media_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..3ec01174451b9b692746d4e19eb6419e04b8728f
--- /dev/null
+++ b/chromecast/common/media/cast_media_client.h
@@ -0,0 +1,50 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMECAST_COMMON_MEDIA_CAST_MEDIA_CLIENT_H_
+#define CHROMECAST_COMMON_MEDIA_CAST_MEDIA_CLIENT_H_
+
+#include "base/lazy_instance.h"
+#include "base/macros.h"
+#include "media/base/media_client.h"
+
+namespace chromecast {
+namespace media {
+
+// Forwards MediaClient::IsSupportedVideoConfig calls to MediaCapabilitiesShlib
+// and the rest of the calls to the default content media client (i.e.
+// content::RenderMediaClient).
+class CastMediaClient : public ::media::MediaClient {
+ public:
+ // Initialize CastMediaClient and SetMediaClient(). Note that the instance
+ // is not exposed because no content code needs to directly access it.
+ static void Initialize();
+
+ // MediaClient implementation
+ void AddKeySystemsInfoForUMA(std::vector<::media::KeySystemInfoForUMA>*
+ key_systems_info_for_uma) override;
+ bool IsKeySystemsUpdateNeeded() override;
+ void AddSupportedKeySystems(
+ std::vector<std::unique_ptr<::media::KeySystemProperties>>*
+ key_systems_properties) override;
+ void RecordRapporURL(const std::string& metric, const GURL& url) override;
+ bool IsSupportedVideoConfig(::media::VideoCodec codec,
+ ::media::VideoCodecProfile profile,
+ int level) override;
+
+ private:
+ friend struct base::DefaultLazyInstanceTraits<CastMediaClient>;
+
+ CastMediaClient();
+ ~CastMediaClient() override;
+
+ ::media::MediaClient* content_media_client_;
+
+ DISALLOW_COPY_AND_ASSIGN(CastMediaClient);
+};
+
+} // namespace media
+} // namespace chromecast
+
+#endif // CHROMECAST_COMMON_MEDIA_CAST_MEDIA_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698