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

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: Moved GetMEdiaTaskRunner() and UseMediaThread() to a separate file, renamed the latter 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
OLDNEW
(Empty)
1 #include "media/base/android/media_task_runner.h"
2
3 #include "base/command_line.h"
4 #include "base/lazy_instance.h"
5 #include "base/metrics/field_trial.h"
6 #include "base/strings/string_util.h"
7 #include "base/threading/thread.h"
8 #include "media/base/media_switches.h"
9
10 namespace media {
11
12 class MediaThread : public base::Thread {
13 public:
14 MediaThread() : base::Thread("BrowserMediaThread") {
15 Start();
16 }
17 };
18
19 // Create media thread
20 base::LazyInstance<MediaThread>::Leaky g_media_thread =
21 LAZY_INSTANCE_INITIALIZER;
22
23 scoped_refptr<base::SingleThreadTaskRunner> GetMediaTaskRunner() {
24 return g_media_thread.Pointer()->task_runner();
25 }
26
27 bool UseMediaThreadForMediaPlayback() {
28 const std::string group_name =
29 base::FieldTrialList::FindFullName("EnableMediaThreadForMediaPlayback");
30
31 if (base::CommandLine::ForCurrentProcess()->
32 HasSwitch(switches::kEnableMediaThreadForMediaPlayback)) {
33 return true;
34 }
35
36 return base::StartsWith(group_name, "Enabled", base::CompareCase::SENSITIVE);
37 }
38
39 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698