gecko-dev/dom/media/fmp4/ffmpeg/FFmpegDataDecoder.cpp

177 lines
4.5 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <string.h>
#include <unistd.h>
#include "MediaTaskQueue.h"
#include "mp4_demuxer/mp4_demuxer.h"
Bug 1015829 - Runtime binding for libav 53, 54, 55; r=edwin --HG-- rename : content/media/fmp4/ffmpeg/include/README_mozilla => content/media/fmp4/ffmpeg/README_mozilla rename : content/media/fmp4/ffmpeg/include/COPYING.LGPLv2.1 => content/media/fmp4/ffmpeg/libav53/include/COPYING.LGPLv2.1 rename : content/media/fmp4/ffmpeg/include/libavcodec/avcodec.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/avcodec.h rename : content/media/fmp4/ffmpeg/include/libavcodec/avfft.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/avfft.h rename : content/media/fmp4/ffmpeg/include/libavcodec/dxva2.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/dxva2.h rename : content/media/fmp4/ffmpeg/include/libavcodec/old_codec_ids.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/old_codec_ids.h rename : content/media/fmp4/ffmpeg/include/libavcodec/opt.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/opt.h rename : content/media/fmp4/ffmpeg/include/libavcodec/vaapi.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/vaapi.h rename : content/media/fmp4/ffmpeg/include/libavcodec/vda.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/vda.h rename : content/media/fmp4/ffmpeg/include/libavcodec/vdpau.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/vdpau.h rename : content/media/fmp4/ffmpeg/include/libavcodec/version.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/version.h rename : content/media/fmp4/ffmpeg/include/libavcodec/xvmc.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/xvmc.h rename : content/media/fmp4/ffmpeg/include/libavformat/avformat.h => content/media/fmp4/ffmpeg/libav53/include/libavformat/avformat.h rename : content/media/fmp4/ffmpeg/include/libavformat/avio.h => content/media/fmp4/ffmpeg/libav53/include/libavformat/avio.h rename : content/media/fmp4/ffmpeg/include/libavformat/version.h => content/media/fmp4/ffmpeg/libav53/include/libavformat/version.h rename : content/media/fmp4/ffmpeg/include/libavutil/adler32.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/adler32.h rename : content/media/fmp4/ffmpeg/include/libavutil/aes.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/aes.h rename : content/media/fmp4/ffmpeg/include/libavutil/attributes.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/attributes.h rename : content/media/fmp4/ffmpeg/include/libavutil/audio_fifo.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/audio_fifo.h rename : content/media/fmp4/ffmpeg/include/libavutil/audioconvert.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/audioconvert.h rename : content/media/fmp4/ffmpeg/include/libavutil/avassert.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/avassert.h rename : content/media/fmp4/ffmpeg/include/libavutil/avconfig.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/avconfig.h rename : content/media/fmp4/ffmpeg/include/libavutil/avstring.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/avstring.h rename : content/media/fmp4/ffmpeg/include/libavutil/avutil.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/avutil.h rename : content/media/fmp4/ffmpeg/include/libavutil/base64.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/base64.h rename : content/media/fmp4/ffmpeg/include/libavutil/blowfish.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/blowfish.h rename : content/media/fmp4/ffmpeg/include/libavutil/bprint.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/bprint.h rename : content/media/fmp4/ffmpeg/include/libavutil/bswap.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/bswap.h rename : content/media/fmp4/ffmpeg/include/libavutil/common.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/common.h rename : content/media/fmp4/ffmpeg/include/libavutil/cpu.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/cpu.h rename : content/media/fmp4/ffmpeg/include/libavutil/crc.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/crc.h rename : content/media/fmp4/ffmpeg/include/libavutil/dict.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/dict.h rename : content/media/fmp4/ffmpeg/include/libavutil/error.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/error.h rename : content/media/fmp4/ffmpeg/include/libavutil/eval.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/eval.h rename : content/media/fmp4/ffmpeg/include/libavutil/fifo.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/fifo.h rename : content/media/fmp4/ffmpeg/include/libavutil/file.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/file.h rename : content/media/fmp4/ffmpeg/include/libavutil/imgutils.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/imgutils.h rename : content/media/fmp4/ffmpeg/include/libavutil/intfloat.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/intfloat.h rename : content/media/fmp4/ffmpeg/include/libavutil/intfloat_readwrite.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/intfloat_readwrite.h rename : content/media/fmp4/ffmpeg/include/libavutil/intreadwrite.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/intreadwrite.h rename : content/media/fmp4/ffmpeg/include/libavutil/lfg.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/lfg.h rename : content/media/fmp4/ffmpeg/include/libavutil/log.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/log.h rename : content/media/fmp4/ffmpeg/include/libavutil/lzo.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/lzo.h rename : content/media/fmp4/ffmpeg/include/libavutil/mathematics.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/mathematics.h rename : content/media/fmp4/ffmpeg/include/libavutil/md5.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/md5.h rename : content/media/fmp4/ffmpeg/include/libavutil/mem.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/mem.h rename : content/media/fmp4/ffmpeg/include/libavutil/old_pix_fmts.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/old_pix_fmts.h rename : content/media/fmp4/ffmpeg/include/libavutil/opt.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/opt.h rename : content/media/fmp4/ffmpeg/include/libavutil/parseutils.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/parseutils.h rename : content/media/fmp4/ffmpeg/include/libavutil/pixdesc.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/pixdesc.h rename : content/media/fmp4/ffmpeg/include/libavutil/pixfmt.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/pixfmt.h rename : content/media/fmp4/ffmpeg/include/libavutil/random_seed.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/random_seed.h rename : content/media/fmp4/ffmpeg/include/libavutil/rational.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/rational.h rename : content/media/fmp4/ffmpeg/include/libavutil/samplefmt.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/samplefmt.h rename : content/media/fmp4/ffmpeg/include/libavutil/sha.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/sha.h rename : content/media/fmp4/ffmpeg/include/libavutil/time.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/time.h rename : content/media/fmp4/ffmpeg/include/libavutil/timecode.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/timecode.h rename : content/media/fmp4/ffmpeg/include/libavutil/timestamp.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/timestamp.h rename : content/media/fmp4/ffmpeg/include/libavutil/version.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/version.h rename : content/media/fmp4/ffmpeg/include/libavutil/xtea.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/xtea.h
2014-07-03 02:43:13 +00:00
#include "FFmpegLibs.h"
#include "FFmpegLog.h"
#include "FFmpegDataDecoder.h"
#include "prsystem.h"
namespace mozilla
{
Bug 1015829 - Runtime binding for libav 53, 54, 55; r=edwin --HG-- rename : content/media/fmp4/ffmpeg/include/README_mozilla => content/media/fmp4/ffmpeg/README_mozilla rename : content/media/fmp4/ffmpeg/include/COPYING.LGPLv2.1 => content/media/fmp4/ffmpeg/libav53/include/COPYING.LGPLv2.1 rename : content/media/fmp4/ffmpeg/include/libavcodec/avcodec.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/avcodec.h rename : content/media/fmp4/ffmpeg/include/libavcodec/avfft.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/avfft.h rename : content/media/fmp4/ffmpeg/include/libavcodec/dxva2.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/dxva2.h rename : content/media/fmp4/ffmpeg/include/libavcodec/old_codec_ids.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/old_codec_ids.h rename : content/media/fmp4/ffmpeg/include/libavcodec/opt.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/opt.h rename : content/media/fmp4/ffmpeg/include/libavcodec/vaapi.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/vaapi.h rename : content/media/fmp4/ffmpeg/include/libavcodec/vda.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/vda.h rename : content/media/fmp4/ffmpeg/include/libavcodec/vdpau.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/vdpau.h rename : content/media/fmp4/ffmpeg/include/libavcodec/version.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/version.h rename : content/media/fmp4/ffmpeg/include/libavcodec/xvmc.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/xvmc.h rename : content/media/fmp4/ffmpeg/include/libavformat/avformat.h => content/media/fmp4/ffmpeg/libav53/include/libavformat/avformat.h rename : content/media/fmp4/ffmpeg/include/libavformat/avio.h => content/media/fmp4/ffmpeg/libav53/include/libavformat/avio.h rename : content/media/fmp4/ffmpeg/include/libavformat/version.h => content/media/fmp4/ffmpeg/libav53/include/libavformat/version.h rename : content/media/fmp4/ffmpeg/include/libavutil/adler32.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/adler32.h rename : content/media/fmp4/ffmpeg/include/libavutil/aes.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/aes.h rename : content/media/fmp4/ffmpeg/include/libavutil/attributes.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/attributes.h rename : content/media/fmp4/ffmpeg/include/libavutil/audio_fifo.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/audio_fifo.h rename : content/media/fmp4/ffmpeg/include/libavutil/audioconvert.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/audioconvert.h rename : content/media/fmp4/ffmpeg/include/libavutil/avassert.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/avassert.h rename : content/media/fmp4/ffmpeg/include/libavutil/avconfig.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/avconfig.h rename : content/media/fmp4/ffmpeg/include/libavutil/avstring.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/avstring.h rename : content/media/fmp4/ffmpeg/include/libavutil/avutil.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/avutil.h rename : content/media/fmp4/ffmpeg/include/libavutil/base64.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/base64.h rename : content/media/fmp4/ffmpeg/include/libavutil/blowfish.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/blowfish.h rename : content/media/fmp4/ffmpeg/include/libavutil/bprint.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/bprint.h rename : content/media/fmp4/ffmpeg/include/libavutil/bswap.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/bswap.h rename : content/media/fmp4/ffmpeg/include/libavutil/common.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/common.h rename : content/media/fmp4/ffmpeg/include/libavutil/cpu.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/cpu.h rename : content/media/fmp4/ffmpeg/include/libavutil/crc.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/crc.h rename : content/media/fmp4/ffmpeg/include/libavutil/dict.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/dict.h rename : content/media/fmp4/ffmpeg/include/libavutil/error.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/error.h rename : content/media/fmp4/ffmpeg/include/libavutil/eval.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/eval.h rename : content/media/fmp4/ffmpeg/include/libavutil/fifo.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/fifo.h rename : content/media/fmp4/ffmpeg/include/libavutil/file.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/file.h rename : content/media/fmp4/ffmpeg/include/libavutil/imgutils.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/imgutils.h rename : content/media/fmp4/ffmpeg/include/libavutil/intfloat.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/intfloat.h rename : content/media/fmp4/ffmpeg/include/libavutil/intfloat_readwrite.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/intfloat_readwrite.h rename : content/media/fmp4/ffmpeg/include/libavutil/intreadwrite.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/intreadwrite.h rename : content/media/fmp4/ffmpeg/include/libavutil/lfg.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/lfg.h rename : content/media/fmp4/ffmpeg/include/libavutil/log.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/log.h rename : content/media/fmp4/ffmpeg/include/libavutil/lzo.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/lzo.h rename : content/media/fmp4/ffmpeg/include/libavutil/mathematics.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/mathematics.h rename : content/media/fmp4/ffmpeg/include/libavutil/md5.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/md5.h rename : content/media/fmp4/ffmpeg/include/libavutil/mem.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/mem.h rename : content/media/fmp4/ffmpeg/include/libavutil/old_pix_fmts.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/old_pix_fmts.h rename : content/media/fmp4/ffmpeg/include/libavutil/opt.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/opt.h rename : content/media/fmp4/ffmpeg/include/libavutil/parseutils.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/parseutils.h rename : content/media/fmp4/ffmpeg/include/libavutil/pixdesc.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/pixdesc.h rename : content/media/fmp4/ffmpeg/include/libavutil/pixfmt.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/pixfmt.h rename : content/media/fmp4/ffmpeg/include/libavutil/random_seed.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/random_seed.h rename : content/media/fmp4/ffmpeg/include/libavutil/rational.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/rational.h rename : content/media/fmp4/ffmpeg/include/libavutil/samplefmt.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/samplefmt.h rename : content/media/fmp4/ffmpeg/include/libavutil/sha.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/sha.h rename : content/media/fmp4/ffmpeg/include/libavutil/time.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/time.h rename : content/media/fmp4/ffmpeg/include/libavutil/timecode.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/timecode.h rename : content/media/fmp4/ffmpeg/include/libavutil/timestamp.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/timestamp.h rename : content/media/fmp4/ffmpeg/include/libavutil/version.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/version.h rename : content/media/fmp4/ffmpeg/include/libavutil/xtea.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/xtea.h
2014-07-03 02:43:13 +00:00
bool FFmpegDataDecoder<LIBAV_VER>::sFFmpegInitDone = false;
StaticMutex FFmpegDataDecoder<LIBAV_VER>::sMonitor;
Bug 1015829 - Runtime binding for libav 53, 54, 55; r=edwin --HG-- rename : content/media/fmp4/ffmpeg/include/README_mozilla => content/media/fmp4/ffmpeg/README_mozilla rename : content/media/fmp4/ffmpeg/include/COPYING.LGPLv2.1 => content/media/fmp4/ffmpeg/libav53/include/COPYING.LGPLv2.1 rename : content/media/fmp4/ffmpeg/include/libavcodec/avcodec.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/avcodec.h rename : content/media/fmp4/ffmpeg/include/libavcodec/avfft.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/avfft.h rename : content/media/fmp4/ffmpeg/include/libavcodec/dxva2.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/dxva2.h rename : content/media/fmp4/ffmpeg/include/libavcodec/old_codec_ids.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/old_codec_ids.h rename : content/media/fmp4/ffmpeg/include/libavcodec/opt.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/opt.h rename : content/media/fmp4/ffmpeg/include/libavcodec/vaapi.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/vaapi.h rename : content/media/fmp4/ffmpeg/include/libavcodec/vda.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/vda.h rename : content/media/fmp4/ffmpeg/include/libavcodec/vdpau.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/vdpau.h rename : content/media/fmp4/ffmpeg/include/libavcodec/version.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/version.h rename : content/media/fmp4/ffmpeg/include/libavcodec/xvmc.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/xvmc.h rename : content/media/fmp4/ffmpeg/include/libavformat/avformat.h => content/media/fmp4/ffmpeg/libav53/include/libavformat/avformat.h rename : content/media/fmp4/ffmpeg/include/libavformat/avio.h => content/media/fmp4/ffmpeg/libav53/include/libavformat/avio.h rename : content/media/fmp4/ffmpeg/include/libavformat/version.h => content/media/fmp4/ffmpeg/libav53/include/libavformat/version.h rename : content/media/fmp4/ffmpeg/include/libavutil/adler32.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/adler32.h rename : content/media/fmp4/ffmpeg/include/libavutil/aes.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/aes.h rename : content/media/fmp4/ffmpeg/include/libavutil/attributes.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/attributes.h rename : content/media/fmp4/ffmpeg/include/libavutil/audio_fifo.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/audio_fifo.h rename : content/media/fmp4/ffmpeg/include/libavutil/audioconvert.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/audioconvert.h rename : content/media/fmp4/ffmpeg/include/libavutil/avassert.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/avassert.h rename : content/media/fmp4/ffmpeg/include/libavutil/avconfig.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/avconfig.h rename : content/media/fmp4/ffmpeg/include/libavutil/avstring.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/avstring.h rename : content/media/fmp4/ffmpeg/include/libavutil/avutil.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/avutil.h rename : content/media/fmp4/ffmpeg/include/libavutil/base64.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/base64.h rename : content/media/fmp4/ffmpeg/include/libavutil/blowfish.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/blowfish.h rename : content/media/fmp4/ffmpeg/include/libavutil/bprint.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/bprint.h rename : content/media/fmp4/ffmpeg/include/libavutil/bswap.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/bswap.h rename : content/media/fmp4/ffmpeg/include/libavutil/common.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/common.h rename : content/media/fmp4/ffmpeg/include/libavutil/cpu.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/cpu.h rename : content/media/fmp4/ffmpeg/include/libavutil/crc.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/crc.h rename : content/media/fmp4/ffmpeg/include/libavutil/dict.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/dict.h rename : content/media/fmp4/ffmpeg/include/libavutil/error.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/error.h rename : content/media/fmp4/ffmpeg/include/libavutil/eval.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/eval.h rename : content/media/fmp4/ffmpeg/include/libavutil/fifo.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/fifo.h rename : content/media/fmp4/ffmpeg/include/libavutil/file.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/file.h rename : content/media/fmp4/ffmpeg/include/libavutil/imgutils.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/imgutils.h rename : content/media/fmp4/ffmpeg/include/libavutil/intfloat.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/intfloat.h rename : content/media/fmp4/ffmpeg/include/libavutil/intfloat_readwrite.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/intfloat_readwrite.h rename : content/media/fmp4/ffmpeg/include/libavutil/intreadwrite.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/intreadwrite.h rename : content/media/fmp4/ffmpeg/include/libavutil/lfg.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/lfg.h rename : content/media/fmp4/ffmpeg/include/libavutil/log.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/log.h rename : content/media/fmp4/ffmpeg/include/libavutil/lzo.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/lzo.h rename : content/media/fmp4/ffmpeg/include/libavutil/mathematics.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/mathematics.h rename : content/media/fmp4/ffmpeg/include/libavutil/md5.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/md5.h rename : content/media/fmp4/ffmpeg/include/libavutil/mem.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/mem.h rename : content/media/fmp4/ffmpeg/include/libavutil/old_pix_fmts.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/old_pix_fmts.h rename : content/media/fmp4/ffmpeg/include/libavutil/opt.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/opt.h rename : content/media/fmp4/ffmpeg/include/libavutil/parseutils.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/parseutils.h rename : content/media/fmp4/ffmpeg/include/libavutil/pixdesc.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/pixdesc.h rename : content/media/fmp4/ffmpeg/include/libavutil/pixfmt.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/pixfmt.h rename : content/media/fmp4/ffmpeg/include/libavutil/random_seed.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/random_seed.h rename : content/media/fmp4/ffmpeg/include/libavutil/rational.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/rational.h rename : content/media/fmp4/ffmpeg/include/libavutil/samplefmt.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/samplefmt.h rename : content/media/fmp4/ffmpeg/include/libavutil/sha.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/sha.h rename : content/media/fmp4/ffmpeg/include/libavutil/time.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/time.h rename : content/media/fmp4/ffmpeg/include/libavutil/timecode.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/timecode.h rename : content/media/fmp4/ffmpeg/include/libavutil/timestamp.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/timestamp.h rename : content/media/fmp4/ffmpeg/include/libavutil/version.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/version.h rename : content/media/fmp4/ffmpeg/include/libavutil/xtea.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/xtea.h
2014-07-03 02:43:13 +00:00
FFmpegDataDecoder<LIBAV_VER>::FFmpegDataDecoder(MediaTaskQueue* aTaskQueue,
AVCodecID aCodecID)
: mTaskQueue(aTaskQueue)
, mCodecContext(nullptr)
, mFrame(NULL)
, mCodecID(aCodecID)
{
MOZ_COUNT_CTOR(FFmpegDataDecoder);
}
Bug 1015829 - Runtime binding for libav 53, 54, 55; r=edwin --HG-- rename : content/media/fmp4/ffmpeg/include/README_mozilla => content/media/fmp4/ffmpeg/README_mozilla rename : content/media/fmp4/ffmpeg/include/COPYING.LGPLv2.1 => content/media/fmp4/ffmpeg/libav53/include/COPYING.LGPLv2.1 rename : content/media/fmp4/ffmpeg/include/libavcodec/avcodec.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/avcodec.h rename : content/media/fmp4/ffmpeg/include/libavcodec/avfft.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/avfft.h rename : content/media/fmp4/ffmpeg/include/libavcodec/dxva2.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/dxva2.h rename : content/media/fmp4/ffmpeg/include/libavcodec/old_codec_ids.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/old_codec_ids.h rename : content/media/fmp4/ffmpeg/include/libavcodec/opt.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/opt.h rename : content/media/fmp4/ffmpeg/include/libavcodec/vaapi.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/vaapi.h rename : content/media/fmp4/ffmpeg/include/libavcodec/vda.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/vda.h rename : content/media/fmp4/ffmpeg/include/libavcodec/vdpau.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/vdpau.h rename : content/media/fmp4/ffmpeg/include/libavcodec/version.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/version.h rename : content/media/fmp4/ffmpeg/include/libavcodec/xvmc.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/xvmc.h rename : content/media/fmp4/ffmpeg/include/libavformat/avformat.h => content/media/fmp4/ffmpeg/libav53/include/libavformat/avformat.h rename : content/media/fmp4/ffmpeg/include/libavformat/avio.h => content/media/fmp4/ffmpeg/libav53/include/libavformat/avio.h rename : content/media/fmp4/ffmpeg/include/libavformat/version.h => content/media/fmp4/ffmpeg/libav53/include/libavformat/version.h rename : content/media/fmp4/ffmpeg/include/libavutil/adler32.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/adler32.h rename : content/media/fmp4/ffmpeg/include/libavutil/aes.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/aes.h rename : content/media/fmp4/ffmpeg/include/libavutil/attributes.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/attributes.h rename : content/media/fmp4/ffmpeg/include/libavutil/audio_fifo.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/audio_fifo.h rename : content/media/fmp4/ffmpeg/include/libavutil/audioconvert.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/audioconvert.h rename : content/media/fmp4/ffmpeg/include/libavutil/avassert.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/avassert.h rename : content/media/fmp4/ffmpeg/include/libavutil/avconfig.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/avconfig.h rename : content/media/fmp4/ffmpeg/include/libavutil/avstring.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/avstring.h rename : content/media/fmp4/ffmpeg/include/libavutil/avutil.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/avutil.h rename : content/media/fmp4/ffmpeg/include/libavutil/base64.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/base64.h rename : content/media/fmp4/ffmpeg/include/libavutil/blowfish.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/blowfish.h rename : content/media/fmp4/ffmpeg/include/libavutil/bprint.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/bprint.h rename : content/media/fmp4/ffmpeg/include/libavutil/bswap.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/bswap.h rename : content/media/fmp4/ffmpeg/include/libavutil/common.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/common.h rename : content/media/fmp4/ffmpeg/include/libavutil/cpu.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/cpu.h rename : content/media/fmp4/ffmpeg/include/libavutil/crc.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/crc.h rename : content/media/fmp4/ffmpeg/include/libavutil/dict.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/dict.h rename : content/media/fmp4/ffmpeg/include/libavutil/error.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/error.h rename : content/media/fmp4/ffmpeg/include/libavutil/eval.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/eval.h rename : content/media/fmp4/ffmpeg/include/libavutil/fifo.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/fifo.h rename : content/media/fmp4/ffmpeg/include/libavutil/file.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/file.h rename : content/media/fmp4/ffmpeg/include/libavutil/imgutils.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/imgutils.h rename : content/media/fmp4/ffmpeg/include/libavutil/intfloat.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/intfloat.h rename : content/media/fmp4/ffmpeg/include/libavutil/intfloat_readwrite.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/intfloat_readwrite.h rename : content/media/fmp4/ffmpeg/include/libavutil/intreadwrite.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/intreadwrite.h rename : content/media/fmp4/ffmpeg/include/libavutil/lfg.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/lfg.h rename : content/media/fmp4/ffmpeg/include/libavutil/log.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/log.h rename : content/media/fmp4/ffmpeg/include/libavutil/lzo.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/lzo.h rename : content/media/fmp4/ffmpeg/include/libavutil/mathematics.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/mathematics.h rename : content/media/fmp4/ffmpeg/include/libavutil/md5.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/md5.h rename : content/media/fmp4/ffmpeg/include/libavutil/mem.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/mem.h rename : content/media/fmp4/ffmpeg/include/libavutil/old_pix_fmts.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/old_pix_fmts.h rename : content/media/fmp4/ffmpeg/include/libavutil/opt.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/opt.h rename : content/media/fmp4/ffmpeg/include/libavutil/parseutils.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/parseutils.h rename : content/media/fmp4/ffmpeg/include/libavutil/pixdesc.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/pixdesc.h rename : content/media/fmp4/ffmpeg/include/libavutil/pixfmt.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/pixfmt.h rename : content/media/fmp4/ffmpeg/include/libavutil/random_seed.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/random_seed.h rename : content/media/fmp4/ffmpeg/include/libavutil/rational.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/rational.h rename : content/media/fmp4/ffmpeg/include/libavutil/samplefmt.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/samplefmt.h rename : content/media/fmp4/ffmpeg/include/libavutil/sha.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/sha.h rename : content/media/fmp4/ffmpeg/include/libavutil/time.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/time.h rename : content/media/fmp4/ffmpeg/include/libavutil/timecode.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/timecode.h rename : content/media/fmp4/ffmpeg/include/libavutil/timestamp.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/timestamp.h rename : content/media/fmp4/ffmpeg/include/libavutil/version.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/version.h rename : content/media/fmp4/ffmpeg/include/libavutil/xtea.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/xtea.h
2014-07-03 02:43:13 +00:00
FFmpegDataDecoder<LIBAV_VER>::~FFmpegDataDecoder()
{
MOZ_COUNT_DTOR(FFmpegDataDecoder);
}
/**
* FFmpeg calls back to this function with a list of pixel formats it supports.
* We choose a pixel format that we support and return it.
* For now, we just look for YUV420P as it is the only non-HW accelerated format
* supported by FFmpeg's H264 decoder.
*/
static PixelFormat
ChoosePixelFormat(AVCodecContext* aCodecContext, const PixelFormat* aFormats)
{
FFMPEG_LOG("Choosing FFmpeg pixel format for video decoding.");
for (; *aFormats > -1; aFormats++) {
if (*aFormats == PIX_FMT_YUV420P) {
FFMPEG_LOG("Requesting pixel format YUV420P.");
return PIX_FMT_YUV420P;
}
}
NS_WARNING("FFmpeg does not share any supported pixel formats.");
return PIX_FMT_NONE;
}
nsresult
Bug 1015829 - Runtime binding for libav 53, 54, 55; r=edwin --HG-- rename : content/media/fmp4/ffmpeg/include/README_mozilla => content/media/fmp4/ffmpeg/README_mozilla rename : content/media/fmp4/ffmpeg/include/COPYING.LGPLv2.1 => content/media/fmp4/ffmpeg/libav53/include/COPYING.LGPLv2.1 rename : content/media/fmp4/ffmpeg/include/libavcodec/avcodec.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/avcodec.h rename : content/media/fmp4/ffmpeg/include/libavcodec/avfft.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/avfft.h rename : content/media/fmp4/ffmpeg/include/libavcodec/dxva2.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/dxva2.h rename : content/media/fmp4/ffmpeg/include/libavcodec/old_codec_ids.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/old_codec_ids.h rename : content/media/fmp4/ffmpeg/include/libavcodec/opt.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/opt.h rename : content/media/fmp4/ffmpeg/include/libavcodec/vaapi.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/vaapi.h rename : content/media/fmp4/ffmpeg/include/libavcodec/vda.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/vda.h rename : content/media/fmp4/ffmpeg/include/libavcodec/vdpau.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/vdpau.h rename : content/media/fmp4/ffmpeg/include/libavcodec/version.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/version.h rename : content/media/fmp4/ffmpeg/include/libavcodec/xvmc.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/xvmc.h rename : content/media/fmp4/ffmpeg/include/libavformat/avformat.h => content/media/fmp4/ffmpeg/libav53/include/libavformat/avformat.h rename : content/media/fmp4/ffmpeg/include/libavformat/avio.h => content/media/fmp4/ffmpeg/libav53/include/libavformat/avio.h rename : content/media/fmp4/ffmpeg/include/libavformat/version.h => content/media/fmp4/ffmpeg/libav53/include/libavformat/version.h rename : content/media/fmp4/ffmpeg/include/libavutil/adler32.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/adler32.h rename : content/media/fmp4/ffmpeg/include/libavutil/aes.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/aes.h rename : content/media/fmp4/ffmpeg/include/libavutil/attributes.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/attributes.h rename : content/media/fmp4/ffmpeg/include/libavutil/audio_fifo.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/audio_fifo.h rename : content/media/fmp4/ffmpeg/include/libavutil/audioconvert.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/audioconvert.h rename : content/media/fmp4/ffmpeg/include/libavutil/avassert.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/avassert.h rename : content/media/fmp4/ffmpeg/include/libavutil/avconfig.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/avconfig.h rename : content/media/fmp4/ffmpeg/include/libavutil/avstring.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/avstring.h rename : content/media/fmp4/ffmpeg/include/libavutil/avutil.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/avutil.h rename : content/media/fmp4/ffmpeg/include/libavutil/base64.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/base64.h rename : content/media/fmp4/ffmpeg/include/libavutil/blowfish.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/blowfish.h rename : content/media/fmp4/ffmpeg/include/libavutil/bprint.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/bprint.h rename : content/media/fmp4/ffmpeg/include/libavutil/bswap.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/bswap.h rename : content/media/fmp4/ffmpeg/include/libavutil/common.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/common.h rename : content/media/fmp4/ffmpeg/include/libavutil/cpu.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/cpu.h rename : content/media/fmp4/ffmpeg/include/libavutil/crc.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/crc.h rename : content/media/fmp4/ffmpeg/include/libavutil/dict.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/dict.h rename : content/media/fmp4/ffmpeg/include/libavutil/error.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/error.h rename : content/media/fmp4/ffmpeg/include/libavutil/eval.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/eval.h rename : content/media/fmp4/ffmpeg/include/libavutil/fifo.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/fifo.h rename : content/media/fmp4/ffmpeg/include/libavutil/file.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/file.h rename : content/media/fmp4/ffmpeg/include/libavutil/imgutils.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/imgutils.h rename : content/media/fmp4/ffmpeg/include/libavutil/intfloat.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/intfloat.h rename : content/media/fmp4/ffmpeg/include/libavutil/intfloat_readwrite.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/intfloat_readwrite.h rename : content/media/fmp4/ffmpeg/include/libavutil/intreadwrite.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/intreadwrite.h rename : content/media/fmp4/ffmpeg/include/libavutil/lfg.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/lfg.h rename : content/media/fmp4/ffmpeg/include/libavutil/log.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/log.h rename : content/media/fmp4/ffmpeg/include/libavutil/lzo.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/lzo.h rename : content/media/fmp4/ffmpeg/include/libavutil/mathematics.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/mathematics.h rename : content/media/fmp4/ffmpeg/include/libavutil/md5.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/md5.h rename : content/media/fmp4/ffmpeg/include/libavutil/mem.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/mem.h rename : content/media/fmp4/ffmpeg/include/libavutil/old_pix_fmts.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/old_pix_fmts.h rename : content/media/fmp4/ffmpeg/include/libavutil/opt.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/opt.h rename : content/media/fmp4/ffmpeg/include/libavutil/parseutils.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/parseutils.h rename : content/media/fmp4/ffmpeg/include/libavutil/pixdesc.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/pixdesc.h rename : content/media/fmp4/ffmpeg/include/libavutil/pixfmt.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/pixfmt.h rename : content/media/fmp4/ffmpeg/include/libavutil/random_seed.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/random_seed.h rename : content/media/fmp4/ffmpeg/include/libavutil/rational.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/rational.h rename : content/media/fmp4/ffmpeg/include/libavutil/samplefmt.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/samplefmt.h rename : content/media/fmp4/ffmpeg/include/libavutil/sha.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/sha.h rename : content/media/fmp4/ffmpeg/include/libavutil/time.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/time.h rename : content/media/fmp4/ffmpeg/include/libavutil/timecode.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/timecode.h rename : content/media/fmp4/ffmpeg/include/libavutil/timestamp.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/timestamp.h rename : content/media/fmp4/ffmpeg/include/libavutil/version.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/version.h rename : content/media/fmp4/ffmpeg/include/libavutil/xtea.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/xtea.h
2014-07-03 02:43:13 +00:00
FFmpegDataDecoder<LIBAV_VER>::Init()
{
StaticMutexAutoLock mon(sMonitor);
FFMPEG_LOG("Initialising FFmpeg decoder.");
if (!sFFmpegInitDone) {
av_register_all();
#ifdef DEBUG
av_log_set_level(AV_LOG_DEBUG);
#endif
sFFmpegInitDone = true;
}
AVCodec* codec = avcodec_find_decoder(mCodecID);
if (!codec) {
NS_WARNING("Couldn't find ffmpeg decoder");
return NS_ERROR_FAILURE;
}
if (!(mCodecContext = avcodec_alloc_context3(codec))) {
NS_WARNING("Couldn't init ffmpeg context");
return NS_ERROR_FAILURE;
}
mCodecContext->opaque = this;
// FFmpeg takes this as a suggestion for what format to use for audio samples.
mCodecContext->request_sample_fmt = AV_SAMPLE_FMT_FLT;
// FFmpeg will call back to this to negotiate a video pixel format.
mCodecContext->get_format = ChoosePixelFormat;
mCodecContext->thread_count = PR_GetNumberOfProcessors();
mCodecContext->thread_type = FF_THREAD_SLICE | FF_THREAD_FRAME;
mCodecContext->thread_safe_callbacks = false;
mCodecContext->extradata_size = mExtraData.length();
for (int i = 0; i < FF_INPUT_BUFFER_PADDING_SIZE; i++) {
mExtraData.append(0);
}
mCodecContext->extradata = mExtraData.begin();
if (codec->capabilities & CODEC_CAP_DR1) {
mCodecContext->flags |= CODEC_FLAG_EMU_EDGE;
}
if (avcodec_open2(mCodecContext, codec, nullptr) < 0) {
NS_WARNING("Couldn't initialise ffmpeg decoder");
return NS_ERROR_FAILURE;
}
if (mCodecContext->codec_type == AVMEDIA_TYPE_AUDIO &&
mCodecContext->sample_fmt != AV_SAMPLE_FMT_FLT &&
mCodecContext->sample_fmt != AV_SAMPLE_FMT_FLTP &&
mCodecContext->sample_fmt != AV_SAMPLE_FMT_S16 &&
mCodecContext->sample_fmt != AV_SAMPLE_FMT_S16P) {
NS_WARNING("FFmpeg audio decoder outputs unsupported audio format.");
return NS_ERROR_FAILURE;
}
FFMPEG_LOG("FFmpeg init successful.");
return NS_OK;
}
nsresult
Bug 1015829 - Runtime binding for libav 53, 54, 55; r=edwin --HG-- rename : content/media/fmp4/ffmpeg/include/README_mozilla => content/media/fmp4/ffmpeg/README_mozilla rename : content/media/fmp4/ffmpeg/include/COPYING.LGPLv2.1 => content/media/fmp4/ffmpeg/libav53/include/COPYING.LGPLv2.1 rename : content/media/fmp4/ffmpeg/include/libavcodec/avcodec.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/avcodec.h rename : content/media/fmp4/ffmpeg/include/libavcodec/avfft.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/avfft.h rename : content/media/fmp4/ffmpeg/include/libavcodec/dxva2.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/dxva2.h rename : content/media/fmp4/ffmpeg/include/libavcodec/old_codec_ids.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/old_codec_ids.h rename : content/media/fmp4/ffmpeg/include/libavcodec/opt.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/opt.h rename : content/media/fmp4/ffmpeg/include/libavcodec/vaapi.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/vaapi.h rename : content/media/fmp4/ffmpeg/include/libavcodec/vda.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/vda.h rename : content/media/fmp4/ffmpeg/include/libavcodec/vdpau.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/vdpau.h rename : content/media/fmp4/ffmpeg/include/libavcodec/version.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/version.h rename : content/media/fmp4/ffmpeg/include/libavcodec/xvmc.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/xvmc.h rename : content/media/fmp4/ffmpeg/include/libavformat/avformat.h => content/media/fmp4/ffmpeg/libav53/include/libavformat/avformat.h rename : content/media/fmp4/ffmpeg/include/libavformat/avio.h => content/media/fmp4/ffmpeg/libav53/include/libavformat/avio.h rename : content/media/fmp4/ffmpeg/include/libavformat/version.h => content/media/fmp4/ffmpeg/libav53/include/libavformat/version.h rename : content/media/fmp4/ffmpeg/include/libavutil/adler32.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/adler32.h rename : content/media/fmp4/ffmpeg/include/libavutil/aes.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/aes.h rename : content/media/fmp4/ffmpeg/include/libavutil/attributes.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/attributes.h rename : content/media/fmp4/ffmpeg/include/libavutil/audio_fifo.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/audio_fifo.h rename : content/media/fmp4/ffmpeg/include/libavutil/audioconvert.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/audioconvert.h rename : content/media/fmp4/ffmpeg/include/libavutil/avassert.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/avassert.h rename : content/media/fmp4/ffmpeg/include/libavutil/avconfig.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/avconfig.h rename : content/media/fmp4/ffmpeg/include/libavutil/avstring.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/avstring.h rename : content/media/fmp4/ffmpeg/include/libavutil/avutil.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/avutil.h rename : content/media/fmp4/ffmpeg/include/libavutil/base64.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/base64.h rename : content/media/fmp4/ffmpeg/include/libavutil/blowfish.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/blowfish.h rename : content/media/fmp4/ffmpeg/include/libavutil/bprint.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/bprint.h rename : content/media/fmp4/ffmpeg/include/libavutil/bswap.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/bswap.h rename : content/media/fmp4/ffmpeg/include/libavutil/common.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/common.h rename : content/media/fmp4/ffmpeg/include/libavutil/cpu.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/cpu.h rename : content/media/fmp4/ffmpeg/include/libavutil/crc.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/crc.h rename : content/media/fmp4/ffmpeg/include/libavutil/dict.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/dict.h rename : content/media/fmp4/ffmpeg/include/libavutil/error.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/error.h rename : content/media/fmp4/ffmpeg/include/libavutil/eval.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/eval.h rename : content/media/fmp4/ffmpeg/include/libavutil/fifo.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/fifo.h rename : content/media/fmp4/ffmpeg/include/libavutil/file.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/file.h rename : content/media/fmp4/ffmpeg/include/libavutil/imgutils.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/imgutils.h rename : content/media/fmp4/ffmpeg/include/libavutil/intfloat.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/intfloat.h rename : content/media/fmp4/ffmpeg/include/libavutil/intfloat_readwrite.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/intfloat_readwrite.h rename : content/media/fmp4/ffmpeg/include/libavutil/intreadwrite.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/intreadwrite.h rename : content/media/fmp4/ffmpeg/include/libavutil/lfg.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/lfg.h rename : content/media/fmp4/ffmpeg/include/libavutil/log.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/log.h rename : content/media/fmp4/ffmpeg/include/libavutil/lzo.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/lzo.h rename : content/media/fmp4/ffmpeg/include/libavutil/mathematics.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/mathematics.h rename : content/media/fmp4/ffmpeg/include/libavutil/md5.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/md5.h rename : content/media/fmp4/ffmpeg/include/libavutil/mem.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/mem.h rename : content/media/fmp4/ffmpeg/include/libavutil/old_pix_fmts.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/old_pix_fmts.h rename : content/media/fmp4/ffmpeg/include/libavutil/opt.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/opt.h rename : content/media/fmp4/ffmpeg/include/libavutil/parseutils.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/parseutils.h rename : content/media/fmp4/ffmpeg/include/libavutil/pixdesc.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/pixdesc.h rename : content/media/fmp4/ffmpeg/include/libavutil/pixfmt.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/pixfmt.h rename : content/media/fmp4/ffmpeg/include/libavutil/random_seed.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/random_seed.h rename : content/media/fmp4/ffmpeg/include/libavutil/rational.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/rational.h rename : content/media/fmp4/ffmpeg/include/libavutil/samplefmt.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/samplefmt.h rename : content/media/fmp4/ffmpeg/include/libavutil/sha.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/sha.h rename : content/media/fmp4/ffmpeg/include/libavutil/time.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/time.h rename : content/media/fmp4/ffmpeg/include/libavutil/timecode.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/timecode.h rename : content/media/fmp4/ffmpeg/include/libavutil/timestamp.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/timestamp.h rename : content/media/fmp4/ffmpeg/include/libavutil/version.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/version.h rename : content/media/fmp4/ffmpeg/include/libavutil/xtea.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/xtea.h
2014-07-03 02:43:13 +00:00
FFmpegDataDecoder<LIBAV_VER>::Flush()
{
mTaskQueue->Flush();
avcodec_flush_buffers(mCodecContext);
return NS_OK;
}
nsresult
Bug 1015829 - Runtime binding for libav 53, 54, 55; r=edwin --HG-- rename : content/media/fmp4/ffmpeg/include/README_mozilla => content/media/fmp4/ffmpeg/README_mozilla rename : content/media/fmp4/ffmpeg/include/COPYING.LGPLv2.1 => content/media/fmp4/ffmpeg/libav53/include/COPYING.LGPLv2.1 rename : content/media/fmp4/ffmpeg/include/libavcodec/avcodec.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/avcodec.h rename : content/media/fmp4/ffmpeg/include/libavcodec/avfft.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/avfft.h rename : content/media/fmp4/ffmpeg/include/libavcodec/dxva2.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/dxva2.h rename : content/media/fmp4/ffmpeg/include/libavcodec/old_codec_ids.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/old_codec_ids.h rename : content/media/fmp4/ffmpeg/include/libavcodec/opt.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/opt.h rename : content/media/fmp4/ffmpeg/include/libavcodec/vaapi.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/vaapi.h rename : content/media/fmp4/ffmpeg/include/libavcodec/vda.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/vda.h rename : content/media/fmp4/ffmpeg/include/libavcodec/vdpau.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/vdpau.h rename : content/media/fmp4/ffmpeg/include/libavcodec/version.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/version.h rename : content/media/fmp4/ffmpeg/include/libavcodec/xvmc.h => content/media/fmp4/ffmpeg/libav53/include/libavcodec/xvmc.h rename : content/media/fmp4/ffmpeg/include/libavformat/avformat.h => content/media/fmp4/ffmpeg/libav53/include/libavformat/avformat.h rename : content/media/fmp4/ffmpeg/include/libavformat/avio.h => content/media/fmp4/ffmpeg/libav53/include/libavformat/avio.h rename : content/media/fmp4/ffmpeg/include/libavformat/version.h => content/media/fmp4/ffmpeg/libav53/include/libavformat/version.h rename : content/media/fmp4/ffmpeg/include/libavutil/adler32.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/adler32.h rename : content/media/fmp4/ffmpeg/include/libavutil/aes.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/aes.h rename : content/media/fmp4/ffmpeg/include/libavutil/attributes.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/attributes.h rename : content/media/fmp4/ffmpeg/include/libavutil/audio_fifo.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/audio_fifo.h rename : content/media/fmp4/ffmpeg/include/libavutil/audioconvert.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/audioconvert.h rename : content/media/fmp4/ffmpeg/include/libavutil/avassert.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/avassert.h rename : content/media/fmp4/ffmpeg/include/libavutil/avconfig.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/avconfig.h rename : content/media/fmp4/ffmpeg/include/libavutil/avstring.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/avstring.h rename : content/media/fmp4/ffmpeg/include/libavutil/avutil.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/avutil.h rename : content/media/fmp4/ffmpeg/include/libavutil/base64.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/base64.h rename : content/media/fmp4/ffmpeg/include/libavutil/blowfish.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/blowfish.h rename : content/media/fmp4/ffmpeg/include/libavutil/bprint.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/bprint.h rename : content/media/fmp4/ffmpeg/include/libavutil/bswap.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/bswap.h rename : content/media/fmp4/ffmpeg/include/libavutil/common.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/common.h rename : content/media/fmp4/ffmpeg/include/libavutil/cpu.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/cpu.h rename : content/media/fmp4/ffmpeg/include/libavutil/crc.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/crc.h rename : content/media/fmp4/ffmpeg/include/libavutil/dict.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/dict.h rename : content/media/fmp4/ffmpeg/include/libavutil/error.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/error.h rename : content/media/fmp4/ffmpeg/include/libavutil/eval.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/eval.h rename : content/media/fmp4/ffmpeg/include/libavutil/fifo.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/fifo.h rename : content/media/fmp4/ffmpeg/include/libavutil/file.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/file.h rename : content/media/fmp4/ffmpeg/include/libavutil/imgutils.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/imgutils.h rename : content/media/fmp4/ffmpeg/include/libavutil/intfloat.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/intfloat.h rename : content/media/fmp4/ffmpeg/include/libavutil/intfloat_readwrite.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/intfloat_readwrite.h rename : content/media/fmp4/ffmpeg/include/libavutil/intreadwrite.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/intreadwrite.h rename : content/media/fmp4/ffmpeg/include/libavutil/lfg.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/lfg.h rename : content/media/fmp4/ffmpeg/include/libavutil/log.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/log.h rename : content/media/fmp4/ffmpeg/include/libavutil/lzo.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/lzo.h rename : content/media/fmp4/ffmpeg/include/libavutil/mathematics.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/mathematics.h rename : content/media/fmp4/ffmpeg/include/libavutil/md5.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/md5.h rename : content/media/fmp4/ffmpeg/include/libavutil/mem.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/mem.h rename : content/media/fmp4/ffmpeg/include/libavutil/old_pix_fmts.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/old_pix_fmts.h rename : content/media/fmp4/ffmpeg/include/libavutil/opt.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/opt.h rename : content/media/fmp4/ffmpeg/include/libavutil/parseutils.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/parseutils.h rename : content/media/fmp4/ffmpeg/include/libavutil/pixdesc.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/pixdesc.h rename : content/media/fmp4/ffmpeg/include/libavutil/pixfmt.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/pixfmt.h rename : content/media/fmp4/ffmpeg/include/libavutil/random_seed.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/random_seed.h rename : content/media/fmp4/ffmpeg/include/libavutil/rational.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/rational.h rename : content/media/fmp4/ffmpeg/include/libavutil/samplefmt.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/samplefmt.h rename : content/media/fmp4/ffmpeg/include/libavutil/sha.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/sha.h rename : content/media/fmp4/ffmpeg/include/libavutil/time.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/time.h rename : content/media/fmp4/ffmpeg/include/libavutil/timecode.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/timecode.h rename : content/media/fmp4/ffmpeg/include/libavutil/timestamp.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/timestamp.h rename : content/media/fmp4/ffmpeg/include/libavutil/version.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/version.h rename : content/media/fmp4/ffmpeg/include/libavutil/xtea.h => content/media/fmp4/ffmpeg/libav53/include/libavutil/xtea.h
2014-07-03 02:43:13 +00:00
FFmpegDataDecoder<LIBAV_VER>::Shutdown()
{
StaticMutexAutoLock mon(sMonitor);
if (sFFmpegInitDone) {
avcodec_close(mCodecContext);
av_freep(&mCodecContext);
#if LIBAVCODEC_VERSION_MAJOR >= 55
av_frame_free(&mFrame);
#elif LIBAVCODEC_VERSION_MAJOR == 54
avcodec_free_frame(&mFrame);
#else
delete mFrame;
mFrame = nullptr;
#endif
}
return NS_OK;
}
AVFrame*
FFmpegDataDecoder<LIBAV_VER>::PrepareFrame()
{
#if LIBAVCODEC_VERSION_MAJOR >= 55
if (mFrame) {
av_frame_unref(mFrame);
} else {
mFrame = av_frame_alloc();
}
#elif LIBAVCODEC_VERSION_MAJOR == 54
if (mFrame) {
avcodec_get_frame_defaults(mFrame);
} else {
mFrame = avcodec_alloc_frame();
}
#else
delete mFrame;
mFrame = new AVFrame;
avcodec_get_frame_defaults(mFrame);
#endif
return mFrame;
}
} // namespace mozilla