Bug 1240630: [ffmpeg] P3. Only build FFmpeg on mac and unixes. r=kentuckyfriedtakahe
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 19 Jan 2016 22:00:03 +1100
changeset 280922 162aaf87ac4550be7c09bcb84ab1486ae21d97bf
parent 280921 163314b3e52ab30f6ea40f96508d661d0c127276
child 280923 082d96361ca850d0274db9775a88123e3eafbbd9
push id70621
push userjyavenard@mozilla.com
push dateThu, 21 Jan 2016 13:21:02 +0000
treeherdermozilla-inbound@082d96361ca8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskentuckyfriedtakahe
bugs1240630, 1214462
milestone46.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1240630: [ffmpeg] P3. Only build FFmpeg on mac and unixes. r=kentuckyfriedtakahe This is a partial revert of bug 1214462 part2. We don't need FFmpeg support on Android or Windows anymore; instead the functionality is provided by the FFVPX PDM. Remove support for FFmpeg on Windows.
configure.in
dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp
dom/media/platforms/ffmpeg/ffmpeg57/moz.build
dom/media/platforms/ffmpeg/libav55/moz.build
dom/media/platforms/moz.build
--- a/configure.in
+++ b/configure.in
@@ -3741,17 +3741,17 @@ MOZ_SAMPLE_TYPE_FLOAT32=
 MOZ_SAMPLE_TYPE_S16=
 MOZ_DIRECTSHOW=
 MOZ_WMF=
 if test -n "$MOZ_FMP4"; then
   MOZ_FMP4=1
 else
   MOZ_FMP4=
 fi
-MOZ_FFMPEG=1
+MOZ_FFMPEG=
 MOZ_WEBRTC=1
 MOZ_PEERCONNECTION=
 MOZ_SRTP=
 MOZ_WEBRTC_SIGNALING=
 MOZ_WEBRTC_ASSERT_ALWAYS=1
 MOZ_WEBRTC_HARDWARE_AEC_NS=
 MOZ_SCTP=
 MOZ_ANDROID_OMX=
@@ -5229,16 +5229,24 @@ MOZ_ARG_DISABLE_BOOL(wmf,
 
 if test -n "$MOZ_WMF"; then
     AC_DEFINE(MOZ_WMF)
 fi;
 
 dnl ========================================================
 dnl FFmpeg H264/AAC Decoding Support
 dnl ========================================================
+case "$OS_TARGET" in
+WINNT|Android)
+    ;;
+*)
+    MOZ_FFMPEG=1
+    ;;
+esac
+
 MOZ_ARG_DISABLE_BOOL(ffmpeg,
 [  --disable-ffmpeg         Disable FFmpeg for fragmented H264/AAC decoding],
     MOZ_FFMPEG=,
     MOZ_FFMPEG=1
 )
 
 if test -n "$MOZ_FFMPEG"; then
     AC_DEFINE(MOZ_FFMPEG)
--- a/dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp
@@ -39,43 +39,40 @@ static const char* sLibs[] = {
   "libavcodec.so.53",
 #endif
 };
 
 PRLibrary* FFmpegRuntimeLinker::sLinkedLib = nullptr;
 PRLibrary* FFmpegRuntimeLinker::sLinkedUtilLib = nullptr;
 static unsigned (*avcodec_version)() = nullptr;
 
-#if !defined(XP_WIN)
 #ifdef __GNUC__
 #define AV_FUNC(func, ver) void (*func)();
 #define LIBAVCODEC_ALLVERSION
 #else
 #define AV_FUNC(func, ver) decltype(func)* func;
 #endif
 #include "FFmpegFunctionList.h"
 #undef AV_FUNC
