]> git.sesse.net Git - ffmpeg/commitdiff
Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 6 Nov 2011 01:18:50 +0000 (02:18 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 6 Nov 2011 01:23:34 +0000 (02:23 +0100)
* qatar/master:
  http: Remove the custom function for disabling chunked posts
  rtsp: Disable chunked http post through AVOptions
  movdec: Set frame_size for AMR
  h264_weight: remove duplication functions.
  swscale: align vertical filtersize by 2 on x86.
  libavfilter: reindent.
  matroskadec: empty blocks are in fact valid.
  avfilter: don't abort() on zero-size allocations.
  h264: improve calculation of codec delay.
  movenc: Set a correct packet size for AMR-NB mode 15, "no data"
  avformat: Add functions for doing global network initialization
  avformat: Add the https protocol
  avformat: Add the tls protocol, using OpenSSL or gnutls
  avformat: Initialize gnutls in ff_tls_init()
  w32threads: Wrap the mutex functions in inline functions returning int
  configure: Allow linking to the gnutls library
  avformat: Add ff_tls_init()/deinit() that initialize OpenSSL
  configure: Allow linking to openssl
  avcodec: Allow locking and unlocking an avformat specific mutex
  avformat: Split out functions from network.h to a new file, network.c

Conflicts:
Changelog
configure
doc/APIchanges
libavcodec/internal.h
libavcodec/version.h
libavfilter/formats.c
libavformat/matroskadec.c
libavformat/mov.c
libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
22 files changed:
1  2 
Changelog
configure
doc/APIchanges
libavcodec/h264.c
libavcodec/h264.h
libavcodec/internal.h
libavcodec/utils.c
libavcodec/version.h
libavcodec/x86/h264_weight.asm
libavformat/Makefile
libavformat/allformats.c
libavformat/avformat.h
libavformat/http.c
libavformat/http.h
libavformat/matroskadec.c
libavformat/mov.c
libavformat/network.c
libavformat/network.h
libavformat/rtsp.c
libavformat/utils.c
libavformat/version.h
libswscale/utils.c

diff --cc Changelog
index d28265db3d6706479fe03b43a9f87adbdf921a83,34ec3c65e19a8824175c680cf53c6bec84607fa4..3fb8e650c82cd318246881a9c3db5149e562c388
+++ b/Changelog
@@@ -69,19 -56,36 +69,20 @@@ easier to use. The changes are
  - Speex encoding via libspeex
  - 4:2:2 H.264 decoding support
  - Pulseaudio input device
 +- Prores encoder
 +- Video Decoder Acceleration (VDA) HWAccel module.
  - replacement Indeo 3 decoder
 +- new ffmpeg option: -map_channel
 +- volume audio filter added
 +- earwax audio filter added
 +- libv4l2 support (--enable-libv4l2)
+ - TLS/SSL and HTTPS protocol support
  
  
 -version 0.7:
 -
 -- E-AC-3 audio encoder
 -- ac3enc: add channel coupling support
 -- floating-point sample format support for (E-)AC-3, DCA, AAC, Vorbis decoders
 -- H.264/MPEG frame-level multithreading
 -- av_metadata_* functions renamed to av_dict_* and moved to libavutil
 -- 4:4:4 H.264 decoding support
 -- 10-bit H.264 optimizations for x86
 -- bump libswscale for recently reported ABI break
 +version 0.8:
  
  
 -version 0.7_beta2:
 -
 -- VP8 frame-level multithreading
 -- NEON optimizations for VP8
 -- removed a lot of deprecated API cruft
 -- FFT and IMDCT optimizations for AVX (Sandy Bridge) processors
 -- DPX image encoder
 -- SMPTE 302M AES3 audio decoder
 -- ffmpeg no longer quits after the 'q' key is pressed; use 'ctrl+c' instead
 -- 9bit and 10bit per sample support in the H.264 decoder
 -
 -
 -version 0.7_beta1:
 -
 +- many many things we forgot because we rather write code than changelogs
  - WebM support in Matroska de/muxer
  - low overhead Ogg muxing
  - MMS-TCP support
diff --cc configure
index f26f8de11095c7e5925bb8a587b89885ec762f14,fa23619d3997df07632ecd07414c0c891e89807d..d77f91bc5a995fe6473a6fc8aaee52694a3e8dd5
+++ b/configure
@@@ -163,9 -161,8 +163,10 @@@ Configuration options
  External library support:
    --enable-avisynth        enable reading of AVISynth script files [no]
    --enable-bzlib           enable bzlib [autodetect]
 +  --enable-libcelt         enable CELT decoding via libcelt [no]
    --enable-frei0r          enable frei0r video filtering
 +  --enable-libaacplus      enable AAC+ encoding via libaacplus [no]
+   --enable-gnutls          enable gnutls [no]
    --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
    --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
    --enable-libopencv       enable video filtering via libopencv [no]
    --enable-libxavs         enable AVS encoding via xavs [no]
    --enable-libxvid         enable Xvid encoding via xvidcore,
                             native MPEG-4/Xvid encoder exists [no]
 +  --enable-openal          enable OpenAL 1.1 capture support [no]
    --enable-mlib            enable Sun medialib [no]
+   --enable-openssl         enable openssl [no]
    --enable-zlib            enable zlib [autodetect]
  
  Advanced options (experts only):
@@@ -989,11 -918,12 +991,12 @@@ CONFIG_LIST=
      fastdiv
      ffmpeg
      avconv
 -    avplay
 -    avprobe
 -    avserver
 +    ffplay
 +    ffprobe
 +    ffserver
      fft
      frei0r
+     gnutls
      golomb
      gpl
      gray
      mpegaudiodsp
      network
      nonfree
 +    openal
+     openssl
      pic
      postproc
      rdft
@@@ -2706,8 -2578,8 +2713,9 @@@ die_license_disabled gpl libxav
  die_license_disabled gpl libxvid
  die_license_disabled gpl x11grab
  
 +die_license_disabled nonfree libaacplus
  die_license_disabled nonfree libfaac
+ die_license_disabled nonfree openssl
  
  die_license_disabled version3 libopencore_amrnb
  die_license_disabled version3 libopencore_amrwb
@@@ -3032,10 -2893,8 +3040,11 @@@ check_mathfunc trunc
  
  # these are off by default, so fail if requested and not available
  enabled avisynth   && require2 vfw32 "windows.h vfw.h" AVIFileInit -lavifil32
 +enabled libcelt    && require libcelt celt/celt.h celt_decode -lcelt0
  enabled frei0r     && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
 +enabled libaacplus && require  "libaacplus >= 2.0.0" aacplus.h aacplusEncOpen -laacplus
 +enabled libdc1394  && require_pkg_config libdc1394-2 dc1394/dc1394.h dc1394_new
+ enabled gnutls     && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init
  enabled libdirac   && require_pkg_config dirac                          \
      "libdirac_decoder/dirac_parser.h libdirac_encoder/dirac_encoder.h"  \
      "dirac_decoder_init dirac_encoder_init"
@@@ -3072,14 -2925,21 +3081,18 @@@ enabled libx264    && require  libx264 
                          die "ERROR: libx264 version must be >= 0.118."; }
  enabled libxavs    && require  libxavs xavs.h xavs_encoder_encode -lxavs
  enabled libxvid    && require  libxvid xvid.h xvid_global -lxvidcore
 +enabled openal     && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
 +                        check_lib 'AL/al.h' alGetError "${al_libs}" && break; done } ||
 +                        die "ERROR: openal not found"; } &&
 +                      { check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
 +                        die "ERROR: openal version must be 1.1 or compatible"; }
  enabled mlib       && require  mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
+ enabled openssl    && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto ||
+                         check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
+                         check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
+                         die "ERROR: openssl not found"; }
  
 -# libdc1394 check
 -if enabled libdc1394; then
 -    { check_lib dc1394/dc1394.h dc1394_new -ldc1394 -lraw1394 &&
 -        enable libdc1394_2; } ||
 -    { check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 &&
 -        enable libdc1394_1; } ||
 -    die "ERROR: No version of libdc1394 found "
 -fi
 -
 +SDL_CONFIG="${cross_prefix}sdl-config"
  if check_pkg_config sdl SDL_version.h SDL_Linked_Version; then
      check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
      enable sdl &&
@@@ -3365,8 -3185,8 +3378,9 @@@ echo "libdxva2 enabled          ${dxva2
  echo "libva enabled             ${vaapi-no}"
  echo "libvdpau enabled          ${vdpau-no}"
  echo "AVISynth enabled          ${avisynth-no}"
 +echo "libcelt enabled           ${libcelt-no}"
  echo "frei0r enabled            ${frei0r-no}"
+ echo "gnutls enabled            ${gnutls-no}"
  echo "libcdio support           ${libcdio-no}"
  echo "libdc1394 support         ${libdc1394-no}"
  echo "libdirac enabled          ${libdirac-no}"
@@@ -3395,7 -3210,7 +3409,8 @@@ echo "libvpx enabled            ${libvp
  echo "libx264 enabled           ${libx264-no}"
  echo "libxavs enabled           ${libxavs-no}"
  echo "libxvid enabled           ${libxvid-no}"
 +echo "openal enabled            ${openal-no}"
+ echo "openssl enabled           ${openssl-no}"
  echo "zlib enabled              ${zlib-no}"
  echo "bzlib enabled             ${bzlib-no}"
  echo
diff --cc doc/APIchanges
index 4f1b98f7ea02bbfd55df878d66da7ec72e8d4e93,1e6adf5a62c3a80de924c96a544f035fa77daffe..a3265846453b30bb780ec02fc9373f6f554143db
@@@ -13,13 -13,10 +13,16 @@@ libavutil:   2011-04-1
  
  API changes, most recent first:
  
 -2011-xx-xx - xxxxxxx - lavc 53.15.0
 +2011-11-03 - 96949da - lavu 51.23.0
 +  Add av_strcasecmp() and av_strncasecmp() to avstring.h.
 +
 +2011-10-20 - b35e9e1 - lavu 51.22.0
 +  Add av_strtok() to avstring.h.
 +
+ 2011-11-xx - xxxxxxx - lavf 53.13.0
+   Add avformat_network_init()/avformat_network_uninit()
 +2011-10-27 - 512557b - lavc 53.15.0
    Remove avcodec_parse_frame.
    Deprecate AVCodecContext.parse_only and CODEC_CAP_PARSE_ONLY.
  
Simple merge
Simple merge
index d431a85bf97841e0f4b950d16a977c7dfd4739de,54d57d2bec51e6774dbe9fe6a24467347757a84b..375c5674590e85f02268f50e96939c21d309b8da
@@@ -55,9 -55,7 +55,12 @@@ int ff_match_2uint16(const uint16_t (*t
  
  unsigned int avpriv_toupper4(unsigned int x);
  
 +/**
 + * does needed setup of pkt_pts/pos and such for (re)get_buffer();
 + */
 +void ff_init_buffer_info(AVCodecContext *s, AVFrame *pic);
 +
+ int avpriv_lock_avformat(void);
+ int avpriv_unlock_avformat(void);
  #endif /* AVCODEC_INTERNAL_H */
Simple merge
index ad64b6032a6a6e527c9945ccce2129fb10a76b1e,3fc418e466dad10544559406736d0ce286a8255e..6cbc3f650aaf7fac16d651e66102c6d3f88132af
@@@ -21,7 -21,7 +21,7 @@@
  #define AVCODEC_VERSION_H
  
  #define LIBAVCODEC_VERSION_MAJOR 53
- #define LIBAVCODEC_VERSION_MINOR 27
 -#define LIBAVCODEC_VERSION_MINOR 16
++#define LIBAVCODEC_VERSION_MINOR 28
  #define LIBAVCODEC_VERSION_MICRO  0
  
  #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
Simple merge
index 94923265fb7562e04a3bd0be6e165f52bf7075e8,54bc8a16459dd0107f0c78a61c2dc37c83d53ec1..264ab926111f3b1de3bd68f75c5523e79294fd9b
@@@ -354,9 -335,10 +357,10 @@@ OBJS-$(CONFIG_RTMP_PROTOCOL
  
  OBJS-$(CONFIG_RTP_PROTOCOL)              += rtpproto.o
  OBJS-$(CONFIG_TCP_PROTOCOL)              += tcp.o
+ OBJS-$(CONFIG_TLS_PROTOCOL)              += tls.o
  OBJS-$(CONFIG_UDP_PROTOCOL)              += udp.o
  
 -EXAMPLES  = metadata output
 +
  TESTPROGS = seek
  TOOLS     = pktdumper probetest
  
Simple merge
Simple merge
Simple merge
Simple merge
index abedcd7bb8f827531066267a0626335c6a056679,a40aa1c469c41aa6f6d4de0cdaa95611f5ee4195..b47f4de8d46a0139cd9ba333511b12c2dff6c53c
@@@ -1750,11 -1679,12 +1750,12 @@@ static int matroska_parse_block(Matrosk
      size -= n;
  
      track = matroska_find_track_by_num(matroska, num);
-     if (size <= 3 || !track || !track->stream) {
+     if (!track || !track->stream) {
          av_log(matroska->ctx, AV_LOG_INFO,
                 "Invalid stream %"PRIu64" or size %u\n", num, size);
 -        return AVERROR_INVALIDDATA;
 +        return res;
-     }
+     } else if (size <= 3)
+         return 0;
      st = track->stream;
      if (st->discard >= AVDISCARD_ALL)
          return res;
Simple merge
index 0000000000000000000000000000000000000000,d50e1e70f87878222fb753268aa0c0fd1e78194b..33435cf524fe3471a6bd19c9f6aeb05567bf37c9
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,175 +1,176 @@@
+ /*
+  * Copyright (c) 2007 The Libav Project
+  *
+  * This file is part of Libav.
+  *
+  * Libav 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,
+  * 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
+  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+  */
++#include "libavutil/avutil.h"
+ #include "network.h"
+ #include "libavcodec/internal.h"
+ #define THREADS (HAVE_PTHREADS || (defined(WIN32) && !defined(__MINGW32CE__)))
+ #if THREADS
+ #if HAVE_PTHREADS
+ #include <pthread.h>
+ #else
+ #include "libavcodec/w32pthreads.h"
+ #endif
+ #endif
+ #if CONFIG_OPENSSL
+ #include <openssl/ssl.h>
+ static int openssl_init;
+ #if THREADS
+ #include <openssl/crypto.h>
+ #include "libavutil/avutil.h"
+ pthread_mutex_t *openssl_mutexes;
+ static void openssl_lock(int mode, int type, const char *file, int line)
+ {
+     if (mode & CRYPTO_LOCK)
+         pthread_mutex_lock(&openssl_mutexes[type]);
+     else
+         pthread_mutex_unlock(&openssl_mutexes[type]);
+ }
+ #ifndef WIN32
+ static unsigned long openssl_thread_id(void)
+ {
+     return (intptr_t) pthread_self();
+ }
+ #endif
+ #endif
+ #endif
+ #if CONFIG_GNUTLS
+ #include <gnutls/gnutls.h>
+ #if THREADS && GNUTLS_VERSION_NUMBER <= 0x020b00
+ #include <gcrypt.h>
+ #include <errno.h>
+ #undef malloc
+ #undef free
+ GCRY_THREAD_OPTION_PTHREAD_IMPL;
+ #endif
+ #endif
+ void ff_tls_init(void)
+ {
+     avpriv_lock_avformat();
+ #if CONFIG_OPENSSL
+     if (!openssl_init) {
+         SSL_library_init();
+         SSL_load_error_strings();
+ #if THREADS
+         if (!CRYPTO_get_locking_callback()) {
+             int i;
+             openssl_mutexes = av_malloc(sizeof(pthread_mutex_t) * CRYPTO_num_locks());
+             for (i = 0; i < CRYPTO_num_locks(); i++)
+                 pthread_mutex_init(&openssl_mutexes[i], NULL);
+             CRYPTO_set_locking_callback(openssl_lock);
+ #ifndef WIN32
+             CRYPTO_set_id_callback(openssl_thread_id);
+ #endif
+         }
+ #endif
+     }
+     openssl_init++;
+ #endif
+ #if CONFIG_GNUTLS
+ #if THREADS && GNUTLS_VERSION_NUMBER < 0x020b00
+     if (gcry_control(GCRYCTL_ANY_INITIALIZATION_P) == 0)
+         gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
+ #endif
+     gnutls_global_init();
+ #endif
+     avpriv_unlock_avformat();
+ }
+ void ff_tls_deinit(void)
+ {
+     avpriv_lock_avformat();
+ #if CONFIG_OPENSSL
+     openssl_init--;
+     if (!openssl_init) {
+ #if THREADS
+         if (CRYPTO_get_locking_callback() == openssl_lock) {
+             int i;
+             CRYPTO_set_locking_callback(NULL);
+             for (i = 0; i < CRYPTO_num_locks(); i++)
+                 pthread_mutex_destroy(&openssl_mutexes[i]);
+             av_free(openssl_mutexes);
+         }
+ #endif
+     }
+ #endif
+ #if CONFIG_GNUTLS
+     gnutls_global_deinit();
+ #endif
+     avpriv_unlock_avformat();
+ }
+ int ff_network_init(void)
+ {
+ #if HAVE_WINSOCK2_H
+     WSADATA wsaData;
+     if (WSAStartup(MAKEWORD(1,1), &wsaData))
+         return 0;
+ #endif
+     return 1;
+ }
+ int ff_network_wait_fd(int fd, int write)
+ {
+     int ev = write ? POLLOUT : POLLIN;
+     struct pollfd p = { .fd = fd, .events = ev, .revents = 0 };
+     int ret;
+     ret = poll(&p, 1, 100);
+     return ret < 0 ? ff_neterrno() : p.revents & (ev | POLLERR | POLLHUP) ? 0 : AVERROR(EAGAIN);
+ }
+ void ff_network_close(void)
+ {
+ #if HAVE_WINSOCK2_H
+     WSACleanup();
+ #endif
+ }
+ #if HAVE_WINSOCK2_H
+ int ff_neterrno(void)
+ {
+     int err = WSAGetLastError();
+     switch (err) {
+     case WSAEWOULDBLOCK:
+         return AVERROR(EAGAIN);
+     case WSAEINTR:
+         return AVERROR(EINTR);
+     }
+     return -err;
+ }
+ #endif
+ int ff_is_multicast_address(struct sockaddr *addr)
+ {
+     if (addr->sa_family == AF_INET) {
+         return IN_MULTICAST(ntohl(((struct sockaddr_in *)addr)->sin_addr.s_addr));
+     }
+ #if HAVE_STRUCT_SOCKADDR_IN6
+     if (addr->sa_family == AF_INET6) {
+         return IN6_IS_ADDR_MULTICAST(&((struct sockaddr_in6 *)addr)->sin6_addr);
+     }
+ #endif
+     return 0;
+ }
Simple merge
Simple merge
Simple merge
index c3c8d2b19df1956a0411df689a7c9f96cdf26812,48f2303f9e383f92d1e3e517e52cd4d8160dff05..bc427d3f4e017ae9839a8c0cd9e1dc45bb59a54f
@@@ -24,7 -24,7 +24,7 @@@
  #include "libavutil/avutil.h"
  
  #define LIBAVFORMAT_VERSION_MAJOR 53
- #define LIBAVFORMAT_VERSION_MINOR 18
 -#define LIBAVFORMAT_VERSION_MINOR 13
++#define LIBAVFORMAT_VERSION_MINOR 19
  #define LIBAVFORMAT_VERSION_MICRO  0
  
  #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
Simple merge