Bug 1240630: [ffmpeg] P3. Only build FFmpeg on mac and unixes. r=kentuckyfriedtakahe
☠☠ backed out by 72660585b6a3 ☠ ☠
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 19 Jan 2016 22:00:03 +1100
changeset 303023 06abea99a29206ba64d2231ace8ac9d25b1da3a7
parent 303022 9d90d4b0b9289c2104420b323cd5ca4ea26fbede
child 303024 dc949ca1e1ecc7eb5324fc4d5e510ebbc9e2ee0b
push id8978
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 14:05:32 +0000
treeherdermozilla-aurora@b9a803752a2c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskentuckyfriedtakahe
bugs1240630, 1214462
milestone46.0a1
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
@@ -3736,17 +3736,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=
@@ -5224,16 +5224,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',