diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-12 00:03:46 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-12 00:03:46 +0000 |
commit | 67922822899b341d9788c59ceb32d8e12ea2c5e8 (patch) | |
tree | 259faf47fea0eccc547c6c4394c5632725d3e9e4 /media | |
parent | 7b6afd0c466f6a8e87178008c65afc00fd84440e (diff) | |
download | chromium_src-67922822899b341d9788c59ceb32d8e12ea2c5e8.zip chromium_src-67922822899b341d9788c59ceb32d8e12ea2c5e8.tar.gz chromium_src-67922822899b341d9788c59ceb32d8e12ea2c5e8.tar.bz2 |
Fold media/ffmpeg/ffmpeg_util.{cc,h} into media/ffmpeg/ffmpeg_common.{cc,h}
BUG=none
TEST=compiles
Review URL: http://codereview.chromium.org/6686011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77896 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/ffmpeg/ffmpeg_common.cc | 7 | ||||
-rw-r--r-- | media/ffmpeg/ffmpeg_common.h | 3 | ||||
-rw-r--r-- | media/ffmpeg/ffmpeg_unittest.cc | 5 | ||||
-rw-r--r-- | media/ffmpeg/ffmpeg_util.cc | 18 | ||||
-rw-r--r-- | media/ffmpeg/ffmpeg_util.h | 18 | ||||
-rw-r--r-- | media/filters/audio_file_reader.cc | 3 | ||||
-rw-r--r-- | media/filters/ffmpeg_demuxer.cc | 1 | ||||
-rw-r--r-- | media/filters/ffmpeg_video_decoder.cc | 1 | ||||
-rw-r--r-- | media/media.gyp | 2 | ||||
-rw-r--r-- | media/video/ffmpeg_video_allocator.h | 3 | ||||
-rw-r--r-- | media/video/ffmpeg_video_decode_engine.cc | 1 |
11 files changed, 13 insertions, 49 deletions
diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc index dce96a5..fd82936 100644 --- a/media/ffmpeg/ffmpeg_common.cc +++ b/media/ffmpeg/ffmpeg_common.cc @@ -8,7 +8,12 @@ namespace media { -// TODO(scherkus): combine ffmpeg_common.h with ffmpeg_util.h +static const AVRational kMicrosBase = { 1, base::Time::kMicrosecondsPerSecond }; + +base::TimeDelta ConvertTimestamp(const AVRational& time_base, int64 timestamp) { + int64 microseconds = av_rescale_q(timestamp, time_base, kMicrosBase); + return base::TimeDelta::FromMicroseconds(microseconds); +} VideoCodec CodecIDToVideoCodec(CodecID codec_id) { switch (codec_id) { diff --git a/media/ffmpeg/ffmpeg_common.h b/media/ffmpeg/ffmpeg_common.h index 3b0d0ee..b0fa1eb 100644 --- a/media/ffmpeg/ffmpeg_common.h +++ b/media/ffmpeg/ffmpeg_common.h @@ -10,6 +10,7 @@ #include "base/compiler_specific.h" #include "base/singleton.h" +#include "base/time.h" #include "media/video/video_decode_engine.h" // Include FFmpeg header files. @@ -49,6 +50,8 @@ class ScopedPtrAVFreePacket { } }; +base::TimeDelta ConvertTimestamp(const AVRational& time_base, int64 timestamp); + VideoCodec CodecIDToVideoCodec(CodecID codec_id); CodecID VideoCodecToCodecID(VideoCodec video_codec); diff --git a/media/ffmpeg/ffmpeg_unittest.cc b/media/ffmpeg/ffmpeg_unittest.cc index d6eebe2..140ea48 100644 --- a/media/ffmpeg/ffmpeg_unittest.cc +++ b/media/ffmpeg/ffmpeg_unittest.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. @@ -37,7 +37,6 @@ #include "base/test/perf_test_suite.h" #include "media/base/media.h" #include "media/ffmpeg/ffmpeg_common.h" -#include "media/ffmpeg/ffmpeg_util.h" #include "media/ffmpeg/file_protocol.h" #include "testing/gtest/include/gtest/gtest.h" @@ -270,7 +269,7 @@ class FFmpegTest : public testing::TestWithParam<const char*> { } if (result > 0) { - // TODO(scherkus): move this to ffmpeg_util.h and dedup. + // TODO(scherkus): move this to ffmpeg_common.h and dedup. int64 denominator = av_audio_context()->channels * av_get_bits_per_sample_fmt(av_audio_context()->sample_fmt) / 8 * av_audio_context()->sample_rate; diff --git a/media/ffmpeg/ffmpeg_util.cc b/media/ffmpeg/ffmpeg_util.cc deleted file mode 100644 index aa9f7a27..0000000 --- a/media/ffmpeg/ffmpeg_util.cc +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) 2010 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. - -#include "media/ffmpeg/ffmpeg_util.h" - -#include "media/ffmpeg/ffmpeg_common.h" - -namespace media { - -static const AVRational kMicrosBase = { 1, base::Time::kMicrosecondsPerSecond }; - -base::TimeDelta ConvertTimestamp(const AVRational& time_base, int64 timestamp) { - int64 microseconds = av_rescale_q(timestamp, time_base, kMicrosBase); - return base::TimeDelta::FromMicroseconds(microseconds); -} - -} // namespace media diff --git a/media/ffmpeg/ffmpeg_util.h b/media/ffmpeg/ffmpeg_util.h deleted file mode 100644 index 6799cc4..0000000 --- a/media/ffmpeg/ffmpeg_util.h +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) 2009 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. - -#ifndef MEDIA_FFMPEG_FFMPEG_UTIL_H_ -#define MEDIA_FFMPEG_FFMPEG_UTIL_H_ - -#include "base/time.h" - -struct AVRational; - -namespace media { - -base::TimeDelta ConvertTimestamp(const AVRational& time_base, int64 timestamp); - -} // namespace media - -#endif // MEDIA_FFMPEG_FFMPEG_UTIL_H_ diff --git a/media/filters/audio_file_reader.cc b/media/filters/audio_file_reader.cc index ceeb3a1..5e01d27 100644 --- a/media/filters/audio_file_reader.cc +++ b/media/filters/audio_file_reader.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. @@ -11,7 +11,6 @@ #include "media/audio/audio_util.h" #include "media/base/filters.h" #include "media/ffmpeg/ffmpeg_common.h" -#include "media/ffmpeg/ffmpeg_util.h" #include "media/filters/ffmpeg_glue.h" namespace media { diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc index cd1a132..fe9f6ea 100644 --- a/media/filters/ffmpeg_demuxer.cc +++ b/media/filters/ffmpeg_demuxer.cc @@ -13,7 +13,6 @@ #include "media/base/limits.h" #include "media/base/media_switches.h" #include "media/ffmpeg/ffmpeg_common.h" -#include "media/ffmpeg/ffmpeg_util.h" #include "media/filters/bitstream_converter.h" #include "media/filters/ffmpeg_demuxer.h" #include "media/filters/ffmpeg_glue.h" diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc index 313d55c..cbad2e8 100644 --- a/media/filters/ffmpeg_video_decoder.cc +++ b/media/filters/ffmpeg_video_decoder.cc @@ -14,7 +14,6 @@ #include "media/base/media_format.h" #include "media/base/video_frame.h" #include "media/ffmpeg/ffmpeg_common.h" -#include "media/ffmpeg/ffmpeg_util.h" #include "media/filters/ffmpeg_interfaces.h" #include "media/video/ffmpeg_video_decode_engine.h" #include "media/video/video_decode_context.h" diff --git a/media/media.gyp b/media/media.gyp index 48d9e4d..ebccbf2 100644 --- a/media/media.gyp +++ b/media/media.gyp @@ -115,8 +115,6 @@ 'base/video_frame.h', 'ffmpeg/ffmpeg_common.cc', 'ffmpeg/ffmpeg_common.h', - 'ffmpeg/ffmpeg_util.cc', - 'ffmpeg/ffmpeg_util.h', 'ffmpeg/file_protocol.cc', 'ffmpeg/file_protocol.h', 'filters/audio_file_reader.cc', diff --git a/media/video/ffmpeg_video_allocator.h b/media/video/ffmpeg_video_allocator.h index c1e371a..5602256 100644 --- a/media/video/ffmpeg_video_allocator.h +++ b/media/video/ffmpeg_video_allocator.h @@ -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. @@ -9,7 +9,6 @@ #include "base/scoped_ptr.h" #include "media/base/video_frame.h" #include "media/ffmpeg/ffmpeg_common.h" -#include "media/ffmpeg/ffmpeg_util.h" #include <deque> #include <map> diff --git a/media/video/ffmpeg_video_decode_engine.cc b/media/video/ffmpeg_video_decode_engine.cc index 20fc480..18397e5 100644 --- a/media/video/ffmpeg_video_decode_engine.cc +++ b/media/video/ffmpeg_video_decode_engine.cc @@ -13,7 +13,6 @@ #include "media/base/media_switches.h" #include "media/base/pipeline.h" #include "media/ffmpeg/ffmpeg_common.h" -#include "media/ffmpeg/ffmpeg_util.h" #include "media/filters/ffmpeg_demuxer.h" #include "media/video/ffmpeg_video_allocator.h" |