summaryrefslogtreecommitdiffstats
path: root/media/ffmpeg
diff options
context:
space:
mode:
authorjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-12 03:42:09 +0000
committerjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-12 03:42:09 +0000
commit5e3e47065c478279a2a3a56c9063405c2e812927 (patch)
treec4693e4edc51df3df331fe0d1fe5b17ab5198ed0 /media/ffmpeg
parent58dd56d1be3b5b4dcba851aebd59b8d3645685e8 (diff)
downloadchromium_src-5e3e47065c478279a2a3a56c9063405c2e812927.zip
chromium_src-5e3e47065c478279a2a3a56c9063405c2e812927.tar.gz
chromium_src-5e3e47065c478279a2a3a56c9063405c2e812927.tar.bz2
Revert 41386 - Removed custom FFmpegLock. Removed ffmpeg headers from third_party/ffmpeg/include.
Bot unhappy Automatic: "media_unittests" on "Vista Tests" from 41386: ... scherkus@chromium.org ... http://chrome-buildbot:8010/builders/Vista%20Tests/builds/17009/steps/media_unittests/logs/stdio Patch by sergeyu@chromium.org BUG=23271 TEST=none Review URL: http://codereview.chromium.org/909002 TBR=scherkus@chromium.org Review URL: http://codereview.chromium.org/854006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41389 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/ffmpeg')
-rw-r--r--media/ffmpeg/ffmpeg_common.cc10
-rw-r--r--media/ffmpeg/ffmpeg_common.h26
2 files changed, 33 insertions, 3 deletions
diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc
index 08228fd..5100b31 100644
--- a/media/ffmpeg/ffmpeg_common.cc
+++ b/media/ffmpeg/ffmpeg_common.cc
@@ -6,6 +6,16 @@
namespace media {
+FFmpegLock::FFmpegLock() {
+}
+
+FFmpegLock::~FFmpegLock() {
+}
+
+Lock& FFmpegLock::lock() {
+ return lock_;
+}
+
namespace mime_type {
const char kFFmpegAudio[] = "audio/x-ffmpeg";
diff --git a/media/ffmpeg/ffmpeg_common.h b/media/ffmpeg/ffmpeg_common.h
index 4b60046..9be245f 100644
--- a/media/ffmpeg/ffmpeg_common.h
+++ b/media/ffmpeg/ffmpeg_common.h
@@ -19,14 +19,34 @@ extern "C" {
// Temporarily disable possible loss of data warning.
// TODO(scherkus): fix and upstream the compiler warnings.
MSVC_PUSH_DISABLE_WARNING(4244);
-#include "third_party/ffmpeg/source/patched-ffmpeg-mt/libavcodec/avcodec.h"
-#include "third_party/ffmpeg/source/patched-ffmpeg-mt/libavformat/avformat.h"
-#include "third_party/ffmpeg/source/patched-ffmpeg-mt/libavutil/log.h"
+#include "third_party/ffmpeg/include/libavcodec/avcodec.h"
+#include "third_party/ffmpeg/include/libavformat/avformat.h"
+#include "third_party/ffmpeg/include/libavutil/log.h"
MSVC_POP_WARNING();
} // extern "C"
namespace media {
+// FFmpegLock is used to serialize calls to avcodec_open(), avcodec_close(),
+// and av_find_stream_info() for an entire process because for whatever reason
+// it does Very Bad Things to other FFmpeg instances.
+//
+// TODO(scherkus): track down and upstream a fix to FFmpeg, if possible.
+class FFmpegLock : public Singleton<FFmpegLock> {
+ public:
+ Lock& lock();
+
+ private:
+ // Only allow Singleton to create and delete FFmpegLock.
+ friend struct DefaultSingletonTraits<FFmpegLock>;
+ FFmpegLock();
+ virtual ~FFmpegLock();
+
+ Lock lock_;
+ DISALLOW_COPY_AND_ASSIGN(FFmpegLock);
+};
+
+
// Wraps FFmpeg's av_free() in a class that can be passed as a template argument
// to scoped_ptr_malloc.
class ScopedPtrAVFree {