Re: [libav-devel] [PATCH] libkvazaar: Add missing header #includes

2016-12-06 Thread Vittorio Giovara
On Wed, Dec 7, 2016 at 1:52 AM, Diego Biurrun  wrote:
> This fixes compilation after the next version bump.
> ---
>  libavcodec/libkvazaar.c | 4 
>  1 file changed, 4 insertions(+)
>
> diff --git a/libavcodec/libkvazaar.c b/libavcodec/libkvazaar.c
> index 19122e0..efc98f1 100644
> --- a/libavcodec/libkvazaar.c
> +++ b/libavcodec/libkvazaar.c
> @@ -21,12 +21,16 @@
>   */
>
>  #include 
> +#include 
>  #include 
>
> +#include "libavutil/attributes.h"
>  #include "libavutil/dict.h"
>  #include "libavutil/error.h"
>  #include "libavutil/imgutils.h"
>  #include "libavutil/internal.h"
> +#include "libavutil/log.h"
> +#include "libavutil/mem.h"
>  #include "libavutil/pixdesc.h"
>  #include "libavutil/opt.h"
>

ok

-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] Remove deprecated XvMC support hacks

2016-12-06 Thread Diego Biurrun
Deprecated in 11/2013.
---

These are not the droids you are looking for.

 configure |   3 -
 libavcodec/4xm.c  |   2 +-
 libavcodec/Makefile   |   3 -
 libavcodec/allcodecs.c|   3 -
 libavcodec/asvdec.c   |   2 +-
 libavcodec/avcodec.h  |  17 ---
 libavcodec/bink.c |   2 +-
 libavcodec/blockdsp.c |  10 +-
 libavcodec/blockdsp.h |  10 +-
 libavcodec/cavs.c |   2 +-
 libavcodec/codec_desc.c   |  11 +-
 libavcodec/dnxhddec.c |   2 +-
 libavcodec/dnxhdenc.c |   2 +-
 libavcodec/eamad.c|   2 +-
 libavcodec/eatqi.c|   2 +-
 libavcodec/error_resilience.c |  21 ---
 libavcodec/g2meet.c   |   2 +-
 libavcodec/intrax8.c  |   2 +-
 libavcodec/jvdec.c|   2 +-
 libavcodec/mdec.c |   2 +-
 libavcodec/mimic.c|   2 +-
 libavcodec/mjpegdec.c |   2 +-
 libavcodec/mpeg12dec.c| 103 -
 libavcodec/mpegvideo.c|  29 +---
 libavcodec/mpegvideo_xvmc.c   | 337 --
 libavcodec/options_table.h|   3 -
 libavcodec/vc1dec.c   |   2 +-
 libavcodec/version.h  |   3 -
 libavcodec/wmv2.c |   2 +-
 libavcodec/x86/blockdsp.c |  16 +-
 libavcodec/xvmc.h | 174 --
 libavcodec/xvmc_internal.h|  38 -
 libavutil/pixdesc.c   |  10 --
 libavutil/pixfmt.h|   4 -
 libavutil/version.h   |   3 -
 tests/checkasm/blockdsp.c |   4 +-
 36 files changed, 25 insertions(+), 809 deletions(-)
 delete mode 100644 libavcodec/mpegvideo_xvmc.c
 delete mode 100644 libavcodec/xvmc.h
 delete mode 100644 libavcodec/xvmc_internal.h

diff --git a/configure b/configure
index 4c11e5e..cdc5cf0 100755
--- a/configure
+++ b/configure
@@ -2032,8 +2032,6 @@ mp3on4_decoder_select="mpegaudio"
 mp3on4float_decoder_select="mpegaudio"
 mpc7_decoder_select="bswapdsp mpegaudiodsp"
 mpc8_decoder_select="mpegaudiodsp"
-mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
-mpeg_xvmc_decoder_select="mpeg2video_decoder"
 mpeg1video_decoder_select="error_resilience mpeg_er mpegvideo"
 mpeg1video_encoder_select="aandcttables mpegvideoenc"
 mpeg2video_decoder_select="error_resilience mpeg_er mpegvideo"
@@ -4552,7 +4550,6 @@ check_header vdpau/vdpau.h
 check_header vdpau/vdpau_x11.h
 check_header VideoDecodeAcceleration/VDADecoder.h
 check_header windows.h
-check_header X11/extensions/XvMClib.h
 
 # it seems there are versions of clang in some distros that try to use the
 # gcc headers, which explodes for stdatomic
diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c
index ee9d020..c38da8f 100644
--- a/libavcodec/4xm.c
+++ b/libavcodec/4xm.c
@@ -960,7 +960,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
 }
 
 f->version = AV_RL32(avctx->extradata) >> 16;
-ff_blockdsp_init(&f->bdsp, avctx);
+ff_blockdsp_init(&f->bdsp);
 ff_bswapdsp_init(&f->bbdsp);
 f->avctx = avctx;
 init_vlcs(f);
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 0beeda4..8e77222 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -12,7 +12,6 @@ HEADERS = avcodec.h   
  \
   vdpau.h   \
   version.h \
   vorbis_parser.h   \
-  xvmc.h\
 
 OBJS = allcodecs.o  \
avpacket.o   \
@@ -328,7 +327,6 @@ OBJS-$(CONFIG_MP3ON4_DECODER)  += 
mpegaudiodec_fixed.o mpeg4audio.o
 OBJS-$(CONFIG_MP3ON4FLOAT_DECODER) += mpegaudiodec_float.o mpeg4audio.o
 OBJS-$(CONFIG_MPC7_DECODER)+= mpc7.o mpc.o
 OBJS-$(CONFIG_MPC8_DECODER)+= mpc8.o mpc.o
-OBJS-$(CONFIG_MPEG_XVMC_DECODER)   += mpegvideo_xvmc.o
 OBJS-$(CONFIG_MPEG1VIDEO_DECODER)  += mpeg12dec.o mpeg12.o mpeg12data.o
 OBJS-$(CONFIG_MPEG1VIDEO_ENCODER)  += mpeg12enc.o mpeg12.o
 OBJS-$(CONFIG_MPEG2_QSV_DECODER)   += qsvdec_other.o
@@ -777,7 +775,6 @@ SKIPHEADERS-$(CONFIG_D3D11VA)  += d3d11va.h 
dxva2_internal.h
 SKIPHEADERS-$(CONFIG_DXVA2)+= dxva2.h dxva2_internal.h
 SKIPHEADERS-$(CONFIG_LIBSCHROEDINGER)  += libschroedinger.h
 SKIPHEADERS-$(CONFIG_LIBVPX)   += libvpx.h