-#endif
 
 static PRLibrary*
 MozAVLink(const char* aName)
 {
   PRLibSpec lspec;
   lspec.type = PR_LibSpec_Pathname;
   lspec.value.pathname = aName;
   return PR_LoadLibraryWithFlags(lspec, PR_LD_NOW | PR_LD_LOCAL);
 }
 
 /* static */ bool
 FFmpegRuntimeLinker::Link()
 {
   if (sLinkStatus) {
     return sLinkStatus == LinkStatus_SUCCEEDED;
   }
-#if !defined(XP_WIN)
   MOZ_ASSERT(NS_IsMainThread());
 
   for (size_t i = 0; i < ArrayLength(sLibs); i++) {
     const char* lib = sLibs[i];
     sLinkedLib = MozAVLink(lib);
     if (sLinkedLib) {
       sLinkedUtilLib = sLinkedLib;
       if (Bind(lib)) {
@@ -89,28 +86,24 @@ FFmpegRuntimeLinker::Link()
 
   FFMPEG_LOG("H264/AAC codecs unsupported without [");
   for (size_t i = 0; i < ArrayLength(sLibs); i++) {
     FFMPEG_LOG("%s %s", i ? "," : "", sLibs[i]);
   }
   FFMPEG_LOG(" ]\n");
 
   Unlink();
-#endif
 
   sLinkStatus = LinkStatus_FAILED;
   return false;
 }
 
 /* static */ bool
 FFmpegRuntimeLinker::Bind(const char* aLibName)
 {
-#if defined(XP_WIN)
-  return false;
-#else
   avcodec_version = (decltype(avcodec_version))PR_FindSymbol(sLinkedLib,
                                                            "avcodec_version");
   uint32_t major, minor, micro;
   if (!GetVersion(major, minor, micro)) {
     return false;
   }
 
   int version;
@@ -147,25 +140,21 @@ FFmpegRuntimeLinker::Bind(const char* aL
       return false;                                                            \
     }                                                                          \
   } else {                                                                     \
     func = (decltype(func))nullptr;                                            \
   }
 #include "FFmpegFunctionList.h"
 #undef AV_FUNC
   return true;
-#endif
 }
 
 /* static */ already_AddRefed<PlatformDecoderModule>
 FFmpegRuntimeLinker::CreateDecoderModule()
 {
-#if defined(XP_WIN)
-  return nullptr;
-#else
   if (!Link()) {
     return nullptr;
   }
   uint32_t major, minor, micro;
   if (!GetVersion(major, minor, micro)) {
     return  nullptr;
   }
 
@@ -174,17 +163,16 @@ FFmpegRuntimeLinker::CreateDecoderModule
     case 53: module = FFmpegDecoderModule<53>::Create(); break;
     case 54: module = FFmpegDecoderModule<54>::Create(); break;
     case 55:
     case 56: module = FFmpegDecoderModule<55>::Create(); break;
     case 57: module = FFmpegDecoderModule<57>::Create(); break;
     default: module = nullptr;
   }
   return module.forget();
-#endif
 }
 
 /* static */ void
 FFmpegRuntimeLinker::Unlink()
 {
   if (sLinkedUtilLib && sLinkedUtilLib != sLinkedLib) {
     PR_UnloadLibrary(sLinkedUtilLib);
   }
--- a/dom/media/platforms/ffmpeg/ffmpeg57/moz.build
+++ b/dom/media/platforms/ffmpeg/ffmpeg57/moz.build
@@ -16,14 +16,10 @@ LOCAL_INCLUDES += [
 ]
 
 if CONFIG['GNU_CXX']:
   CXXFLAGS += [ '-Wno-deprecated-declarations' ]
 if CONFIG['CLANG_CXX']:
   CXXFLAGS += [
     '-Wno-unknown-attributes',
   ]
-if CONFIG['_MSC_VER']:
-  CXXFLAGS += [
-    '-wd4996', # deprecated declaration
-  ]
 
 FINAL_LIBRARY = 'xul'
--- a/dom/media/platforms/ffmpeg/libav55/moz.build
+++ b/dom/media/platforms/ffmpeg/libav55/moz.build
@@ -16,14 +16,10 @@ LOCAL_INCLUDES += [
 ]
 
 if CONFIG['GNU_CXX']:
   CXXFLAGS += [ '-Wno-deprecated-declarations' ]
 if CONFIG['CLANG_CXX']:
   CXXFLAGS += [
     '-Wno-unknown-attributes',
   ]
-if CONFIG['_MSC_VER']:
-  CXXFLAGS += [
-    '-wd4996', # deprecated declaration
-  ]
 
 FINAL_LIBRARY = 'xul'
--- a/dom/media/platforms/moz.build
+++ b/dom/media/platforms/moz.build
@@ -33,34 +33,34 @@ DIRS += [
 ]
 
 if CONFIG['MOZ_WMF']:
     DIRS += [ 'wmf' ];
 
 if CONFIG['MOZ_EME']:
     DIRS += ['agnostic/eme']
 
+if CONFIG['MOZ_FFVPX']:
+    DIRS += [
+        'ffmpeg/ffvpx',
+    ]
+
 if CONFIG['MOZ_FFMPEG']:
     EXPORTS += [
         'ffmpeg/FFmpegRuntimeLinker.h',
     ]
     UNIFIED_SOURCES += [
         'ffmpeg/FFmpegRuntimeLinker.cpp',
     ]
-    if CONFIG['MOZ_FFVPX']:
-        DIRS += [
-            'ffmpeg/ffvpx',
-        ]
-    if CONFIG['OS_ARCH'] != 'WINNT':
-        DIRS += [
-            'ffmpeg/libav53',
-            'ffmpeg/libav54',
-            'ffmpeg/libav55',
-            'ffmpeg/ffmpeg57',
-        ]
+    DIRS += [
+        'ffmpeg/libav53',
+        'ffmpeg/libav54',
+        'ffmpeg/libav55',
+        'ffmpeg/ffmpeg57',
+    ]
 
 if CONFIG['MOZ_APPLEMEDIA']:
   EXPORTS += [
       'apple/AppleDecoderModule.h',
   ]
   UNIFIED_SOURCES += [
       'apple/AppleATDecoder.cpp',
       'apple/AppleCMLinker.cpp',