[FFmpeg-cvslog] Merge commit '6bb99757b780144d9fa27cdce09d3621e1a0ed43'

Derek Buitenhuis git at videolan.org
Mon May 9 00:03:09 CEST 2016


ffmpeg | branch: master | Derek Buitenhuis <derek.buitenhuis at gmail.com> | Sun May  8 23:01:58 2016 +0100| [dc0152548f03ec83a48d5419143d14fd7878b8f3] | committer: Derek Buitenhuis

Merge commit '6bb99757b780144d9fa27cdce09d3621e1a0ed43'

* commit '6bb99757b780144d9fa27cdce09d3621e1a0ed43':
  jack: Support OSX

Merged-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dc0152548f03ec83a48d5419143d14fd7878b8f3
---

 compat/dispatch_semaphore/semaphore.h |   42 +++++++++++++++++++++++++++++++++
 configure                             |    6 ++++-
 2 files changed, 47 insertions(+), 1 deletion(-)

diff --git a/compat/dispatch_semaphore/semaphore.h b/compat/dispatch_semaphore/semaphore.h
new file mode 100644
index 0000000..008c637
--- /dev/null
+++ b/compat/dispatch_semaphore/semaphore.h
@@ -0,0 +1,42 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef COMPAT_DISPATCH_SEMAPHORE_SEMAPHORE_H
+#define COMPAT_DISPATCH_SEMAPHORE_SEMAPHORE_H
+
+#include <dispatch/dispatch.h>
+#include <errno.h>
+
+#define sem_t dispatch_semaphore_t
+#define sem_post(psem)              dispatch_semaphore_signal(*psem)
+#define sem_wait(psem)              dispatch_semaphore_wait(*psem, DISPATCH_TIME_FOREVER)
+#define sem_timedwait(psem, val)    dispatch_semaphore_wait(*psem, dispatch_walltime(val, 0))
+#define sem_destroy(psem)           dispatch_release(*psem)
+
+static inline int compat_sem_init(dispatch_semaphore_t *psem,
+                                  int unused, int val)
+{
+    int ret = !!(*psem = dispatch_semaphore_create(val)) - 1;
+    if (ret < 0)
+        errno = ENOMEM;
+    return ret;
+}
+
+#define sem_init compat_sem_init
+
+#endif /* COMPAT_DISPATCH_SEMAPHORE_SEMAPHORE_H */
diff --git a/configure b/configure
index 21808ea..bbf5709 100755
--- a/configure
+++ b/configure
@@ -4615,7 +4615,8 @@ case $target_os in
         enabled x86_64 && objformat="macho64"
         enabled_any pic shared x86_64 ||
             { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
-        check_header dispatch/dispatch.h
+        check_header dispatch/dispatch.h &&
+            add_cppflags '-I\$(SRC_PATH)/compat/dispatch_semaphore'
         ;;
     msys*)
         die "Native MSYS builds are discouraged, please use the MINGW environment.";
@@ -5522,6 +5523,9 @@ if enabled pthreads; then
   check_func pthread_cancel
 fi
 
+enabled pthreads &&
+    check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)"
+
 disabled  zlib || check_lib   zlib.h      zlibVersion -lz   || disable  zlib
 disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
 disabled  lzma || check_lib2  lzma.h lzma_version_number -llzma || disable lzma


======================================================================