-SKIPHEADERS-$(CONFIG_MPEG_XVMC_DECODER) += xvmc.h
 SKIPHEADERS-$(CONFIG_NVENC)+= nvenc.h
 SKIPHEADERS-$(CONFIG_QSV)  += qsv.h qsv_internal.h
 SKIPHEADERS-$(CONFIG_QSVDEC)   += qsvdec.h
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 591fd87..ba7874e 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -201,9 +201,6 @@ void avcodec_register_all(void)
 REGISTER_DECODER(MJPEG

[libav-devel] [PATCH] Remove deprecated XvMC support hacks

2016-12-06 Thread Diego Biurrun
Deprecated in 11/2013.
---

What is mine is mine! I know where you live Vittorio!
And where your family lives also!1! ;-p

 configure |   3 -
 libavcodec/Makefile   |   3 -
 libavcodec/allcodecs.c|   3 -
 libavcodec/avcodec.h  |  17 ---
 libavcodec/blockdsp.c |  10 +-
 libavcodec/blockdsp.h |  10 +-
 libavcodec/codec_desc.c   |  11 +-
 libavcodec/error_resilience.c |  21 ---
 libavcodec/mpeg12dec.c| 103 -
 libavcodec/mpegvideo.c|  27 
 libavcodec/mpegvideo_xvmc.c   | 337 --
 libavcodec/options_table.h|   3 -
 libavcodec/version.h  |   3 -
 libavcodec/x86/blockdsp.c |  15 +-
 libavcodec/xvmc.h | 174 --
 libavcodec/xvmc_internal.h|  38 -
 libavutil/pixdesc.c   |  10 --
 libavutil/pixfmt.h|   4 -
 libavutil/version.h   |   3 -
 19 files changed, 6 insertions(+), 789 deletions(-)
 delete mode 100644 libavcodec/mpegvideo_xvmc.c
 delete mode 100644 libavcodec/xvmc.h
 delete mode 100644 libavcodec/xvmc_internal.h

diff --git a/configure b/configure
index 4c11e5e..cdc5cf0 100755
--- a/configure
+++ b/configure
@@ -2032,8 +2032,6 @@ mp3on4_decoder_select="mpegaudio"
 mp3on4float_decoder_select="mpegaudio"
 mpc7_decoder_select="bswapdsp mpegaudiodsp"
 mpc8_decoder_select="mpegaudiodsp"
-mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
-mpeg_xvmc_decoder_select="mpeg2video_decoder"
 mpeg1video_decoder_select="error_resilience mpeg_er mpegvideo"
 mpeg1video_encoder_select="aandcttables mpegvideoenc"
 mpeg2video_decoder_select="error_resilience mpeg_er mpegvideo"
@@ -4552,7 +4550,6 @@ check_header vdpau/vdpau.h
 check_header vdpau/vdpau_x11.h
 check_header VideoDecodeAcceleration/VDADecoder.h
 check_header windows.h
-check_header X11/extensions/XvMClib.h
 
 # it seems there are versions of clang in some distros that try to use the
 # gcc headers, which explodes for stdatomic
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 0beeda4..8e77222 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -12,7 +12,6 @@ HEADERS = avcodec.h   
  \
   vdpau.h   \
   version.h \
   vorbis_parser.h   \
-  xvmc.h\
 
 OBJS = allcodecs.o  \
avpacket.o   \
@@ -328,7 +327,6 @@ OBJS-$(CONFIG_MP3ON4_DECODER)  += 
mpegaudiodec_fixed.o mpeg4audio.o
 OBJS-$(CONFIG_MP3ON4FLOAT_DECODER) += mpegaudiodec_float.o mpeg4audio.o
 OBJS-$(CONFIG_MPC7_DECODER)+= mpc7.o mpc.o
 OBJS-$(CONFIG_MPC8_DECODER)+= mpc8.o mpc.o
-OBJS-$(CONFIG_MPEG_XVMC_DECODER)   += mpegvideo_xvmc.o
 OBJS-$(CONFIG_MPEG1VIDEO_DECODER)  += mpeg12dec.o mpeg12.o mpeg12data.o
 OBJS-$(CONFIG_MPEG1VIDEO_ENCODER)  += mpeg12enc.o mpeg12.o
 OBJS-$(CONFIG_MPEG2_QSV_DECODER)   += qsvdec_other.o
@@ -777,7 +775,6 @@ SKIPHEADERS-$(CONFIG_D3D11VA)  += d3d11va.h 
dxva2_internal.h
 SKIPHEADERS-$(CONFIG_DXVA2)+= dxva2.h dxva2_internal.h
 SKIPHEADERS-$(CONFIG_LIBSCHROEDINGER)  += libschroedinger.h
 SKIPHEADERS-$(CONFIG_LIBVPX)   += libvpx.h
-SKIPHEADERS-$(CONFIG_MPEG_XVMC_DECODER) += xvmc.h
 SKIPHEADERS-$(CONFIG_NVENC)+= nvenc.h
 SKIPHEADERS-$(CONFIG_QSV)  += qsv.h qsv_internal.h
 SKIPHEADERS-$(CONFIG_QSVDEC)   += qsvdec.h
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 591fd87..ba7874e 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -201,9 +201,6 @@ void avcodec_register_all(void)
 REGISTER_DECODER(MJPEGB,mjpegb);
 REGISTER_DECODER(MMVIDEO,   mmvideo);
 REGISTER_DECODER(MOTIONPIXELS,  motionpixels);
-#if FF_API_XVMC
-REGISTER_DECODER(MPEG_XVMC, mpeg_xvmc);
-#endif /* FF_API_XVMC */
 REGISTER_ENCDEC (MPEG1VIDEO,mpeg1video);
 REGISTER_ENCDEC (MPEG2VIDEO,mpeg2video);
 REGISTER_DECODER(MPEG2_MMAL,mpeg2_mmal);
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 635fdd2..1bcaf81 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -196,9 +196,6 @@ enum AVCodecID {
 /* video codecs */
 AV_CODEC_ID_MPEG1VIDEO,
 AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
-#if FF_API_XVMC
-AV_CODEC_ID_MPEG2VIDEO_XVMC,
-#endif /* FF_API_XVMC */
 AV_CODEC_ID_H261,
 AV_CODEC_ID_H263,
 AV_CODEC_ID_RV10,
@@ -986,10 +983,6 @@ typedef struct RcOverride{
  */
 #define CODEC_CAP_DR1 0x0002
 #define CODEC_CAP_TRUNCATED   0x0008
-#if FF_API_XVMC
-/* Codec can export data for HW decoding (XvMC

[libav-devel] [PATCH] libkvazaar: Add missing header #includes

2016-12-06 Thread Diego Biurrun
This fixes compilation after the next version bump.
---
 libavcodec/libkvazaar.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/libkvazaar.c b/libavcodec/libkvazaar.c
index 19122e0..efc98f1 100644
--- a/libavcodec/libkvazaar.c
+++ b/libavcodec/libkvazaar.c
@@ -21,12 +21,16 @@
  */
 
 #include 
+#include 
 #include 
 
+#include "libavutil/attributes.h"
 #include "libavutil/dict.h"
 #include "libavutil/error.h"
 #include "libavutil/imgutils.h"
 #include "libavutil/internal.h"
+#include "libavutil/log.h"
+#include "libavutil/mem.h"
 #include "libavutil/pixdesc.h"
 #include "libavutil/opt.h"
 
-- 
2.1.4

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 01/41] Bump major versions of all libraries

2016-12-06 Thread Diego Biurrun
On Tue, Dec 06, 2016 at 12:22:42PM +0100, Diego Biurrun wrote:
> On Tue, Dec 06, 2016 at 11:54:20AM +0100, Diego Biurrun wrote:
> > On Tue, Dec 06, 2016 at 08:43:05AM +0100, Diego Biurrun wrote:
> > > So before you push this, it has to survive Oracle.
> > 
> > Also, have you compared warnings before and after?
> > This might leave behind some unused variables and similar.
> 
> Set looks good to me overall; I haven't grepped for any leftovers though
> and did not doublecheck for warnings.

Also, make sure you drop version.h #includes that become unnecessary
after your patches. I already found some in xvmc[1].

Diego

[1] A sad day indeed for your karma. Are you certain your soul is
still immortal? ;-p
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] configure: add -fPIE instead of -pie to C flags for ThreadSanitizer

2016-12-06 Thread Diego Biurrun
On Tue, Dec 06, 2016 at 08:36:32PM -0800, Wan-Teh Chang wrote:
> On Tue, Dec 6, 2016 at 11:36 AM, Luca Barbato  wrote:
> >
> > Sure, thank you again for spotting it, had been ages since I tried to
> > use tsan.
> 
> You are welcome. Could you please also commit my FFmpeg patch?
> 
> http://ffmpeg.org/pipermail/ffmpeg-devel/2016-December/203836.html

You are asking on the wrong mailing list. But you can simply wait.
FFmpeg merges all libav commits, so this will show up on the FFmpeg
side after a little delay.

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 3/3] pthread_frame: do not run hwaccel decoding asynchronously unless it's safe

