[FFmpeg-devel] [PATCH] configure: do not fork off grep subprocess while testing for whitespace

2015-08-25 Thread Ganesh Ajjanagadde
grep is not necessary for the functionality.
This avoids an unnecessary fork.

Signed-off-by: Ganesh Ajjanagadde 
---
 configure | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index db94c45..7acb2dd 100755
--- a/configure
+++ b/configure
@@ -2974,8 +2974,9 @@ if test -f configure; then
 source_path=.
 else
 source_path=$(cd $(dirname "$0"); pwd)
-echo "$source_path" | grep -q '[[:blank:]]' &&
-die "Out of tree builds are impossible with whitespace in source path."
+case "$source_path" in
+*[[:blank:]]*) die "Out of tree builds are impossible with whitespace 
in source path." ;;
+esac
 test -e "$source_path/config.h" &&
 die "Out of tree builds are impossible with config.h in source dir."
 fi
-- 
2.5.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/vdpau: fix compilation of mpeg1/mpeg4/vc1 decoders when h264 is disabled

2015-08-25 Thread James Almer
On 25/08/15 11:45 PM, Philip Langdale wrote:
> Compiles fine. Ship it.
> 
> --phil
> 

Shipped. Thanks.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] vaapi: Add hevc hwaccel support

2015-08-25 Thread Philip Langdale
On Wed, 26 Aug 2015 02:19:02 +0200
Timo Rothenpieler  wrote:

> ---
>  configure   |   4 +
>  libavcodec/Makefile |   1 +
>  libavcodec/allcodecs.c  |   1 +
>  libavcodec/hevc.c   |   5 +-
>  libavcodec/vaapi_hevc.c | 449
>  5 files changed, 459
> insertions(+), 1 deletion(-) create mode 100644
> libavcodec/vaapi_hevc.c
> 
> diff --git a/configure b/configure
> index 76c6662..4a3afb3 100755
> --- a/configure
> +++ b/configure
> @@ -2425,6 +2425,8 @@ hevc_d3d11va_hwaccel_select="hevc_decoder"
>  hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC"
>  hevc_dxva2_hwaccel_select="hevc_decoder"
>  hevc_qsv_hwaccel_deps="libmfx"
> +hevc_vaapi_hwaccel_deps="vaapi VAPictureParameterBufferHEVC"
> +hevc_vaapi_hwaccel_select="hevc_decoder"
>  hevc_vdpau_hwaccel_deps="vdpau VdpPictureInfoHEVC"
>  hevc_vdpau_hwaccel_select="hevc_decoder"
>  mpeg_vdpau_decoder_deps="vdpau"
> @@ -5145,6 +5147,8 @@ check_type "windows.h dxva.h"
> "DXVA_PicParams_HEVC" -DWINAPI_FAMILY=WINAPI_FAMIL check_type
> "windows.h d3d11.h" "ID3D11VideoDecoder" check_type "d3d9.h
> dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0602 
> +check_type "va/va.h" "VAPictureParameterBufferHEVC"
> +
>  check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC"
>  
>  if ! disabled w32threads && ! enabled pthreads; then
> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> index 3c50ff8..407c6c3 100644
> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -715,6 +715,7 @@ OBJS-$(CONFIG_H264_VDPAU_HWACCEL) +=
> vdpau_h264.o OBJS-$(CONFIG_H264_VIDEOTOOLBOX_HWACCEL)  +=
> videotoolbox.o OBJS-$(CONFIG_HEVC_D3D11VA_HWACCEL)   +=
> dxva2_hevc.o OBJS-$(CONFIG_HEVC_DXVA2_HWACCEL) += dxva2_hevc.o
> +OBJS-$(CONFIG_HEVC_VAAPI_HWACCEL) += vaapi_hevc.o
>  OBJS-$(CONFIG_HEVC_VDPAU_HWACCEL) += vdpau_hevc.o
>  OBJS-$(CONFIG_MPEG1_VDPAU_HWACCEL)+= vdpau_mpeg12.o
>  OBJS-$(CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL) += videotoolbox.o
> diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
> index d4ae497..dbf3927 100644
> --- a/libavcodec/allcodecs.c
> +++ b/libavcodec/allcodecs.c
> @@ -89,6 +89,7 @@ void avcodec_register_all(void)
>  REGISTER_HWACCEL(HEVC_D3D11VA,  hevc_d3d11va);
>  REGISTER_HWACCEL(HEVC_DXVA2,hevc_dxva2);
>  REGISTER_HWACCEL(HEVC_QSV,  hevc_qsv);
> +REGISTER_HWACCEL(HEVC_VAAPI,hevc_vaapi);
>  REGISTER_HWACCEL(HEVC_VDPAU,hevc_vdpau);
>  REGISTER_HWACCEL(MPEG1_XVMC,mpeg1_xvmc);
>  REGISTER_HWACCEL(MPEG1_VDPAU,   mpeg1_vdpau);
> diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
> index 3f1a2bb..e7ac50e 100644
> --- a/libavcodec/hevc.c
> +++ b/libavcodec/hevc.c
> @@ -328,7 +328,7 @@ static void export_stream_params(AVCodecContext
> *avctx, const HEVCParamSets *ps, 
>  static int set_sps(HEVCContext *s, const HEVCSPS *sps, enum
> AVPixelFormat pix_fmt) {
> -#define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL +
> CONFIG_HEVC_D3D11VA_HWACCEL + CONFIG_HEVC_VDPAU_HWACCEL)
> +#define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL +
> CONFIG_HEVC_D3D11VA_HWACCEL + CONFIG_HEVC_VAAPI_HWACCEL +
> CONFIG_HEVC_VDPAU_HWACCEL) enum AVPixelFormat pix_fmts[HWACCEL_MAX +
> 2], *fmt = pix_fmts; int ret, i; 
> @@ -352,6 +352,9 @@ static int set_sps(HEVCContext *s, const HEVCSPS
> *sps, enum AVPixelFormat pix_fm #if CONFIG_HEVC_D3D11VA_HWACCEL
>  *fmt++ = AV_PIX_FMT_D3D11VA_VLD;
>  #endif
> +#if CONFIG_HEVC_VAAPI_HWACCEL
> +*fmt++ = AV_PIX_FMT_VAAPI;
> +#endif
>  #if CONFIG_HEVC_VDPAU_HWACCEL
>  *fmt++ = AV_PIX_FMT_VDPAU;
>  #endif
> diff --git a/libavcodec/vaapi_hevc.c b/libavcodec/vaapi_hevc.c
> new file mode 100644
> index 000..d0f35bb
> --- /dev/null
> +++ b/libavcodec/vaapi_hevc.c
> @@ -0,0 +1,449 @@
> +/*
> + * HEVC HW decode acceleration through VA API
> + *
> + * Copyright (C) 2015 Timo Rothenpieler 
> + *
> + * 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
> + */
> +
> +#include "vaapi_internal.h"
> +#include "hevc.h"
> +#include "mpegutils.h"
> +
> +/**
> + * @file
> + * This file implements the glue code between FFmpeg's and VA API's
> + * structures for HEVC decoding.
> + */
> +
> +typedef struct vaapi_hevc_frame_data {

Re: [FFmpeg-devel] [PATCH] avcodec/vdpau: fix compilation of mpeg1/mpeg4/vc1 decoders when h264 is disabled

2015-08-25 Thread Philip Langdale
On Tue, 25 Aug 2015 09:50:47 -0700
Philip Langdale  wrote:

> On 2015-08-24 19:58, James Almer wrote:
> > Signed-off-by: James Almer 
> > ---
> > Untested as i don't have a vdpau system.
> > See
> > http://fate.ffmpeg.org/report.cgi?time=20150823144028&slot=x86_64-archlinux-gcc-random
> > 
> >  libavcodec/vdpau.c | 44
> > +++- 1 file changed, 23
> > insertions(+), 21 deletions(-)
> > 
> > diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c
> > index 7cb8ad2..b530466 100644
> > --- a/libavcodec/vdpau.c
> > +++ b/libavcodec/vdpau.c
> > @@ -358,7 +358,25 @@ int ff_vdpau_add_buffer(struct
> > vdpau_picture_context *pic_ctx,
> > 
> >  /* Obsolete non-hwaccel VDPAU support below... */
> > 
> > -#if CONFIG_H264_VDPAU_DECODER && FF_API_VDPAU
> > +#if FF_API_VDPAU
> > +void ff_vdpau_add_data_chunk(uint8_t *data, const uint8_t *buf,
> > int buf_size)
> > +{
> > +struct vdpau_render_state *render = (struct 
> > vdpau_render_state*)data;
> > +assert(render);
> > +
> > +render->bitstream_buffers= av_fast_realloc(
> > +render->bitstream_buffers,
> > +&render->bitstream_buffers_allocated,
> > +
> > sizeof(*render->bitstream_buffers)*(render->bitstream_buffers_used
> > + 1)
> > +);
> > +
> > +
> > render->bitstream_buffers[render->bitstream_buffers_used].struct_version
> >  = VDP_BITSTREAM_BUFFER_VERSION;
> > +
> > render->bitstream_buffers[render->bitstream_buffers_used].bitstream
> >= buf;
> > +
> > render->bitstream_buffers[render->bitstream_buffers_used].bitstream_bytes
> > = buf_size;
> > +render->bitstream_buffers_used++;
> > +}
> > +
> > +#if CONFIG_H264_VDPAU_DECODER
> >  void ff_vdpau_h264_set_reference_frames(H264Context *h)
> >  {
> >  struct vdpau_render_state *render, *render_ref;
> > @@ -427,23 +445,6 @@ void 
> > ff_vdpau_h264_set_reference_frames(H264Context *h)
> >  }
> >  }
> > 
> > -void ff_vdpau_add_data_chunk(uint8_t *data, const uint8_t *buf,
> > int buf_size)
> > -{
> > -struct vdpau_render_state *render = (struct 
> > vdpau_render_state*)data;
> > -assert(render);
> > -
> > -render->bitstream_buffers= av_fast_realloc(
> > -render->bitstream_buffers,
> > -&render->bitstream_buffers_allocated,
> > -
> > sizeof(*render->bitstream_buffers)*(render->bitstream_buffers_used
> > + 1)
> > -);
> > -
> > -
> > render->bitstream_buffers[render->bitstream_buffers_used].struct_version
> >  = VDP_BITSTREAM_BUFFER_VERSION;
> > -
> > render->bitstream_buffers[render->bitstream_buffers_used].bitstream
> >= buf;
> > -
> > render->bitstream_buffers[render->bitstream_buffers_used].bitstream_bytes
> > = buf_size;
> > -render->bitstream_buffers_used++;
> > -}
> > -
> >  void ff_vdpau_h264_picture_start(H264Context *h)
> >  {
> >  struct vdpau_render_state *render;
> > @@ -506,7 +507,7 @@ void ff_vdpau_h264_picture_complete(H264Context
> > *h) }
> >  #endif /* CONFIG_H264_VDPAU_DECODER */
> > 
> > -#if (CONFIG_MPEG_VDPAU_DECODER || CONFIG_MPEG1_VDPAU_DECODER) && 
> > FF_API_VDPAU
> > +#if CONFIG_MPEG_VDPAU_DECODER || CONFIG_MPEG1_VDPAU_DECODER
> >  void ff_vdpau_mpeg_picture_complete(MpegEncContext *s, const
> > uint8_t *buf,
> >  int buf_size, int slice_count)
> >  {
> > @@ -565,7 +566,7 @@ void
> > ff_vdpau_mpeg_picture_complete(MpegEncContext *s, const uint8_t
> > *buf, }
> >  #endif /* CONFIG_MPEG_VDPAU_DECODER || CONFIG_MPEG1_VDPAU_DECODER
> > */
> > 
> > -#if CONFIG_VC1_VDPAU_DECODER && FF_API_VDPAU
> > +#if CONFIG_VC1_VDPAU_DECODER
> >  void ff_vdpau_vc1_decode_picture(MpegEncContext *s, const uint8_t 
> > *buf,
> >   int buf_size)
> >  {
> > @@ -636,7 +637,7 @@ void ff_vdpau_vc1_decode_picture(MpegEncContext
> > *s, const uint8_t *buf,
> >  }
> >  #endif /* (CONFIG_VC1_VDPAU_DECODER */
> > 
> > -#if CONFIG_MPEG4_VDPAU_DECODER && FF_API_VDPAU
> > +#if CONFIG_MPEG4_VDPAU_DECODER
> >  void ff_vdpau_mpeg4_decode_picture(Mpeg4DecContext *ctx, const
> > uint8_t *buf,
> > int buf_size)
> >  {
> > @@ -692,6 +693,7 @@ void
> > ff_vdpau_mpeg4_decode_picture(Mpeg4DecContext *ctx, const uint8_t
> > *buf, render->bitstream_buffers_used = 0;
> >  }
> >  #endif /* CONFIG_MPEG4_VDPAU_DECODER */
> > +#endif /* FF_API_VDPAU */
> > 
> >  int av_vdpau_get_profile(AVCodecContext *avctx, VdpDecoderProfile 
> > *profile)
> >  {
> 
> This looks correct, but I won't be able to test it until tonight.

Compiles fine. Ship it.

--phil
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] HLS Stream on Kodi

2015-08-25 Thread Lucas Andrade
I'm trying to run a HLS Live Stream on Kodi and I'm getting an error 403
after 5 minutes. Checking the wireshark capture I did realize that the
ffmpeg requests aren't changing a cookie that is set on every response.

Do you guys confirm that is a FFMpeg issue?

GET
/dvr/m/off24ha/master-playlist.m3u8?h=0411440465697761939438414404691735864119652h6rN-AOOhXZcPlp2UCV8Fg&k=html5&a=F&u=52dfc02cdd2381059f57_605fd6ba-6320-4a5a-b10f-065e5363421d
HTTP/1.1
Range: bytes=0-
User-Agent: Kodi/14.1 (Windows NT 10.0; WOW64) App_Bitness/32
Version/14.1-Git:20150129-38e4046
Host: live.hls.globo.com
Accept: */*
Cookie: locksession=
Accept-Charset: UTF-8,*;q=0.8


HTTP/1.1 200 OK
Server: nginx
Date: Tue, 25 Aug 2015 01:19:39 GMT
Content-Type: application/vnd.apple.mpegurl
Content-Length: 573
Connection: keep-alive
Set-Cookie:
vssession=cR_S3dMoZipzPbX8eNy0Qw14404658790059058404/dvr/m/off24ha/?0411440465697761939438414404691735864119652h6rN-AOOhXZcPlp2UCV8Fg|F|52dfc02cdd2381059f57_605fd6ba-6320-4a5a-b10f-065e5363421d;
Expires=Tue, 25 Aug 2015 01:24:39 GMT; Path=/dvr/m/off24ha/;
Vary: Accept-Encoding
Expires: Tue, 25 Aug 2015 01:19:41 GMT
Cache-Control: private, max-age=0, no-cache
Set-Cookie: locksession=8171fe6881c99d4d95b53cd0dcf3acd9; Path=/;
Max-Age=300

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=264000
off24ha_264/playlist.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=464000
off24ha_464/playlist.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=75
off24ha_750/playlist.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1264000
off24ha_1264/playlist.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1864000
off24ha_1864/playlist.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2564000
off24ha_2564/playlist.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=64000,CODECS="mp4a.40.2"
off24ha_264/playlist-audio.m3u8


GET /dvr/m/off24ha/off24ha_2564/playlist.m3u8 HTTP/1.1
User-Agent: Kodi/14.1 (Windows NT 10.0; WOW64) App_Bitness/32
Version/14.1-Git:20150129-38e4046
Accept: */*
Connection: close
Host: live.hls.globo.com
Cookie: locksession=8171fe6881c99d4d95b53cd0dcf3acd9;
vssession=cR_S3dMoZipzPbX8eNy0Qw14404658790059058404/dvr/m/off24ha/?0411440465697761939438414404691735864119652h6rN-AOOhXZcPlp2UCV8Fg|F|52dfc02cdd2381059f57_605fd6ba-6320-4a5a-b10f-065e5363421d;
locksession=8171fe6881c99d4d95b53cd0dcf3acd9
Icy-MetaData: 1


HTTP/1.1 200 OK
Server: nginx
Date: Tue, 25 Aug 2015 01:23:03 GMT
Content-Type: application/vnd.apple.mpegurl
Content-Length: 750
Connection: close
Set-Cookie:
vssession=UPDcUGHKJXpc7LOg8kGzuQ14404660821688619614/dvr/m/off24ha/?0411440465697761939438414404691735864119652h6rN-AOOhXZcPlp2UCV8Fg|F|52dfc02cdd2381059f57_605fd6ba-6320-4a5a-b10f-065e5363421d;
Expires=Tue, 25 Aug 2015 01:28:02 GMT; Path=/dvr/m/off24ha/;
Vary: Accept-Encoding
Expires: Tue, 25 Aug 2015 01:23:05 GMT
Cache-Control: private, max-age=0, no-cache
Set-Cookie: locksession=8171fe6881c99d4d95b53cd0dcf3acd9; Path=/;
Max-Age=300

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:5
#EXT-X-MEDIA-SEQUENCE:171228
#EXTINF:5.,
off24ha_2564-1440465725-148687275600.ts
#EXTINF:5.,
off24ha_2564-1440465730-148687725600.ts
#EXTINF:5.,
off24ha_2564-1440465735-148688175600.ts
#EXTINF:5.,
off24ha_2564-1440465740-148688625600.ts
#EXTINF:5.,
off24ha_2564-1440465745-148689075600.ts
#EXTINF:5.,
off24ha_2564-1440465750-148689525600.ts
#EXTINF:5.,
off24ha_2564-1440465755-148689975600.ts
#EXTINF:5.,
off24ha_2564-1440465760-148690425600.ts
#EXTINF:5.,
off24ha_2564-1440465765-148690875600.ts
#EXTINF:5.,
off24ha_2564-1440465770-148691325600.ts
#EXTINF:5.,
off24ha_2564-1440465775-148691775600.ts
#EXTINF:5.,
off24ha_2564-1440465780-148692225600.ts


GET /dvr/m/off24ha/off24ha_2564/off24ha_2564-1440465730-148687725600.ts
HTTP/1.1
User-Agent: Kodi/14.1 (Windows NT 10.0; WOW64) App_Bitness/32
Version/14.1-Git:20150129-38e4046
Accept: */*
Connection: close
Host: live.hls.globo.com
Cookie: locksession=8171fe6881c99d4d95b53cd0dcf3acd9;
vssession=cR_S3dMoZipzPbX8eNy0Qw14404658790059058404/dvr/m/off24ha/?0411440465697761939438414404691735864119652h6rN-AOOhXZcPlp2UCV8Fg|F|52dfc02cdd2381059f57_605fd6ba-6320-4a5a-b10f-065e5363421d;
locksession=8171fe6881c99d4d95b53cd0dcf3acd9
Icy-MetaData: 1


HTTP/1.1 200 OK
Server: nginx
Date: Tue, 25 Aug 2015 01:23:03 GMT
Content-Type: video/MP2T
Content-Length: 1690308
Connection: close
Set-Cookie:
vssession=Psd_ZJE9VB33-uVq-64xew14404660830665574113/dvr/m/off24ha/?0411440465697761939438414404691735864119652h6rN-AOOhXZcPlp2UCV8Fg|F|52dfc02cdd2381059f57_605fd6ba-6320-4a5a-b10f-065e5363421d;
Expires=Tue, 25 Aug 2015 01:28:03 GMT; Path=/dvr/m/off24ha/;
Expires: Tue, 25 Aug 2015 01:23:02 GMT
Cache-Control: no-cache


GET /dvr/m/off24ha/off24ha_2564/off24ha_2564-1440465735-148688175600.ts
HTTP/1.1
User-Agent: Kodi/14.1 (Windows NT 10.0; WOW64) App_Bitness/32
Version/14.1-Git:20150129-38e4046
Accept: */*
Connection: close
Host: live.hls.globo.com
Cookie: locksession=8171fe6881

Re: [FFmpeg-devel] [PATCH] ffmpeg_opt: Add -hwaccels option that lists all supported hwaccels

2015-08-25 Thread Ganesh Ajjanagadde
On Tue, Aug 25, 2015 at 9:03 PM, Timothy Gu  wrote:
> On Tue, Aug 25, 2015 at 08:19:59PM -0400, Ganesh Ajjanagadde wrote:
>> For consistency, prefix with an opt_?
>
> This name is chosen to be consistent with other show_ functions. opt_*
> are exclusively used for setting some options AFAICT.

Ok. Please place the function outside of all the opt_* stuff;
since this is not setting options, it should not be in the middle of them.
Otherwise, patch LGTM.

>
>> Maybe you could check the return value of printf?
>
> Absolutely zero calls to printf in FFmpeg are checked. Even if checking
> the result code can be more secure, it is way outside the scope of this
> patch.

Perhaps. My point was not so much from the position of security,
but program correctness: a non zero printf return should propagate to
the exit code.
You are right this is beyond this patch's scope.

>
> Timothy
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] ffmpeg_opt: Add -hwaccels option that lists all supported hwaccels

2015-08-25 Thread Timothy Gu
On Tue, Aug 25, 2015 at 08:19:59PM -0400, Ganesh Ajjanagadde wrote:
> For consistency, prefix with an opt_?

This name is chosen to be consistent with other show_ functions. opt_*
are exclusively used for setting some options AFAICT.

> Maybe you could check the return value of printf?

Absolutely zero calls to printf in FFmpeg are checked. Even if checking
the result code can be more secure, it is way outside the scope of this
patch.

Timothy
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] ffmpeg_opt: Add -hwaccels option that lists all supported hwaccels

2015-08-25 Thread Timothy Gu
On Tue, Aug 25, 2015 at 08:28:43PM -0400, Ganesh Ajjanagadde wrote:
> On Tue, Aug 25, 2015 at 8:08 PM, Timothy Gu  wrote:
> >
> > cmdutils.c is shared for all ff* programs. -hwaccel is only supported in
> > ffmpeg.
> 
> Why?

Because nobody has implemented it for other fftools yet.

> I don't know about this and I might be naive here,
> but isn't hardware acceleration useful for decoding as well?

The existing hwaccel is only for decoding.

Timothy
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] api-h264-test: rename and expand

2015-08-25 Thread Michael Niedermayer
On Tue, Aug 25, 2015 at 11:00:40PM +0300, Ludmila Glinskih wrote:
> Add support of floating point decoders. Add support of audio decoders.
> ---
>  tests/api/Makefile |   2 +-
>  tests/api/api-decode-test.c| 355 
> +
>  tests/api/api-h264-test.c  | 166 ---
>  tests/fate/api.mak |  12 +-
>  tests/ref/fate/api-decode-h264 |  18 +++
>  tests/ref/fate/api-h264|  18 ---
>  6 files changed, 383 insertions(+), 188 deletions(-)
>  create mode 100644 tests/api/api-decode-test.c
>  delete mode 100644 tests/api/api-h264-test.c
>  create mode 100644 tests/ref/fate/api-decode-h264
>  delete mode 100644 tests/ref/fate/api-h264
> 
> diff --git a/tests/api/Makefile b/tests/api/Makefile
> index 27f499f..57a7422 100644
> --- a/tests/api/Makefile
> +++ b/tests/api/Makefile
> @@ -1,5 +1,5 @@
>  APITESTPROGS-$(call ENCDEC, FLAC, FLAC) += api-flac
> -APITESTPROGS-$(call DEMDEC, H264, H264) += api-h264
> +APITESTPROGS-yes += api-decode
>  APITESTPROGS-yes += api-seek
>  APITESTPROGS-$(call DEMDEC, H263, H263) += api-band
>  APITESTPROGS += $(APITESTPROGS-yes)
> diff --git a/tests/api/api-decode-test.c b/tests/api/api-decode-test.c
> new file mode 100644
> index 000..29c7dd7
> --- /dev/null
> +++ b/tests/api/api-decode-test.c
> @@ -0,0 +1,355 @@
> +/*
> + * Copyright (c) 2015 Ludmila Glinskih
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a 
> copy
> + * of this software and associated documentation files (the "Software"), to 
> deal
> + * in the Software without restriction, including without limitation the 
> rights
> + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> + * copies of the Software, and to permit persons to whom the Software is
> + * furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice shall be included in
> + * all copies or substantial portions of the Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
> FROM,
> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
> + * THE SOFTWARE.
> + */
> +
> +/**
> + * Decode test.
> + */
> +
> +#include "libavutil/adler32.h"
> +#include "libavcodec/avcodec.h"
> +#include "libavformat/avformat.h"
> +#include "libavutil/imgutils.h"
> +#include "libswresample/swresample.h"
> +#include "libavutil/opt.h"
> +
> +static int resample_and_print_data(AVCodecContext *ctx, AVFrame *fr, int 
> sample_fmt)
> +{
> +struct SwrContext *swr_ctx;
> +int dst_nb_samples;
> +int dst_bufsize;
> +int dst_linesize = 0;
> +uint8_t **dst_data = NULL;
> +int result;
> +
> +swr_ctx = swr_alloc_set_opts(NULL,
> +fr->channel_layout,
> +sample_fmt,
> +fr->sample_rate,
> +fr->channel_layout,
> +ctx->sample_fmt,
> +fr->sample_rate,
> +0, NULL);
> +if (!swr_ctx) {
> +av_log(NULL, AV_LOG_ERROR, "Could not allocate resampler context\n");
> +return -1;
> +}
> +result = swr_init(swr_ctx);
> +if (result < 0) {
> +av_log(NULL, AV_LOG_ERROR, "Can't initialize the resampling 
> context\n");
> +return result;
> +}
> +dst_nb_samples = fr->nb_samples;
> +result = av_samples_alloc_array_and_samples(&dst_data, &dst_linesize, 
> fr->channels,
> + dst_nb_samples, sample_fmt, 0);
> +if (result < 0) {
> +av_log(NULL, AV_LOG_ERROR, "Can't allocate buffer for samples after 
> resampling\n");
> +return result;
> +}
> +

> +result = swr_convert(swr_ctx, dst_data, dst_nb_samples, (const uint8_t 
> **)fr->data, fr->nb_samples);
> +if (result < 0) {
> +av_log(NULL, AV_LOG_ERROR, "Error while resampling\n");
> +return result;
> +}
> +
> +dst_bufsize = av_samples_get_buffer_size(&dst_linesize, fr->channels, 
> result, sample_fmt, 1);
> +if (dst_bufsize < 0) {
> +av_log(NULL, AV_LOG_ERROR, "Can'get buffer size after resampling\n");
> +return dst_bufsize;
> +}
> +
> +fwrite(dst_data[0], 1, dst_bufsize, stdout);

this would mismatch on big endian


[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Frequently ignored answer#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.


signature.asc
Descri

Re: [FFmpeg-devel] [PATCH] ffmpeg_opt: Add -hwaccels option that lists all supported hwaccels

2015-08-25 Thread Ganesh Ajjanagadde
On Tue, Aug 25, 2015 at 8:08 PM, Timothy Gu  wrote:
> On Tue, Aug 25, 2015 at 5:06 PM Ganesh Ajjanagadde  wrote:
>
>> On Tue, Aug 25, 2015 at 7:47 PM, Timothy Gu  wrote:
>> > ---
>> >  doc/ffmpeg.texi |  4 
>> >  ffmpeg_opt.c| 14 ++
>> >  2 files changed, 18 insertions(+)
>> >
>> > diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
>> > index 51a4ec5..e1d8562 100644
>> > --- a/doc/ffmpeg.texi
>> > +++ b/doc/ffmpeg.texi
>> > @@ -698,6 +698,10 @@ is not specified, the value of the @var{DISPLAY}
>> environment variable is used
>> >  For DXVA2, this option should contain the number of the display adapter
>> to use.
>> >  If this option is not specified, the default adapter is used.
>> >  @end table
>> > +
>> > +@item -hwaccels
>> > +List all hardware acceleration methods supported in this build of
>> avconv.
>> > +
>>
>> This is ffmpeg, not avconv.
>>
>
> Oops. Fixed locally.
>
> Doesn't this belong in cmdutils.c?
>>
>
> No.
>
>
>> What was your rationale for placing it here?
>>
>
> cmdutils.c is shared for all ff* programs. -hwaccel is only supported in
> ffmpeg.

Why?
I don't know about this and I might be naive here,
but isn't hardware acceleration useful for decoding as well?
In this case it would be relevant to at least ffplay as well as ffmpeg.

>
> Timothy
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] ffmpeg_opt: Add -hwaccels option that lists all supported hwaccels

2015-08-25 Thread Ganesh Ajjanagadde
On Tue, Aug 25, 2015 at 7:47 PM, Timothy Gu  wrote:
> ---
>  doc/ffmpeg.texi |  4 
>  ffmpeg_opt.c| 14 ++
>  2 files changed, 18 insertions(+)
>
> diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
> index 51a4ec5..e1d8562 100644
> --- a/doc/ffmpeg.texi
> +++ b/doc/ffmpeg.texi
> @@ -698,6 +698,10 @@ is not specified, the value of the @var{DISPLAY} 
> environment variable is used
>  For DXVA2, this option should contain the number of the display adapter to 
> use.
>  If this option is not specified, the default adapter is used.
>  @end table
> +
> +@item -hwaccels
> +List all hardware acceleration methods supported in this build of avconv.
> +
>  @end table
>
>  @section Audio Options
> diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
> index a369224..b8b9022 100644
> --- a/ffmpeg_opt.c
> +++ b/ffmpeg_opt.c
> @@ -205,6 +205,18 @@ static int opt_video_standard(void *optctx, const char 
> *opt, const char *arg)
>  return opt_default(optctx, "standard", arg);
>  }
>
> +static int show_hwaccels(void *optctx, const char *opt, const char *arg)
> +{
> +int i;
> +
> +printf("Hardware acceleration methods:\n");
> +for (i = 0; i < FF_ARRAY_ELEMS(hwaccels) - 1; i++) {
> +printf("%s\n", hwaccels[i].name);
> +}
> +printf("\n");
> +return 0;
> +}

For consistency, prefix with an opt_?
Also, you always return a 0, making return value useless.
I understand this is done to match the func_arg signature.
Maybe you could check the return value of printf?
I do note that almost none of ffmpeg is that meticulous about these things,
but check out:
https://www.irill.org/events/ghm-gnu-hackers-meeting/videos/jim-meyering-goodbye-world-the-perils-of-relying-on-output-streams-in-c

> +
>  static int opt_audio_codec(void *optctx, const char *opt, const char *arg)
>  {
>  OptionsContext *o = optctx;
> @@ -3241,6 +3253,8 @@ const OptionDef options[] = {
>  #if CONFIG_VDA || CONFIG_VIDEOTOOLBOX
>  { "videotoolbox_pixfmt", HAS_ARG | OPT_STRING | OPT_EXPERT, { 
> &videotoolbox_pixfmt}, "" },
>  #endif
> +{ "hwaccels", OPT_EXIT,  
> { .func_arg = show_hwaccels },
> +"show available HW acceleration methods" },
>  { "autorotate",   HAS_ARG | OPT_BOOL | OPT_SPEC |
>OPT_EXPERT | OPT_INPUT,
> { .off = OFFSET(autorotate) },
>  "automatically insert correct rotate filters" },
> --
> 1.9.1
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] vaapi: Add hevc hwaccel support

2015-08-25 Thread Timo Rothenpieler
---
 configure   |   4 +
 libavcodec/Makefile |   1 +
 libavcodec/allcodecs.c  |   1 +
 libavcodec/hevc.c   |   5 +-
 libavcodec/vaapi_hevc.c | 449 
 5 files changed, 459 insertions(+), 1 deletion(-)
 create mode 100644 libavcodec/vaapi_hevc.c

diff --git a/configure b/configure
index 76c6662..4a3afb3 100755
--- a/configure
+++ b/configure
@@ -2425,6 +2425,8 @@ hevc_d3d11va_hwaccel_select="hevc_decoder"
 hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC"
 hevc_dxva2_hwaccel_select="hevc_decoder"
 hevc_qsv_hwaccel_deps="libmfx"
+hevc_vaapi_hwaccel_deps="vaapi VAPictureParameterBufferHEVC"
+hevc_vaapi_hwaccel_select="hevc_decoder"
 hevc_vdpau_hwaccel_deps="vdpau VdpPictureInfoHEVC"
 hevc_vdpau_hwaccel_select="hevc_decoder"
 mpeg_vdpau_decoder_deps="vdpau"
@@ -5145,6 +5147,8 @@ check_type "windows.h dxva.h" "DXVA_PicParams_HEVC" 
-DWINAPI_FAMILY=WINAPI_FAMIL
 check_type "windows.h d3d11.h" "ID3D11VideoDecoder"
 check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0602
 
+check_type "va/va.h" "VAPictureParameterBufferHEVC"
+
 check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC"
 
 if ! disabled w32threads && ! enabled pthreads; then
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 3c50ff8..407c6c3 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -715,6 +715,7 @@ OBJS-$(CONFIG_H264_VDPAU_HWACCEL) += vdpau_h264.o
 OBJS-$(CONFIG_H264_VIDEOTOOLBOX_HWACCEL)  += videotoolbox.o
 OBJS-$(CONFIG_HEVC_D3D11VA_HWACCEL)   += dxva2_hevc.o
 OBJS-$(CONFIG_HEVC_DXVA2_HWACCEL) += dxva2_hevc.o
+OBJS-$(CONFIG_HEVC_VAAPI_HWACCEL) += vaapi_hevc.o
 OBJS-$(CONFIG_HEVC_VDPAU_HWACCEL) += vdpau_hevc.o
 OBJS-$(CONFIG_MPEG1_VDPAU_HWACCEL)+= vdpau_mpeg12.o
 OBJS-$(CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL) += videotoolbox.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index d4ae497..dbf3927 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -89,6 +89,7 @@ void avcodec_register_all(void)
 REGISTER_HWACCEL(HEVC_D3D11VA,  hevc_d3d11va);
 REGISTER_HWACCEL(HEVC_DXVA2,hevc_dxva2);
 REGISTER_HWACCEL(HEVC_QSV,  hevc_qsv);
+REGISTER_HWACCEL(HEVC_VAAPI,hevc_vaapi);
 REGISTER_HWACCEL(HEVC_VDPAU,hevc_vdpau);
 REGISTER_HWACCEL(MPEG1_XVMC,mpeg1_xvmc);
 REGISTER_HWACCEL(MPEG1_VDPAU,   mpeg1_vdpau);
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 3f1a2bb..e7ac50e 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -328,7 +328,7 @@ static void export_stream_params(AVCodecContext *avctx, 
const HEVCParamSets *ps,
 
 static int set_sps(HEVCContext *s, const HEVCSPS *sps, enum AVPixelFormat 
pix_fmt)
 {
-#define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL + 
CONFIG_HEVC_D3D11VA_HWACCEL + CONFIG_HEVC_VDPAU_HWACCEL)
+#define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL + 
CONFIG_HEVC_D3D11VA_HWACCEL + CONFIG_HEVC_VAAPI_HWACCEL + 
CONFIG_HEVC_VDPAU_HWACCEL)
 enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmt = pix_fmts;
 int ret, i;
 
@@ -352,6 +352,9 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps, enum 
AVPixelFormat pix_fm
 #if CONFIG_HEVC_D3D11VA_HWACCEL
 *fmt++ = AV_PIX_FMT_D3D11VA_VLD;
 #endif
+#if CONFIG_HEVC_VAAPI_HWACCEL
+*fmt++ = AV_PIX_FMT_VAAPI;
+#endif
 #if CONFIG_HEVC_VDPAU_HWACCEL
 *fmt++ = AV_PIX_FMT_VDPAU;
 #endif
diff --git a/libavcodec/vaapi_hevc.c b/libavcodec/vaapi_hevc.c
new file mode 100644
index 000..d0f35bb
--- /dev/null
+++ b/libavcodec/vaapi_hevc.c
@@ -0,0 +1,449 @@
+/*
+ * HEVC HW decode acceleration through VA API
+ *
+ * Copyright (C) 2015 Timo Rothenpieler 
+ *
+ * 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
+ */
+
+#include "vaapi_internal.h"
+#include "hevc.h"
+#include "mpegutils.h"
+
+/**
+ * @file
+ * This file implements the glue code between FFmpeg's and VA API's
+ * structures for HEVC decoding.
+ */
+
+typedef struct vaapi_hevc_frame_data {
+VAPictureParameterBufferHEVC *pic_param;
+VASliceParameterBufferHEVC *last_slice_param;
+} vaapi_hevc_frame_data;
+
+/**
+ * Initialize an empty VA API picture.
+ *
+ * VA API requires a fixed-size reference picture array.
+ */
+static void init_vaapi_pic(VAPictu

Re: [FFmpeg-devel] [PATCH] ffmpeg_opt: Add -hwaccels option that lists all supported hwaccels

2015-08-25 Thread Timothy Gu
On Tue, Aug 25, 2015 at 5:06 PM Ganesh Ajjanagadde  wrote:

> On Tue, Aug 25, 2015 at 7:47 PM, Timothy Gu  wrote:
> > ---
> >  doc/ffmpeg.texi |  4 
> >  ffmpeg_opt.c| 14 ++
> >  2 files changed, 18 insertions(+)
> >
> > diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
> > index 51a4ec5..e1d8562 100644
> > --- a/doc/ffmpeg.texi
> > +++ b/doc/ffmpeg.texi
> > @@ -698,6 +698,10 @@ is not specified, the value of the @var{DISPLAY}
> environment variable is used
> >  For DXVA2, this option should contain the number of the display adapter
> to use.
> >  If this option is not specified, the default adapter is used.
> >  @end table
> > +
> > +@item -hwaccels
> > +List all hardware acceleration methods supported in this build of
> avconv.
> > +
>
> This is ffmpeg, not avconv.
>

Oops. Fixed locally.

Doesn't this belong in cmdutils.c?
>

No.


> What was your rationale for placing it here?
>

cmdutils.c is shared for all ff* programs. -hwaccel is only supported in
ffmpeg.

Timothy
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] ffmpeg_opt: Add -hwaccels option that lists all supported hwaccels

2015-08-25 Thread Ganesh Ajjanagadde
On Tue, Aug 25, 2015 at 7:47 PM, Timothy Gu  wrote:
> ---
>  doc/ffmpeg.texi |  4 
>  ffmpeg_opt.c| 14 ++
>  2 files changed, 18 insertions(+)
>
> diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
> index 51a4ec5..e1d8562 100644
> --- a/doc/ffmpeg.texi
> +++ b/doc/ffmpeg.texi
> @@ -698,6 +698,10 @@ is not specified, the value of the @var{DISPLAY} 
> environment variable is used
>  For DXVA2, this option should contain the number of the display adapter to 
> use.
>  If this option is not specified, the default adapter is used.
>  @end table
> +
> +@item -hwaccels
> +List all hardware acceleration methods supported in this build of avconv.
> +

This is ffmpeg, not avconv.

>  @end table
>
>  @section Audio Options
> diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
> index a369224..b8b9022 100644
> --- a/ffmpeg_opt.c
> +++ b/ffmpeg_opt.c
> @@ -205,6 +205,18 @@ static int opt_video_standard(void *optctx, const char 
> *opt, const char *arg)
>  return opt_default(optctx, "standard", arg);
>  }
>
> +static int show_hwaccels(void *optctx, const char *opt, const char *arg)
> +{
> +int i;
> +
> +printf("Hardware acceleration methods:\n");
> +for (i = 0; i < FF_ARRAY_ELEMS(hwaccels) - 1; i++) {
> +printf("%s\n", hwaccels[i].name);
> +}
> +printf("\n");
> +return 0;
> +}

Doesn't this belong in cmdutils.c?
What was your rationale for placing it here?

> +
>  static int opt_audio_codec(void *optctx, const char *opt, const char *arg)
>  {
>  OptionsContext *o = optctx;
> @@ -3241,6 +3253,8 @@ const OptionDef options[] = {
>  #if CONFIG_VDA || CONFIG_VIDEOTOOLBOX
>  { "videotoolbox_pixfmt", HAS_ARG | OPT_STRING | OPT_EXPERT, { 
> &videotoolbox_pixfmt}, "" },
>  #endif
> +{ "hwaccels", OPT_EXIT,  
> { .func_arg = show_hwaccels },
> +"show available HW acceleration methods" },

Likewise, shouldn't this be in cmdutils_common_opts.h?
There is no OPT_EXIT option in this table; they are all in
cmdutils_common_opts.h.

>  { "autorotate",   HAS_ARG | OPT_BOOL | OPT_SPEC |
>OPT_EXPERT | OPT_INPUT,
> { .off = OFFSET(autorotate) },
>  "automatically insert correct rotate filters" },
> --
> 1.9.1
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] ffmpeg_opt: Add -hwaccels option that lists all supported hwaccels

2015-08-25 Thread Timothy Gu
---
 doc/ffmpeg.texi |  4 
 ffmpeg_opt.c| 14 ++
 2 files changed, 18 insertions(+)

diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
index 51a4ec5..e1d8562 100644
--- a/doc/ffmpeg.texi
+++ b/doc/ffmpeg.texi
@@ -698,6 +698,10 @@ is not specified, the value of the @var{DISPLAY} 
environment variable is used
 For DXVA2, this option should contain the number of the display adapter to use.
 If this option is not specified, the default adapter is used.
 @end table
+
+@item -hwaccels
+List all hardware acceleration methods supported in this build of avconv.
+
 @end table
 
 @section Audio Options
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index a369224..b8b9022 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -205,6 +205,18 @@ static int opt_video_standard(void *optctx, const char 
*opt, const char *arg)
 return opt_default(optctx, "standard", arg);
 }
 
+static int show_hwaccels(void *optctx, const char *opt, const char *arg)
+{
+int i;
+
+printf("Hardware acceleration methods:\n");
+for (i = 0; i < FF_ARRAY_ELEMS(hwaccels) - 1; i++) {
+printf("%s\n", hwaccels[i].name);
+}
+printf("\n");
+return 0;
+}
+
 static int opt_audio_codec(void *optctx, const char *opt, const char *arg)
 {
 OptionsContext *o = optctx;
@@ -3241,6 +3253,8 @@ const OptionDef options[] = {
 #if CONFIG_VDA || CONFIG_VIDEOTOOLBOX
 { "videotoolbox_pixfmt", HAS_ARG | OPT_STRING | OPT_EXPERT, { 
&videotoolbox_pixfmt}, "" },
 #endif
+{ "hwaccels", OPT_EXIT,
  { .func_arg = show_hwaccels },
+"show available HW acceleration methods" },
 { "autorotate",   HAS_ARG | OPT_BOOL | OPT_SPEC |
   OPT_EXPERT | OPT_INPUT,  
  { .off = OFFSET(autorotate) },
 "automatically insert correct rotate filters" },
-- 
1.9.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [libav-devel] [PATCH 20/20] Bump major versions of all libraries

2015-08-25 Thread Andreas Cadhalpun
On 25.08.2015 11:03, Vittorio Giovara wrote:
> On Mon, Aug 24, 2015 at 11:43 PM, Andreas Cadhalpun
>  wrote:
>> On 24.08.2015 13:44, Vittorio Giovara wrote:
>>> On Tue, Jul 28, 2015 at 6:54 PM, Luca Barbato  wrote:
 On 28/07/15 15:41, Vittorio Giovara wrote:
> On Tue, Jul 28, 2015 at 2:40 PM, Luca Barbato  wrote:
>> On 28/07/15 15:30, Vittorio Giovara wrote:
>>> I believe to see general consensus towards applying the set as is.
>>
>> There is no consensus for that.
> 
> There is, consensus does not need to be unanimous, and so far only you
> have been expressing concerns (multiple times).

That's not true.
wm4, James and indirectly Ronald also had concerns.
And there have been more on ffmpeg-devel.

>>> I've added a skeleton to the wiki
>>> (https://wiki.libav.org/Migration/12) so that we can properly document
>>> the necessary changes before we release. Any help with that is of
>>> course welcome.
>>
>> I have a work-in-progress API-porting-guide.
> 
> if you're talking about the patch set you sent it, I don't believe
> it's a good idea adding yet-another-doc-file to the tree,

Having this in the tree is important, because then one can make
sure that whenever something gets deprecated the necessary
documentation for API users gets added.

> it mostly duplicates APIChanges

No, APIchanges lacks code examples and it contains too much unrelated
stuff to be useful as porting guide.

> and its contents are much better off on a wiki,

That has been tried and it didn't work that well. The current wiki pages
don't even mention many API deprecations/removals.

> where it can be quickly updated and edited. Your efforts are indeed
> commendable and I look forward to seeing the wiki page I linked filled
> with documentation.

You can copy the API-porting-guide to the wiki, whenever a release is
made.

>>> If no objections I'll push this set in the following days.
>>
>> Can you explain why you believe it makes any kind of sense to remove
>> widely used APIs like FF_API_PIX_FMT/FF_API_AVCODEC_FRAME, while
>> keeping completely useless ones like FF_API_MISSING_SAMPLE?
> 
> I was afraid someone would point out it's less than two years old.

Why that? You apparently don't care that avcodec_alloc_frame was
deprecated less than two years ago.
And anyway, doing these removals strictly according to the calendar
doesn't make sense.

The reason for keeping deprecated APIs is, as you say, that
"downstream users need time to update their applications".
For widely used APIs this naturally takes longer than for rarely
used ones.

> Jokes aside, missing_sample can go as well if you insist,

Yes, I do insist that the decision which APIs get removed now and which
are kept makes some kind of sense.
Apropos, delaying FF_API_NOCONST_GET_NAME also doesn't make any sense,
because API users can't adapt to that before it happened.

> while for
> the other two you mention do you have any other argument than being
> "widely used"?

That's a way better argument than your argument for FF_API_MISSING_SAMPLE.

What's your argument for keeping the ones you suggested?
In particular I'm interested in explanations for the following, unused APIs:
  [lavc]
- FF_API_AC_VLC
- FF_API_OLD_MSMPEG4
- FF_API_ASPECT_EXTENDED
- FF_API_ARCH_ALPHA
- FF_API_QSCALE_TYPE
- FF_API_MB_TYPE
- FF_API_FAST_MALLOC
- FF_API_NEG_LINESIZES
- FF_API_IDCT_XVIDMMX
- FF_API_INPUT_PRESERVED
- FF_API_AFD
  [lavfi]
- FF_API_AVFILTER_OPEN
- FF_API_AVFILTER_INIT_FILTER
  [lavu]
- FF_API_OPT_TYPE_METADATA
- FF_API_DLOG

> I believe we went over and over explaining why it's a
> good a idea to remove those, not sure how beneficial it is to iterate
> once again.

Let me try to phrase it differently:
If it's a good idea to remove those, it's an even better idea to remove
all those, which you suggested to delay, because they are much less used.
But you didn't propose that. Why?

Best regards,
Andreas
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] mxfdec: set AVFMT_SEEK_TO_PTS demuxer flag

2015-08-25 Thread Tomas Härdin
On Tue, 2015-08-25 at 07:58 +0100, tim nicholson wrote:
> On 14/08/15 13:27, Tomas Härdin wrote:
> > On Mon, 2015-08-10 at 10:14 +0200, Tomas Härdin wrote:
> >> On Sun, 2015-08-09 at 20:32 +0200, Marton Balint wrote:
> >>> Since 53f2ef2c4afb1d49a679dea9163cb0e4671f3117 seeking is done using
>  PTS.
> >>>
> >>> Signed-off-by: Marton Balint 
> >>> ---
> >>>  libavformat/mxfdec.c | 1 +
> >>>  1 file changed, 1 insertion(+)
> >>>
> >>> diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> >>> index 2d921db..5734976 100644
> >>> --- a/libavformat/mxfdec.c
> >>> +++ b/libavformat/mxfdec.c
> >>> @@ -3210,6 +3210,7 @@ static int mxf_read_seek(AVFormatContext *s, i
> nt stream_index, int64_t sample_ti
> >>>  AVInputFormat ff_mxf_demuxer = {
> >>>  .name   = "mxf",
> >>>  .long_name  = NULL_IF_CONFIG_SMALL("MXF (Material eXchange 
> Format)"),
> >>> +.flags  = AVFMT_SEEK_TO_PTS,
> >>>  .priv_data_size = sizeof(MXFContext),
> >>>  .read_probe = mxf_probe,
> >>>  .read_header= mxf_read_header,
> >>
> >> Yeah, I seem to recall this when swearing at the seek code in mxfdec
> >> some years ago. I'll wait a few days to see if any other MXF guys hav
> e
> >> something to say here or on IRC, then I suppose I'll push
> >>
> 
> Only the seek code you swear at?

Good point; MXF provides plenty of opportunity for getting riled up

> >> /Tomas
> > 
> > Pushed. Hopefully everything worked alright
> > 
> 
> Just back from leave, so time will tell

Indeed.

/Tomas

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] api-h264-test: rename and expand

2015-08-25 Thread Ludmila Glinskih
Add support of floating point decoders. Add support of audio decoders.
---
 tests/api/Makefile |   2 +-
 tests/api/api-decode-test.c| 355 +
 tests/api/api-h264-test.c  | 166 ---
 tests/fate/api.mak |  12 +-
 tests/ref/fate/api-decode-h264 |  18 +++
 tests/ref/fate/api-h264|  18 ---
 6 files changed, 383 insertions(+), 188 deletions(-)
 create mode 100644 tests/api/api-decode-test.c
 delete mode 100644 tests/api/api-h264-test.c
 create mode 100644 tests/ref/fate/api-decode-h264
 delete mode 100644 tests/ref/fate/api-h264

diff --git a/tests/api/Makefile b/tests/api/Makefile
index 27f499f..57a7422 100644
--- a/tests/api/Makefile
+++ b/tests/api/Makefile
@@ -1,5 +1,5 @@
 APITESTPROGS-$(call ENCDEC, FLAC, FLAC) += api-flac
-APITESTPROGS-$(call DEMDEC, H264, H264) += api-h264
+APITESTPROGS-yes += api-decode
 APITESTPROGS-yes += api-seek
 APITESTPROGS-$(call DEMDEC, H263, H263) += api-band
 APITESTPROGS += $(APITESTPROGS-yes)
diff --git a/tests/api/api-decode-test.c b/tests/api/api-decode-test.c
new file mode 100644
index 000..29c7dd7
--- /dev/null
+++ b/tests/api/api-decode-test.c
@@ -0,0 +1,355 @@
+/*
+ * Copyright (c) 2015 Ludmila Glinskih
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to 
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+/**
+ * Decode test.
+ */
+
+#include "libavutil/adler32.h"
+#include "libavcodec/avcodec.h"
+#include "libavformat/avformat.h"
+#include "libavutil/imgutils.h"
+#include "libswresample/swresample.h"
+#include "libavutil/opt.h"
+
+static int resample_and_print_data(AVCodecContext *ctx, AVFrame *fr, int 
sample_fmt)
+{
+struct SwrContext *swr_ctx;
+int dst_nb_samples;
+int dst_bufsize;
+int dst_linesize = 0;
+uint8_t **dst_data = NULL;
+int result;
+
+swr_ctx = swr_alloc_set_opts(NULL,
+fr->channel_layout,
+sample_fmt,
+fr->sample_rate,
+fr->channel_layout,
+ctx->sample_fmt,
+fr->sample_rate,
+0, NULL);
+if (!swr_ctx) {
+av_log(NULL, AV_LOG_ERROR, "Could not allocate resampler context\n");
+return -1;
+}
+result = swr_init(swr_ctx);
+if (result < 0) {
+av_log(NULL, AV_LOG_ERROR, "Can't initialize the resampling 
context\n");
+return result;
+}
+dst_nb_samples = fr->nb_samples;
+result = av_samples_alloc_array_and_samples(&dst_data, &dst_linesize, 
fr->channels,
+ dst_nb_samples, sample_fmt, 0);
+if (result < 0) {
+av_log(NULL, AV_LOG_ERROR, "Can't allocate buffer for samples after 
resampling\n");
+return result;
+}
+
+result = swr_convert(swr_ctx, dst_data, dst_nb_samples, (const uint8_t 
**)fr->data, fr->nb_samples);
+if (result < 0) {
+av_log(NULL, AV_LOG_ERROR, "Error while resampling\n");
+return result;
+}
+
+dst_bufsize = av_samples_get_buffer_size(&dst_linesize, fr->channels, 
result, sample_fmt, 1);
+if (dst_bufsize < 0) {
+av_log(NULL, AV_LOG_ERROR, "Can'get buffer size after resampling\n");
+return dst_bufsize;
+}
+
+fwrite(dst_data[0], 1, dst_bufsize, stdout);
+
+av_freep(dst_data);
+av_freep(&dst_data);
+swr_free(&swr_ctx);
+
+return 0;
+}
+
+static int decode_video(AVPacket *pkt, AVCodecContext *ctx, int is_bitexact, 
int i, int *got_frame, int stream)
+{
+AVFrame *fr = NULL;
+uint8_t *byte_buffer = NULL;
+int number_of_written_bytes;
+int byte_buffer_size = 0;
+int result;
+
+fr = av_frame_alloc();
+if (!fr) {
+av_log(NULL, AV_LOG_ERROR, "Can't allocate frame\n");
+return AVERROR(ENOMEM);
+}
+
+byte_buffer_size = av_image_get_buffer_size(ctx->pix_fmt, ctx->width, 
ctx->height, 16);
+byte_buffer = av_malloc(byte_buffer_size);
+if (!byte_buffer) {
+av

Re: [FFmpeg-devel] FFmpegs future and resigning as leader

2015-08-25 Thread compn
On Mon, 24 Aug 2015 14:51:25 -0600
Roger Pack  wrote:

> I guess most of the decision making will be decided in person or
> something like that [?]

no, we arent making decisions in person. this is something i can speak
for the project on.

i'm guessing its less than 10 ffmpeg devels showing up to vdd in sept.
there will be some discussions in person of course.

discussions on irc , email and on ml, decisions on ml so that all devels
can take part. since we currently dont have a leader, i guess we're back
to straight mob-rule democracy.

unless we can get baptiste to come back and be leader...

> Once there's general concensus around what to do I will follow it,
> please post an announcement or something :)

of course.


> I'll admit one of the thoughts I had for "recombining" was (cough)
> basically directing new patches to libav, then somebody [michael? not
> as a committer, just contributor] going back through the last 4 years
> of commits and trying to get them committed to libav.  Fun fun (not
> really--just a lot of work).  And possibly not an option dunno.

this idea to cherry pick has been suggested already. it is under
consideration by everyone right now. some people have made up their
minds.

4 years of patches would be quite a lot of work. michael was clear that
he did not want to deal with merging, forks or hostility anymore, so i
dont believe its nice to ask him to do this.

which means finding volunteers to do this idea.

somewhat related, there was talk on irc of a workaround to avoid
landing on a merge when using git bisect. i forgot it already.


there are of course many other ideas.

earlier in this thread it was suggested to write down your ideas and
we'll see how many of them we all agree on, then we'll vote on all of
that i guess.


> Cheers!
> -roger-

hope i answered some of the questions that i could. well this is just
my opinion i dont speak for the project.

-compn
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] avfilter: add hstack & vstack filter

2015-08-25 Thread Timothy Gu
On Tue, Aug 25, 2015 at 7:37 AM Paul B Mahol  wrote:

> +@section hstack
> +Stack streams horizontally.
> +
> +All streams must be of same pixel format and of same height.
>

Add a new line here


> +Note: this filter is faster then using @ref{overlay} and @ref{pad} filter

+to create same output.


You can use @float NOTE

Same below in vstack. You should also add a similar note in docs of pad
filter.

Timothy
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] vaapi: Add hevc hwaccel support

2015-08-25 Thread Philip Langdale

On 2015-08-25 10:33, Hendrik Leppkes wrote:
On Tue, Aug 25, 2015 at 7:24 PM, Philip Langdale  
wrote:

On 2015-08-25 05:06, Timo Rothenpieler wrote:


---
 configure   |   2 +
 libavcodec/Makefile |   1 +
 libavcodec/allcodecs.c  |   1 +
 libavcodec/hevc.c   |   5 +-
 libavcodec/vaapi_hevc.c | 442

 5 files changed, 450 insertions(+), 1 deletion(-)
 create mode 100644 libavcodec/vaapi_hevc.c

diff --git a/configure b/configure
index 1e82030..5868c26 100755
--- a/configure
+++ b/configure
@@ -2425,6 +2425,8 @@ hevc_d3d11va_hwaccel_select="hevc_decoder"
 hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC"
 hevc_dxva2_hwaccel_select="hevc_decoder"
 hevc_qsv_hwaccel_deps="libmfx"
+hevc_vaapi_hwaccel_deps="vaapi"
+hevc_vaapi_hwaccel_select="hevc_decoder"
 hevc_vdpau_hwaccel_deps="vdpau VdpPictureInfoHEVC"
 hevc_vdpau_hwaccel_select="hevc_decoder"
 mpeg_vdpau_decoder_deps="vdpau"
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 3c50ff8..407c6c3 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -715,6 +715,7 @@ OBJS-$(CONFIG_H264_VDPAU_HWACCEL) +=
vdpau_h264.o
 OBJS-$(CONFIG_H264_VIDEOTOOLBOX_HWACCEL)  += videotoolbox.o
 OBJS-$(CONFIG_HEVC_D3D11VA_HWACCEL)   += dxva2_hevc.o
 OBJS-$(CONFIG_HEVC_DXVA2_HWACCEL) += dxva2_hevc.o
+OBJS-$(CONFIG_HEVC_VAAPI_HWACCEL) += vaapi_hevc.o
 OBJS-$(CONFIG_HEVC_VDPAU_HWACCEL) += vdpau_hevc.o
 OBJS-$(CONFIG_MPEG1_VDPAU_HWACCEL)+= vdpau_mpeg12.o
 OBJS-$(CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL) += videotoolbox.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index d4ae497..dbf3927 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -89,6 +89,7 @@ void avcodec_register_all(void)
 REGISTER_HWACCEL(HEVC_D3D11VA,  hevc_d3d11va);
 REGISTER_HWACCEL(HEVC_DXVA2,hevc_dxva2);
 REGISTER_HWACCEL(HEVC_QSV,  hevc_qsv);
+REGISTER_HWACCEL(HEVC_VAAPI,hevc_vaapi);
 REGISTER_HWACCEL(HEVC_VDPAU,hevc_vdpau);
 REGISTER_HWACCEL(MPEG1_XVMC,mpeg1_xvmc);
 REGISTER_HWACCEL(MPEG1_VDPAU,   mpeg1_vdpau);
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 3f1a2bb..e7ac50e 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -328,7 +328,7 @@ static void export_stream_params(AVCodecContext
*avctx, const HEVCParamSets *ps,

 static int set_sps(HEVCContext *s, const HEVCSPS *sps, enum
AVPixelFormat pix_fmt)
 {
-#define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL +
CONFIG_HEVC_D3D11VA_HWACCEL + CONFIG_HEVC_VDPAU_HWACCEL)
+#define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL +
CONFIG_HEVC_D3D11VA_HWACCEL + CONFIG_HEVC_VAAPI_HWACCEL +
CONFIG_HEVC_VDPAU_HWACCEL)
 enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmt = pix_fmts;
 int ret, i;

@@ -352,6 +352,9 @@ static int set_sps(HEVCContext *s, const HEVCSPS
*sps, enum AVPixelFormat pix_fm
 #if CONFIG_HEVC_D3D11VA_HWACCEL
 *fmt++ = AV_PIX_FMT_D3D11VA_VLD;
 #endif
+#if CONFIG_HEVC_VAAPI_HWACCEL
+*fmt++ = AV_PIX_FMT_VAAPI;
+#endif
 #if CONFIG_HEVC_VDPAU_HWACCEL
 *fmt++ = AV_PIX_FMT_VDPAU;
 #endif
diff --git a/libavcodec/vaapi_hevc.c b/libavcodec/vaapi_hevc.c
new file mode 100644
index 000..dd1e303
--- /dev/null
+++ b/libavcodec/vaapi_hevc.c
@@ -0,0 +1,442 @@
+/*
+ * HEVC HW decode acceleration through VA API
+ *
+ * Copyright (C) 2015 XBMC Foundation
+ *
+ * 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
+ */
+
+#include "vaapi_internal.h"
+#include "hevc.h"
+#include "mpegutils.h"
+
+/**
+ * @file
+ * This file implements the glue code between FFmpeg's and VA API's
+ * structures for HEVC decoding.
+ */
+
+typedef struct vaapi_hevc_frame_data {
+VAPictureParameterBufferHEVC *pic_param;
+VASliceParameterBufferHEVC *last_slice_param;
+} vaapi_hevc_frame_data;
+
+/**
+ * Initialize an empty VA API picture.
+ *
+ * VA API requires a fixed-size reference picture array.
+ */
+static void init_vaapi_pic(VAPictureHEVC *va_pic)
+{
+va_pic->picture_id = VA_INVALID_ID;
+va_pic->flags = VA_PICTURE_HEVC_INVALID;
+va_pic->pic_order_cnt = 0;
+}
+
+static void fill_vaapi_pic(VAPictureHEVC *va_pic, const HEVCFrame
*pic, int rps_type)
+{
+va_pic->picture_id = ff_vaapi_get_surface_id(pi

Re: [FFmpeg-devel] [PATCH] lavf/http: Fix parsing http request data to not read over '\0'.

2015-08-25 Thread Nicolas George
Le tridi 3 fructidor, an CCXXIII, Stephan Holljes a écrit :
> Signed-off-by: Stephan Holljes 
> ---
>  libavformat/http.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Pushed.

Regards,

-- 
  Nicolas George


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] configure: aac encoder requires lpc

2015-08-25 Thread wm4
On Tue, 25 Aug 2015 14:11:11 -0300
James Almer  wrote:

> On 25/08/15 1:59 PM, wm4 wrote:
> > Fixes compilation with --disable-encoders --enable-encoder=aac
> > ---
> > The missing dependency was pointed out by James Almer.
> > ---
> >  configure | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/configure b/configure
> > index 1e82030..da1f920 100755
> > --- a/configure
> > +++ b/configure
> > @@ -2151,7 +2151,7 @@ qsvenc_select="qsv"
> >  # decoders / encoders
> >  aac_decoder_select="imdct15 mdct sinewin"
> >  aac_fixed_decoder_select="mdct sinewin"
> > -aac_encoder_select="audio_frame_queue iirfilter mdct sinewin"
> > +aac_encoder_select="audio_frame_queue iirfilter mdct sinewin lpc"
> >  aac_latm_decoder_select="aac_decoder aac_latm_parser"
> >  ac3_decoder_select="ac3_parser ac3dsp bswapdsp fmtconvert mdct"
> >  ac3_fixed_decoder_select="ac3_parser ac3dsp bswapdsp mdct"
> > 
> 
> LGTM. And no need to send a patch for something as simple as this, really.

Pushed. I moved lpc before mdct, because it looks like they're supposed
to be sorted.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] checkasm: Fix floating point arguments on 64-bit Windows

2015-08-25 Thread Henrik Gramner
On Tue, Aug 25, 2015 at 1:44 PM, Michael Niedermayer
 wrote:
> works in mingw + wine

Applied.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] vaapi: Add hevc hwaccel support

2015-08-25 Thread Hendrik Leppkes
On Tue, Aug 25, 2015 at 7:24 PM, Philip Langdale  wrote:
> On 2015-08-25 05:06, Timo Rothenpieler wrote:
>>
>> ---
>>  configure   |   2 +
>>  libavcodec/Makefile |   1 +
>>  libavcodec/allcodecs.c  |   1 +
>>  libavcodec/hevc.c   |   5 +-
>>  libavcodec/vaapi_hevc.c | 442
>> 
>>  5 files changed, 450 insertions(+), 1 deletion(-)
>>  create mode 100644 libavcodec/vaapi_hevc.c
>>
>> diff --git a/configure b/configure
>> index 1e82030..5868c26 100755
>> --- a/configure
>> +++ b/configure
>> @@ -2425,6 +2425,8 @@ hevc_d3d11va_hwaccel_select="hevc_decoder"
>>  hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC"
>>  hevc_dxva2_hwaccel_select="hevc_decoder"
>>  hevc_qsv_hwaccel_deps="libmfx"
>> +hevc_vaapi_hwaccel_deps="vaapi"
>> +hevc_vaapi_hwaccel_select="hevc_decoder"
>>  hevc_vdpau_hwaccel_deps="vdpau VdpPictureInfoHEVC"
>>  hevc_vdpau_hwaccel_select="hevc_decoder"
>>  mpeg_vdpau_decoder_deps="vdpau"
>> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
>> index 3c50ff8..407c6c3 100644
>> --- a/libavcodec/Makefile
>> +++ b/libavcodec/Makefile
>> @@ -715,6 +715,7 @@ OBJS-$(CONFIG_H264_VDPAU_HWACCEL) +=
>> vdpau_h264.o
>>  OBJS-$(CONFIG_H264_VIDEOTOOLBOX_HWACCEL)  += videotoolbox.o
>>  OBJS-$(CONFIG_HEVC_D3D11VA_HWACCEL)   += dxva2_hevc.o
>>  OBJS-$(CONFIG_HEVC_DXVA2_HWACCEL) += dxva2_hevc.o
>> +OBJS-$(CONFIG_HEVC_VAAPI_HWACCEL) += vaapi_hevc.o
>>  OBJS-$(CONFIG_HEVC_VDPAU_HWACCEL) += vdpau_hevc.o
>>  OBJS-$(CONFIG_MPEG1_VDPAU_HWACCEL)+= vdpau_mpeg12.o
>>  OBJS-$(CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL) += videotoolbox.o
>> diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
>> index d4ae497..dbf3927 100644
>> --- a/libavcodec/allcodecs.c
>> +++ b/libavcodec/allcodecs.c
>> @@ -89,6 +89,7 @@ void avcodec_register_all(void)
>>  REGISTER_HWACCEL(HEVC_D3D11VA,  hevc_d3d11va);
>>  REGISTER_HWACCEL(HEVC_DXVA2,hevc_dxva2);
>>  REGISTER_HWACCEL(HEVC_QSV,  hevc_qsv);
>> +REGISTER_HWACCEL(HEVC_VAAPI,hevc_vaapi);
>>  REGISTER_HWACCEL(HEVC_VDPAU,hevc_vdpau);
>>  REGISTER_HWACCEL(MPEG1_XVMC,mpeg1_xvmc);
>>  REGISTER_HWACCEL(MPEG1_VDPAU,   mpeg1_vdpau);
>> diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
>> index 3f1a2bb..e7ac50e 100644
>> --- a/libavcodec/hevc.c
>> +++ b/libavcodec/hevc.c
>> @@ -328,7 +328,7 @@ static void export_stream_params(AVCodecContext
>> *avctx, const HEVCParamSets *ps,
>>
>>  static int set_sps(HEVCContext *s, const HEVCSPS *sps, enum
>> AVPixelFormat pix_fmt)
>>  {
>> -#define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL +
>> CONFIG_HEVC_D3D11VA_HWACCEL + CONFIG_HEVC_VDPAU_HWACCEL)
>> +#define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL +
>> CONFIG_HEVC_D3D11VA_HWACCEL + CONFIG_HEVC_VAAPI_HWACCEL +
>> CONFIG_HEVC_VDPAU_HWACCEL)
>>  enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmt = pix_fmts;
>>  int ret, i;
>>
>> @@ -352,6 +352,9 @@ static int set_sps(HEVCContext *s, const HEVCSPS
>> *sps, enum AVPixelFormat pix_fm
>>  #if CONFIG_HEVC_D3D11VA_HWACCEL
>>  *fmt++ = AV_PIX_FMT_D3D11VA_VLD;
>>  #endif
>> +#if CONFIG_HEVC_VAAPI_HWACCEL
>> +*fmt++ = AV_PIX_FMT_VAAPI;
>> +#endif
>>  #if CONFIG_HEVC_VDPAU_HWACCEL
>>  *fmt++ = AV_PIX_FMT_VDPAU;
>>  #endif
>> diff --git a/libavcodec/vaapi_hevc.c b/libavcodec/vaapi_hevc.c
>> new file mode 100644
>> index 000..dd1e303
>> --- /dev/null
>> +++ b/libavcodec/vaapi_hevc.c
>> @@ -0,0 +1,442 @@
>> +/*
>> + * HEVC HW decode acceleration through VA API
>> + *
>> + * Copyright (C) 2015 XBMC Foundation
>> + *
>> + * 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
>> + */
>> +
>> +#include "vaapi_internal.h"
>> +#include "hevc.h"
>> +#include "mpegutils.h"
>> +
>> +/**
>> + * @file
>> + * This file implements the glue code between FFmpeg's and VA API's
>> + * structures for HEVC decoding.
>> + */
>> +
>> +typedef struct vaapi_hevc_frame_data {
>> +VAPictureParameterBufferHEVC *pic_param;
>> +VASliceParameterBufferHEVC *last_slice_param;
>> +} vaapi_hevc_frame_data;
>> +
>> +/**
>> + * Initialize an empty VA API picture.
>> + *
>> + * VA API requires a fixed-size reference picture array.

Re: [FFmpeg-devel] [PATCH] vaapi: Add hevc hwaccel support

2015-08-25 Thread Philip Langdale

On 2015-08-25 05:06, Timo Rothenpieler wrote:

---
 configure   |   2 +
 libavcodec/Makefile |   1 +
 libavcodec/allcodecs.c  |   1 +
 libavcodec/hevc.c   |   5 +-
 libavcodec/vaapi_hevc.c | 442 


 5 files changed, 450 insertions(+), 1 deletion(-)
 create mode 100644 libavcodec/vaapi_hevc.c

diff --git a/configure b/configure
index 1e82030..5868c26 100755
--- a/configure
+++ b/configure
@@ -2425,6 +2425,8 @@ hevc_d3d11va_hwaccel_select="hevc_decoder"
 hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC"
 hevc_dxva2_hwaccel_select="hevc_decoder"
 hevc_qsv_hwaccel_deps="libmfx"
+hevc_vaapi_hwaccel_deps="vaapi"
+hevc_vaapi_hwaccel_select="hevc_decoder"
 hevc_vdpau_hwaccel_deps="vdpau VdpPictureInfoHEVC"
 hevc_vdpau_hwaccel_select="hevc_decoder"
 mpeg_vdpau_decoder_deps="vdpau"
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 3c50ff8..407c6c3 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -715,6 +715,7 @@ OBJS-$(CONFIG_H264_VDPAU_HWACCEL) += 
vdpau_h264.o

 OBJS-$(CONFIG_H264_VIDEOTOOLBOX_HWACCEL)  += videotoolbox.o
 OBJS-$(CONFIG_HEVC_D3D11VA_HWACCEL)   += dxva2_hevc.o
 OBJS-$(CONFIG_HEVC_DXVA2_HWACCEL) += dxva2_hevc.o
+OBJS-$(CONFIG_HEVC_VAAPI_HWACCEL) += vaapi_hevc.o
 OBJS-$(CONFIG_HEVC_VDPAU_HWACCEL) += vdpau_hevc.o
 OBJS-$(CONFIG_MPEG1_VDPAU_HWACCEL)+= vdpau_mpeg12.o
 OBJS-$(CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL) += videotoolbox.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index d4ae497..dbf3927 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -89,6 +89,7 @@ void avcodec_register_all(void)
 REGISTER_HWACCEL(HEVC_D3D11VA,  hevc_d3d11va);
 REGISTER_HWACCEL(HEVC_DXVA2,hevc_dxva2);
 REGISTER_HWACCEL(HEVC_QSV,  hevc_qsv);
+REGISTER_HWACCEL(HEVC_VAAPI,hevc_vaapi);
 REGISTER_HWACCEL(HEVC_VDPAU,hevc_vdpau);
 REGISTER_HWACCEL(MPEG1_XVMC,mpeg1_xvmc);
 REGISTER_HWACCEL(MPEG1_VDPAU,   mpeg1_vdpau);
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 3f1a2bb..e7ac50e 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -328,7 +328,7 @@ static void export_stream_params(AVCodecContext
*avctx, const HEVCParamSets *ps,

 static int set_sps(HEVCContext *s, const HEVCSPS *sps, enum
AVPixelFormat pix_fmt)
 {
-#define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL +
CONFIG_HEVC_D3D11VA_HWACCEL + CONFIG_HEVC_VDPAU_HWACCEL)
+#define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL +
CONFIG_HEVC_D3D11VA_HWACCEL + CONFIG_HEVC_VAAPI_HWACCEL +
CONFIG_HEVC_VDPAU_HWACCEL)
 enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmt = pix_fmts;
 int ret, i;

@@ -352,6 +352,9 @@ static int set_sps(HEVCContext *s, const HEVCSPS
*sps, enum AVPixelFormat pix_fm
 #if CONFIG_HEVC_D3D11VA_HWACCEL
 *fmt++ = AV_PIX_FMT_D3D11VA_VLD;
 #endif
+#if CONFIG_HEVC_VAAPI_HWACCEL
+*fmt++ = AV_PIX_FMT_VAAPI;
+#endif
 #if CONFIG_HEVC_VDPAU_HWACCEL
 *fmt++ = AV_PIX_FMT_VDPAU;
 #endif
diff --git a/libavcodec/vaapi_hevc.c b/libavcodec/vaapi_hevc.c
new file mode 100644
index 000..dd1e303
--- /dev/null
+++ b/libavcodec/vaapi_hevc.c
@@ -0,0 +1,442 @@
+/*
+ * HEVC HW decode acceleration through VA API
+ *
+ * Copyright (C) 2015 XBMC Foundation
+ *
+ * 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

+ */
+
+#include "vaapi_internal.h"
+#include "hevc.h"
+#include "mpegutils.h"
+
+/**
+ * @file
+ * This file implements the glue code between FFmpeg's and VA API's
+ * structures for HEVC decoding.
+ */
+
+typedef struct vaapi_hevc_frame_data {
+VAPictureParameterBufferHEVC *pic_param;
+VASliceParameterBufferHEVC *last_slice_param;
+} vaapi_hevc_frame_data;
+
+/**
+ * Initialize an empty VA API picture.
+ *
+ * VA API requires a fixed-size reference picture array.
+ */
+static void init_vaapi_pic(VAPictureHEVC *va_pic)
+{
+va_pic->picture_id = VA_INVALID_ID;
+va_pic->flags = VA_PICTURE_HEVC_INVALID;
+va_pic->pic_order_cnt = 0;
+}
+
+static void fill_vaapi_pic(VAPictureHEVC *va_pic, const HEVCFrame
*pic, int rps_type)
+{
+va_pic->picture_id = ff_vaapi_get_surface_id(pic->frame);
+va_pic->pic_order_cnt = pic->poc;
+va_pic->flags = rps_type;
+
+if (pic->fla

Re: [FFmpeg-devel] [PATCH] configure: aac encoder requires lpc

2015-08-25 Thread James Almer
On 25/08/15 1:59 PM, wm4 wrote:
> Fixes compilation with --disable-encoders --enable-encoder=aac
> ---
> The missing dependency was pointed out by James Almer.
> ---
>  configure | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index 1e82030..da1f920 100755
> --- a/configure
> +++ b/configure
> @@ -2151,7 +2151,7 @@ qsvenc_select="qsv"
>  # decoders / encoders
>  aac_decoder_select="imdct15 mdct sinewin"
>  aac_fixed_decoder_select="mdct sinewin"
> -aac_encoder_select="audio_frame_queue iirfilter mdct sinewin"
> +aac_encoder_select="audio_frame_queue iirfilter mdct sinewin lpc"
>  aac_latm_decoder_select="aac_decoder aac_latm_parser"
>  ac3_decoder_select="ac3_parser ac3dsp bswapdsp fmtconvert mdct"
>  ac3_fixed_decoder_select="ac3_parser ac3dsp bswapdsp mdct"
> 

LGTM. And no need to send a patch for something as simple as this, really.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] configure: aac encoder requires lpc

2015-08-25 Thread wm4
Fixes compilation with --disable-encoders --enable-encoder=aac
---
The missing dependency was pointed out by James Almer.
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 1e82030..da1f920 100755
--- a/configure
+++ b/configure
@@ -2151,7 +2151,7 @@ qsvenc_select="qsv"
 # decoders / encoders
 aac_decoder_select="imdct15 mdct sinewin"
 aac_fixed_decoder_select="mdct sinewin"
-aac_encoder_select="audio_frame_queue iirfilter mdct sinewin"
+aac_encoder_select="audio_frame_queue iirfilter mdct sinewin lpc"
 aac_latm_decoder_select="aac_decoder aac_latm_parser"
 ac3_decoder_select="ac3_parser ac3dsp bswapdsp fmtconvert mdct"
 ac3_fixed_decoder_select="ac3_parser ac3dsp bswapdsp mdct"
-- 
2.5.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/vdpau: fix compilation of mpeg1/mpeg4/vc1 decoders when h264 is disabled

2015-08-25 Thread Philip Langdale

On 2015-08-24 19:58, James Almer wrote:

Signed-off-by: James Almer 
---
Untested as i don't have a vdpau system.
See
http://fate.ffmpeg.org/report.cgi?time=20150823144028&slot=x86_64-archlinux-gcc-random

 libavcodec/vdpau.c | 44 +++-
 1 file changed, 23 insertions(+), 21 deletions(-)

diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c
index 7cb8ad2..b530466 100644
--- a/libavcodec/vdpau.c
+++ b/libavcodec/vdpau.c
@@ -358,7 +358,25 @@ int ff_vdpau_add_buffer(struct
vdpau_picture_context *pic_ctx,

 /* Obsolete non-hwaccel VDPAU support below... */

-#if CONFIG_H264_VDPAU_DECODER && FF_API_VDPAU
+#if FF_API_VDPAU
+void ff_vdpau_add_data_chunk(uint8_t *data, const uint8_t *buf, int 
buf_size)

+{
+struct vdpau_render_state *render = (struct 
vdpau_render_state*)data;

+assert(render);
+
+render->bitstream_buffers= av_fast_realloc(
+render->bitstream_buffers,
+&render->bitstream_buffers_allocated,
+
sizeof(*render->bitstream_buffers)*(render->bitstream_buffers_used + 1)

+);
+
+
render->bitstream_buffers[render->bitstream_buffers_used].struct_version
 = VDP_BITSTREAM_BUFFER_VERSION;
+
render->bitstream_buffers[render->bitstream_buffers_used].bitstream
   = buf;
+
render->bitstream_buffers[render->bitstream_buffers_used].bitstream_bytes
= buf_size;
+render->bitstream_buffers_used++;
+}
+
+#if CONFIG_H264_VDPAU_DECODER
 void ff_vdpau_h264_set_reference_frames(H264Context *h)
 {
 struct vdpau_render_state *render, *render_ref;
@@ -427,23 +445,6 @@ void 
ff_vdpau_h264_set_reference_frames(H264Context *h)

 }
 }

-void ff_vdpau_add_data_chunk(uint8_t *data, const uint8_t *buf, int 
buf_size)

-{
-struct vdpau_render_state *render = (struct 
vdpau_render_state*)data;

-assert(render);
-
-render->bitstream_buffers= av_fast_realloc(
-render->bitstream_buffers,
-&render->bitstream_buffers_allocated,
-
sizeof(*render->bitstream_buffers)*(render->bitstream_buffers_used + 1)

-);
-
-
render->bitstream_buffers[render->bitstream_buffers_used].struct_version
 = VDP_BITSTREAM_BUFFER_VERSION;
-
render->bitstream_buffers[render->bitstream_buffers_used].bitstream
   = buf;
-
render->bitstream_buffers[render->bitstream_buffers_used].bitstream_bytes
= buf_size;
-render->bitstream_buffers_used++;
-}
-
 void ff_vdpau_h264_picture_start(H264Context *h)
 {
 struct vdpau_render_state *render;
@@ -506,7 +507,7 @@ void ff_vdpau_h264_picture_complete(H264Context *h)
 }
 #endif /* CONFIG_H264_VDPAU_DECODER */

-#if (CONFIG_MPEG_VDPAU_DECODER || CONFIG_MPEG1_VDPAU_DECODER) && 
FF_API_VDPAU

+#if CONFIG_MPEG_VDPAU_DECODER || CONFIG_MPEG1_VDPAU_DECODER
 void ff_vdpau_mpeg_picture_complete(MpegEncContext *s, const uint8_t 
*buf,

 int buf_size, int slice_count)
 {
@@ -565,7 +566,7 @@ void ff_vdpau_mpeg_picture_complete(MpegEncContext
*s, const uint8_t *buf,
 }
 #endif /* CONFIG_MPEG_VDPAU_DECODER || CONFIG_MPEG1_VDPAU_DECODER */

-#if CONFIG_VC1_VDPAU_DECODER && FF_API_VDPAU
+#if CONFIG_VC1_VDPAU_DECODER
 void ff_vdpau_vc1_decode_picture(MpegEncContext *s, const uint8_t 
*buf,

  int buf_size)
 {
@@ -636,7 +637,7 @@ void ff_vdpau_vc1_decode_picture(MpegEncContext
*s, const uint8_t *buf,
 }
 #endif /* (CONFIG_VC1_VDPAU_DECODER */

-#if CONFIG_MPEG4_VDPAU_DECODER && FF_API_VDPAU
+#if CONFIG_MPEG4_VDPAU_DECODER
 void ff_vdpau_mpeg4_decode_picture(Mpeg4DecContext *ctx, const uint8_t 
*buf,

int buf_size)
 {
@@ -692,6 +693,7 @@ void ff_vdpau_mpeg4_decode_picture(Mpeg4DecContext
*ctx, const uint8_t *buf,
 render->bitstream_buffers_used = 0;
 }
 #endif /* CONFIG_MPEG4_VDPAU_DECODER */
+#endif /* FF_API_VDPAU */

 int av_vdpau_get_profile(AVCodecContext *avctx, VdpDecoderProfile 
*profile)

 {


This looks correct, but I won't be able to test it until tonight.

--phil
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 1/2] avfilter/framesync: allocate FFFrameSyncIn internally

2015-08-25 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
Already OKed years ago.
---
 libavfilter/dualinput.c  | 8 ++--
 libavfilter/dualinput.h  | 1 -
 libavfilter/framesync.c  | 9 -
 libavfilter/framesync.h  | 7 ---
 libavfilter/vf_mergeplanes.c | 7 ---
 5 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/libavfilter/dualinput.c b/libavfilter/dualinput.c
index 45f6810..ea2007f 100644
--- a/libavfilter/dualinput.c
+++ b/libavfilter/dualinput.c
@@ -42,9 +42,13 @@ static int process_frame(FFFrameSync *fs)
 
 int ff_dualinput_init(AVFilterContext *ctx, FFDualInputContext *s)
 {
-FFFrameSyncIn *in = s->fs.in;
+FFFrameSyncIn *in;
+int ret;
 
-ff_framesync_init(&s->fs, ctx, 2);
+if ((ret = ff_framesync_init(&s->fs, ctx, 2)) < 0)
+return ret;
+
+in = s->fs.in;
 s->fs.opaque = s;
 s->fs.on_event = process_frame;
 in[0].time_base = ctx->inputs[0]->time_base;
diff --git a/libavfilter/dualinput.h b/libavfilter/dualinput.h
index 0ec0ea7..5ff23e6 100644
--- a/libavfilter/dualinput.h
+++ b/libavfilter/dualinput.h
@@ -31,7 +31,6 @@
 
 typedef struct {
 FFFrameSync fs;
-FFFrameSyncIn second_input; /* must be immediately after fs */
 
 AVFrame *(*process)(AVFilterContext *ctx, AVFrame *main, const AVFrame 
*second);
 int shortest;   ///< terminate stream when the second input 
terminates
diff --git a/libavfilter/framesync.c b/libavfilter/framesync.c
index 12db50c..bdac40b 100644
--- a/libavfilter/framesync.c
+++ b/libavfilter/framesync.c
@@ -46,11 +46,16 @@ enum {
 STATE_EOF,
 };
 
-void ff_framesync_init(FFFrameSync *fs, void *parent, unsigned nb_in)
+int ff_framesync_init(FFFrameSync *fs, void *parent, unsigned nb_in)
 {
 fs->class  = &framesync_class;
 fs->parent = parent;
 fs->nb_in  = nb_in;
+
+fs->in = av_calloc(nb_in, sizeof(*fs->in));
+if (!fs->in)
+return AVERROR(ENOMEM);
+return 0;
 }
 
 static void framesync_sync_level_update(FFFrameSync *fs)
@@ -267,6 +272,8 @@ void ff_framesync_uninit(FFFrameSync *fs)
 av_frame_free(&fs->in[i].frame_next);
 ff_bufqueue_discard_all(&fs->in[i].queue);
 }
+
+av_freep(&fs->in);
 }
 
 int ff_framesync_process_frame(FFFrameSync *fs, unsigned all)
diff --git a/libavfilter/framesync.h b/libavfilter/framesync.h
index 2072781..7ba99d5 100644
--- a/libavfilter/framesync.h
+++ b/libavfilter/framesync.h
@@ -201,9 +201,9 @@ typedef struct FFFrameSync {
 uint8_t eof;
 
 /**
- * Array of inputs; all inputs must be in consecutive memory
+ * Pointer to array of inputs.
  */
-FFFrameSyncIn in[1]; /* must be the last field */
+FFFrameSyncIn *in;
 
 } FFFrameSync;
 
@@ -215,8 +215,9 @@ typedef struct FFFrameSync {
  * @param  fs  frame sync structure to initialize
  * @param  parent  parent object, used for logging
  * @param  nb_in   number of inputs
+ * @return  >= 0 for success or a negative error code
  */
-void ff_framesync_init(FFFrameSync *fs, void *parent, unsigned nb_in);
+int ff_framesync_init(FFFrameSync *fs, void *parent, unsigned nb_in);
 
 /**
  * Configure a frame sync structure.
diff --git a/libavfilter/vf_mergeplanes.c b/libavfilter/vf_mergeplanes.c
index c76e82a..734327e 100644
--- a/libavfilter/vf_mergeplanes.c
+++ b/libavfilter/vf_mergeplanes.c
@@ -46,7 +46,6 @@ typedef struct MergePlanesContext {
 const AVPixFmtDescriptor *outdesc;
 
 FFFrameSync fs;
-FFFrameSyncIn fsin[3]; /* must be immediately after fs */
 } MergePlanesContext;
 
 #define OFFSET(x) offsetof(MergePlanesContext, x)
@@ -174,9 +173,11 @@ static int config_output(AVFilterLink *outlink)
 MergePlanesContext *s = ctx->priv;
 InputParam inputsp[4];
 FFFrameSyncIn *in;
-int i;
+int i, ret;
+
+if ((ret = ff_framesync_init(&s->fs, ctx, s->nb_inputs)) < 0)
+return ret;
 
-ff_framesync_init(&s->fs, ctx, s->nb_inputs);
 in = s->fs.in;
 s->fs.opaque = s;
 s->fs.on_event = process_frame;
-- 
1.7.11.2

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavf/http: Export headers as AVDictionary

2015-08-25 Thread Nicolas George
Le quintidi 5 fructidor, an CCXXIII, Stephan Holljes a écrit :
> Signed-off-by: Stephan Holljes 
> ---
>  libavformat/http.c | 13 +
>  1 file changed, 13 insertions(+)
> 
> diff --git a/libavformat/http.c b/libavformat/http.c
> index fba87ac..064239b 100644
> --- a/libavformat/http.c
> +++ b/libavformat/http.c
> @@ -48,6 +48,7 @@
>  #define MAX_REDIRECTS 8
>  #define HTTP_SINGLE   1
>  #define HTTP_MUTLI2
> +#define MAX_HEADER_LINES 100
>  typedef enum {
>  LOWER_PROTO,
>  READ_HEADERS,
> @@ -69,6 +70,8 @@ typedef struct HTTPContext {
>  HTTPAuthState auth_state;
>  HTTPAuthState proxy_auth_state;
>  char *headers;
> +AVDictionary *headers_dict;
> +int nb_headers;
>  char *mime_type;
>  char *user_agent;
>  char *content_type;
> @@ -128,6 +131,7 @@ static const AVOption options[] = {
>  { "seekable", "control seekability of connection", OFFSET(seekable), 
> AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, D },
>  { "chunked_post", "use(s) chunked transfer-encoding for posts", 
> OFFSET(chunked_post), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, D | E },
>  { "headers", "set custom HTTP headers, can override built in default 
> headers", OFFSET(headers), AV_OPT_TYPE_STRING, { 0 }, 0, 0, D | E },
> +{ "headers_dict", "Contains the parsed headers as a dictionary.", 
> OFFSET(headers_dict), AV_OPT_TYPE_DICT, { 0 }, 0, 0, AV_OPT_FLAG_EXPORT | D | 
> E },
>  { "content_type", "set a specific content type for the POST messages", 
> OFFSET(content_type), AV_OPT_TYPE_STRING, { 0 }, 0, 0, D | E },
>  { "body", "set the body of a simple HTTP reply", OFFSET(body), 
> AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E },
>  { "user_agent", "override User-Agent header", OFFSET(user_agent), 
> AV_OPT_TYPE_STRING, { .str = DEFAULT_USER_AGENT }, 0, 0, D },
> @@ -910,6 +914,14 @@ static int process_line(URLContext *h, char *line, int 
> line_count,
>  return AVERROR(ENOMEM);
>  }
>  }

> +if (s->nb_headers < MAX_HEADER_LINES) {
> +if (av_dict_get(s->headers_dict, tag, NULL, 0)) {
> +av_dict_set(&s->headers_dict, tag, ",", AV_DICT_APPEND);
> +av_dict_set(&s->headers_dict, tag, p, AV_DICT_APPEND);
> +} else
> +av_dict_set(&s->headers_dict, tag, p, 0);
> +s->nb_headers++;
> +}

Nit: the usual coding style for FFmpeg is to put braces on both the if
clause and the else clause if one of them needs them.

This version has a more severe problem: it stores everything sent by the
client without a limit if it is given in duplicated headers. A malicious
client could exhaust the server's memory by sending endless similar headers.

I strongly suggest to limit both the total number of different headers as
you already do and the (approximate) total size of the headers data.

>  return 1;
>  }
>  
> @@ -1032,6 +1044,7 @@ static int http_read_header(URLContext *h, int 
> *new_location)
>  int err = 0;
>  
>  s->chunksize = -1;
> +s->nb_headers = 0;
>  
>  for (;;) {
>  if ((err = http_get_line(s, line, sizeof(line))) < 0)

Note: I write this mail assuming you intend to continue working on the
project in your free time. Of course, whether you decide to or not does not
affect the outcome of the GsoC evaluation.

Regards,

-- 
  Nicolas George


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/2] avfilter: add hstack & vstack filter

2015-08-25 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 doc/filters.texi |  29 +
 libavfilter/Makefile |   2 +
 libavfilter/allfilters.c |   2 +
 libavfilter/vf_stack.c   | 271 +++
 4 files changed, 304 insertions(+)
 create mode 100644 libavfilter/vf_stack.c

diff --git a/doc/filters.texi b/doc/filters.texi
index 2f7b0fa..47362e9 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -6589,6 +6589,20 @@ Set the scaling dimension: @code{2} for @code{hq2x}, 
@code{3} for
 Default is @code{3}.
 @end table
 
+@section hstack
+Stack streams horizontally.
+
+All streams must be of same pixel format and of same height.
+Note: this filter is faster then using @ref{overlay} and @ref{pad} filter
+to create same output.
+
+The filter accept the following option:
+
+@table @option
+@item nb_inputs
+Set number of input streams. Default is 2.
+@end table
+
 @section hue
 
 Modify the hue and/or the saturation of the input.
@@ -7736,6 +7750,7 @@ Set chroma strength.
 Must be a double value in the range 0-1000, default is @code{1.0}.
 @end table
 
+@anchor{pad}
 @section pad
 
 Add paddings to the input image, and place the original input at the
@@ -10892,6 +10907,20 @@ vignette='PI/4+random(1)*PI/50':eval=frame
 
 @end itemize
 
+@section vstack
+Stack streams vertically.
+
+All streams must be of same pixel format and of same width.
+Note: this filter is faster then using @ref{overlay} and @ref{pad} filter
+to create same output.
+
+The filter accept the following option:
+
+@table @option
+@item nb_inputs
+Set number of input streams. Default is 2.
+@end table
+
 @section w3fdif
 
 Deinterlace the input video ("w3fdif" stands for "Weston 3 Field
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index aa34d8b..58f990a 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -153,6 +153,7 @@ OBJS-$(CONFIG_HISTEQ_FILTER) += vf_histeq.o
 OBJS-$(CONFIG_HISTOGRAM_FILTER)  += vf_histogram.o
 OBJS-$(CONFIG_HQDN3D_FILTER) += vf_hqdn3d.o
 OBJS-$(CONFIG_HQX_FILTER)+= vf_hqx.o
+OBJS-$(CONFIG_HSTACK_FILTER) += vf_stack.o framesync.o
 OBJS-$(CONFIG_HUE_FILTER)+= vf_hue.o
 OBJS-$(CONFIG_IDET_FILTER)   += vf_idet.o
 OBJS-$(CONFIG_IL_FILTER) += vf_il.o
@@ -231,6 +232,7 @@ OBJS-$(CONFIG_VFLIP_FILTER)  += vf_vflip.o
 OBJS-$(CONFIG_VIDSTABDETECT_FILTER)  += vidstabutils.o 
vf_vidstabdetect.o
 OBJS-$(CONFIG_VIDSTABTRANSFORM_FILTER)   += vidstabutils.o 
vf_vidstabtransform.o
 OBJS-$(CONFIG_VIGNETTE_FILTER)   += vf_vignette.o
+OBJS-$(CONFIG_VSTACK_FILTER) += vf_stack.o framesync.o
 OBJS-$(CONFIG_W3FDIF_FILTER) += vf_w3fdif.o
 OBJS-$(CONFIG_WAVEFORM_FILTER)   += vf_waveform.o
 OBJS-$(CONFIG_XBR_FILTER)+= vf_xbr.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 353a1dc..0a1bdfd 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -169,6 +169,7 @@ void avfilter_register_all(void)
 REGISTER_FILTER(HISTOGRAM,  histogram,  vf);
 REGISTER_FILTER(HQDN3D, hqdn3d, vf);
 REGISTER_FILTER(HQX,hqx,vf);
+REGISTER_FILTER(HSTACK, hstack, vf);
 REGISTER_FILTER(HUE,hue,vf);
 REGISTER_FILTER(IDET,   idet,   vf);
 REGISTER_FILTER(IL, il, vf);
@@ -246,6 +247,7 @@ void avfilter_register_all(void)
 REGISTER_FILTER(VIDSTABDETECT,  vidstabdetect,  vf);
 REGISTER_FILTER(VIDSTABTRANSFORM, vidstabtransform, vf);
 REGISTER_FILTER(VIGNETTE,   vignette,   vf);
+REGISTER_FILTER(VSTACK, vstack, vf);
 REGISTER_FILTER(W3FDIF, w3fdif, vf);
 REGISTER_FILTER(WAVEFORM,   waveform,   vf);
 REGISTER_FILTER(XBR,xbr,vf);
diff --git a/libavfilter/vf_stack.c b/libavfilter/vf_stack.c
new file mode 100644
index 000..6342e3f
--- /dev/null
+++ b/libavfilter/vf_stack.c
@@ -0,0 +1,271 @@
+/*
+ * Copyright (c) 2015 Paul B. Mahol
+ *
+ * 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
+ */
+
+#include "li

Re: [FFmpeg-devel] [PATCH 03/13] avfilter: add missing FF_API_AVFILTERBUFFER guards

2015-08-25 Thread Nicolas George
Le nonidi 29 thermidor, an CCXXIII, Michael Niedermayer a écrit :
> PEEK/NO_REQUEST would tell if the fifo is empty or not
> av_buffersink_poll_frame() basically provided the user application
> with the number of frames in the fifo (plus what it could figure
> out from previous filters) but my concern is about loosing the
> detailed information about the fifo

That is true, but I am not sure it matters at all: I can not imagine how
that information could be really useful for an application.

Also, I might add I consider adding a callback API for buffersink, this is
IMHO more useful than inspecting the FIFO.

Regards,

-- 
  Nicolas George


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] configure: warn if GCC 4.2 is being used

2015-08-25 Thread Ganesh Ajjanagadde
On Tue, Aug 25, 2015 at 5:37 AM, Carl Eugen Hoyos  wrote:
> Ganesh Ajjanagadde  gmail.com> writes:
>
>> +if [ "$first" = true ]; then
>> +case $gcc_basever in
>> +4.2*)
>> +warn "gcc 4.2 is outdated and may miscompile
>> FFmpeg. Please use a newer compiler."
>
> Nothing wrong with that if the English Language Police
> has no objections.
>
> And I still consider it an improvement.
>
>> +warn "See https://trac.ffmpeg.org/ticket/1464
>> for more details." ;;
>
> I don't think the ticket contains useful information, the
> issue iirc was that users from time to time reported
> issues and it turned out that their compiler was buggy.

I put this because that is what the wiki does.
There is perhaps a minor benefit in that 1464 links to 3970,
where it is mentioned that certain patched versions work just fine.
Anyway, I will delete this unless someone has a better idea.

>
> Carl Eugen
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] FFmpegs future and resigning as leader

2015-08-25 Thread wm4
On Tue, 25 Aug 2015 13:23:47 +0200
Jan Ehrhardt  wrote:

> Roger Pack in gmane.comp.video.ffmpeg.devel (Mon, 24 Aug 2015 14:51:25
> -0600):
> >I will also admit my one other concern: that without Michael there
> >won't be enough active leadership *total* to "fix all the annoying
> >bugs" and everything.
> 
> There is another concern: Michael was doing the merges from Libav into
> FFmpeg. If that stops Libav and FFmpeg will drift apart and gradually
> become incompatible. That would be a real pity.

Someone already took over merging. And Michael not doing merges anymore
was the only actual effect of the "resignation" so far.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] vaapi: Add hevc hwaccel support

2015-08-25 Thread wm4
On Tue, 25 Aug 2015 14:52:13 +0200
Michael Niedermayer  wrote:

> On Tue, Aug 25, 2015 at 02:06:19PM +0200, Timo Rothenpieler wrote:
> > ---
> >  configure   |   2 +
> >  libavcodec/Makefile |   1 +
> >  libavcodec/allcodecs.c  |   1 +
> >  libavcodec/hevc.c   |   5 +-
> >  libavcodec/vaapi_hevc.c | 442 
> > 
> >  5 files changed, 450 insertions(+), 1 deletion(-)
> >  create mode 100644 libavcodec/vaapi_hevc.c
> 
> fails to build:
> CC  libavcodec/vaapi_hevc.o
> libavcodec/vaapi_hevc.c:34:5: error: unknown type name 
> ‘VAPictureParameterBufferHEVC’

Obviously you need a recent libva, and obviously the patch should
include a check for it.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] vaapi: Add hevc hwaccel support

2015-08-25 Thread Michael Niedermayer
On Tue, Aug 25, 2015 at 02:06:19PM +0200, Timo Rothenpieler wrote:
> ---
>  configure   |   2 +
>  libavcodec/Makefile |   1 +
>  libavcodec/allcodecs.c  |   1 +
>  libavcodec/hevc.c   |   5 +-
>  libavcodec/vaapi_hevc.c | 442 
> 
>  5 files changed, 450 insertions(+), 1 deletion(-)
>  create mode 100644 libavcodec/vaapi_hevc.c

fails to build:
CC  libavcodec/vaapi_hevc.o
libavcodec/vaapi_hevc.c:34:5: error: unknown type name 
‘VAPictureParameterBufferHEVC’
libavcodec/vaapi_hevc.c:35:5: error: unknown type name 
‘VASliceParameterBufferHEVC’
libavcodec/vaapi_hevc.c:43:28: error: unknown type name ‘VAPictureHEVC’
libavcodec/vaapi_hevc.c:50:28: error: unknown type name ‘VAPictureHEVC’
libavcodec/vaapi_hevc.c: In function ‘find_frame_rps_type’:
libavcodec/vaapi_hevc.c:75:20: error: ‘VA_PICTURE_HEVC_RPS_ST_CURR_BEFORE’ 
undeclared (first use in this function)
libavcodec/vaapi_hevc.c:75:20: note: each undeclared identifier is reported 
only once for each function it appears in
libavcodec/vaapi_hevc.c:80:20: error: ‘VA_PICTURE_HEVC_RPS_ST_CURR_AFTER’ 
undeclared (first use in this function)
libavcodec/vaapi_hevc.c:85:20: error: ‘VA_PICTURE_HEVC_RPS_LT_CURR’ undeclared 
(first use in this function)
libavcodec/vaapi_hevc.c: At top level:
libavcodec/vaapi_hevc.c:91:62: error: unknown type name 
‘VAPictureParameterBufferHEVC’
libavcodec/vaapi_hevc.c: In function ‘get_ref_pic_index’:
libavcodec/vaapi_hevc.c:117:5: error: unknown type name 
‘VAPictureParameterBufferHEVC’
libavcodec/vaapi_hevc.c:123:31: error: request for member ‘ReferenceFrames’ in 
something not a structure or union
libavcodec/vaapi_hevc.c:123:62: error: request for member ‘ReferenceFrames’ in 
something not a structure or union
libavcodec/vaapi_hevc.c:124:29: error: request for member ‘ReferenceFrames’ in 
something not a structure or union
libavcodec/vaapi_hevc.c:125:21: error: request for member ‘ReferenceFrames’ in 
something not a structure or union
libavcodec/vaapi_hevc.c: At top level:
libavcodec/vaapi_hevc.c:133:59: error: unknown type name 
‘VAPictureParameterBufferHEVC’
libavcodec/vaapi_hevc.c: In function ‘vaapi_hevc_start_frame’:
libavcodec/vaapi_hevc.c:260:5: error: unknown type name 
‘VAPictureParameterBufferHEVC’
libavcodec/vaapi_hevc.c:261:5: error: unknown type name ‘VAIQMatrixBufferHEVC’
libavcodec/vaapi_hevc.c:266:38: error: ‘VASliceParameterBufferHEVC’ undeclared 
(first use in this function)
libavcodec/vaapi_hevc.c:269:56: error: ‘VAPictureParameterBufferHEVC’ 
undeclared (first use in this function)
libavcodec/vaapi_hevc.c:272:5: error: implicit declaration of function 
‘fill_picture_parameters’ [-Werror=implicit-function-declaration]
libavcodec/vaapi_hevc.c:284:56: error: ‘VAIQMatrixBufferHEVC’ undeclared (first 
use in this function)
libavcodec/vaapi_hevc.c:287:21: error: request for member ‘ScalingList4x4’ in 
something not a structure or union
libavcodec/vaapi_hevc.c:287:78: error: request for member ‘ScalingList4x4’ in 
something not a structure or union
libavcodec/vaapi_hevc.c:288:21: error: request for member ‘ScalingList8x8’ in 
something not a structure or union
libavcodec/vaapi_hevc.c:288:78: error: request for member ‘ScalingList8x8’ in 
something not a structure or union
libavcodec/vaapi_hevc.c:289:21: error: request for member ‘ScalingList16x16’ in 
something not a structure or union
libavcodec/vaapi_hevc.c:289:80: error: request for member ‘ScalingList16x16’ in 
something not a structure or union
libavcodec/vaapi_hevc.c:290:21: error: request for member ‘ScalingList32x32’ in 
something not a structure or union
libavcodec/vaapi_hevc.c:290:80: error: request for member ‘ScalingList32x32’ in 
something not a structure or union
libavcodec/vaapi_hevc.c:291:21: error: request for member ‘ScalingListDC16x16’ 
in something not a structure or union
libavcodec/vaapi_hevc.c:291:83: error: request for member ‘ScalingListDC16x16’ 
in something not a structure or union
libavcodec/vaapi_hevc.c:292:21: error: request for member ‘ScalingListDC32x32’ 
in something not a structure or union
libavcodec/vaapi_hevc.c:292:83: error: request for member ‘ScalingListDC32x32’ 
in something not a structure or union
libavcodec/vaapi_hevc.c: In function ‘vaapi_hevc_end_frame’:
libavcodec/vaapi_hevc.c:307:33: error: request for member ‘LongSliceFlags’ in 
something not a structure or union
libavcodec/vaapi_hevc.c: In function ‘vaapi_hevc_decode_slice’:
libavcodec/vaapi_hevc.c:331:5: error: unknown type name 
‘VASliceParameterBufferHEVC’
libavcodec/vaapi_hevc.c:341:20: error: ‘VASliceParameterBufferHEVC’ undeclared 
(first use in this function)
libavcodec/vaapi_hevc.c:341:48: error: expected expression before ‘)’ token
libavcodec/vaapi_hevc.c:348:16: error: request for member ‘slice_data_flag’ in 
something not a structure or union
libavcodec/vaapi_hevc.c:351:16: error: request for member 
‘slice_data_byte_offset’ in something not a structure or union
libavcodec/vaapi_hevc.c:35

Re: [FFmpeg-devel] [PATCH 2/2] lavf/file: check for dirent.h support

2015-08-25 Thread Michael Niedermayer
On Tue, Aug 25, 2015 at 02:18:22AM -0300, James Almer wrote:
> On 24/08/15 10:02 PM, Michael Niedermayer wrote:
> > On Fri, Aug 21, 2015 at 02:18:34AM +0200, Mariusz Szczepańczyk wrote:
> >> On Thu, Jun 25, 2015 at 12:09 PM, Michael Niedermayer 
> >> wrote:
> >>
> >>> On Wed, Jun 24, 2015 at 03:25:18AM +0200, Mariusz Szczepańczyk wrote:
>  On Tue, Jun 23, 2015 at 8:34 PM, Michael Niedermayer 
>  wrote:
> 
> > On Mon, Jun 22, 2015 at 12:01:33AM +0200, Mariusz Szczepańczyk wrote:
> >> ---
> >>  configure  |  2 ++
> >>  libavformat/file.c | 34 ++
> >>  2 files changed, 36 insertions(+)
> >
> > this and the previous patch fails to build
> >
> > make distclean ; ./configure --disable-sdl && make -j12
> >
> > libavformat/file.c: In function ‘file_read_dir’:
> > libavformat/file.c:302:10: error: ‘DT_FIFO’ undeclared (first use in
> >>> this
> > function)
> > libavformat/file.c:302:10: note: each undeclared identifier is reported
> > only once for each function it appears in
> > libavformat/file.c:305:10: error: ‘DT_CHR’ undeclared (first use in
> >>> this
> > function)
> > libavformat/file.c:308:10: error: ‘DT_DIR’ undeclared (first use in
> >>> this
> > function)
> > libavformat/file.c:311:10: error: ‘DT_BLK’ undeclared (first use in
> >>> this
> > function)
> > libavformat/file.c:314:10: error: ‘DT_REG’ undeclared (first use in
> >>> this
> > function)
> > libavformat/file.c:317:10: error: ‘DT_LNK’ undeclared (first use in
> >>> this
> > function)
> > libavformat/file.c:320:10: error: ‘DT_SOCK’ undeclared (first use in
> >>> this
> > function)
> > libavformat/file.c:323:10: error: ‘DT_UNKNOWN’ undeclared (first use in
> > this function)
> > make: *** [libavformat/file.o] Error 1
> > make: *** Waiting for unfinished jobs
> >
> > sdl disable is needed to reproduce  as sdls pkgcnonfig adds
> > GNU_SOURCE i suspect
> >
> 
>  Added contraint on _GNU_SOURCE and now it compiles fine on my linux in
> >>> both
>  cases (with or without sdl).
> >>>
> >>> The code probably should #ifdef DT_... like DT_FIFO
> >>> also are both variants needed ?
> >>> are there systems lacking some of the S_IS*() ? or is there some
> >>> disadvantage in their use ? (i dont know, just asking ...)
> >>>
> >>> testing for _GNU_SOURCE is not correct, nothing gurantees that the
> >>> compiler or headers know or react to _GNU_SOURCE
> >>>
> >>
> >> Yet another try.
> >>
> >> Completely removed reliance on DT_* and added definitions for some S_* that
> >> can be missing.
> > 
> >>  configure  |2 +
> >>  libavformat/file.c |   80 
> >> ++---
> >>  2 files changed, 54 insertions(+), 28 deletions(-)
> >> 47af9bc90efe51f1d94455bdf7e3eafaec6e61e2  
> >> 0002-lavf-file-check-for-dirent.h-support.patch
> >> From 820bd4aa5b064861935f8ef9e37a19bf459620c8 Mon Sep 17 00:00:00 2001
> >> From: =?UTF-8?q?Mariusz=20Szczepa=C5=84czyk?= 
> >> Date: Mon, 29 Jun 2015 00:13:43 +0200
> >> Subject: [PATCH 2/2] lavf/file: check for dirent.h support
> > 
> > both patches applied
> > 
> > thanks
> 
> This broke mingw-w64 (x86_32 and x86_64) and mingw32.
> http://fate.ffmpeg.org/report.cgi?time=20150825040408&slot=x86_32-mingw-w64-dll-windows-native
> http://fate.ffmpeg.org/report.cgi?time=20150822201317&slot=x86_64-freebsd10-mingw32
> http://fate.ffmpeg.org/report.cgi?time=20150825012347&slot=x86_64-mingw-w64-windows-native
> 
> /src/libavformat/file.c: In function 'file_read_dir':
> /src/libavformat/file.c:289:9: error: implicit declaration of function 
> 'lstat' [-Werror=implicit-function-declaration]

should be fixed
didint see your mail before runing into the failure myself

[..]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] vaapi: Add hevc hwaccel support

2015-08-25 Thread Timo Rothenpieler
---
 configure   |   2 +
 libavcodec/Makefile |   1 +
 libavcodec/allcodecs.c  |   1 +
 libavcodec/hevc.c   |   5 +-
 libavcodec/vaapi_hevc.c | 442 
 5 files changed, 450 insertions(+), 1 deletion(-)
 create mode 100644 libavcodec/vaapi_hevc.c

diff --git a/configure b/configure
index 1e82030..5868c26 100755
--- a/configure
+++ b/configure
@@ -2425,6 +2425,8 @@ hevc_d3d11va_hwaccel_select="hevc_decoder"
 hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC"
 hevc_dxva2_hwaccel_select="hevc_decoder"
 hevc_qsv_hwaccel_deps="libmfx"
+hevc_vaapi_hwaccel_deps="vaapi"
+hevc_vaapi_hwaccel_select="hevc_decoder"
 hevc_vdpau_hwaccel_deps="vdpau VdpPictureInfoHEVC"
 hevc_vdpau_hwaccel_select="hevc_decoder"
 mpeg_vdpau_decoder_deps="vdpau"
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 3c50ff8..407c6c3 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -715,6 +715,7 @@ OBJS-$(CONFIG_H264_VDPAU_HWACCEL) += vdpau_h264.o
 OBJS-$(CONFIG_H264_VIDEOTOOLBOX_HWACCEL)  += videotoolbox.o
 OBJS-$(CONFIG_HEVC_D3D11VA_HWACCEL)   += dxva2_hevc.o
 OBJS-$(CONFIG_HEVC_DXVA2_HWACCEL) += dxva2_hevc.o
+OBJS-$(CONFIG_HEVC_VAAPI_HWACCEL) += vaapi_hevc.o
 OBJS-$(CONFIG_HEVC_VDPAU_HWACCEL) += vdpau_hevc.o
 OBJS-$(CONFIG_MPEG1_VDPAU_HWACCEL)+= vdpau_mpeg12.o
 OBJS-$(CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL) += videotoolbox.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index d4ae497..dbf3927 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -89,6 +89,7 @@ void avcodec_register_all(void)
 REGISTER_HWACCEL(HEVC_D3D11VA,  hevc_d3d11va);
 REGISTER_HWACCEL(HEVC_DXVA2,hevc_dxva2);
 REGISTER_HWACCEL(HEVC_QSV,  hevc_qsv);
+REGISTER_HWACCEL(HEVC_VAAPI,hevc_vaapi);
 REGISTER_HWACCEL(HEVC_VDPAU,hevc_vdpau);
 REGISTER_HWACCEL(MPEG1_XVMC,mpeg1_xvmc);
 REGISTER_HWACCEL(MPEG1_VDPAU,   mpeg1_vdpau);
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 3f1a2bb..e7ac50e 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -328,7 +328,7 @@ static void export_stream_params(AVCodecContext *avctx, 
const HEVCParamSets *ps,
 
 static int set_sps(HEVCContext *s, const HEVCSPS *sps, enum AVPixelFormat 
pix_fmt)
 {
-#define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL + 
CONFIG_HEVC_D3D11VA_HWACCEL + CONFIG_HEVC_VDPAU_HWACCEL)
+#define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL + 
CONFIG_HEVC_D3D11VA_HWACCEL + CONFIG_HEVC_VAAPI_HWACCEL + 
CONFIG_HEVC_VDPAU_HWACCEL)
 enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmt = pix_fmts;
 int ret, i;
 
@@ -352,6 +352,9 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps, enum 
AVPixelFormat pix_fm
 #if CONFIG_HEVC_D3D11VA_HWACCEL
 *fmt++ = AV_PIX_FMT_D3D11VA_VLD;
 #endif
+#if CONFIG_HEVC_VAAPI_HWACCEL
+*fmt++ = AV_PIX_FMT_VAAPI;
+#endif
 #if CONFIG_HEVC_VDPAU_HWACCEL
 *fmt++ = AV_PIX_FMT_VDPAU;
 #endif
diff --git a/libavcodec/vaapi_hevc.c b/libavcodec/vaapi_hevc.c
new file mode 100644
index 000..dd1e303
--- /dev/null
+++ b/libavcodec/vaapi_hevc.c
@@ -0,0 +1,442 @@
+/*
+ * HEVC HW decode acceleration through VA API
+ *
+ * Copyright (C) 2015 XBMC Foundation
+ *
+ * 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
+ */
+
+#include "vaapi_internal.h"
+#include "hevc.h"
+#include "mpegutils.h"
+
+/**
+ * @file
+ * This file implements the glue code between FFmpeg's and VA API's
+ * structures for HEVC decoding.
+ */
+
+typedef struct vaapi_hevc_frame_data {
+VAPictureParameterBufferHEVC *pic_param;
+VASliceParameterBufferHEVC *last_slice_param;
+} vaapi_hevc_frame_data;
+
+/**
+ * Initialize an empty VA API picture.
+ *
+ * VA API requires a fixed-size reference picture array.
+ */
+static void init_vaapi_pic(VAPictureHEVC *va_pic)
+{
+va_pic->picture_id = VA_INVALID_ID;
+va_pic->flags = VA_PICTURE_HEVC_INVALID;
+va_pic->pic_order_cnt = 0;
+}
+
+static void fill_vaapi_pic(VAPictureHEVC *va_pic, const HEVCFrame *pic, int 
rps_type)
+{
+va_pic->picture_id = ff_vaapi_get_surface_id(pic->frame);
+va_pic->pic_order_cnt = pic->poc;
+va_pic->flags = rps_type;
+
+if (pic->flags & HEVC_FRAME_FLAG_LONG_REF)
+va_pi

Re: [FFmpeg-devel] [PATCH] checkasm: Fix floating point arguments on 64-bit Windows

2015-08-25 Thread Michael Niedermayer
On Mon, Aug 24, 2015 at 10:58:23PM +0200, Henrik Gramner wrote:
> ---
>  tests/checkasm/x86/checkasm.asm | 10 +++---
>  1 file changed, 7 insertions(+), 3 deletions(-)

works in mingw + wine

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are best at talking, realize last or never when they are wrong.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] FFmpegs future and resigning as leader

2015-08-25 Thread Jan Ehrhardt
Roger Pack in gmane.comp.video.ffmpeg.devel (Mon, 24 Aug 2015 14:51:25
-0600):
>I will also admit my one other concern: that without Michael there
>won't be enough active leadership *total* to "fix all the annoying
>bugs" and everything.

There is another concern: Michael was doing the merges from Libav into
FFmpeg. If that stops Libav and FFmpeg will drift apart and gradually
become incompatible. That would be a real pity.
-- 
Jan

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]lavf/segment: Fix memleak

2015-08-25 Thread Stefano Sabatini
On date Friday 2015-08-21 12:21:05 +0200, Carl Eugen Hoyos encoded:
> Hi!
> 
> Attached patch fixes a memleak for me, reproducible with:
> $ valgrind --leak-check=full ./ffmpeg_g -i 
> fate-suite/lena.pnm -reset_timestamps 1 -f segment out%1d.avi
> 
> Please review, Carl Eugen

> diff --git a/libavformat/segment.c b/libavformat/segment.c
> index 0d66211..9345dc9 100644
> --- a/libavformat/segment.c
> +++ b/libavformat/segment.c
> @@ -876,6 +876,7 @@ fail:
>  av_opt_free(seg);
>  av_freep(&seg->times);
>  av_freep(&seg->frames);
> +av_freep(&seg->cur_entry.filename);
>  
>  cur = seg->segment_list_entries;
>  while (cur) {

LGTM. For the future, please send a git-format patch so that I can
apply&test&commit with no editing on my side.
-- 
FFmpeg = Fundamentalist and Formidable Martial Power Elected Guru
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: add hstack & vstack filter

2015-08-25 Thread Paul B Mahol
On 8/25/15, Carl Eugen Hoyos  wrote:
> Paul B Mahol  gmail.com> writes:
>
>> >> +Stack streams horizontally.
>> >
>> > Out of curiosity:
>> > Is this faster than overlay or overlay and pad?
>>
>> Of course it is faster
>
> Should this be mentioned in the documentation?

Mentioned.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] fate: add tests for vectorscope filter

2015-08-25 Thread Paul B Mahol
On 8/24/15, Andreas Cadhalpun  wrote:
> On 25.08.2015 00:13, Paul B Mahol wrote:
>> On 8/24/15, Andreas Cadhalpun  wrote:
>>> On 24.08.2015 21:04, Paul B Mahol wrote:
 Signed-off-by: Paul B Mahol 
 ---
  tests/fate/filter-video.mak  | 15 +++
  tests/ref/fate/filter-vectorscope_color  |  4 
  tests/ref/fate/filter-vectorscope_color2 |  4 
  tests/ref/fate/filter-vectorscope_color3 |  4 
  tests/ref/fate/filter-vectorscope_gray   |  4 
  tests/ref/fate/filter-vectorscope_xy |  4 
  6 files changed, 35 insertions(+)
  create mode 100644 tests/ref/fate/filter-vectorscope_color
  create mode 100644 tests/ref/fate/filter-vectorscope_color2
  create mode 100644 tests/ref/fate/filter-vectorscope_color3
  create mode 100644 tests/ref/fate/filter-vectorscope_gray
  create mode 100644 tests/ref/fate/filter-vectorscope_xy

 diff --git a/tests/fate/filter-video.mak b/tests/fate/filter-video.mak
 index 8aa4198..3be299d 100644
 --- a/tests/fate/filter-video.mak
 +++ b/tests/fate/filter-video.mak
 @@ -123,6 +123,21 @@ fate-filter-waveform_envelope: CMD = framecrc -c:v
 pgmyuv -i $(SRC) -vf waveform
  FATE_FILTER_VSYNTH-$(CONFIG_WAVEFORM_FILTER) += fate-filter-waveform_uv
  fate-filter-waveform_uv: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf
 waveform=c=6 -flags +bitexact -sws_flags +accurate_rnd+bitexact
>>>
>>> I believe these would also need '-fflags +bitexact', when
>>> FF_API_LAVF_BITEXACT is
>>> disabled. Have you checked that?
>>
>> I do not think that pgmyuv store any metadata.
>
> Actually you don't even have to set '-flags +bitexact', because
> framecrc does that anyway.

Pushed with that part removed.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: add hstack & vstack filter

2015-08-25 Thread Carl Eugen Hoyos
Paul B Mahol  gmail.com> writes:

> >> +Stack streams horizontally.
> >
> > Out of curiosity:
> > Is this faster than overlay or overlay and pad?
> 
> Of course it is faster

Should this be mentioned in the documentation?

> pad is slow, and how do you plan to stack
> without using pad.
> Also using overlay & pad for stacking is PITA 
> from user POW.

(I don't disagree with any of these!)

Carl Eugen

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: add hstack & vstack filter

2015-08-25 Thread Paul B Mahol
On 8/25/15, Carl Eugen Hoyos  wrote:
> Paul B Mahol  gmail.com> writes:
>
>> +Stack streams horizontally.
>
> Out of curiosity:
> Is this faster than overlay or overlay and pad?

Of course it is faster, pad is slow, and how do you plan to stack
without using pad.
Also using overlay & pad for stacking is PITA from user POW.

>
> Carl Eugen
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/mjpegenc: remove non mod 16 check, theres a amv file that is not mod 16 == 0

2015-08-25 Thread Michael Niedermayer
On Tue, Aug 25, 2015 at 09:35:51AM +, Carl Eugen Hoyos wrote:
> Michael Niedermayer  gmx.at> writes:
> 
> > [...]
> 
> This is fine if that produces output similar to the 
> file that was uploaded.

it should i think but of course if someone can test that would be
better

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] configure: warn if GCC 4.2 is being used

2015-08-25 Thread Carl Eugen Hoyos
Ganesh Ajjanagadde  gmail.com> writes:

> +if [ "$first" = true ]; then
> +case $gcc_basever in
> +4.2*)
> +warn "gcc 4.2 is outdated and may miscompile 
> FFmpeg. Please use a newer compiler."

Nothing wrong with that if the English Language Police 
has no objections.

And I still consider it an improvement.

> +warn "See https://trac.ffmpeg.org/ticket/1464 
> for more details." ;;

I don't think the ticket contains useful information, the 
issue iirc was that users from time to time reported 
issues and it turned out that their compiler was buggy.

Carl Eugen

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/mjpegenc: remove non mod 16 check, theres a amv file that is not mod 16 == 0

2015-08-25 Thread Carl Eugen Hoyos
Michael Niedermayer  gmx.at> writes:

> [...]

This is fine if that produces output similar to the 
file that was uploaded.

Carl Eugen

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/vdpau: fix compilation of mpeg1/mpeg4/vc1 decoders when h264 is disabled

2015-08-25 Thread wm4
On Mon, 24 Aug 2015 23:58:05 -0300
James Almer  wrote:

> Signed-off-by: James Almer 
> ---
> Untested as i don't have a vdpau system.
> See 
> http://fate.ffmpeg.org/report.cgi?time=20150823144028&slot=x86_64-archlinux-gcc-random
> 
>  libavcodec/vdpau.c | 44 +++-
>  1 file changed, 23 insertions(+), 21 deletions(-)
> 
> diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c
> index 7cb8ad2..b530466 100644
> --- a/libavcodec/vdpau.c
> +++ b/libavcodec/vdpau.c
> @@ -358,7 +358,25 @@ int ff_vdpau_add_buffer(struct vdpau_picture_context 
> *pic_ctx,
>  
>  /* Obsolete non-hwaccel VDPAU support below... */
>  
> -#if CONFIG_H264_VDPAU_DECODER && FF_API_VDPAU
> +#if FF_API_VDPAU
> +void ff_vdpau_add_data_chunk(uint8_t *data, const uint8_t *buf, int buf_size)
> +{
> +struct vdpau_render_state *render = (struct vdpau_render_state*)data;
> +assert(render);
> +
> +render->bitstream_buffers= av_fast_realloc(
> +render->bitstream_buffers,
> +&render->bitstream_buffers_allocated,
> +sizeof(*render->bitstream_buffers)*(render->bitstream_buffers_used + 
> 1)
> +);
> +
> +render->bitstream_buffers[render->bitstream_buffers_used].struct_version 
>  = VDP_BITSTREAM_BUFFER_VERSION;
> +render->bitstream_buffers[render->bitstream_buffers_used].bitstream  
>  = buf;
> +
> render->bitstream_buffers[render->bitstream_buffers_used].bitstream_bytes = 
> buf_size;
> +render->bitstream_buffers_used++;
> +}
> +
> +#if CONFIG_H264_VDPAU_DECODER
>  void ff_vdpau_h264_set_reference_frames(H264Context *h)
>  {
>  struct vdpau_render_state *render, *render_ref;
> @@ -427,23 +445,6 @@ void ff_vdpau_h264_set_reference_frames(H264Context *h)
>  }
>  }
>  
> -void ff_vdpau_add_data_chunk(uint8_t *data, const uint8_t *buf, int buf_size)
> -{
> -struct vdpau_render_state *render = (struct vdpau_render_state*)data;
> -assert(render);
> -
> -render->bitstream_buffers= av_fast_realloc(
> -render->bitstream_buffers,
> -&render->bitstream_buffers_allocated,
> -sizeof(*render->bitstream_buffers)*(render->bitstream_buffers_used + 
> 1)
> -);
> -
> -render->bitstream_buffers[render->bitstream_buffers_used].struct_version 
>  = VDP_BITSTREAM_BUFFER_VERSION;
> -render->bitstream_buffers[render->bitstream_buffers_used].bitstream  
>  = buf;
> -
> render->bitstream_buffers[render->bitstream_buffers_used].bitstream_bytes = 
> buf_size;
> -render->bitstream_buffers_used++;
> -}
> -
>  void ff_vdpau_h264_picture_start(H264Context *h)
>  {
>  struct vdpau_render_state *render;
> @@ -506,7 +507,7 @@ void ff_vdpau_h264_picture_complete(H264Context *h)
>  }
>  #endif /* CONFIG_H264_VDPAU_DECODER */
>  
> -#if (CONFIG_MPEG_VDPAU_DECODER || CONFIG_MPEG1_VDPAU_DECODER) && FF_API_VDPAU
> +#if CONFIG_MPEG_VDPAU_DECODER || CONFIG_MPEG1_VDPAU_DECODER
>  void ff_vdpau_mpeg_picture_complete(MpegEncContext *s, const uint8_t *buf,
>  int buf_size, int slice_count)
>  {
> @@ -565,7 +566,7 @@ void ff_vdpau_mpeg_picture_complete(MpegEncContext *s, 
> const uint8_t *buf,
>  }
>  #endif /* CONFIG_MPEG_VDPAU_DECODER || CONFIG_MPEG1_VDPAU_DECODER */
>  
> -#if CONFIG_VC1_VDPAU_DECODER && FF_API_VDPAU
> +#if CONFIG_VC1_VDPAU_DECODER
>  void ff_vdpau_vc1_decode_picture(MpegEncContext *s, const uint8_t *buf,
>   int buf_size)
>  {
> @@ -636,7 +637,7 @@ void ff_vdpau_vc1_decode_picture(MpegEncContext *s, const 
> uint8_t *buf,
>  }
>  #endif /* (CONFIG_VC1_VDPAU_DECODER */
>  
> -#if CONFIG_MPEG4_VDPAU_DECODER && FF_API_VDPAU
> +#if CONFIG_MPEG4_VDPAU_DECODER
>  void ff_vdpau_mpeg4_decode_picture(Mpeg4DecContext *ctx, const uint8_t *buf,
> int buf_size)
>  {
> @@ -692,6 +693,7 @@ void ff_vdpau_mpeg4_decode_picture(Mpeg4DecContext *ctx, 
> const uint8_t *buf,
>  render->bitstream_buffers_used = 0;
>  }
>  #endif /* CONFIG_MPEG4_VDPAU_DECODER */
> +#endif /* FF_API_VDPAU */
>  
>  int av_vdpau_get_profile(AVCodecContext *avctx, VdpDecoderProfile *profile)
>  {

It compiles with vdpau and h264 _enabled_, so maybe ok.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: add hstack & vstack filter

2015-08-25 Thread Carl Eugen Hoyos
Paul B Mahol  gmail.com> writes:

> +Stack streams horizontally.

Out of curiosity:
Is this faster than overlay or overlay and pad?

Carl Eugen

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [libav-devel] [PATCH 20/20] Bump major versions of all libraries

2015-08-25 Thread Vittorio Giovara
On Mon, Aug 24, 2015 at 11:43 PM, Andreas Cadhalpun
 wrote:
> On 24.08.2015 13:44, Vittorio Giovara wrote:
>> On Tue, Jul 28, 2015 at 6:54 PM, Luca Barbato  wrote:
>>> On 28/07/15 15:41, Vittorio Giovara wrote:
 On Tue, Jul 28, 2015 at 2:40 PM, Luca Barbato  wrote:
> On 28/07/15 15:30, Vittorio Giovara wrote:
>> I believe to see general consensus towards applying the set as is.
>
> There is no consensus for that.

There is, consensus does not need to be unanimous, and so far only you
have been expressing concerns (multiple times).

>> I've added a skeleton to the wiki
>> (https://wiki.libav.org/Migration/12) so that we can properly document
>> the necessary changes before we release. Any help with that is of
>> course welcome.
>
> I have a work-in-progress API-porting-guide.

if you're talking about the patch set you sent it, I don't believe
it's a good idea adding yet-another-doc-file to the tree, it mostly
duplicates APIChanges and its contents are much better off on a wiki,
where it can be quickly updated and edited. Your efforts are indeed
commendable and I look forward to seeing the wiki page I linked filled
with documentation.

>> If no objections I'll push this set in the following days.
>
> Can you explain why you believe it makes any kind of sense to remove
> widely used APIs like FF_API_PIX_FMT/FF_API_AVCODEC_FRAME, while
> keeping completely useless ones like FF_API_MISSING_SAMPLE?

I was afraid someone would point out it's less than two years old.
Jokes aside, missing_sample can go as well if you insist, while for
the other two you mention do you have any other argument than being
"widely used"? I believe we went over and over explaining why it's a
good a idea to remove those, not sure how beneficial it is to iterate
once again.

Regards.
-- 
Vittorio
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] lavd/avfoundation: uses a queue to buffer audio and video samples

2015-08-25 Thread Matthieu Bouron
From: Matthieu Bouron 

Tries to avoid losing frames when frames are not consumed quickly enough.

Locking/Condition waiting is now performed with a NSConditionLock instead
of a pthread mutex/condition.

The first frames are not discarded anymore in the get_(video|audio)_config
functions.

Tries to improve issue #4437, however it looks like the avfoundation
screen recording is not necesseraly in sync with the display,
occasionally leading to duplicated frames or frames not being catched.

The issue can be reproduced with the following test case:
  * play a video at 60fps, each frames of this video has its number
burnt in
  * record screen at 60fps

The output capture could have a pattern similar to the following one:
  * 0, 1, 2, 3, [...], 50, 50, 52, 53, [...], 100, 102, 102, 103, [...]

The code will now output a warning if the drop happens on the avdevice
side.
---
 libavdevice/avfoundation.m | 154 ++---
 1 file changed, 91 insertions(+), 63 deletions(-)

diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m
index 763e675..1ed9cef 100644
--- a/libavdevice/avfoundation.m
+++ b/libavdevice/avfoundation.m
@@ -37,6 +37,8 @@
 #include "libavutil/time.h"
 #include "avdevice.h"
 
+#define QUEUE_SIZE 4
+
 static const int avf_time_base = 100;
 
 static const AVRational avf_time_base_q = {
@@ -78,6 +80,11 @@ static const struct AVFPixelFormatSpec avf_pixel_formats[] = 
{
 { AV_PIX_FMT_NONE, 0 }
 };
 
+enum {
+QUEUE_IS_EMPTY,
+QUEUE_HAS_BUFFERS,
+};
+
 typedef struct
 {
 AVClass*class;
@@ -86,8 +93,6 @@ typedef struct
 int audio_frames_captured;
 int64_t first_pts;
 int64_t first_audio_pts;
-pthread_mutex_t frame_lock;
-pthread_cond_t  frame_wait_cond;
 id  avf_delegate;
 id  avf_audio_delegate;
 
@@ -124,19 +129,12 @@ typedef struct
 AVCaptureSession *capture_session;
 AVCaptureVideoDataOutput *video_output;
 AVCaptureAudioDataOutput *audio_output;
-CMSampleBufferRef current_frame;
-CMSampleBufferRef current_audio_frame;
-} AVFContext;
 
-static void lock_frames(AVFContext* ctx)
-{
-pthread_mutex_lock(&ctx->frame_lock);
-}
+NSConditionLock *lock;
+NSMutableArray *video_queue;
+NSMutableArray *audio_queue;
 
-static void unlock_frames(AVFContext* ctx)
-{
-pthread_mutex_unlock(&ctx->frame_lock);
-}
+} AVFContext;
 
 /** FrameReciever class - delegate for AVCaptureSession
  */
@@ -167,17 +165,19 @@ static void unlock_frames(AVFContext* ctx)
   didOutputSampleBuffer:(CMSampleBufferRef)videoFrame
  fromConnection:(AVCaptureConnection *)connection
 {
-lock_frames(_context);
+NSMutableArray *queue = _context->video_queue;
+NSConditionLock *lock = _context->lock;
 
-if (_context->current_frame != nil) {
-CFRelease(_context->current_frame);
-}
+[lock lock];
 
-_context->current_frame = (CMSampleBufferRef)CFRetain(videoFrame);
+if ([queue count] == QUEUE_SIZE) {
+av_log(_context, AV_LOG_WARNING, "video queue is full, the oldest 
frame has been dropped\n");
+[queue removeLastObject];
+}
 
-pthread_cond_signal(&_context->frame_wait_cond);
+[queue insertObject:(id)videoFrame atIndex:0];
 
-unlock_frames(_context);
+[lock unlockWithCondition:QUEUE_HAS_BUFFERS];
 
 ++_context->frames_captured;
 }
@@ -213,17 +213,19 @@ static void unlock_frames(AVFContext* ctx)
   didOutputSampleBuffer:(CMSampleBufferRef)audioFrame
  fromConnection:(AVCaptureConnection *)connection
 {
-lock_frames(_context);
+NSMutableArray *queue = _context->audio_queue;
+NSConditionLock *lock = _context->lock;
 
-if (_context->current_audio_frame != nil) {
-CFRelease(_context->current_audio_frame);
-}
+[lock lock];
 
-_context->current_audio_frame = (CMSampleBufferRef)CFRetain(audioFrame);
+if ([queue count] == QUEUE_SIZE) {
+av_log(_context, AV_LOG_WARNING, "audio queue is full, the oldest 
frame has been dropped\n");
+[queue removeLastObject];
+}
 
-pthread_cond_signal(&_context->frame_wait_cond);
+[queue insertObject:(id)audioFrame atIndex:0];
 
-unlock_frames(_context);
+[lock unlockWithCondition:QUEUE_HAS_BUFFERS];
 
 ++_context->audio_frames_captured;
 }
@@ -248,12 +250,13 @@ static void destroy_context(AVFContext* ctx)
 
 av_freep(&ctx->audio_buffer);
 
-pthread_mutex_destroy(&ctx->frame_lock);
-pthread_cond_destroy(&ctx->frame_wait_cond);
+[ctx->audio_queue release];
+[ctx->video_queue release];
+[ctx->lock release];
 
-if (ctx->current_frame) {
-CFRelease(ctx->current_frame);
-}
+ctx->audio_queue = NULL;
+ctx->video_queue = NULL;
+ctx->lock = NULL;
 }
 
 static void parse_device_name(AVFormatContext *s)
@@ -538,6 +541,7 @@ static int add_audio_device(AVFormatContext *s, 
AVCaptureDevice *audio_device

Re: [FFmpeg-devel] [PATCH] mxfdec: set AVFMT_SEEK_TO_PTS demuxer flag

2015-08-25 Thread tim nicholson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 14/08/15 13:27, Tomas Härdin wrote:
> On Mon, 2015-08-10 at 10:14 +0200, Tomas Härdin wrote:
>> On Sun, 2015-08-09 at 20:32 +0200, Marton Balint wrote:
>>> Since 53f2ef2c4afb1d49a679dea9163cb0e4671f3117 seeking is done using
 PTS.
>>>
>>> Signed-off-by: Marton Balint 
>>> ---
>>>  libavformat/mxfdec.c | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
>>> index 2d921db..5734976 100644
>>> --- a/libavformat/mxfdec.c
>>> +++ b/libavformat/mxfdec.c
>>> @@ -3210,6 +3210,7 @@ static int mxf_read_seek(AVFormatContext *s, i
nt stream_index, int64_t sample_ti
>>>  AVInputFormat ff_mxf_demuxer = {
>>>  .name   = "mxf",
>>>  .long_name  = NULL_IF_CONFIG_SMALL("MXF (Material eXchange 
Format)"),
>>> +.flags  = AVFMT_SEEK_TO_PTS,
>>>  .priv_data_size = sizeof(MXFContext),
>>>  .read_probe = mxf_probe,
>>>  .read_header= mxf_read_header,
>>
>> Yeah, I seem to recall this when swearing at the seek code in mxfdec
>> some years ago. I'll wait a few days to see if any other MXF guys hav
e
>> something to say here or on IRC, then I suppose I'll push
>>

Only the seek code you swear at?

>> /Tomas
> 
> Pushed. Hopefully everything worked alright
> 

Just back from leave, so time will tell

> /Tomas
> [..]

- -- 
Tim.
Key Fingerprint 38CF DB09 3ED0 F607 8B67 6CED 0C0B FC44 8B0B FC83
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.22 (GNU/Linux)

iQEcBAEBAgAGBQJV3BIoAAoJEAwL/ESLC/yD4jgH/35vOcJkv8daPCvNiXc+p8HD
DJc3YBFINl3wY8HohQJWcjYTfma8DVJS4XPCIMqsYpnzPvWH+VBp5hYxQ1UwrRDY
trRjuMTtcfDp9kL3O1cGKHPDV0eyJXvoyR8gw1zpKdZsVE4In7VnQRLahj//2HFt
+tWcuPG+IhMrgyOMM5UH5rSd5doCQgkLC3iouX40NTmpzo5fGAdqH8+4qrMJSY6e
Uth3xK7hHRQqnbDEYNmKMOSeVasnwaxx26y2hCtVUaUypnyhH7lkY2ndfURg0pD3
80yCPI253cy1tbtsmRyph3z/BXTsa3xPUFIcdcKjpnQuv7pio/a+w3a1UqpE8PI=
=1mAZ
-END PGP SIGNATURE-
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel