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

Side by Side Diff: media/base/android/media_task_runner.cc

Issue 2276343005: Delete MediaCodecPlayer, it's time! (Closed)
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « media/base/android/media_task_runner.h ('k') | media/base/android/video_media_codec_decoder.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 // Command line switches take precedence over filed trial groups.
36 // The disable switch takes precedence over enable switch.
37 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
38 switches::kDisableMediaThreadForMediaPlayback)) {
39 return false;
40 }
41
42 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
43 switches::kEnableMediaThreadForMediaPlayback)) {
44 return true;
45 }
46
47 DVLOG(1) << __FUNCTION__ << ": group_name:'" << group_name << "'";
48
49 return base::StartsWith(group_name, "Enabled", base::CompareCase::SENSITIVE);
50 }
51
52 } // namespace media
OLDNEW
« no previous file with comments | « media/base/android/media_task_runner.h ('k') | media/base/android/video_media_codec_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698