Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "media/ozone/ozone_platform.h" | |
| 6 | |
| 7 #include "base/debug/trace_event.h" | |
| 8 #include "base/logging.h" | |
| 9 #include "ui/ozone/platform_object.h" | |
| 10 #include "ui/ozone/platform_selection.h" | |
| 11 | |
| 12 namespace media { | |
| 13 | |
| 14 // the following are just convenient stubs and need to be removed once the | |
| 15 // internal platforms decide to actually implement their media specifics | |
| 16 OzonePlatformMedia* CreateOzonePlatformMediaDri() { return NULL; } | |
|
spang
2014/06/09 19:17:32
You are dereferencing this NULL elsewhere.
For no
vignatti (out of this project)
2014/06/09 20:30:27
Done.
| |
| 17 OzonePlatformMedia* CreateOzonePlatformMediaEgltest() { return NULL; } | |
| 18 OzonePlatformMedia* CreateOzonePlatformMediaTest() { return NULL; } | |
| 19 | |
| 20 OzonePlatformMedia::OzonePlatformMedia() { | |
| 21 CHECK(!instance_) << "There should only be a single OzonePlatformMedia."; | |
| 22 instance_ = this; | |
| 23 } | |
| 24 | |
| 25 OzonePlatformMedia::~OzonePlatformMedia() { | |
| 26 CHECK_EQ(instance_, this); | |
| 27 instance_ = NULL; | |
| 28 } | |
| 29 | |
| 30 // static | |
| 31 OzonePlatformMedia* OzonePlatformMedia::GetInstance() { | |
| 32 if (!instance_) | |
| 33 CreateInstance(); | |
| 34 return instance_; | |
| 35 } | |
| 36 | |
| 37 VideoDecodeAccelerator* OzonePlatformMedia::CreateVideoDecodeFactoryOzone( | |
| 38 const base::Callback<bool(void)>& make_context_current) { | |
| 39 NOTIMPLEMENTED(); | |
| 40 return NULL; | |
| 41 } | |
| 42 | |
| 43 // static | |
| 44 void OzonePlatformMedia::CreateInstance() { | |
| 45 if (!instance_) { | |
| 46 TRACE_EVENT1("ozone", | |
| 47 "OzonePlatformMedia::Initialize", | |
| 48 "platform", | |
| 49 ui::GetOzonePlatformName()); | |
| 50 scoped_ptr<OzonePlatformMedia> platform = | |
| 51 ui::PlatformObject<OzonePlatformMedia>::Create(); | |
| 52 | |
| 53 // TODO(spang): Currently need to leak this object. | |
| 54 CHECK_EQ(instance_, platform.release()); | |
| 55 } | |
| 56 } | |
| 57 | |
| 58 // static | |
| 59 OzonePlatformMedia* OzonePlatformMedia::instance_; | |
| 60 | |
| 61 } // namespace media | |
| OLD | NEW |