diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-24 02:01:06 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-24 02:01:06 +0000 |
commit | 6502d03df070469ccc6f634f4c72d4ceda9a3bb3 (patch) | |
tree | f308ad1057b1ff5d2c6d4f6dfeb5495dd86ec29f /media/ffmpeg | |
parent | d4a5ab28e9b97e9b18875611305c3f5cc03f802c (diff) | |
download | chromium_src-6502d03df070469ccc6f634f4c72d4ceda9a3bb3.zip chromium_src-6502d03df070469ccc6f634f4c72d4ceda9a3bb3.tar.gz chromium_src-6502d03df070469ccc6f634f4c72d4ceda9a3bb3.tar.bz2 |
Revert 42415 - Removed custom FFmpegLock. Removed ffmpeg headers from third_party/ffmpeg/include.
Patch by sergeyu@chromium.org
BUG=23271
TEST=none
Review URL: http://codereview.chromium.org/1213002
TBR=scherkus@chromium.org
Review URL: http://codereview.chromium.org/1240002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42422 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/ffmpeg')
-rw-r--r-- | media/ffmpeg/ffmpeg_common.cc | 10 | ||||
-rw-r--r-- | media/ffmpeg/ffmpeg_common.h | 26 |
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 { |