OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/base/media.h" | 5 #include "media/base/media.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/command_line.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/path_service.h" | 10 #include "base/metrics/field_trial.h" |
11 #include "base/synchronization/lock.h" | |
12 #include "base/trace_event/trace_event.h" | 11 #include "base/trace_event/trace_event.h" |
13 #include "build/build_config.h" | 12 #include "media/base/media_switches.h" |
14 #include "media/base/yuv_convert.h" | 13 #include "media/base/yuv_convert.h" |
15 | 14 |
16 #if !defined(MEDIA_DISABLE_FFMPEG) | 15 #if !defined(MEDIA_DISABLE_FFMPEG) |
17 #include "media/ffmpeg/ffmpeg_common.h" | 16 #include "media/ffmpeg/ffmpeg_common.h" |
18 #endif | 17 #endif |
19 | 18 |
20 namespace media { | 19 namespace media { |
21 | 20 |
22 // Media must only be initialized once, so use a LazyInstance to ensure this. | 21 // Media must only be initialized once, so use a LazyInstance to ensure this. |
23 class MediaInitializer { | 22 class MediaInitializer { |
(...skipping 30 matching lines...) Expand all Loading... | |
54 DISALLOW_COPY_AND_ASSIGN(MediaInitializer); | 53 DISALLOW_COPY_AND_ASSIGN(MediaInitializer); |
55 }; | 54 }; |
56 | 55 |
57 static base::LazyInstance<MediaInitializer>::Leaky g_media_library = | 56 static base::LazyInstance<MediaInitializer>::Leaky g_media_library = |
58 LAZY_INSTANCE_INITIALIZER; | 57 LAZY_INSTANCE_INITIALIZER; |
59 | 58 |
60 void InitializeMediaLibrary() { | 59 void InitializeMediaLibrary() { |
61 g_media_library.Get(); | 60 g_media_library.Get(); |
62 } | 61 } |
63 | 62 |
63 #if defined(OS_ANDROID) | |
64 bool IsUnifiedMediaPipelineEnabled() { | |
ddorwin
2016/02/12 18:45:12
This logic needs to account for the blacklist (see
DaleCurtis
2016/02/13 02:01:42
Thanks. You're correct, cleaned this up per our of
| |
65 // TODO(dalecurtis): This experiment is temporary and should be removed once | |
66 // we have enough data to support the primacy of the unified media pipeline; | |
67 // see http://crbug.com/533190 for details. | |
68 // | |
69 // Note: It's important to query the field trial state first, to ensure that | |
70 // UMA reports the correct group. | |
71 const std::string group_name = | |
72 base::FieldTrialList::FindFullName("UnifiedMediaPipelineTrial"); | |
73 const bool enabled_via_cli = | |
74 base::CommandLine::ForCurrentProcess()->HasSwitch( | |
75 switches::kEnableUnifiedMediaPipeline); | |
76 return enabled_via_cli || | |
77 base::StartsWith(group_name, "Enabled", base::CompareCase::SENSITIVE); | |
78 } | |
79 #endif | |
80 | |
64 } // namespace media | 81 } // namespace media |
OLD | NEW |