summaryrefslogtreecommitdiffstats
path: root/media/ffmpeg
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-12 00:03:46 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-12 00:03:46 +0000
commit67922822899b341d9788c59ceb32d8e12ea2c5e8 (patch)
tree259faf47fea0eccc547c6c4394c5632725d3e9e4 /media/ffmpeg
parent7b6afd0c466f6a8e87178008c65afc00fd84440e (diff)
downloadchromium_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/ffmpeg')
-rw-r--r--media/ffmpeg/ffmpeg_common.cc7
-rw-r--r--media/ffmpeg/ffmpeg_common.h3
-rw-r--r--media/ffmpeg/ffmpeg_unittest.cc5
-rw-r--r--media/ffmpeg/ffmpeg_util.cc18
-rw-r--r--media/ffmpeg/ffmpeg_util.h18
5 files changed, 11 insertions, 40 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_