| 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/command_line.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/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| 11 #include "base/trace_event/trace_event.h" | 11 #include "base/trace_event/trace_event.h" |
| 12 #include "media/base/media_switches.h" | 12 #include "media/base/media_switches.h" |
| 13 #include "media/base/vector_math.h" |
| 13 #include "media/base/yuv_convert.h" | 14 #include "media/base/yuv_convert.h" |
| 14 | 15 |
| 15 #if defined(OS_ANDROID) | 16 #if defined(OS_ANDROID) |
| 16 #include "base/android/build_info.h" | 17 #include "base/android/build_info.h" |
| 17 #include "media/base/android/media_codec_util.h" | 18 #include "media/base/android/media_codec_util.h" |
| 18 #endif | 19 #endif |
| 19 | 20 |
| 20 #if !defined(MEDIA_DISABLE_FFMPEG) | 21 #if !defined(MEDIA_DISABLE_FFMPEG) |
| 21 #include "media/ffmpeg/ffmpeg_common.h" | 22 #include "media/ffmpeg/ffmpeg_common.h" |
| 22 #endif | 23 #endif |
| (...skipping 11 matching lines...) Expand all Loading... |
| 34 | 35 |
| 35 private: | 36 private: |
| 36 friend struct base::DefaultLazyInstanceTraits<MediaInitializer>; | 37 friend struct base::DefaultLazyInstanceTraits<MediaInitializer>; |
| 37 | 38 |
| 38 MediaInitializer() { | 39 MediaInitializer() { |
| 39 TRACE_EVENT_WARMUP_CATEGORY("audio"); | 40 TRACE_EVENT_WARMUP_CATEGORY("audio"); |
| 40 TRACE_EVENT_WARMUP_CATEGORY("media"); | 41 TRACE_EVENT_WARMUP_CATEGORY("media"); |
| 41 | 42 |
| 42 // Perform initialization of libraries which require runtime CPU detection. | 43 // Perform initialization of libraries which require runtime CPU detection. |
| 43 InitializeCPUSpecificYUVConversions(); | 44 InitializeCPUSpecificYUVConversions(); |
| 45 vector_math::Initialize(); |
| 44 | 46 |
| 45 #if !defined(MEDIA_DISABLE_FFMPEG) | 47 #if !defined(MEDIA_DISABLE_FFMPEG) |
| 46 // Initialize CPU flags outside of the sandbox as this may query /proc for | 48 // Initialize CPU flags outside of the sandbox as this may query /proc for |
| 47 // details on the current CPU for NEON, VFP, etc optimizations. | 49 // details on the current CPU for NEON, VFP, etc optimizations. |
| 48 av_get_cpu_flags(); | 50 av_get_cpu_flags(); |
| 49 | 51 |
| 50 // Disable logging as it interferes with layout tests. | 52 // Disable logging as it interferes with layout tests. |
| 51 av_log_set_level(AV_LOG_QUIET); | 53 av_log_set_level(AV_LOG_QUIET); |
| 52 | 54 |
| 53 #if defined(ALLOCATOR_SHIM) | 55 #if defined(ALLOCATOR_SHIM) |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 } | 95 } |
| 94 | 96 |
| 95 bool ArePlatformDecodersAvailable() { | 97 bool ArePlatformDecodersAvailable() { |
| 96 return IsUnifiedMediaPipelineEnabled() | 98 return IsUnifiedMediaPipelineEnabled() |
| 97 ? HasPlatformDecoderSupport() | 99 ? HasPlatformDecoderSupport() |
| 98 : MediaCodecUtil::IsMediaCodecAvailable(); | 100 : MediaCodecUtil::IsMediaCodecAvailable(); |
| 99 } | 101 } |
| 100 #endif | 102 #endif |
| 101 | 103 |
| 102 } // namespace media | 104 } // namespace media |
| OLD | NEW |