diff --git a/config/external/moz.build b/config/external/moz.build index c22a36cd7359..f67c5c7948e8 100644 --- a/config/external/moz.build +++ b/config/external/moz.build @@ -33,15 +33,14 @@ if CONFIG['MOZ_WEBM_ENCODER']: if CONFIG['MOZ_VPX'] and not CONFIG['MOZ_NATIVE_LIBVPX']: external_dirs += ['media/libvpx'] -if CONFIG['MOZ_OGG']: - external_dirs += ['media/libogg', 'media/libtheora'] - if not CONFIG['MOZ_NATIVE_PNG']: external_dirs += ['media/libpng'] external_dirs += [ 'media/kiss_fft', 'media/libcubeb', + 'media/libogg', + 'media/libtheora', 'media/libspeex_resampler', 'media/libsoundtouch', ] diff --git a/configure.in b/configure.in index b49a29c58430..8bc0a3ebb577 100644 --- a/configure.in +++ b/configure.in @@ -3867,7 +3867,6 @@ MOZ_FEEDS=1 MOZ_WEBAPP_RUNTIME= MOZ_JSDEBUGGER=1 MOZ_AUTH_EXTENSION=1 -MOZ_OGG=1 MOZ_RAW= MOZ_VORBIS= MOZ_TREMOR= @@ -5109,37 +5108,25 @@ fi AC_SUBST(MOZ_RAW) -dnl ======================================================== -dnl = Disable Ogg Codecs -dnl ======================================================== -MOZ_ARG_DISABLE_BOOL(ogg, -[ --disable-ogg Disable support for OGG media (Theora video and Vorbis audio)], - MOZ_OGG=, - MOZ_OGG=1) - -if test -n "$MOZ_OGG"; then - AC_DEFINE(MOZ_OGG) - - dnl Checks for __attribute__(aligned()) directive - AC_CACHE_CHECK([__attribute__ ((aligned ())) support], - [ac_cv_c_attribute_aligned], - [ac_cv_c_attribute_aligned=0 - CFLAGS_save="${CFLAGS}" - CFLAGS="${CFLAGS} -Werror" - for ac_cv_c_attr_align_try in 64 32 16 8; do - echo "trying $ac_cv_c_attr_align_try" - AC_TRY_COMPILE([], - [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;], - [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"]) - if test "$ac_cv_c_attribute_aligned" != 0; then - break; - fi - done - CFLAGS="${CFLAGS_save}"]) - if test "${ac_cv_c_attribute_aligned}" != "0"; then - AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX], - [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment]) - fi +dnl Checks for __attribute__(aligned()) directive need by libogg +AC_CACHE_CHECK([__attribute__ ((aligned ())) support], + [ac_cv_c_attribute_aligned], + [ac_cv_c_attribute_aligned=0 + CFLAGS_save="${CFLAGS}" + CFLAGS="${CFLAGS} -Werror" + for ac_cv_c_attr_align_try in 64 32 16 8; do + echo "trying $ac_cv_c_attr_align_try" + AC_TRY_COMPILE([], + [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;], + [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"]) + if test "$ac_cv_c_attribute_aligned" != 0; then + break; + fi + done + CFLAGS="${CFLAGS_save}"]) +if test "${ac_cv_c_attribute_aligned}" != "0"; then + AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX], + [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment]) fi dnl ======================================================== @@ -5323,7 +5310,7 @@ AC_SUBST(MOZ_NATIVE_LIBVPX) AC_SUBST(MOZ_LIBVPX_CFLAGS) AC_SUBST(MOZ_LIBVPX_LIBS) -if test "$MOZ_WEBM" -o "$MOZ_OGG"; then +if test "$MOZ_WEBM"; then if test "$MOZ_SAMPLE_TYPE_FLOAT32"; then MOZ_VORBIS=1 else @@ -5430,15 +5417,6 @@ dnl ======================================================== dnl = Handle dependent MEDIA defines dnl ======================================================== -if test -n "$MOZ_OPUS" -a -z "$MOZ_OGG"; then - AC_MSG_ERROR([MOZ_OPUS requires MOZ_OGG which is disabled.]) -fi - -if test -n "$MOZ_VORBIS" -a -z "$MOZ_OGG"; then - AC_MSG_ERROR([MOZ_VORBIS requires MOZ_OGG which is disabled. -Note that you need vorbis support for WebM playback.]) -fi - 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 @@ -8619,7 +8597,6 @@ AC_SUBST(MOZ_APPLEMEDIA) AC_SUBST(MOZ_OMX_PLUGIN) AC_SUBST(MOZ_VPX_ERROR_CONCEALMENT) AC_SUBST(MOZ_VPX) -AC_SUBST(MOZ_OGG) AC_SUBST(VPX_AS) AC_SUBST(VPX_ASFLAGS) AC_SUBST(VPX_DASH_C_FLAG) diff --git a/content/html/content/src/HTMLAudioElement.cpp b/content/html/content/src/HTMLAudioElement.cpp index d2c170b11279..52426590559e 100644 --- a/content/html/content/src/HTMLAudioElement.cpp +++ b/content/html/content/src/HTMLAudioElement.cpp @@ -205,16 +205,12 @@ nsresult HTMLAudioElement::SetAcceptHeader(nsIHttpChannel* aChannel) #ifdef MOZ_WEBM "audio/webm," #endif -#ifdef MOZ_OGG "audio/ogg," -#endif #ifdef MOZ_WAVE "audio/wav," #endif "audio/*;q=0.9," -#ifdef MOZ_OGG "application/ogg;q=0.7," -#endif "video/*;q=0.6,*/*;q=0.5"); return aChannel->SetRequestHeader(NS_LITERAL_CSTRING("Accept"), diff --git a/content/html/content/src/HTMLVideoElement.cpp b/content/html/content/src/HTMLVideoElement.cpp index 0d096acc8f9a..2a48392d3239 100644 --- a/content/html/content/src/HTMLVideoElement.cpp +++ b/content/html/content/src/HTMLVideoElement.cpp @@ -137,13 +137,9 @@ nsresult HTMLVideoElement::SetAcceptHeader(nsIHttpChannel* aChannel) #ifdef MOZ_WEBM "video/webm," #endif -#ifdef MOZ_OGG "video/ogg," -#endif "video/*;q=0.9," -#ifdef MOZ_OGG "application/ogg;q=0.7," -#endif "audio/*;q=0.6,*/*;q=0.5"); return aChannel->SetRequestHeader(NS_LITERAL_CSTRING("Accept"), diff --git a/content/media/DecoderTraits.cpp b/content/media/DecoderTraits.cpp index 480bc7cbb7a4..934728361a05 100644 --- a/content/media/DecoderTraits.cpp +++ b/content/media/DecoderTraits.cpp @@ -13,10 +13,8 @@ #include "MediaPluginHost.h" #endif -#ifdef MOZ_OGG #include "OggDecoder.h" #include "OggReader.h" -#endif #ifdef MOZ_WAVE #include "WaveDecoder.h" #include "WaveReader.h" @@ -102,7 +100,6 @@ IsRawType(const nsACString& aType) } #endif -#ifdef MOZ_OGG // See http://www.rfc-editor.org/rfc/rfc5334.txt for the definitions // of Ogg media types and codec types static const char* const gOggTypes[4] = { @@ -134,7 +131,6 @@ IsOggType(const nsACString& aType) return CodecListContains(gOggTypes, aType); } -#endif #ifdef MOZ_WAVE // See http://www.rfc-editor.org/rfc/rfc2361.txt for the definitions @@ -203,10 +199,8 @@ IsGStreamerSupportedType(const nsACString& aMimeType) if (IsWebMType(aMimeType) && !Preferences::GetBool("media.prefer-gstreamer", false)) return false; #endif -#ifdef MOZ_OGG if (IsOggType(aMimeType) && !Preferences::GetBool("media.prefer-gstreamer", false)) return false; -#endif return GStreamerDecoder::CanHandleMediaType(aMimeType, nullptr); } @@ -376,12 +370,10 @@ DecoderTraits::CanHandleMediaType(const char* aMIMEType, result = CANPLAY_MAYBE; } #endif -#ifdef MOZ_OGG if (IsOggType(nsDependentCString(aMIMEType))) { codecList = MediaDecoder::IsOpusEnabled() ? gOggCodecsWithOpus : gOggCodecs; result = CANPLAY_MAYBE; } -#endif #ifdef MOZ_WAVE if (IsWaveType(nsDependentCString(aMIMEType))) { codecList = gWaveCodecs; @@ -480,12 +472,10 @@ InstantiateDecoder(const nsACString& aType, MediaDecoderOwner* aOwner) return decoder.forget(); } #endif -#ifdef MOZ_OGG if (IsOggType(aType)) { decoder = new OggDecoder(); return decoder.forget(); } -#endif #ifdef MOZ_WAVE if (IsWaveType(aType)) { decoder = new WaveDecoder(); @@ -590,11 +580,9 @@ MediaDecoderReader* DecoderTraits::CreateReader(const nsACString& aType, Abstrac decoderReader = new RawReader(aDecoder); } else #endif -#ifdef MOZ_OGG if (IsOggType(aType)) { decoderReader = new OggReader(aDecoder); } else -#endif #ifdef MOZ_WAVE if (IsWaveType(aType)) { decoderReader = new WaveReader(aDecoder); @@ -647,9 +635,7 @@ MediaDecoderReader* DecoderTraits::CreateReader(const nsACString& aType, Abstrac bool DecoderTraits::IsSupportedInVideoDocument(const nsACString& aType) { return -#ifdef MOZ_OGG IsOggType(aType) || -#endif #ifdef MOZ_OMX_DECODER // We support amr inside WebApps on firefoxOS but not in general web content. // Ensure we dont create a VideoDocument when accessing amr URLs directly. diff --git a/content/media/MediaDecoder.cpp b/content/media/MediaDecoder.cpp index 64ff279b07d3..93274f6d46c6 100644 --- a/content/media/MediaDecoder.cpp +++ b/content/media/MediaDecoder.cpp @@ -1735,7 +1735,6 @@ MediaDecoder::IsRawEnabled() } #endif -#ifdef MOZ_OGG bool MediaDecoder::IsOpusEnabled() { @@ -1751,7 +1750,6 @@ MediaDecoder::IsOggEnabled() { return Preferences::GetBool("media.ogg.enabled"); } -#endif #ifdef MOZ_WAVE bool diff --git a/content/media/MediaDecoder.h b/content/media/MediaDecoder.h index 151b4978ca81..99f85953f912 100644 --- a/content/media/MediaDecoder.h +++ b/content/media/MediaDecoder.h @@ -816,10 +816,8 @@ public: static bool IsRawEnabled(); #endif -#ifdef MOZ_OGG static bool IsOggEnabled(); static bool IsOpusEnabled(); -#endif #ifdef MOZ_WAVE static bool IsWaveEnabled(); diff --git a/content/media/encoder/MediaEncoder.cpp b/content/media/encoder/MediaEncoder.cpp index bd76a4d65846..1b601b021541 100644 --- a/content/media/encoder/MediaEncoder.cpp +++ b/content/media/encoder/MediaEncoder.cpp @@ -9,9 +9,7 @@ #include "prlog.h" #include "mozilla/Preferences.h" -#ifdef MOZ_OGG #include "OggWriter.h" -#endif #ifdef MOZ_OPUS #include "OpusTrackEncoder.h" @@ -127,7 +125,6 @@ MediaEncoder::CreateEncoder(const nsAString& aMIMEType, uint8_t aTrackTypes) mimeType = NS_LITERAL_STRING(VIDEO_MP4); } #endif // MOZ_OMX_ENCODER -#ifdef MOZ_OGG else if (MediaDecoder::IsOggEnabled() && MediaDecoder::IsOpusEnabled() && (aMIMEType.EqualsLiteral(AUDIO_OGG) || (aTrackTypes & ContainerWriter::CREATE_AUDIO_TRACK))) { @@ -137,7 +134,6 @@ MediaEncoder::CreateEncoder(const nsAString& aMIMEType, uint8_t aTrackTypes) NS_ENSURE_TRUE(audioEncoder, nullptr); mimeType = NS_LITERAL_STRING(AUDIO_OGG); } -#endif // MOZ_OGG else { LOG(PR_LOG_ERROR, ("Can not find any encoder to record this media stream")); return nullptr; diff --git a/content/media/moz.build b/content/media/moz.build index 528126b353d7..e45776bba749 100644 --- a/content/media/moz.build +++ b/content/media/moz.build @@ -7,6 +7,7 @@ PARALLEL_DIRS += [ 'encoder', 'mediasource', + 'ogg', 'webaudio', 'webvtt' ] @@ -14,9 +15,6 @@ PARALLEL_DIRS += [ if CONFIG['MOZ_RAW']: PARALLEL_DIRS += ['raw'] -if CONFIG['MOZ_OGG']: - PARALLEL_DIRS += ['ogg'] - if CONFIG['MOZ_WAVE']: PARALLEL_DIRS += ['wave'] diff --git a/layout/media/symbols.def.in b/layout/media/symbols.def.in index 84fc943f30d0..e87c3282c846 100644 --- a/layout/media/symbols.def.in +++ b/layout/media/symbols.def.in @@ -140,7 +140,6 @@ cubeb_stream_init cubeb_stream_start cubeb_stream_stop cubeb_stream_get_latency -#ifdef MOZ_OGG th_comment_clear th_comment_init th_decode_alloc @@ -154,7 +153,6 @@ th_info_init th_packet_isheader th_packet_iskeyframe th_setup_free -#endif #ifdef MOZ_OPUS opus_decoder_create opus_decoder_destroy diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js index d1af2836ce41..bbc980ee530f 100644 --- a/modules/libpref/src/init/all.js +++ b/modules/libpref/src/init/all.js @@ -208,9 +208,7 @@ pref("media.fragmented-mp4.use-blank-decoder", false); #ifdef MOZ_RAW pref("media.raw.enabled", true); #endif -#ifdef MOZ_OGG pref("media.ogg.enabled", true); -#endif #ifdef MOZ_OPUS pref("media.opus.enabled", true); #endif diff --git a/python/mozbuild/mozbuild/mozinfo.py b/python/mozbuild/mozbuild/mozinfo.py index 6fb35fedc78e..6e6bf56e50ac 100755 --- a/python/mozbuild/mozbuild/mozinfo.py +++ b/python/mozbuild/mozbuild/mozinfo.py @@ -83,7 +83,7 @@ def build_dict(config, env=os.environ): d['tests_enabled'] = substs.get('ENABLE_TESTS') == "1" d['bin_suffix'] = substs.get('BIN_SUFFIX', '') - d['ogg'] = bool(substs.get('MOZ_OGG')) + d['ogg'] = True d['webm'] = bool(substs.get('MOZ_WEBM')) d['wave'] = bool(substs.get('MOZ_WAVE')) diff --git a/uriloader/exthandler/nsExternalHelperAppService.cpp b/uriloader/exthandler/nsExternalHelperAppService.cpp index 66e8a70a361f..1c35fc94bf4e 100644 --- a/uriloader/exthandler/nsExternalHelperAppService.cpp +++ b/uriloader/exthandler/nsExternalHelperAppService.cpp @@ -432,7 +432,6 @@ static nsDefaultMimeTypeEntry defaultMimeEntries [] = { "application/xhtml+xml", "xhtml" }, { "application/xhtml+xml", "xht" }, { TEXT_PLAIN, "txt" }, -#ifdef MOZ_OGG { VIDEO_OGG, "ogv" }, { VIDEO_OGG, "ogg" }, { APPLICATION_OGG, "ogg" }, @@ -440,7 +439,6 @@ static nsDefaultMimeTypeEntry defaultMimeEntries [] = #ifdef MOZ_OPUS { AUDIO_OGG, "opus" }, #endif -#endif #ifdef MOZ_WEBM { VIDEO_WEBM, "webm" }, { AUDIO_WEBM, "webm" },