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

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

Issue 1254463002: media: Always enable trace event for "media" category group. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
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/files/file_path.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
11 #include "base/trace_event/trace_event.h"
11 #include "build/build_config.h" 12 #include "build/build_config.h"
12 #include "media/base/yuv_convert.h" 13 #include "media/base/yuv_convert.h"
13 14
14 #if !defined(MEDIA_DISABLE_FFMPEG) 15 #if !defined(MEDIA_DISABLE_FFMPEG)
15 #include "media/ffmpeg/ffmpeg_common.h" 16 #include "media/ffmpeg/ffmpeg_common.h"
16 #endif 17 #endif
17 18
18 namespace media { 19 namespace media {
19 20
20 // 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.
21 class MediaInitializer { 22 class MediaInitializer {
22 private: 23 private:
23 friend struct base::DefaultLazyInstanceTraits<MediaInitializer>; 24 friend struct base::DefaultLazyInstanceTraits<MediaInitializer>;
24 25
25 MediaInitializer() { 26 MediaInitializer() {
27 TRACE_EVENT_INIT_CATEGORY("media");
28
26 // Perform initialization of libraries which require runtime CPU detection. 29 // Perform initialization of libraries which require runtime CPU detection.
27 InitializeCPUSpecificYUVConversions(); 30 InitializeCPUSpecificYUVConversions();
28 31
29 #if !defined(MEDIA_DISABLE_FFMPEG) 32 #if !defined(MEDIA_DISABLE_FFMPEG)
30 // Initialize CPU flags outside of the sandbox as this may query /proc for 33 // Initialize CPU flags outside of the sandbox as this may query /proc for
31 // details on the current CPU for NEON, VFP, etc optimizations. 34 // details on the current CPU for NEON, VFP, etc optimizations.
32 av_get_cpu_flags(); 35 av_get_cpu_flags();
33 36
34 // Disable logging as it interferes with layout tests. 37 // Disable logging as it interferes with layout tests.
35 av_log_set_level(AV_LOG_QUIET); 38 av_log_set_level(AV_LOG_QUIET);
(...skipping 14 matching lines...) Expand all
50 }; 53 };
51 54
52 static base::LazyInstance<MediaInitializer>::Leaky g_media_library = 55 static base::LazyInstance<MediaInitializer>::Leaky g_media_library =
53 LAZY_INSTANCE_INITIALIZER; 56 LAZY_INSTANCE_INITIALIZER;
54 57
55 void InitializeMediaLibrary() { 58 void InitializeMediaLibrary() {
56 g_media_library.Get(); 59 g_media_library.Get();
57 } 60 }
58 61
59 } // namespace media 62 } // namespace media
OLDNEW
« base/trace_event/trace_event.h ('K') | « base/trace_event/trace_event.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698