2016-12-06 Thread Diego Biurrun
On Sat, Dec 03, 2016 at 05:34:34PM +0100, Anton Khirnov wrote:
> --- /dev/null
> +++ b/libavcodec/hwaccel.h
> @@ -0,0 +1,24 @@
> +#ifndef AVCODEC_HWACCEL_H
> +#define AVCODEC_HWACCEL_H
> +
> +#define HWACCEL_CAP_ASYNC_SAFE  (1 << 0)
> +
> +#endif /* AVCODEC_HWACCEL_H */

Do you plan to add more here? A header for a single define seems gratuitous...

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 3/3] pthread_frame: do not run hwaccel decoding asynchronously unless it's safe

2016-12-06 Thread Janne Grunau
On 2016-12-03 17:34:34 +0100, Anton Khirnov wrote:
> Certain hardware decoding APIs are often not thread-safe, so having the user
> access decoded hardware surfaces while the decoder is running in another
> thread can cause failures (this is mainly known to happen with DXVA2).
> 
> For such hwaccels, only allow the decoding thread to run while the user
> is inside a lavc decode call (avcodec_send_packet/receive_frame).
> ---
>  libavcodec/avcodec.h   |  5 +
>  libavcodec/hwaccel.h   | 24 ++
>  libavcodec/pthread_frame.c | 51 
> --
>  libavcodec/vaapi_h264.c|  2 ++
>  libavcodec/vaapi_mpeg2.c   |  2 ++
>  libavcodec/vaapi_mpeg4.c   |  3 +++
>  libavcodec/vaapi_vc1.c |  3 +++
>  libavcodec/vaapi_vp8.c |  2 ++
>  8 files changed, 86 insertions(+), 6 deletions(-)
>  create mode 100644 libavcodec/hwaccel.h
> 
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index e75d300..96149ac 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -3361,6 +3361,11 @@ typedef struct AVHWAccel {
>   * AVCodecInternal.hwaccel_priv_data.
>   */
>  int priv_data_size;
> +
> +/**
> + * Internal hwaccel capabilities.
> + */
> +int caps_internal;
>  } AVHWAccel;
>  
>  /**
> diff --git a/libavcodec/hwaccel.h b/libavcodec/hwaccel.h
> new file mode 100644
> index 000..60dbe81
> --- /dev/null
> +++ b/libavcodec/hwaccel.h
> @@ -0,0 +1,24 @@
> +/*
> + * 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
> + */
> +
> +#ifndef AVCODEC_HWACCEL_H
> +#define AVCODEC_HWACCEL_H
> +
> +#define HWACCEL_CAP_ASYNC_SAFE  (1 << 0)
> +
> +#endif /* AVCODEC_HWACCEL_H */
> diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
> index 9fdfb93..83f528e 100644
> --- a/libavcodec/pthread_frame.c
> +++ b/libavcodec/pthread_frame.c
> @@ -34,6 +34,7 @@
>  #endif
>  
>  #include "avcodec.h"
> +#include "hwaccel.h"
>  #include "internal.h"
>  #include "pthread_internal.h"
>  #include "thread.h"
> @@ -101,6 +102,7 @@ typedef struct PerThreadContext {
>  int die;   ///< Set when the thread should exit.
>  
>  int hwaccel_serializing;
> +int async_serializing;
>  } PerThreadContext;
>  
>  /**
> @@ -116,6 +118,7 @@ typedef struct FrameThreadContext {
>   * is used.
>   */
>  pthread_mutex_t hwaccel_mutex;
> +pthread_mutex_t async_mutex;
>  
>  int next_decoding; ///< The next context to submit a packet 
> to.
>  int next_finished; ///< The next context to return output 
> from.
> @@ -178,6 +181,11 @@ static attribute_align_arg void 
> *frame_worker_thread(void *arg)
>  if (atomic_load(&p->state) == STATE_SETTING_UP)
>  ff_thread_finish_setup(avctx);
>  
> +if (p->async_serializing) {
> +p->async_serializing = 0;
> +pthread_mutex_unlock(&p->parent->async_mutex);
> +}
> +
>  if (p->hwaccel_serializing) {
>  p->hwaccel_serializing = 0;
>  pthread_mutex_unlock(&p->parent->hwaccel_mutex);

is it concise decision to release the async_mutex before the hwaccel 
mutex? That should it make more likely that only 1 frame per decode call 
is decoded. If it is a concise and or tested decision it warrants a 
comment here.

> @@ -406,7 +414,11 @@ int ff_thread_decode_frame(AVCodecContext *avctx,
>  FrameThreadContext *fctx = avctx->internal->thread_ctx;
>  int finished = fctx->next_finished;
>  PerThreadContext *p;
> -int err;
> +int err, ret;
> +
> +/* release the hwaccel lock, permitting blocked hwaccel threadsto

s/hwaccel\( lock\)/async\1/

> + * go forward while we are in this function */
> +pthread_mutex_unlock(&fctx->async_mutex);
>  
>  /*
>   * Submit a packet to the next decoding thread.
> @@ -414,9 +426,11 @@ int ff_thread_decode_frame(AVCodecContext *avctx,
>  
>  p = &fctx->threads[fctx->next_decoding];
>  err = update_context_from_user(p->avctx, avctx);
> -if (err) return err;
> +if (err)
> +goto finish;
>  err = submit_packet(p, avpkt);
> -if (err) return err;
> +if (err)
> +goto finish;
>  
>  /*
>   * If we're sti

Re: [libav-devel] [PATCH 01/41] Bump major versions of all libraries

2016-12-06 Thread Diego Biurrun
On Tue, Dec 06, 2016 at 04:23:09PM -0500, Vittorio Giovara wrote:
> On Tue, Dec 6, 2016 at 2:43 AM, Diego Biurrun  wrote:
> > On Tue, Dec 06, 2016 at 12:27:22AM -0500, Vittorio Giovara wrote:
> >> --- a/libavdevice/version.h
> >> +++ b/libavdevice/version.h
> >> @@ -27,8 +27,8 @@
> >>
> >> -#define LIBAVDEVICE_VERSION_MAJOR 56
> >> -#define LIBAVDEVICE_VERSION_MINOR  1
> >> +#define LIBAVDEVICE_VERSION_MAJOR 57
> >> +#define LIBAVDEVICE_VERSION_MINOR  0
> >>  #define LIBAVDEVICE_VERSION_MICRO  0
> >>
> >> --- a/libavresample/version.h
> >> +++ b/libavresample/version.h
> >> @@ -27,7 +27,7 @@
> >>
> >> -#define LIBAVRESAMPLE_VERSION_MAJOR  3
> >> +#define LIBAVRESAMPLE_VERSION_MAJOR  4
> >>  #define LIBAVRESAMPLE_VERSION_MINOR  0
> >>  #define LIBAVRESAMPLE_VERSION_MICRO  0
> >>
> >> --- a/libswscale/version.h
> >> +++ b/libswscale/version.h
> >> @@ -26,7 +26,7 @@
> >>
> >> -#define LIBSWSCALE_VERSION_MAJOR 4
> >> +#define LIBSWSCALE_VERSION_MAJOR 5
> >>  #define LIBSWSCALE_VERSION_MINOR 0
> >>  #define LIBSWSCALE_VERSION_MICRO 0
> >
> > These bumps seem gratuitous, there are no deprecated APIs in these 
> > libraries.
> 
> I'm aware there are not ABI-changes in those libs, but historically
> we've always bumped every library to avoid any possible version
> conflict. See for example 6d3ea1957f681b3bf9c752e6d21a501cc8d4180d or
> 3bc2e89c76e88ae6f1fd5287e0b11abcfc3c601c. While most of the root
> causes for those incompatibilities have been long resolved, it's still
> a good practice and relatively harmless to do.

There was this idea of a single version number for all libraries.
Maybe it's time to revisit it?

> > Also, lots of tests currently break if you bump all version numbers because
> > the output of the framecrc muxer changes. That will have to be addressed.
> > Anton knows the exact reason and wanted to make a decision which way to
> > resolve this.
> >
> > https://oracle.libav.org/x86_64-linux-version-bump/20161204165430
> 
> This is because that test disables a particular API which changes the
> test duration, which is not yet included in this removal.

I suggest we resolve this in the not-so-distant future and try to maintain
a green version-bump Oracle instance.

> Oracle is fully green https://oracle.libav.org/.

You wish ..

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 2/3] pthread_frame: ensure the threads don't run simultaneously with hwaccel

2016-12-06 Thread Janne Grunau
On 2016-12-03 17:34:33 +0100, Anton Khirnov wrote:
> ---
>  libavcodec/h263dec.c   |  2 +-
>  libavcodec/h264dec.c   |  2 +-
>  libavcodec/pthread_frame.c | 27 +++
>  3 files changed, 29 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
> index e4a7227..921ff5f 100644
> --- a/libavcodec/h263dec.c
> +++ b/libavcodec/h263dec.c
> @@ -558,7 +558,7 @@ int ff_h263_decode_frame(AVCodecContext *avctx, void 
> *data, int *got_frame,
>  if ((ret = ff_mpv_frame_start(s, avctx)) < 0)
>  return ret;
>  
> -if (!s->divx_packed && !avctx->hwaccel)
> +if (!s->divx_packed)
>  ff_thread_finish_setup(avctx);
>  
>  if (avctx->hwaccel) {
> diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
> index 330a74d..83b3ab3 100644
> --- a/libavcodec/h264dec.c
> +++ b/libavcodec/h264dec.c
> @@ -573,7 +573,7 @@ static int decode_nal_units(H264Context *h, const uint8_t 
> *buf, int buf_size)
>  if ((err = ff_h264_queue_decode_slice(h, nal)))
>  break;
>  
> -if (avctx->active_thread_type & FF_THREAD_FRAME && 
> !h->avctx->hwaccel &&
> +if (avctx->active_thread_type & FF_THREAD_FRAME &&
>  i >= nals_needed && !h->setup_finished && h->cur_pic_ptr) {
>  ff_thread_finish_setup(avctx);
>  h->setup_finished = 1;
> diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
> index 2736a81..9fdfb93 100644
> --- a/libavcodec/pthread_frame.c
> +++ b/libavcodec/pthread_frame.c
> @@ -99,6 +99,8 @@ typedef struct PerThreadContext {
>  int  requested_flags;   ///< flags passed to get_buffer() for 
> requested_frame
>  
>  int die;   ///< Set when the thread should exit.
> +
> +int hwaccel_serializing;
>  } PerThreadContext;
>  
>  /**
> @@ -109,6 +111,11 @@ typedef struct FrameThreadContext {
>  PerThreadContext *prev_thread; ///< The last thread submit_packet() was 
> called on.
>  
>  pthread_mutex_t buffer_mutex;  ///< Mutex used to protect 
> get/release_buffer().
> +/**
> + * This lock is used for ensuring threads run in serial when hwaccel
> + * is used.
> + */
> +pthread_mutex_t hwaccel_mutex;
>  
>  int next_decoding; ///< The next context to submit a packet 
> to.
>  int next_finished; ///< The next context to return output 
> from.
> @@ -149,6 +156,14 @@ static attribute_align_arg void 
> *frame_worker_thread(void *arg)
>  ff_thread_finish_setup(avctx);
>  
>  pthread_mutex_lock(&p->mutex);
> +
> +/* if the previous thread uses hwaccel then we take the lock to 
> ensure
> + * the threads don't run concurrently */
> +if (avctx->hwaccel) {

please either add a comment why hwaccel need a update_thread_context 
function pointer or add '!p->hwaccel_serializing' to the if. see the 
ff_thread_finish_setup() call at the beginning oh the hunk

> +pthread_mutex_lock(&p->parent->hwaccel_mutex);
> +p->hwaccel_serializing = 1;
> +}
> +
>  av_frame_unref(p->frame);
>  p->got_frame = 0;
>  p->result = codec->decode(avctx, p->frame, &p->got_frame, &p->avpkt);
> @@ -163,6 +178,11 @@ static attribute_align_arg void 
> *frame_worker_thread(void *arg)
>  if (atomic_load(&p->state) == STATE_SETTING_UP)
>  ff_thread_finish_setup(avctx);
>  
> +if (p->hwaccel_serializing) {
> +p->hwaccel_serializing = 0;
> +pthread_mutex_unlock(&p->parent->hwaccel_mutex);
> +}
> +
>  atomic_store(&p->state, STATE_INPUT_READY);
>  
>  pthread_mutex_lock(&p->progress_mutex);
> @@ -499,6 +519,11 @@ void ff_thread_finish_setup(AVCodecContext *avctx) {
>  
>  if (!(avctx->active_thread_type&FF_THREAD_FRAME)) return;
>  
> +if (avctx->hwaccel && !p->hwaccel_serializing) {
> +pthread_mutex_lock(&p->parent->hwaccel_mutex);
> +p->hwaccel_serializing = 1;
> +}
> +
>  pthread_mutex_lock(&p->progress_mutex);
>  
>  atomic_store(&p->state, STATE_SETUP_FINISHED);
> @@ -579,6 +604,7 @@ void ff_frame_thread_free(AVCodecContext *avctx, int 
> thread_count)
>  
>  av_freep(&fctx->threads);
>  pthread_mutex_destroy(&fctx->buffer_mutex);
> +pthread_mutex_destroy(&fctx->hwaccel_mutex);
>  av_freep(&avctx->internal->thread_ctx);
>  }
>  
> @@ -620,6 +646,7 @@ int ff_frame_thread_init(AVCodecContext *avctx)
>  }
>  
>  pthread_mutex_init(&fctx->buffer_mutex, NULL);
> +pthread_mutex_init(&fctx->hwaccel_mutex, NULL);
>  fctx->delaying = 1;
>  
>  for (i = 0; i < thread_count; i++) {

otherwise ok

Janne
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 1/3] hevc: decouple calling get_format() from exporting the SPS parameters

2016-12-06 Thread Janne Grunau
On 2016-12-03 17:34:32 +0100, Anton Khirnov wrote:
> This makes sure ff_get_format() does not get called unnecessarily from
> update_thread_context().
> ---
>  libavcodec/hevcdec.c | 49 ++---
>  1 file changed, 30 insertions(+), 19 deletions(-)
> 
> diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
> index 9dd86c2..27fd683 100644
> --- a/libavcodec/hevcdec.c
> +++ b/libavcodec/hevcdec.c
> @@ -380,24 +380,10 @@ static void export_stream_params(AVCodecContext *avctx, 
> const HEVCParamSets *ps,
>num, den, 1 << 30);
>  }
>  
> -static int set_sps(HEVCContext *s, const HEVCSPS *sps)
> +static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
>  {
>  #define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL + 
> CONFIG_HEVC_D3D11VA_HWACCEL + CONFIG_HEVC_VDPAU_HWACCEL)
>  enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmt = pix_fmts;
> -int ret;
> -
> -pic_arrays_free(s);
> -s->ps.sps = NULL;
> -s->ps.vps = NULL;
> -
> -if (!sps)
> -return 0;
> -
> -ret = pic_arrays_init(s, sps);
> -if (ret < 0)
> -goto fail;
> -
> -export_stream_params(s->avctx, &s->ps, sps);
>  
>  if (sps->pix_fmt == AV_PIX_FMT_YUV420P || sps->pix_fmt == 
> AV_PIX_FMT_YUVJ420P ||
>  sps->pix_fmt == AV_PIX_FMT_YUV420P10) {
> @@ -417,10 +403,28 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps)
>  *fmt++ = sps->pix_fmt;
>  *fmt = AV_PIX_FMT_NONE;
>  
> -ret = ff_get_format(s->avctx, pix_fmts);
> +return ff_get_format(s->avctx, pix_fmts);
> +}
> +
> +static int set_sps(HEVCContext *s, const HEVCSPS *sps,
> +   enum AVPixelFormat pix_fmt)
> +{
> +int ret;
> +
> +pic_arrays_free(s);
> +s->ps.sps = NULL;
> +s->ps.vps = NULL;
> +
> +if (!sps)
> +return 0;
> +
> +ret = pic_arrays_init(s, sps);
>  if (ret < 0)
>  goto fail;
> -s->avctx->pix_fmt = ret;
> +
> +export_stream_params(s->avctx, &s->ps, sps);
> +
> +s->avctx->pix_fmt = pix_fmt;
>  
>  ff_hevc_pred_init(&s->hpc, sps->bit_depth);
>  ff_hevc_dsp_init (&s->hevcdsp, sps->bit_depth);
> @@ -475,10 +479,17 @@ static int hls_slice_header(HEVCContext *s)
>  s->ps.pps = (HEVCPPS*)s->ps.pps_list[sh->pps_id]->data;
>  
>  if (s->ps.sps != (HEVCSPS*)s->ps.sps_list[s->ps.pps->sps_id]->data) {
> +enum AVPixelFormat pix_fmt;
> +
>  s->ps.sps = (HEVCSPS*)s->ps.sps_list[s->ps.pps->sps_id]->data;
>  
>  ff_hevc_clear_refs(s);
> -ret = set_sps(s, s->ps.sps);
> +
> +pix_fmt = get_format(s, s->ps.sps);
> +if (pix_fmt < 0)
> +return pix_fmt;
> +
> +ret = set_sps(s, s->ps.sps, pix_fmt);
>  if (ret < 0)
>  return ret;
>  
> @@ -2985,7 +2996,7 @@ static int hevc_update_thread_context(AVCodecContext 
> *dst,
>  }
>  
>  if (s->ps.sps != s0->ps.sps)
> -ret = set_sps(s, s0->ps.sps);
> +ret = set_sps(s, s0->ps.sps, src->pix_fmt);
>  
>  s->seq_decode = s0->seq_decode;
>  s->seq_output = s0->seq_output;

ok

Janne
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 06/41] lavfi: Drop deprecated non-const filter retrieval

2016-12-06 Thread Vittorio Giovara
On Tue, Dec 6, 2016 at 5:56 AM, Diego Biurrun  wrote:
> On Tue, Dec 06, 2016 at 12:27:27AM -0500, Vittorio Giovara wrote:
>> --- a/libavfilter/version.h
>> +++ b/libavfilter/version.h
>> @@ -49,8 +49,5 @@
>>   * the public API and may change, break or disappear at any time.
>>   */
>>
>> -#ifndef FF_API_NOCONST_GET_NAME
>> -#define FF_API_NOCONST_GET_NAME (LIBAVFILTER_VERSION_MAJOR < 7)
>> -#endif
>>
>>  #endif /* AVFILTER_VERSION_H */
>
> nit: You're leaving behind a double empty line.

fixed locally
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 01/41] Bump major versions of all libraries

2016-12-06 Thread Vittorio Giovara
On Tue, Dec 6, 2016 at 2:43 AM, Diego Biurrun  wrote:
> On Tue, Dec 06, 2016 at 12:27:22AM -0500, Vittorio Giovara wrote:
>> This disable everything that was deprecated in the past 18 months,
>
> disable_S

fixed locally

>> --- a/libavdevice/version.h
>> +++ b/libavdevice/version.h
>> @@ -27,8 +27,8 @@
>>
>> -#define LIBAVDEVICE_VERSION_MAJOR 56
>> -#define LIBAVDEVICE_VERSION_MINOR  1
>> +#define LIBAVDEVICE_VERSION_MAJOR 57
>> +#define LIBAVDEVICE_VERSION_MINOR  0
>>  #define LIBAVDEVICE_VERSION_MICRO  0
>>
>> --- a/libavresample/version.h
>> +++ b/libavresample/version.h
>> @@ -27,7 +27,7 @@
>>
>> -#define LIBAVRESAMPLE_VERSION_MAJOR  3
>> +#define LIBAVRESAMPLE_VERSION_MAJOR  4
>>  #define LIBAVRESAMPLE_VERSION_MINOR  0
>>  #define LIBAVRESAMPLE_VERSION_MICRO  0
>>
>> --- a/libswscale/version.h
>> +++ b/libswscale/version.h
>> @@ -26,7 +26,7 @@
>>
>> -#define LIBSWSCALE_VERSION_MAJOR 4
>> +#define LIBSWSCALE_VERSION_MAJOR 5
>>  #define LIBSWSCALE_VERSION_MINOR 0
>>  #define LIBSWSCALE_VERSION_MICRO 0
>
> These bumps seem gratuitous, there are no deprecated APIs in these libraries.

I'm aware there are not ABI-changes in those libs, but historically
we've always bumped every library to avoid any possible version
conflict. See for example 6d3ea1957f681b3bf9c752e6d21a501cc8d4180d or
3bc2e89c76e88ae6f1fd5287e0b11abcfc3c601c. While most of the root
causes for those incompatibilities have been long resolved, it's still
a good practice and relatively harmless to do.

> Also, lots of tests currently break if you bump all version numbers because
> the output of the framecrc muxer changes. That will have to be addressed.
> Anton knows the exact reason and wanted to make a decision which way to
> resolve this.
>
> https://oracle.libav.org/x86_64-linux-version-bump/20161204165430

This is because that test disables a particular API which changes the
test duration, which is not yet included in this removal.
Oracle is fully green https://oracle.libav.org/.
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] lavu: Add AVSphericalMapping type and frame side data

2016-12-06 Thread Vittorio Giovara
On Tue, Dec 6, 2016 at 10:44 AM, Vittorio Giovara
 wrote:
> While no decoder currently exports spherical information, this type
> represents a frame property that has to be passed through from container
> to frames.
>
> Signed-off-by: Vittorio Giovara 
> ---
> The specification got updated while this was in the works. So I updated
> the description of yaw, pitch, roll and added a paragraph about the
> coordinate system.
> Vittorio
>
>  doc/APIchanges|   4 ++
>  libavutil/Makefile|   2 +
>  libavutil/frame.h |   6 +++
>  libavutil/spherical.c |  34 +
>  libavutil/spherical.h | 136 
> ++
>  5 files changed, 182 insertions(+)
>  create mode 100644 libavutil/spherical.c
>  create mode 100644 libavutil/spherical.h
>
> diff --git a/doc/APIchanges b/doc/APIchanges
> index dfd1532..01ac90d 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -13,6 +13,10 @@ libavutil: 2015-08-28
>
>  API changes, most recent first:
>
> +2016-xx-xx - xxx - lavu 55.29.0 - spherical.h
> +  Add AV_FRAME_DATA_SPHERICAL value, av_spherical_alloc() API and
> +  AVSphericalMapping type to export and describe spherical video properties.
> +
>  2016-xx-xx - xxx - lavf 57.10.0 - avformat.h
>Add av_stream_add_side_data().
>
> diff --git a/libavutil/Makefile b/libavutil/Makefile
> index fbcf1a7..28372c9 100644
> --- a/libavutil/Makefile
> +++ b/libavutil/Makefile
> @@ -48,6 +48,7 @@ HEADERS = adler32.h 
> \
>replaygain.h  \
>samplefmt.h   \
>sha.h \
> +  spherical.h   \
>stereo3d.h\
>time.h\
>version.h \
> @@ -102,6 +103,7 @@ OBJS = adler32.o  
>   \
> rc4.o\
> samplefmt.o  \
> sha.o\
> +   spherical.o  \
> stereo3d.o   \
> time.o   \
> tree.o   \
> diff --git a/libavutil/frame.h b/libavutil/frame.h
> index 12624d7..4052199 100644
> --- a/libavutil/frame.h
> +++ b/libavutil/frame.h
> @@ -92,6 +92,12 @@ enum AVFrameSideDataType {
>   * enum AVAudioServiceType defined in avcodec.h.
>   */
>  AV_FRAME_DATA_AUDIO_SERVICE_TYPE,
> +
> +/**
> + * The data represents the AVSphericalMapping structure defined in
> + * libavutil/spherical.h.
> + */
> +AV_FRAME_DATA_SPHERICAL,
>  };
>
>  enum AVActiveFormatDescription {
> diff --git a/libavutil/spherical.c b/libavutil/spherical.c
> new file mode 100644
> index 000..f6e53d1
> --- /dev/null
> +++ b/libavutil/spherical.c
> @@ -0,0 +1,34 @@
> +/*
> + * Copyright (c) 2016 Vittorio Giovara 
> + *
> + * 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 "mem.h"
> +#include "spherical.h"
> +
> +AVSphericalMapping *av_spherical_alloc(size_t *size)
> +{
> +AVSphericalMapping *spherical = av_mallocz(sizeof(AVSphericalMapping));
> +if (!spherical)
> +return NULL;
> +
> +if (size)
> +*size = sizeof(*spherical);
> +
> +return spherical;
> +}
> diff --git a/libavutil/spherical.h b/libavutil/spherical.h
> new file mode 100644
> index 000..b37842e
> --- /dev/null
> +++ b/libavutil/spherical.h
> @@ -0,0 +1,136 @@
> +/*
> + * Copyright (c) 2016 Vittorio Giovara 
> + *
> + * 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
> + * Licen

Re: [libav-devel] [PATCH] configure: add -fPIE instead of -pie to C flags for ThreadSanitizer

2016-12-06 Thread Luca Barbato
On 06/12/2016 20:04, Wan-Teh Chang wrote:
> On Fri, Dec 2, 2016 at 2:29 PM, Luca Barbato  wrote:
>> On 02/12/2016 20:27, Wan-Teh Chang wrote:
>>
>> Should not hurt.
> 
> Hi Luca,
> 
> Thank you for the review. Could you please commit my patch for me?
> 

Sure, thank you again for spotting it, had been ages since I tried to
use tsan.

lu

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] configure: add -fPIE instead of -pie to C flags for ThreadSanitizer

2016-12-06 Thread Wan-Teh Chang
On Fri, Dec 2, 2016 at 2:29 PM, Luca Barbato  wrote:
> On 02/12/2016 20:27, Wan-Teh Chang wrote:
>
> Should not hurt.

Hi Luca,

Thank you for the review. Could you please commit my patch for me?

Thanks,
Wan-Teh Chang
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] lavu: Add AVSphericalMapping type and frame side data

2016-12-06 Thread Vittorio Giovara
While no decoder currently exports spherical information, this type
represents a frame property that has to be passed through from container
to frames.

Signed-off-by: Vittorio Giovara 
---
The specification got updated while this was in the works. So I updated
the description of yaw, pitch, roll and added a paragraph about the
coordinate system.
Vittorio

 doc/APIchanges|   4 ++
 libavutil/Makefile|   2 +
 libavutil/frame.h |   6 +++
 libavutil/spherical.c |  34 +
 libavutil/spherical.h | 136 ++
 5 files changed, 182 insertions(+)
 create mode 100644 libavutil/spherical.c
 create mode 100644 libavutil/spherical.h

diff --git a/doc/APIchanges b/doc/APIchanges
index dfd1532..01ac90d 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,10 @@ libavutil: 2015-08-28
 
 API changes, most recent first:
 
+2016-xx-xx - xxx - lavu 55.29.0 - spherical.h
+  Add AV_FRAME_DATA_SPHERICAL value, av_spherical_alloc() API and
+  AVSphericalMapping type to export and describe spherical video properties.
+
 2016-xx-xx - xxx - lavf 57.10.0 - avformat.h
   Add av_stream_add_side_data().
 
diff --git a/libavutil/Makefile b/libavutil/Makefile
index fbcf1a7..28372c9 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -48,6 +48,7 @@ HEADERS = adler32.h   
  \
   replaygain.h  \
   samplefmt.h   \
   sha.h \
+  spherical.h   \
   stereo3d.h\
   time.h\
   version.h \
@@ -102,6 +103,7 @@ OBJS = adler32.o
\
rc4.o\
samplefmt.o  \
sha.o\
+   spherical.o  \
stereo3d.o   \
time.o   \
tree.o   \
diff --git a/libavutil/frame.h b/libavutil/frame.h
index 12624d7..4052199 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -92,6 +92,12 @@ enum AVFrameSideDataType {
  * enum AVAudioServiceType defined in avcodec.h.
  */
 AV_FRAME_DATA_AUDIO_SERVICE_TYPE,
+
+/**
+ * The data represents the AVSphericalMapping structure defined in
+ * libavutil/spherical.h.
+ */
+AV_FRAME_DATA_SPHERICAL,
 };
 
 enum AVActiveFormatDescription {
diff --git a/libavutil/spherical.c b/libavutil/spherical.c
new file mode 100644
index 000..f6e53d1
--- /dev/null
+++ b/libavutil/spherical.c
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2016 Vittorio Giovara 
+ *
+ * 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 "mem.h"
+#include "spherical.h"
+
+AVSphericalMapping *av_spherical_alloc(size_t *size)
+{
+AVSphericalMapping *spherical = av_mallocz(sizeof(AVSphericalMapping));
+if (!spherical)
+return NULL;
+
+if (size)
+*size = sizeof(*spherical);
+
+return spherical;
+}
diff --git a/libavutil/spherical.h b/libavutil/spherical.h
new file mode 100644
index 000..b37842e
--- /dev/null
+++ b/libavutil/spherical.h
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2016 Vittorio Giovara 
+ *
+ * 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 PU

Re: [libav-devel] [PATCH] fate: Add spherical and stereo3d mov tests

2016-12-06 Thread Vittorio Giovara
On Tue, Dec 6, 2016 at 10:43 AM, Vittorio Giovara
 wrote:
> ---
> The specification got updated while this was in the works. So I updated
> the description of yaw, pitch, roll and added a paragraph about the
> coordinate system.
> Vittorio

ops wrong patch sorry
this is fine as is
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] fate: Add spherical and stereo3d mov tests

2016-12-06 Thread Vittorio Giovara
---
The specification got updated while this was in the works. So I updated
the description of yaw, pitch, roll and added a paragraph about the
coordinate system.
Vittorio

 tests/fate/mov.mak   | 6 ++
 tests/ref/fate/mov-spherical | 4 
 tests/ref/fate/mov-stereo3d  | 1 +
 3 files changed, 11 insertions(+)
 create mode 100644 tests/ref/fate/mov-spherical
 create mode 100644 tests/ref/fate/mov-stereo3d

diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak
index 909e438..57cbb1c 100644
--- a/tests/fate/mov.mak
+++ b/tests/fate/mov.mak
@@ -10,6 +10,12 @@ fate-mov-rotation: CMD = probestream rotation 
$(TARGET_SAMPLES)/mov/displaymatri
 FATE_MOV += fate-mov-sar
 fate-mov-sar: CMD = probestream sample_aspect_ratio 
$(TARGET_SAMPLES)/mov/displaymatrix.mov
 
+FATE_MOV += fate-mov-spherical
+fate-mov-spherical: CMD = probestream projection,yaw,pitch,roll 
$(TARGET_SAMPLES)/mov/spherical.mov
+
+FATE_MOV += fate-mov-stereo3d
+fate-mov-stereo3d: CMD = probestream type $(TARGET_SAMPLES)/mov/spherical.mov
+
 $(FATE_MOV): avprobe$(EXESUF)
 FATE_SAMPLES-$(call ALLYES, AVPROBE MOV_DEMUXER) += $(FATE_MOV)
 fate-mov: $(FATE_MOV)
diff --git a/tests/ref/fate/mov-spherical b/tests/ref/fate/mov-spherical
new file mode 100644
index 000..760ae88
--- /dev/null
+++ b/tests/ref/fate/mov-spherical
@@ -0,0 +1,4 @@
+equirectangular
+45
+30
+15
diff --git a/tests/ref/fate/mov-stereo3d b/tests/ref/fate/mov-stereo3d
new file mode 100644
index 000..fe909bb
--- /dev/null
+++ b/tests/ref/fate/mov-stereo3d
@@ -0,0 +1 @@
+2D
-- 
2.10.0

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] configure: Pass CFLAGS_HEADERS through the right CFLAGS filter

2016-12-06 Thread Diego Biurrun
On Sun, Dec 04, 2016 at 11:19:02AM +0100, Diego Biurrun wrote:
> The generic parameter names used for CFLAGS in configure must be filtered
> for each compiler and replaced by the equivalent flag for that compiler.
> ---
> 
> Fixes the checkheaders target with suncc.
> 
>  configure | 8 ++--
>  1 file changed, 6 insertions(+), 2 deletions(-)

OKed by Luca on IRC.

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 01/13] build: Separate avisynth and avxsynth support

2016-12-06 Thread Diego Biurrun
On Tue, Nov 29, 2016 at 07:34:01PM +0100, Diego Biurrun wrote:
> This simplifies the code.
> ---
>  configure  | 13 -
>  libavformat/Makefile   |  2 +-
>  libavformat/avisynth.c | 19 +--
>  3 files changed, 18 insertions(+), 16 deletions(-)

OKed by Luca on IRC.

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 2/2] build: Move entries related to building TOOLS to a subdirectory Makefile

2016-12-06 Thread Luca Barbato
On 06/12/2016 11:59, Diego Biurrun wrote:
> ---
>  Makefile   |  8 +---
>  tools/Makefile | 11 +++
>  2 files changed, 12 insertions(+), 7 deletions(-)
>  create mode 100644 tools/Makefile
> 

Ok.

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 1/2] build: Warn that reconfiguration is necessary if version.h files changed

2016-12-06 Thread Luca Barbato
On 06/12/2016 11:59, Diego Biurrun wrote:
> The library versions are stored in the config.mak file and are used
> to derive shared library names.
> ---
>  Makefile | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 

Possibly ok.

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 01/41] Bump major versions of all libraries

2016-12-06 Thread Diego Biurrun
On Tue, Dec 06, 2016 at 11:54:20AM +0100, Diego Biurrun wrote:
> On Tue, Dec 06, 2016 at 08:43:05AM +0100, Diego Biurrun wrote:
> > So before you push this, it has to survive Oracle.
> 
> Also, have you compared warnings before and after?
> This might leave behind some unused variables and similar.

Set looks good to me overall; I haven't grepped for any leftovers though
and did not doublecheck for warnings.

However, you have permanently damaged your karma by treading where you
were not allowed to and breaking holy vows. You are expected to perform
appropriate penance or suffer apposite punishment in the afterlife.

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 40/41] lavu: Drop deprecated xvmc pixel formats

2016-12-06 Thread Diego Biurrun
On Tue, Dec 06, 2016 at 12:28:01AM -0500, Vittorio Giovara wrote:
> Deprecated in 11/2013.
> ---
>  libavutil/pixdesc.c | 10 --
>  libavutil/pixfmt.h  |  4 
>  libavutil/version.h |  3 ---
>  3 files changed, 17 deletions(-)

The insolence! The gall! My wrath shall smite your wretched soul! ;-p

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 33/41] lavc: Drop deprecated xvidmmx symbols

2016-12-06 Thread Diego Biurrun
On Tue, Dec 06, 2016 at 12:27:54AM -0500, Vittorio Giovara wrote:
> Deprecated in 08/2014.
> ---
>  libavcodec/avcodec.h   | 3 ---
>  libavcodec/options_table.h | 3 ---
>  libavcodec/version.h   | 3 ---
>  3 files changed, 9 deletions(-)

Oh, the nostalgia..

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 32/41] lavc: Drop deprecated unused public members

2016-12-06 Thread Diego Biurrun
On Tue, Dec 06, 2016 at 12:27:53AM -0500, Vittorio Giovara wrote:
> Deprecated in 07/2014.
> ---
>  libavcodec/avcodec.h   | 18 --
>  libavcodec/options_table.h | 12 
>  libavcodec/version.h   |  3 ---
>  3 files changed, 33 deletions(-)

Oh, nostalgia..

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 31/41] lavc: Drop deprecated sparc architecture symbols

2016-12-06 Thread Diego Biurrun
On Tue, Dec 06, 2016 at 12:27:52AM -0500, Vittorio Giovara wrote:
> Deprecated in 01/2014.
> ---
>  libavcodec/avcodec.h | 3 ---
>  libavcodec/version.h | 3 ---
>  2 files changed, 6 deletions(-)

nostalgia!

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 30/41] lavc: Drop deprecated sh4 architecture symbols

2016-12-06 Thread Diego Biurrun
On Tue, Dec 06, 2016 at 12:27:51AM -0500, Vittorio Giovara wrote:
> Deprecated in 01/2014.
> ---
>  libavcodec/avcodec.h   | 3 ---
>  libavcodec/options_table.h | 3 ---
>  libavcodec/version.h   | 3 ---
>  3 files changed, 9 deletions(-)

nostalgia :)

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 22/41] lavc: Drop deprecated xvmc hacks

2016-12-06 Thread Diego Biurrun
On Tue, Dec 06, 2016 at 12:27:43AM -0500, Vittorio Giovara wrote:
> Deprecated in 11/2013.
> ---
>  configure |   2 -
>  libavcodec/Makefile   |   3 -
>  libavcodec/allcodecs.c|   3 -
>  libavcodec/avcodec.h  |  17 ---
>  libavcodec/blockdsp.c |   4 -
>  libavcodec/blockdsp.h |   5 -
>  libavcodec/codec_desc.c   |   9 --
>  libavcodec/error_resilience.c |  20 ---
>  libavcodec/mpeg12dec.c| 103 -
>  libavcodec/mpegvideo.c|  27 
>  libavcodec/mpegvideo_xvmc.c   | 337 
> --
>  libavcodec/options_table.h|   3 -
>  libavcodec/version.h  |   3 -
>  libavcodec/x86/blockdsp.c |  13 --
>  libavcodec/xvmc.h | 174 --
>  libavcodec/xvmc_internal.h|  38 -
>  16 files changed, 761 deletions(-)
>  delete mode 100644 libavcodec/mpegvideo_xvmc.c
>  delete mode 100644 libavcodec/xvmc.h
>  delete mode 100644 libavcodec/xvmc_internal.h

Obvious troll is obvious.

This prize was promised to me a long time ago.
It is mine! Stand in my way and suffer to consequences!

;-p

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 21/41] lavc: Drop deprecated alpha architecture sysmbols

2016-12-06 Thread Diego Biurrun
On Tue, Dec 06, 2016 at 12:27:42AM -0500, Vittorio Giovara wrote:
> Deprecated in 11/2013.
> ---
>  libavcodec/avcodec.h   | 3 ---
>  libavcodec/options_table.h | 3 ---
>  libavcodec/version.h   | 3 ---
>  3 files changed, 9 deletions(-)

sy_mbols

more nostalgia :)

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 2/2] build: Move entries related to building TOOLS to a subdirectory Makefile

2016-12-06 Thread Diego Biurrun
---
 Makefile   |  8 +---
 tools/Makefile | 11 +++
 2 files changed, 12 insertions(+), 7 deletions(-)
 create mode 100644 tools/Makefile

diff --git a/Makefile b/Makefile
index 6b021a9..35dd527 100644
--- a/Makefile
+++ b/Makefile
@@ -90,8 +90,6 @@ OBJS-avconv-$(HAVE_VDPAU_X11) += avconv_vdpau.o
 
 TESTTOOLS   = audiogen videogen rotozoom tiny_psnr base64
 HOSTPROGS  := $(TESTTOOLS:%=tests/%) doc/print_options
-TOOLS   = qt-faststart trasher
-TOOLS-$(CONFIG_ZLIB) += cws2fws
 
 # $(FFLIBS-yes) needs to be in linking order
 FFLIBS-$(CONFIG_AVDEVICE)   += avdevice
@@ -108,6 +106,7 @@ DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.avpreset)
 SKIPHEADERS = cmdutils_common_opts.h\
   compat/w32pthreads.h
 
+include $(SRC_PATH)/tools/Makefile
 include $(SRC_PATH)/common.mak
 
 FF_EXTRALIBS := $(FFEXTRALIBS)
@@ -171,10 +170,6 @@ $(foreach P,$(PROGS),$(eval $(call 
DOPROG,$(P:$(EXESUF)=
 $(PROGS): %$(EXESUF): %.o $(FF_DEP_LIBS)
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)
 
-OBJDIRS += tools
-
--include $(wildcard tools/*.d)
-
 VERSION_SH  = $(SRC_PATH)/version.sh
 GIT_LOG = $(SRC_PATH)/.git/logs/HEAD
 
@@ -219,7 +214,6 @@ uninstall-data:
 clean::
$(RM) $(ALLAVPROGS)
$(RM) $(CLEANSUFFIXES)
-   $(RM) $(CLEANSUFFIXES:%=tools/%)
$(RM) -rf coverage.info lcov
 
 distclean::
diff --git a/tools/Makefile b/tools/Makefile
new file mode 100644
index 000..372287b
--- /dev/null
+++ b/tools/Makefile
@@ -0,0 +1,11 @@
+TOOLS = qt-faststart trasher
+TOOLS-$(CONFIG_ZLIB) += cws2fws
+
+tools/cws2fws$(EXESUF): ELIBS = $(ZLIB)
+
+OBJDIRS += tools
+
+clean::
+   $(RM) $(CLEANSUFFIXES:%=tools/%)
+
+-include $(wildcard tools/*.d)
-- 
2.1.4

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 1/2] build: Warn that reconfiguration is necessary if version.h files changed

2016-12-06 Thread Diego Biurrun
The library versions are stored in the config.mak file and are used
to derive shared library names.
---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 55fff90..6b021a9 100644
--- a/Makefile
+++ b/Makefile
@@ -123,13 +123,14 @@ tools/cws2fws$(EXESUF): ELIBS = $(ZLIB)
 
 CONFIGURABLE_COMPONENTS =   \
 $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c)) \
+$(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/version.h))  \
 $(SRC_PATH)/libavcodec/bitstream_filters.c  \
 $(SRC_PATH)/libavformat/protocols.c \
 
 config.h: .config
 .config: $(CONFIGURABLE_COMPONENTS)
@-tput bold 2>/dev/null
-   @-printf '\nWARNING: $(?F) newer than config.h, rerun configure\n\n'
+   @-printf '\nWARNING: $(?) newer than config.h, rerun configure\n\n'
@-tput sgr0 2>/dev/null
 
 SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS  \
-- 
2.1.4

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 11/41] lavc: Drop deprecated missing sample log function

2016-12-06 Thread Diego Biurrun
On Tue, Dec 06, 2016 at 12:27:32AM -0500, Vittorio Giovara wrote:
> Deprecated in 01/2013.
> ---
>  libavcodec/avcodec.h | 30 --
>  libavcodec/utils.c   | 29 -
>  libavcodec/version.h |  3 ---
>  3 files changed, 62 deletions(-)

Oh, one of mine, the nostalgia... :)

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 06/41] lavfi: Drop deprecated non-const filter retrieval

2016-12-06 Thread Diego Biurrun
On Tue, Dec 06, 2016 at 12:27:27AM -0500, Vittorio Giovara wrote:
> --- a/libavfilter/version.h
> +++ b/libavfilter/version.h
> @@ -49,8 +49,5 @@
>   * the public API and may change, break or disappear at any time.
>   */
>  
> -#ifndef FF_API_NOCONST_GET_NAME
> -#define FF_API_NOCONST_GET_NAME (LIBAVFILTER_VERSION_MAJOR < 7)
> -#endif
>  
>  #endif /* AVFILTER_VERSION_H */

nit: You're leaving behind a double empty line.

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 01/41] Bump major versions of all libraries

2016-12-06 Thread Diego Biurrun
On Tue, Dec 06, 2016 at 08:43:05AM +0100, Diego Biurrun wrote:
> So before you push this, it has to survive Oracle.

Also, have you compared warnings before and after?
This might leave behind some unused variables and similar.

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel