mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1100632 - Remove --disable-opus option and MOZ_OPUS #define macros. r=rillian,ted
This commit is contained in:
parent
4e6599adac
commit
153d42d171
4
config/external/moz.build
vendored
4
config/external/moz.build
vendored
@ -25,9 +25,6 @@ if CONFIG['MOZ_VORBIS']:
|
||||
if CONFIG['MOZ_TREMOR']:
|
||||
external_dirs += ['media/libtremor']
|
||||
|
||||
if CONFIG['MOZ_OPUS']:
|
||||
external_dirs += ['media/libopus']
|
||||
|
||||
if CONFIG['MOZ_WEBM']:
|
||||
external_dirs += ['media/libnestegg']
|
||||
|
||||
@ -44,6 +41,7 @@ external_dirs += [
|
||||
'media/kiss_fft',
|
||||
'media/libcubeb',
|
||||
'media/libogg',
|
||||
'media/libopus',
|
||||
'media/libtheora',
|
||||
'media/libspeex_resampler',
|
||||
'media/libstagefright',
|
||||
|
18
configure.in
18
configure.in
@ -3852,7 +3852,6 @@ MOZ_TREMOR=
|
||||
MOZ_WAVE=1
|
||||
MOZ_SAMPLE_TYPE_FLOAT32=
|
||||
MOZ_SAMPLE_TYPE_S16=
|
||||
MOZ_OPUS=1
|
||||
MOZ_WEBM=1
|
||||
MOZ_GSTREAMER=
|
||||
MOZ_DIRECTSHOW=
|
||||
@ -5224,14 +5223,6 @@ if test "${ac_cv_c_attribute_aligned}" != "0"; then
|
||||
[${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl = Disable Opus audio codec support
|
||||
dnl ========================================================
|
||||
MOZ_ARG_DISABLE_BOOL(opus,
|
||||
[ --disable-opus Disable support for Opus audio],
|
||||
MOZ_OPUS=,
|
||||
MOZ_OPUS=1)
|
||||
|
||||
dnl ========================================================
|
||||
dnl = Disable VP8 decoder support
|
||||
dnl ========================================================
|
||||
@ -5567,10 +5558,6 @@ if test -n "$MOZ_VORBIS" -a -n "$MOZ_TREMOR"; then
|
||||
AC_MSG_ERROR([MOZ_VORBIS and MOZ_TREMOR are mutually exclusive! The build system should not allow them both to be set, but they are. Please file a bug at https://bugzilla.mozilla.org/])
|
||||
fi
|
||||
|
||||
if test -n "$MOZ_WEBRTC" -a -z "$MOZ_OPUS"; then
|
||||
AC_MSG_ERROR([MOZ_WEBRTC requires MOZ_OPUS which is disabled.])
|
||||
fi
|
||||
|
||||
if test -n "$MOZ_VORBIS"; then
|
||||
AC_DEFINE(MOZ_VORBIS)
|
||||
fi
|
||||
@ -5581,10 +5568,6 @@ if test -n "$MOZ_TREMOR"; then
|
||||
MOZ_WEBM_ENCODER=
|
||||
fi
|
||||
|
||||
if test -n "$MOZ_OPUS"; then
|
||||
AC_DEFINE(MOZ_OPUS)
|
||||
fi
|
||||
|
||||
if test -n "$MOZ_WEBM_ENCODER"; then
|
||||
AC_DEFINE(MOZ_WEBM_ENCODER)
|
||||
fi
|
||||
@ -8877,7 +8860,6 @@ AC_SUBST(WIN32_GUI_EXE_LDFLAGS)
|
||||
AC_SUBST(MOZ_WAVE)
|
||||
AC_SUBST(MOZ_VORBIS)
|
||||
AC_SUBST(MOZ_TREMOR)
|
||||
AC_SUBST(MOZ_OPUS)
|
||||
AC_SUBST(MOZ_WEBM)
|
||||
AC_SUBST(MOZ_WMF)
|
||||
AC_SUBST(MOZ_FFMPEG)
|
||||
|
@ -1689,11 +1689,7 @@ MediaDecoder::IsRawEnabled()
|
||||
bool
|
||||
MediaDecoder::IsOpusEnabled()
|
||||
{
|
||||
#ifdef MOZ_OPUS
|
||||
return Preferences::GetBool("media.opus.enabled");
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -12,11 +12,8 @@
|
||||
|
||||
#include"GeckoProfiler.h"
|
||||
#include "OggWriter.h"
|
||||
#ifdef MOZ_OPUS
|
||||
#include "OpusTrackEncoder.h"
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_VORBIS
|
||||
#include "VorbisTrackEncoder.h"
|
||||
#endif
|
||||
|
@ -11,12 +11,14 @@ EXPORTS += [
|
||||
'ContainerWriter.h',
|
||||
'EncodedFrameContainer.h',
|
||||
'MediaEncoder.h',
|
||||
'OpusTrackEncoder.h',
|
||||
'TrackEncoder.h',
|
||||
'TrackMetadataBase.h',
|
||||
]
|
||||
|
||||
UNIFIED_SOURCES += [
|
||||
'MediaEncoder.cpp',
|
||||
'OpusTrackEncoder.cpp',
|
||||
'TrackEncoder.cpp',
|
||||
]
|
||||
|
||||
@ -24,10 +26,6 @@ if CONFIG['MOZ_OMX_ENCODER']:
|
||||
EXPORTS += ['OmxTrackEncoder.h']
|
||||
UNIFIED_SOURCES += ['OmxTrackEncoder.cpp']
|
||||
|
||||
if CONFIG['MOZ_OPUS']:
|
||||
EXPORTS += ['OpusTrackEncoder.h']
|
||||
UNIFIED_SOURCES += ['OpusTrackEncoder.cpp']
|
||||
|
||||
if CONFIG['MOZ_WEBM_ENCODER']:
|
||||
EXPORTS += ['VorbisTrackEncoder.h',
|
||||
'VP8TrackEncoder.h',
|
||||
|
@ -49,10 +49,8 @@ OggCodecState::Create(ogg_page* aPage)
|
||||
codecState = new TheoraState(aPage);
|
||||
} else if (aPage->body_len > 6 && memcmp(aPage->body+1, "vorbis", 6) == 0) {
|
||||
codecState = new VorbisState(aPage);
|
||||
#ifdef MOZ_OPUS
|
||||
} else if (aPage->body_len > 8 && memcmp(aPage->body, "OpusHead", 8) == 0) {
|
||||
codecState = new OpusState(aPage);
|
||||
#endif
|
||||
} else if (aPage->body_len > 8 && memcmp(aPage->body, "fishead\0", 8) == 0) {
|
||||
codecState = new SkeletonState(aPage);
|
||||
} else {
|
||||
@ -795,7 +793,6 @@ nsresult VorbisState::ReconstructVorbisGranulepos()
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef MOZ_OPUS
|
||||
OpusState::OpusState(ogg_page* aBosPage) :
|
||||
OggCodecState(aBosPage, true),
|
||||
mParser(nullptr),
|
||||
@ -1078,7 +1075,6 @@ bool OpusState::ReconstructOpusGranulepos(void)
|
||||
mPrevPageGranulepos = last->granulepos;
|
||||
return true;
|
||||
}
|
||||
#endif /* MOZ_OPUS */
|
||||
|
||||
SkeletonState::SkeletonState(ogg_page* aBosPage) :
|
||||
OggCodecState(aBosPage, true),
|
||||
|
@ -13,14 +13,12 @@
|
||||
#else
|
||||
#include <vorbis/codec.h>
|
||||
#endif
|
||||
#ifdef MOZ_OPUS
|
||||
#include <opus/opus.h>
|
||||
#include "opus/opus_multistream.h"
|
||||
// For MOZ_SAMPLE_TYPE_*
|
||||
#include "mozilla/dom/HTMLMediaElement.h"
|
||||
#include "MediaDecoderStateMachine.h"
|
||||
#include "MediaDecoderReader.h"
|
||||
#endif
|
||||
#include <nsAutoRef.h>
|
||||
#include <nsDeque.h>
|
||||
#include <nsTArray.h>
|
||||
@ -323,7 +321,6 @@ private:
|
||||
};
|
||||
|
||||
class OpusState : public OggCodecState {
|
||||
#ifdef MOZ_OPUS
|
||||
public:
|
||||
explicit OpusState(ogg_page* aBosPage);
|
||||
virtual ~OpusState();
|
||||
@ -375,7 +372,6 @@ private:
|
||||
// where we may need to trim some samples from the end.
|
||||
int64_t mPrevPageGranulepos;
|
||||
|
||||
#endif /* MOZ_OPUS */
|
||||
};
|
||||
|
||||
// Constructs a 32bit version number out of two 16 bit major,minor
|
||||
|
@ -13,12 +13,10 @@
|
||||
#include "VideoUtils.h"
|
||||
#include "theora/theoradec.h"
|
||||
#include <algorithm>
|
||||
#ifdef MOZ_OPUS
|
||||
#include "opus/opus.h"
|
||||
extern "C" {
|
||||
#include "opus/opus_multistream.h"
|
||||
}
|
||||
#endif
|
||||
#include "mozilla/dom/TimeRanges.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
#include "VorbisUtils.h"
|
||||
@ -62,9 +60,7 @@ static const uint32_t SEEK_FUZZ_USECS = 500000;
|
||||
|
||||
// The number of microseconds of "pre-roll" we use for Opus streams.
|
||||
// The specification recommends 80 ms.
|
||||
#ifdef MOZ_OPUS
|
||||
static const int64_t SEEK_OPUS_PREROLL = 80 * USECS_PER_MS;
|
||||
#endif /* MOZ_OPUS */
|
||||
|
||||
enum PageSyncResult {
|
||||
PAGE_SYNC_ERROR = 1,
|
||||
@ -136,10 +132,8 @@ OggReader::OggReader(AbstractMediaDecoder* aDecoder)
|
||||
mMonitor("OggReader"),
|
||||
mTheoraState(nullptr),
|
||||
mVorbisState(nullptr),
|
||||
#ifdef MOZ_OPUS
|
||||
mOpusState(nullptr),
|
||||
mOpusEnabled(MediaDecoder::IsOpusEnabled()),
|
||||
#endif /* MOZ_OPUS */
|
||||
mSkeletonState(nullptr),
|
||||
mVorbisSerial(0),
|
||||
mOpusSerial(0),
|
||||
@ -183,11 +177,9 @@ nsresult OggReader::ResetDecode(bool start)
|
||||
if (mVorbisState && NS_FAILED(mVorbisState->Reset())) {
|
||||
res = NS_ERROR_FAILURE;
|
||||
}
|
||||
#ifdef MOZ_OPUS
|
||||
if (mOpusState && NS_FAILED(mOpusState->Reset(start))) {
|
||||
res = NS_ERROR_FAILURE;
|
||||
}
|
||||
#endif /* MOZ_OPUS */
|
||||
if (mTheoraState && NS_FAILED(mTheoraState->Reset())) {
|
||||
res = NS_ERROR_FAILURE;
|
||||
}
|
||||
@ -217,10 +209,8 @@ void OggReader::BuildSerialList(nsTArray<uint32_t>& aTracks)
|
||||
if (HasAudio()) {
|
||||
if (mVorbisState) {
|
||||
aTracks.AppendElement(mVorbisState->mSerial);
|
||||
#ifdef MOZ_OPUS
|
||||
} else if (mOpusState) {
|
||||
aTracks.AppendElement(mOpusState->mSerial);
|
||||
#endif /* MOZ_OPUS */
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -359,7 +349,6 @@ void OggReader::SetupMediaTracksInfo(const nsTArray<uint32_t>& aSerials)
|
||||
mInfo.mAudio.mHasAudio = true;
|
||||
mInfo.mAudio.mRate = vorbisState->mInfo.rate;
|
||||
mInfo.mAudio.mChannels = vorbisState->mInfo.channels;
|
||||
#ifdef MOZ_OPUS
|
||||
} else if (codecState->GetType() == OggCodecState::TYPE_OPUS) {
|
||||
OpusState* opusState = static_cast<OpusState*>(codecState);
|
||||
if (!(mOpusState && mOpusState->mSerial == opusState->mSerial)) {
|
||||
@ -373,7 +362,6 @@ void OggReader::SetupMediaTracksInfo(const nsTArray<uint32_t>& aSerials)
|
||||
mInfo.mAudio.mHasAudio = true;
|
||||
mInfo.mAudio.mRate = opusState->mRate;
|
||||
mInfo.mAudio.mChannels = opusState->mChannels;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -450,7 +438,6 @@ nsresult OggReader::ReadMetadata(MediaInfo* aInfo,
|
||||
} else {
|
||||
s->Deactivate();
|
||||
}
|
||||
#ifdef MOZ_OPUS
|
||||
} else if (s->GetType() == OggCodecState::TYPE_OPUS && ReadHeaders(s)) {
|
||||
if (mOpusEnabled) {
|
||||
if (!mOpusState) {
|
||||
@ -464,7 +451,6 @@ nsresult OggReader::ReadMetadata(MediaInfo* aInfo,
|
||||
NS_WARNING("Opus decoding disabled."
|
||||
" See media.opus.enabled in about:config");
|
||||
}
|
||||
#endif // MOZ_OPUS
|
||||
} else if (s->GetType() == OggCodecState::TYPE_SKELETON && !mSkeletonState) {
|
||||
mSkeletonState = static_cast<SkeletonState*>(s);
|
||||
} else {
|
||||
@ -570,7 +556,7 @@ nsresult OggReader::DecodeVorbis(ogg_packet* aPacket) {
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
#ifdef MOZ_OPUS
|
||||
|
||||
nsresult OggReader::DecodeOpus(ogg_packet* aPacket) {
|
||||
NS_ASSERTION(aPacket->granulepos != -1, "Must know opus granulepos!");
|
||||
|
||||
@ -682,16 +668,12 @@ nsresult OggReader::DecodeOpus(ogg_packet* aPacket) {
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
#endif /* MOZ_OPUS */
|
||||
|
||||
bool OggReader::DecodeAudioData()
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
DebugOnly<bool> haveCodecState = mVorbisState != nullptr
|
||||
#ifdef MOZ_OPUS
|
||||
|| mOpusState != nullptr
|
||||
#endif /* MOZ_OPUS */
|
||||
;
|
||||
DebugOnly<bool> haveCodecState = mVorbisState != nullptr ||
|
||||
mOpusState != nullptr;
|
||||
NS_ASSERTION(haveCodecState, "Need audio codec state to decode audio");
|
||||
|
||||
// Read the next data packet. Skip any non-data packets we encounter.
|
||||
@ -699,10 +681,8 @@ bool OggReader::DecodeAudioData()
|
||||
OggCodecState* codecState;
|
||||
if (mVorbisState)
|
||||
codecState = static_cast<OggCodecState*>(mVorbisState);
|
||||
#ifdef MOZ_OPUS
|
||||
else
|
||||
codecState = static_cast<OggCodecState*>(mOpusState);
|
||||
#endif /* MOZ_OPUS */
|
||||
do {
|
||||
if (packet) {
|
||||
OggCodecState::ReleasePacket(packet);
|
||||
@ -719,10 +699,8 @@ bool OggReader::DecodeAudioData()
|
||||
nsAutoRef<ogg_packet> autoRelease(packet);
|
||||
if (mVorbisState) {
|
||||
DecodeVorbis(packet);
|
||||
#ifdef MOZ_OPUS
|
||||
} else if (mOpusState) {
|
||||
DecodeOpus(packet);
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((packet->e_o_s) && (!ReadOggChain())) {
|
||||
@ -749,9 +727,7 @@ void OggReader::SetChained(bool aIsChained) {
|
||||
bool OggReader::ReadOggChain()
|
||||
{
|
||||
bool chained = false;
|
||||
#ifdef MOZ_OPUS
|
||||
OpusState* newOpusState = nullptr;
|
||||
#endif /* MOZ_OPUS */
|
||||
VorbisState* newVorbisState = nullptr;
|
||||
nsAutoPtr<MetadataTags> tags;
|
||||
|
||||
@ -778,11 +754,9 @@ bool OggReader::ReadOggChain()
|
||||
if (mVorbisState && (codecState->GetType() == OggCodecState::TYPE_VORBIS)) {
|
||||
newVorbisState = static_cast<VorbisState*>(codecState.get());
|
||||
}
|
||||
#ifdef MOZ_OPUS
|
||||
else if (mOpusState && (codecState->GetType() == OggCodecState::TYPE_OPUS)) {
|
||||
newOpusState = static_cast<OpusState*>(codecState.get());
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
@ -819,7 +793,6 @@ bool OggReader::ReadOggChain()
|
||||
tags = newVorbisState->GetTags();
|
||||
}
|
||||
|
||||
#ifdef MOZ_OPUS
|
||||
if ((newOpusState && ReadHeaders(newOpusState)) &&
|
||||
(mOpusState->mRate == newOpusState->mRate) &&
|
||||
(mOpusState->mChannels == newOpusState->mChannels)) {
|
||||
@ -835,7 +808,6 @@ bool OggReader::ReadOggChain()
|
||||
chained = true;
|
||||
tags = newOpusState->GetTags();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (chained) {
|
||||
SetChained(true);
|
||||
@ -1441,12 +1413,10 @@ nsresult OggReader::SeekInUnbuffered(int64_t aTarget,
|
||||
if (HasVideo() && mTheoraState) {
|
||||
keyframeOffsetMs = mTheoraState->MaxKeyframeOffset();
|
||||
}
|
||||
#ifdef MOZ_OPUS
|
||||
// Add in the Opus pre-roll if necessary, as well.
|
||||
if (HasAudio() && mOpusState) {
|
||||
keyframeOffsetMs = std::max(keyframeOffsetMs, SEEK_OPUS_PREROLL);
|
||||
}
|
||||
#endif /* MOZ_OPUS */
|
||||
int64_t seekTarget = std::max(aStartTime, aTarget - keyframeOffsetMs);
|
||||
// Minimize the bisection search space using the known timestamps from the
|
||||
// buffered ranges.
|
||||
@ -1476,11 +1446,9 @@ nsresult OggReader::SeekInternal(int64_t aTarget,
|
||||
MediaResource* resource = mDecoder->GetResource();
|
||||
NS_ENSURE_TRUE(resource != nullptr, NS_ERROR_FAILURE);
|
||||
int64_t adjustedTarget = aTarget;
|
||||
#ifdef MOZ_OPUS
|
||||
if (HasAudio() && mOpusState){
|
||||
adjustedTarget = std::max(aStartTime, aTarget - SEEK_OPUS_PREROLL);
|
||||
}
|
||||
#endif /* MOZ_OPUS */
|
||||
|
||||
if (adjustedTarget == aStartTime) {
|
||||
// We've seeked to the media start. Just seek to the offset of the first
|
||||
@ -1788,10 +1756,8 @@ nsresult OggReader::SeekBisection(int64_t aTarget,
|
||||
if (HasAudio() && granulepos > 0 && audioTime == -1) {
|
||||
if (mVorbisState && serial == mVorbisState->mSerial) {
|
||||
audioTime = mVorbisState->Time(granulepos);
|
||||
#ifdef MOZ_OPUS
|
||||
} else if (mOpusState && serial == mOpusState->mSerial) {
|
||||
audioTime = mOpusState->Time(granulepos);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -1966,12 +1932,10 @@ nsresult OggReader::GetBuffered(dom::TimeRanges* aBuffered)
|
||||
startTime = VorbisState::Time(&mVorbisInfo, granulepos);
|
||||
NS_ASSERTION(startTime > 0, "Must have positive start time");
|
||||
}
|
||||
#ifdef MOZ_OPUS
|
||||
else if (mOpusState && serial == mOpusSerial) {
|
||||
startTime = OpusState::Time(mOpusPreSkip, granulepos);
|
||||
NS_ASSERTION(startTime > 0, "Must have positive start time");
|
||||
}
|
||||
#endif /* MOZ_OPUS */
|
||||
else if (mTheoraState && serial == mTheoraSerial) {
|
||||
startTime = TheoraState::Time(&mTheoraInfo, granulepos);
|
||||
NS_ASSERTION(startTime > 0, "Must have positive start time");
|
||||
|
@ -65,11 +65,8 @@ public:
|
||||
int64_t aTimeThreshold);
|
||||
|
||||
virtual bool HasAudio() {
|
||||
return (mVorbisState != 0 && mVorbisState->mActive)
|
||||
#ifdef MOZ_OPUS
|
||||
|| (mOpusState != 0 && mOpusState->mActive)
|
||||
#endif /* MOZ_OPUS */
|
||||
;
|
||||
return (mVorbisState != 0 && mVorbisState->mActive) ||
|
||||
(mOpusState != 0 && mOpusState->mActive);
|
||||
}
|
||||
|
||||
virtual bool HasVideo() {
|
||||
@ -285,7 +282,6 @@ private:
|
||||
// Decode state of the Vorbis bitstream we're decoding, if we have audio.
|
||||
VorbisState* mVorbisState;
|
||||
|
||||
#ifdef MOZ_OPUS
|
||||
// Decode state of the Opus bitstream we're decoding, if we have one.
|
||||
OpusState *mOpusState;
|
||||
|
||||
@ -293,7 +289,6 @@ private:
|
||||
// contructor was called. We can't check it dynamically because
|
||||
// we're not on the main thread;
|
||||
bool mOpusEnabled;
|
||||
#endif /* MOZ_OPUS */
|
||||
|
||||
// Decode state of the Skeleton bitstream.
|
||||
SkeletonState* mSkeletonState;
|
||||
|
@ -169,11 +169,9 @@ WebMReader::WebMReader(AbstractMediaDecoder* aDecoder)
|
||||
: MediaDecoderReader(aDecoder)
|
||||
, mContext(nullptr)
|
||||
, mPacketCount(0)
|
||||
#ifdef MOZ_OPUS
|
||||
, mOpusDecoder(nullptr)
|
||||
, mSkip(0)
|
||||
, mSeekPreroll(0)
|
||||
#endif
|
||||
, mVideoTrack(0)
|
||||
, mAudioTrack(0)
|
||||
, mAudioStartUsec(-1)
|
||||
@ -184,9 +182,7 @@ WebMReader::WebMReader(AbstractMediaDecoder* aDecoder)
|
||||
, mLayersBackendType(layers::LayersBackend::LAYERS_NONE)
|
||||
, mHasVideo(false)
|
||||
, mHasAudio(false)
|
||||
#ifdef MOZ_OPUS
|
||||
, mPaddingDiscarded(false)
|
||||
#endif
|
||||
{
|
||||
MOZ_COUNT_CTOR(WebMReader);
|
||||
#ifdef PR_LOGGING
|
||||
@ -304,7 +300,6 @@ nsresult WebMReader::ResetDecode()
|
||||
// aren't fatal and it fails when ResetDecode is called at a
|
||||
// time when no vorbis data has been read.
|
||||
vorbis_synthesis_restart(&mVorbisDsp);
|
||||
#ifdef MOZ_OPUS
|
||||
} else if (mAudioCodec == NESTEGG_CODEC_OPUS) {
|
||||
if (mOpusDecoder) {
|
||||
// Reset the decoder.
|
||||
@ -312,7 +307,6 @@ nsresult WebMReader::ResetDecode()
|
||||
mSkip = mOpusParser->mPreSkip;
|
||||
mPaddingDiscarded = false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
mVideoPackets.Reset();
|
||||
@ -514,7 +508,6 @@ nsresult WebMReader::ReadMetadata(MediaInfo* aInfo,
|
||||
|
||||
mInfo.mAudio.mRate = mVorbisDsp.vi->rate;
|
||||
mInfo.mAudio.mChannels = mVorbisDsp.vi->channels;
|
||||
#ifdef MOZ_OPUS
|
||||
} else if (mAudioCodec == NESTEGG_CODEC_OPUS) {
|
||||
unsigned char* data = 0;
|
||||
size_t length = 0;
|
||||
@ -547,7 +540,6 @@ nsresult WebMReader::ReadMetadata(MediaInfo* aInfo,
|
||||
|
||||
mInfo.mAudio.mChannels = mOpusParser->mChannels;
|
||||
mSeekPreroll = params.seek_preroll;
|
||||
#endif
|
||||
} else {
|
||||
Cleanup();
|
||||
return NS_ERROR_FAILURE;
|
||||
@ -568,7 +560,6 @@ WebMReader::IsMediaSeekable()
|
||||
return mContext && nestegg_has_cues(mContext);
|
||||
}
|
||||
|
||||
#ifdef MOZ_OPUS
|
||||
bool WebMReader::InitOpusDecoder()
|
||||
{
|
||||
int r;
|
||||
@ -586,7 +577,6 @@ bool WebMReader::InitOpusDecoder()
|
||||
|
||||
return r == OPUS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool WebMReader::DecodeAudioPacket(nestegg_packet* aPacket, int64_t aOffset)
|
||||
{
|
||||
@ -653,11 +643,9 @@ bool WebMReader::DecodeAudioPacket(nestegg_packet* aPacket, int64_t aOffset)
|
||||
return false;
|
||||
}
|
||||
} else if (mAudioCodec == NESTEGG_CODEC_OPUS) {
|
||||
#ifdef MOZ_OPUS
|
||||
if (!DecodeOpus(data, length, aOffset, tstamp_usecs, aPacket)) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -739,7 +727,6 @@ bool WebMReader::DecodeVorbis(const unsigned char* aData, size_t aLength,
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef MOZ_OPUS
|
||||
bool WebMReader::DecodeOpus(const unsigned char* aData, size_t aLength,
|
||||
int64_t aOffset, uint64_t aTstampUsecs,
|
||||
nestegg_packet* aPacket)
|
||||
@ -876,7 +863,6 @@ bool WebMReader::DecodeOpus(const unsigned char* aData, size_t aLength,
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif /* MOZ_OPUS */
|
||||
|
||||
nsReturnRef<NesteggPacketHolder> WebMReader::NextPacket(TrackType aTrackType)
|
||||
{
|
||||
|
@ -24,9 +24,7 @@
|
||||
#include "vorbis/codec.h"
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_OPUS
|
||||
#include "OpusParser.h"
|
||||
#endif
|
||||
|
||||
// Holds a nestegg_packet, and its file offset. This is needed so we
|
||||
// know the offset in the file we've played up to, in order to calculate
|
||||
@ -190,10 +188,8 @@ public:
|
||||
MediaTaskQueue* GetTaskQueue() { return mTaskQueue; }
|
||||
|
||||
protected:
|
||||
#ifdef MOZ_OPUS
|
||||
// Setup opus decoder
|
||||
bool InitOpusDecoder();
|
||||
#endif
|
||||
|
||||
// Decode a nestegg packet of audio data. Push the audio data on the
|
||||
// audio queue. Returns true when there's more audio to decode,
|
||||
@ -205,11 +201,9 @@ protected:
|
||||
bool DecodeVorbis(const unsigned char* aData, size_t aLength,
|
||||
int64_t aOffset, uint64_t aTstampUsecs,
|
||||
int32_t* aTotalFrames);
|
||||
#ifdef MOZ_OPUS
|
||||
bool DecodeOpus(const unsigned char* aData, size_t aLength,
|
||||
int64_t aOffset, uint64_t aTstampUsecs,
|
||||
nestegg_packet* aPacket);
|
||||
#endif
|
||||
|
||||
// Release context and set to null. Called when an error occurs during
|
||||
// reading metadata or destruction of the reader itself.
|
||||
@ -235,13 +229,11 @@ private:
|
||||
vorbis_block mVorbisBlock;
|
||||
int64_t mPacketCount;
|
||||
|
||||
#ifdef MOZ_OPUS
|
||||
// Opus decoder state
|
||||
nsAutoPtr<OpusParser> mOpusParser;
|
||||
OpusMSDecoder *mOpusDecoder;
|
||||
uint16_t mSkip; // Samples left to trim before playback.
|
||||
uint64_t mSeekPreroll; // Nanoseconds to discard after seeking.
|
||||
#endif
|
||||
|
||||
// Queue of video and audio packets that have been read but not decoded. These
|
||||
// must only be accessed from the state machine thread.
|
||||
@ -288,12 +280,10 @@ private:
|
||||
bool mHasVideo;
|
||||
bool mHasAudio;
|
||||
|
||||
#ifdef MOZ_OPUS
|
||||
// Opus padding should only be discarded on the final packet. Once this
|
||||
// is set to true, if the reader attempts to decode any further packets it
|
||||
// will raise an error so we can indicate that the file is invalid.
|
||||
bool mPaddingDiscarded;
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
@ -153,7 +153,6 @@ th_info_init
|
||||
th_packet_isheader
|
||||
th_packet_iskeyframe
|
||||
th_setup_free
|
||||
#ifdef MOZ_OPUS
|
||||
opus_decoder_create
|
||||
opus_decoder_destroy
|
||||
opus_decoder_ctl
|
||||
@ -172,7 +171,6 @@ opus_encoder_destroy
|
||||
opus_encoder_ctl
|
||||
opus_encode
|
||||
opus_encode_float
|
||||
#endif
|
||||
#ifndef MOZ_NATIVE_PNG
|
||||
MOZ_APNG_get_first_frame_is_hidden
|
||||
MOZ_APNG_get_next_frame_blend_op
|
||||
|
@ -276,9 +276,7 @@ pref("media.fragmented-mp4.use-blank-decoder", false);
|
||||
pref("media.raw.enabled", true);
|
||||
#endif
|
||||
pref("media.ogg.enabled", true);
|
||||
#ifdef MOZ_OPUS
|
||||
pref("media.opus.enabled", true);
|
||||
#endif
|
||||
#ifdef MOZ_WAVE
|
||||
pref("media.wave.enabled", true);
|
||||
#endif
|
||||
|
@ -458,9 +458,7 @@ static nsDefaultMimeTypeEntry defaultMimeEntries [] =
|
||||
{ VIDEO_OGG, "ogg" },
|
||||
{ APPLICATION_OGG, "ogg" },
|
||||
{ AUDIO_OGG, "oga" },
|
||||
#ifdef MOZ_OPUS
|
||||
{ AUDIO_OGG, "opus" },
|
||||
#endif
|
||||
#ifdef MOZ_WEBM
|
||||
{ VIDEO_WEBM, "webm" },
|
||||
{ AUDIO_WEBM, "webm" },
|
||||
|
Loading…
Reference in New Issue
Block a user