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

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

Issue 308003004: Remove runtime CPU detection for SSE optimized media/ methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: One more salty fix. Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | media/base/simd/sinc_resampler_sse.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "build/build_config.h" 11 #include "build/build_config.h"
12 #include "media/base/sinc_resampler.h"
13 #include "media/base/vector_math.h"
14 #include "media/base/yuv_convert.h" 12 #include "media/base/yuv_convert.h"
15 13
16 namespace media { 14 namespace media {
17 15
18 namespace internal { 16 namespace internal {
19 // Platform specific initialization method. 17 // Platform specific initialization method.
20 extern bool InitializeMediaLibraryInternal(const base::FilePath& module_dir); 18 extern bool InitializeMediaLibraryInternal(const base::FilePath& module_dir);
21 } // namespace internal 19 } // namespace internal
22 20
23 // 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.
(...skipping 13 matching lines...) Expand all
37 return initialized_; 35 return initialized_;
38 } 36 }
39 37
40 private: 38 private:
41 friend struct base::DefaultLazyInstanceTraits<MediaInitializer>; 39 friend struct base::DefaultLazyInstanceTraits<MediaInitializer>;
42 40
43 MediaInitializer() 41 MediaInitializer()
44 : initialized_(false), 42 : initialized_(false),
45 tried_initialize_(false) { 43 tried_initialize_(false) {
46 // Perform initialization of libraries which require runtime CPU detection. 44 // Perform initialization of libraries which require runtime CPU detection.
47 // TODO(dalecurtis): Add initialization of YUV, SincResampler.
48 vector_math::Initialize();
49 SincResampler::InitializeCPUSpecificFeatures();
50 InitializeCPUSpecificYUVConversions(); 45 InitializeCPUSpecificYUVConversions();
51 } 46 }
52 47
53 ~MediaInitializer() { 48 ~MediaInitializer() {
54 NOTREACHED() << "MediaInitializer should be leaky!"; 49 NOTREACHED() << "MediaInitializer should be leaky!";
55 } 50 }
56 51
57 base::Lock lock_; 52 base::Lock lock_;
58 bool initialized_; 53 bool initialized_;
59 bool tried_initialize_; 54 bool tried_initialize_;
(...skipping 17 matching lines...) Expand all
77 bool IsMediaLibraryInitialized() { 72 bool IsMediaLibraryInitialized() {
78 return g_media_library.Get().IsInitialized(); 73 return g_media_library.Get().IsInitialized();
79 } 74 }
80 75
81 void InitializeCPUSpecificMediaFeatures() { 76 void InitializeCPUSpecificMediaFeatures() {
82 // Force initialization of the media initializer, but don't call Initialize(). 77 // Force initialization of the media initializer, but don't call Initialize().
83 g_media_library.Get(); 78 g_media_library.Get();
84 } 79 }
85 80
86 } // namespace media 81 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/base/simd/sinc_resampler_sse.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698