diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-07 15:26:05 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-07 15:26:05 +0000 |
commit | 2770c95a50db703c322d65d286aa5771e58ac25a (patch) | |
tree | 595b2adf92be75f65eccbbb0760e3969d2d840c3 /media/base | |
parent | eac3ba4f0f315bb2c68289062cb9f4f5ec632f90 (diff) | |
download | chromium_src-2770c95a50db703c322d65d286aa5771e58ac25a.zip chromium_src-2770c95a50db703c322d65d286aa5771e58ac25a.tar.gz chromium_src-2770c95a50db703c322d65d286aa5771e58ac25a.tar.bz2 |
Cleaning up src/media to be consistent with static versus anonymous namespaces.
We were using a mix of both (and sometimes even static functions *inside* anonymous namespaces!) so we decided to stick to using static.
Also moved static/test code into media namespace and removed media:: prefixes.
BUG=none
TEST=compiles
Review URL: http://codereview.chromium.org/6628020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77135 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base')
-rw-r--r-- | media/base/media_posix.cc | 16 | ||||
-rw-r--r-- | media/base/media_win.cc | 14 | ||||
-rw-r--r-- | media/base/pipeline_impl_unittest.cc | 10 |
3 files changed, 15 insertions, 25 deletions
diff --git a/media/base/media_posix.cc b/media/base/media_posix.cc index 438155a..08684e7 100644 --- a/media/base/media_posix.cc +++ b/media/base/media_posix.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -24,8 +24,6 @@ namespace tp_ffmpeg = third_party_ffmpeg; namespace media { -namespace { - // Handy to prevent shooting ourselves in the foot with macro wizardry. #if !defined(LIBAVCODEC_VERSION_MAJOR) || \ !defined(LIBAVFORMAT_VERSION_MAJOR) || \ @@ -39,18 +37,20 @@ namespace { #if defined(OS_MACOSX) #define DSO_NAME(MODULE, VERSION) ("lib" MODULE "." VERSION ".dylib") -const FilePath::CharType sumo_name[] = +static const FilePath::CharType sumo_name[] = FILE_PATH_LITERAL("libffmpegsumo.dylib"); #elif defined(OS_POSIX) #define DSO_NAME(MODULE, VERSION) ("lib" MODULE ".so." VERSION) -const FilePath::CharType sumo_name[] = FILE_PATH_LITERAL("libffmpegsumo.so"); +static const FilePath::CharType sumo_name[] = + FILE_PATH_LITERAL("libffmpegsumo.so"); #else #error "Do not know how to construct DSO name for this OS." #endif -const FilePath::CharType openmax_name[] = FILE_PATH_LITERAL("libOmxCore.so"); +static const FilePath::CharType openmax_name[] = + FILE_PATH_LITERAL("libOmxCore.so"); // Retrieves the DSOName for the given key. -std::string GetDSOName(tp_ffmpeg::StubModules stub_key) { +static std::string GetDSOName(tp_ffmpeg::StubModules stub_key) { // TODO(ajwong): Remove this once mac is migrated. Either that, or have GYP // set a constant that we can switch implementations based off of. switch (stub_key) { @@ -66,8 +66,6 @@ std::string GetDSOName(tp_ffmpeg::StubModules stub_key) { } } -} // namespace - // Attempts to initialize the media library (loading DSOs, etc.). // Returns true if everything was successfully initialized, false otherwise. bool InitializeMediaLibrary(const FilePath& module_dir) { diff --git a/media/base/media_win.cc b/media/base/media_win.cc index 87a9aa3..82f8596 100644 --- a/media/base/media_win.cc +++ b/media/base/media_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -22,16 +22,14 @@ namespace media { -namespace { - enum FFmpegDLLKeys { - FILE_LIBAVCODEC, // full path to libavcodec media decoding library. - FILE_LIBAVFORMAT, // full path to libavformat media parsing library. - FILE_LIBAVUTIL, // full path to libavutil media utility library. + FILE_LIBAVCODEC, // full path to libavcodec media decoding library. + FILE_LIBAVFORMAT, // full path to libavformat media parsing library. + FILE_LIBAVUTIL, // full path to libavutil media utility library. }; // Retrieves the DLLName for the given key. -FilePath::CharType* GetDLLName(FFmpegDLLKeys dll_key) { +static FilePath::CharType* GetDLLName(FFmpegDLLKeys dll_key) { // TODO(ajwong): Do we want to lock to a specific ffmpeg version? switch (dll_key) { case FILE_LIBAVCODEC: @@ -46,8 +44,6 @@ FilePath::CharType* GetDLLName(FFmpegDLLKeys dll_key) { } } -} // namespace - // Attempts to initialize the media library (loading DLLs, DSOs, etc.). // Returns true if everything was successfully initialized, false otherwise. bool InitializeMediaLibrary(const FilePath& base_path) { diff --git a/media/base/pipeline_impl_unittest.cc b/media/base/pipeline_impl_unittest.cc index cc6de37..0762cb35 100644 --- a/media/base/pipeline_impl_unittest.cc +++ b/media/base/pipeline_impl_unittest.cc @@ -24,17 +24,13 @@ using ::testing::Return; using ::testing::ReturnRef; using ::testing::StrictMock; -namespace { +namespace media { // Total bytes of the data source. -const int kTotalBytes = 1024; +static const int kTotalBytes = 1024; // Buffered bytes of the data source. -const int kBufferedBytes = 1024; - -} // namespace - -namespace media { +static const int kBufferedBytes = 1024; // Used for setting expectations on pipeline callbacks. Using a StrictMock // also lets us test for missing callbacks. |