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

Unified Diff: media/ozone/media_ozone_platform.cc

Issue 269673005: media: Add MediaOzonePlatform support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed pointed issues. Created 6 years, 6 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
« content/common/gpu/media/DEPS ('K') | « media/ozone/media_ozone_platform.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/ozone/media_ozone_platform.cc
diff --git a/media/ozone/media_ozone_platform.cc b/media/ozone/media_ozone_platform.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e7c75df609a38ad7962b77b62c6626e520d1e528
--- /dev/null
+++ b/media/ozone/media_ozone_platform.cc
@@ -0,0 +1,83 @@
+// Copyright 2014 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 "media/ozone/media_ozone_platform.h"
+
+#include "base/debug/trace_event.h"
+#include "base/logging.h"
+#include "ui/ozone/platform_object.h"
+#include "ui/ozone/platform_selection.h"
+
+namespace media {
+
+namespace {
+
+class MediaOzonePlatformStub : public MediaOzonePlatform {
+ public:
+ MediaOzonePlatformStub() {}
+
+ virtual ~MediaOzonePlatformStub() {}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MediaOzonePlatformStub);
+};
+
+} // namespace
+
+// the following are just convenient stubs and need to be removed once the
+// internal platforms decide to actually implement their media specifics
+MediaOzonePlatform* CreateMediaOzonePlatformDri() {
+ return new MediaOzonePlatformStub;
+}
+
+MediaOzonePlatform* CreateMediaOzonePlatformEgltest() {
+ return new MediaOzonePlatformStub;
+}
+
+MediaOzonePlatform* CreateMediaOzonePlatformTest() {
+ return new MediaOzonePlatformStub;
+}
spang 2014/06/09 20:53:57 Two more that are off by default: Gbm Caca
+
+MediaOzonePlatform::MediaOzonePlatform() {
+ CHECK(!instance_) << "There should only be a single MediaOzonePlatform.";
+ instance_ = this;
+}
+
+MediaOzonePlatform::~MediaOzonePlatform() {
+ CHECK_EQ(instance_, this);
+ instance_ = NULL;
+}
+
+// static
+MediaOzonePlatform* MediaOzonePlatform::GetInstance() {
+ if (!instance_)
+ CreateInstance();
+ return instance_;
+}
+
+VideoDecodeAccelerator* MediaOzonePlatform::CreateVideoDecodeAccelerator(
+ const base::Callback<bool(void)>& make_context_current) {
+ NOTIMPLEMENTED();
+ return NULL;
+}
+
+// static
+void MediaOzonePlatform::CreateInstance() {
+ if (!instance_) {
+ TRACE_EVENT1("ozone",
+ "MediaOzonePlatform::Initialize",
+ "platform",
+ ui::GetOzonePlatformName());
+ scoped_ptr<MediaOzonePlatform> platform =
+ ui::PlatformObject<MediaOzonePlatform>::Create();
+
+ // TODO(spang): Currently need to leak this object.
+ CHECK_EQ(instance_, platform.release());
+ }
+}
+
+// static
+MediaOzonePlatform* MediaOzonePlatform::instance_;
+
+} // namespace media
« content/common/gpu/media/DEPS ('K') | « media/ozone/media_ozone_platform.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698