diff --cc compat/dispatch_semaphore/semaphore.h
index 0000000,2461daf..008c637
mode 000000,100644..100644
--- a/compat/dispatch_semaphore/semaphore.h
+++ b/compat/dispatch_semaphore/semaphore.h
@@@ -1,0 -1,42 +1,42 @@@
+ /*
 - * This file is part of Libav.
++ * This file is part of FFmpeg.
+  *
 - * Libav is free software; you can redistribute it and/or
++ * FFmpeg is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU Lesser General Public
+  * License as published by the Free Software Foundation; either
+  * version 2.1 of the License, or (at your option) any later version.
+  *
 - * Libav is distributed in the hope that it will be useful,
++ * FFmpeg is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
 - * License along with Libav; if not, write to the Free Software
++ * License along with FFmpeg; if not, write to the Free Software
+  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+  */
+ 
+ #ifndef COMPAT_DISPATCH_SEMAPHORE_SEMAPHORE_H
+ #define COMPAT_DISPATCH_SEMAPHORE_SEMAPHORE_H
+ 
+ #include <dispatch/dispatch.h>
+ #include <errno.h>
+ 
+ #define sem_t dispatch_semaphore_t
+ #define sem_post(psem)              dispatch_semaphore_signal(*psem)
+ #define sem_wait(psem)              dispatch_semaphore_wait(*psem, DISPATCH_TIME_FOREVER)
+ #define sem_timedwait(psem, val)    dispatch_semaphore_wait(*psem, dispatch_walltime(val, 0))
+ #define sem_destroy(psem)           dispatch_release(*psem)
+ 
+ static inline int compat_sem_init(dispatch_semaphore_t *psem,
+                                   int unused, int val)
+ {
+     int ret = !!(*psem = dispatch_semaphore_create(val)) - 1;
+     if (ret < 0)
+         errno = ENOMEM;
+     return ret;
+ }
+ 
+ #define sem_init compat_sem_init
+ 
+ #endif /* COMPAT_DISPATCH_SEMAPHORE_SEMAPHORE_H */
diff --cc configure
index 21808ea,546ddc0..bbf5709
--- a/configure
+++ b/configure
@@@ -4613,9 -3748,10 +4613,10 @@@ case $target_os i
          SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
          objformat="macho"
          enabled x86_64 && objformat="macho64"
 -        enabled_any pic shared ||
 +        enabled_any pic shared x86_64 ||
              { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
-         check_header dispatch/dispatch.h
+         check_header dispatch/dispatch.h &&
+             add_cppflags '-I\$(SRC_PATH)/compat/dispatch_semaphore'
          ;;
      msys*)
          die "Native MSYS builds are discouraged, please use the MINGW environment.";
@@@ -5496,42 -4491,33 +5497,45 @@@ f
  
  # check for some common methods of building with pthread support
  # do this before the optional library checks as some of them require pthreads
 -if ! disabled pthreads && ! enabled w32threads; then
 +if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then
      enable pthreads
 -    if check_func pthread_join -pthread; then
 +    if check_func pthread_join -pthread && check_func pthread_create -pthread; then
          add_cflags -pthread
          add_extralibs -pthread
 -    elif check_func pthread_join -pthreads; then
 +    elif check_func pthread_join -pthreads && check_func pthread_create -pthreads; then
          add_cflags -pthreads
          add_extralibs -pthreads
 -    elif check_func pthread_join -lpthreadGC2; then
 +    elif check_func pthread_join -ldl -pthread && check_func pthread_create -ldl -pthread; then
 +        add_cflags -ldl -pthread
 +        add_extralibs -ldl -pthread
 +    elif check_func pthread_join -lpthreadGC2 && check_func pthread_create -lpthreadGC2; then
          add_extralibs -lpthreadGC2
 -    elif check_lib pthread.h pthread_join -lpthread; then
 +    elif check_lib pthread.h pthread_join -lpthread && check_lib pthread.h pthread_create -lpthread; then
          :
 -    elif ! check_func pthread_join; then
 +    elif ! check_func pthread_join && ! check_func pthread_create; then
          disable pthreads
      fi
 +    check_code cc "pthread.h" "static pthread_mutex_t atomic_lock = PTHREAD_MUTEX_INITIALIZER" || disable pthreads
 +fi
 +
 +
 +if enabled pthreads; then
 +  check_func pthread_cancel
  fi
  
+ enabled pthreads &&
+     check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)"
+ 
  disabled  zlib || check_lib   zlib.h      zlibVersion -lz   || disable  zlib
  disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
 +disabled  lzma || check_lib2  lzma.h lzma_version_number -llzma || disable lzma
  
  check_lib math.h sin -lm && LIBM="-lm"
 -enabled vaapi && require vaapi va/va.h vaInitialize -lva
 +disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
  
  atan2f_args=2
 +copysign_args=2
 +hypot_args=2
  ldexpf_args=2
  powf_args=2
  



More information about the ffmpeg-cvslog mailing list