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

Unified Diff: chromecast/renderer/media/cast_media_client.cc

Issue 2712983004: Simplify/Cleanup MediaClient (Closed)
Patch Set: Created 3 years, 9 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/renderer/media/cast_media_client.cc
diff --git a/chromecast/renderer/media/cast_media_client.cc b/chromecast/renderer/media/cast_media_client.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a14c64bb1ef277e1b2ac5b0a5b5af68474e5023c
--- /dev/null
+++ b/chromecast/renderer/media/cast_media_client.cc
@@ -0,0 +1,39 @@
+// 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.
+
+#include "chromecast/renderer/media/cast_media_client.h"
+
+#include "chromecast/media/base/media_codec_support.h"
+#include "chromecast/media/base/supported_codec_profile_levels_memo.h"
+#include "chromecast/public/media/media_capabilities_shlib.h"
+
+namespace chromecast {
+namespace media {
+
+CastMediaClient::CastMediaClient(
+ content::ContentRendererClient* content_renderer_client,
+ SupportedCodecProfileLevelsMemo* supported_profiles)
+ : ContentMediaClient(content_renderer_client),
+ supported_profiles_(supported_profiles) {
+ DCHECK(content_renderer_client);
+}
+
+CastMediaClient::~CastMediaClient() {}
+
+bool CastMediaClient::IsSupportedVideoConfig(
+ const ::media::VideoConfig& config) {
+// TODO(servolk): make use of eotf.
+#if defined(OS_ANDROID)
+ return supported_profiles_->IsSupportedVideoConfig(
+ ToCastVideoCodec(config.codec, config.profile),
+ ToCastVideoProfile(config.profile), config.level);
+#else
+ return MediaCapabilitiesShlib::IsSupportedVideoConfig(
+ ToCastVideoCodec(config.codec, config.profile),
+ ToCastVideoProfile(config.profile), config.level);
+#endif
+}
+
+} // namespace media
+} // namespace chromecast

Powered by Google App Engine
This is Rietveld 408576698