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

Unified Diff: media/base/android/media_task_runner.cc

Issue 1341883003: Prepare MediaDrmBridge to work with MediaCodecPlayer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bug526755
Patch Set: Fixed MediaDrmBridgeTest unit tests Created 5 years, 3 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
« no previous file with comments | « media/base/android/media_task_runner.h ('k') | media/base/browser_cdm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/android/media_task_runner.cc
diff --git a/media/base/android/media_task_runner.cc b/media/base/android/media_task_runner.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a52919cde30b102b61aa6d00735bb11e0bfdc6b9
--- /dev/null
+++ b/media/base/android/media_task_runner.cc
@@ -0,0 +1,43 @@
+// Copyright 2015 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/base/android/media_task_runner.h"
+
+#include "base/command_line.h"
+#include "base/lazy_instance.h"
+#include "base/metrics/field_trial.h"
+#include "base/strings/string_util.h"
+#include "base/threading/thread.h"
+#include "media/base/media_switches.h"
+
+namespace media {
+
+class MediaThread : public base::Thread {
+ public:
+ MediaThread() : base::Thread("BrowserMediaThread") {
+ Start();
+ }
+};
+
+// Create media thread
+base::LazyInstance<MediaThread>::Leaky g_media_thread =
+ LAZY_INSTANCE_INITIALIZER;
+
+scoped_refptr<base::SingleThreadTaskRunner> GetMediaTaskRunner() {
+ return g_media_thread.Pointer()->task_runner();
+}
+
+bool UseMediaThreadForMediaPlayback() {
+ const std::string group_name =
+ base::FieldTrialList::FindFullName("EnableMediaThreadForMediaPlayback");
+
+ if (base::CommandLine::ForCurrentProcess()->
+ HasSwitch(switches::kEnableMediaThreadForMediaPlayback)) {
+ return true;
+ }
+
+ return base::StartsWith(group_name, "Enabled", base::CompareCase::SENSITIVE);
+}
+
+} // namespace media
« no previous file with comments | « media/base/android/media_task_runner.h ('k') | media/base/browser_cdm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698