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

Side by Side 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, 2 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 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/base/android/media_task_runner.h"
6
7 #include "base/command_line.h"
8 #include "base/lazy_instance.h"
9 #include "base/metrics/field_trial.h"
10 #include "base/strings/string_util.h"
11 #include "base/threading/thread.h"
12 #include "media/base/media_switches.h"
13
14 namespace media {
15
16 class MediaThread : public base::Thread {
17 public:
18 MediaThread() : base::Thread("BrowserMediaThread") {
19 Start();
20 }
21 };
22
23 // Create media thread
24 base::LazyInstance<MediaThread>::Leaky g_media_thread =
25 LAZY_INSTANCE_INITIALIZER;
26
27 scoped_refptr<base::SingleThreadTaskRunner> GetMediaTaskRunner() {
28 return g_media_thread.Pointer()->task_runner();
29 }
30
31 bool UseMediaThreadForMediaPlayback() {
32 const std::string group_name =
33 base::FieldTrialList::FindFullName("EnableMediaThreadForMediaPlayback");
34
35 if (base::CommandLine::ForCurrentProcess()->
36 HasSwitch(switches::kEnableMediaThreadForMediaPlayback)) {
37 return true;
38 }
39
40 return base::StartsWith(group_name, "Enabled", base::CompareCase::SENSITIVE);
41 }
42
43 } // namespace media
OLDNEW
« 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