[FFmpeg-devel] [PATCH] hwcontext: fix comments for av_hwdevice_ctx_alloc()

2017-03-19 Thread Jun Zhao
From 74fa715cdc1e17ab3a59a9e3efa6ef142dd35d1a Mon Sep 17 00:00:00 2001
From: Jun Zhao 
Date: Sun, 19 Mar 2017 15:44:46 +0800
Subject: [PATCH] hwcontext: fix comments for av_hwdevice_ctx_alloc()

fix the wrong comments for av_hwdevice_ctx_alloc()

Signed-off-by: Jun Zhao 
---
 libavutil/hwcontext.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavutil/hwcontext.h b/libavutil/hwcontext.h
index 785da09..938c2e4 100644
--- a/libavutil/hwcontext.h
+++ b/libavutil/hwcontext.h
@@ -225,8 +225,7 @@ typedef struct AVHWFramesContext {
 /**
  * Allocate an AVHWDeviceContext for a given pixel format.
  *
- * @param format a hwaccel pixel format (AV_PIX_FMT_FLAG_HWACCEL must be set
- *   on the corresponding format descriptor)
+ * @param type the type of the hwaccel device.
  * @return a reference to the newly created AVHWDeviceContext on success or 
NULL
  * on failure.
  */
-- 
2.9.3

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


[FFmpeg-devel] [PATCH] avformat/dashdec: add dash demuxer base version

2017-03-19 Thread Steven Liu
ffmpeg need a dash demuxer for demux the dash formats
base on 
https://github.com/samsamsam-iptvplayer/exteplayer3/blob/master/tmp/ffmpeg/patches/3.2.2/01_add_dash_demux.patch

Signed-off-by: Steven Liu 
---
 configure|4 +
 libavformat/Makefile |1 +
 libavformat/allformats.c |2 +-
 libavformat/dashdec.c| 1845 ++
 4 files changed, 1851 insertions(+), 1 deletion(-)
 create mode 100644 libavformat/dashdec.c

diff --git a/configure b/configure
index 1e2e774..4850cfa 100755
--- a/configure
+++ b/configure
@@ -292,6 +292,7 @@ External library support:
on OSX if openssl and gnutls are not used 
[autodetect]
   --enable-x11grab enable X11 grabbing (legacy) [no]
   --disable-xlib   disable xlib [autodetect]
+  --disable-xml2   disable XML parsing using the C library libxml2 
[autodetect]
   --disable-zlib   disable zlib [autodetect]
 
   The following libraries provide various hardware acceleration features:
@@ -1508,6 +1509,7 @@ EXTERNAL_AUTODETECT_LIBRARY_LIST="
 sdl2
 securetransport
 xlib
+xml2
 zlib
 "
 
@@ -2902,6 +2904,7 @@ avi_muxer_select="riffenc"
 caf_demuxer_select="iso_media riffdec"
 caf_muxer_select="iso_media"
 dash_muxer_select="mp4_muxer"
+dash_demuxer_select="xml2"
 dirac_demuxer_select="dirac_parser"
 dts_demuxer_select="dca_parser"
 dtshd_demuxer_select="dca_parser"
@@ -5710,6 +5713,7 @@ enabled pthreads &&
 disabled  zlib || check_lib   zlib.h  zlibVersion -lz   || disable  zlib
 disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
 disabled  lzma || check_lib2  lzma.h lzma_version_number -llzma || disable lzma
+disabled  xml2 || { add_cflags -I/usr/include/libxml2 && check_lib 
libxml/xmlversion.h xmlCheckVersion -lxml2; } || disable xml2
 
 check_lib math.h sin -lm && LIBM="-lm"
 disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h 
DtsCrystalHDVersion -lcrystalhd || disable crystalhd
diff --git a/libavformat/Makefile b/libavformat/Makefile
index f56ef16..d77ffaa 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -134,6 +134,7 @@ OBJS-$(CONFIG_CRC_MUXER) += crcenc.o
 OBJS-$(CONFIG_DATA_DEMUXER)  += rawdec.o
 OBJS-$(CONFIG_DATA_MUXER)+= rawenc.o
 OBJS-$(CONFIG_DASH_MUXER)+= dashenc.o
+OBJS-$(CONFIG_DASH_DEMUXER)  += dashdec.o
 OBJS-$(CONFIG_DAUD_DEMUXER)  += dauddec.o
 OBJS-$(CONFIG_DAUD_MUXER)+= daudenc.o
 OBJS-$(CONFIG_DCSTR_DEMUXER) += dcstr.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 09e62c3..d57314b 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -96,7 +96,7 @@ static void register_all(void)
 REGISTER_DEMUXER (CINE, cine);
 REGISTER_DEMUXER (CONCAT,   concat);
 REGISTER_MUXER   (CRC,  crc);
-REGISTER_MUXER   (DASH, dash);
+REGISTER_MUXDEMUX(DASH, dash);
 REGISTER_MUXDEMUX(DATA, data);
 REGISTER_MUXDEMUX(DAUD, daud);
 REGISTER_DEMUXER (DCSTR,dcstr);
diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
new file mode 100644
index 000..4c347f3
--- /dev/null
+++ b/libavformat/dashdec.c
@@ -0,0 +1,1845 @@
+/*
+ * Dynamic Adaptive Streaming over HTTP demux
+ * Copyright (c) 2017 samsam...@o2.pl based on HLS demux
+ * Copyright (c) 2017 Steven Liu
+ *
+ * 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 "libavutil/avstring.h"
+#include "libavutil/avassert.h"
+#include "libavutil/intreadwrite.h"
+#include "libavutil/mathematics.h"
+#include "libavutil/opt.h"
+#include "libavutil/dict.h"
+#include "libavutil/time.h"
+#include "avformat.h"
+#include "internal.h"
+#include "avio_internal.h"
+#include "url.h"
+#include "id3v2.h"
+
+#define INITIAL_BUFFER_SIZE 32768
+
+#include 
+#include 
+
+#if (__STDC_VERSION__ >= 199901L)
+#include 
+#endif
+
+#include 
+#include 
+
+struct fragment {
+int64_t url_offset;
+int64_t size;
+char *url;
+};
+
+struct timeline {
+int64_t t;
+int32_t r;
+int64_t d;
+};
+
+enum RepType {
+REP_TYPE_UNSPECIFIED,
+REP_TY

Re: [FFmpeg-devel] [PATCH] avformat/dashdec: add dash demuxer base version

2017-03-19 Thread Carl Eugen Hoyos
2017-03-19 10:05 GMT+01:00 Steven Liu :

> +  --disable-xml2   disable XML parsing using the C library libxml2 
> [autodetect]

I believe several developers have argued in the past that they are against
adding libxml2 as an external dependency to FFmpeg.
Instead of resending this (or a similar) patch once more, I believe you
first have to argue why you disagree.

Iirc, it was said that a simple (and very incomplete) xml "parser" would
also allow to demux dash.

Carl Eugen

PS: I completely agree with autodetection if xml2 should be added.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/dashdec: add dash demuxer base version

2017-03-19 Thread Steven Liu
2017-03-19 17:34 GMT+08:00 Carl Eugen Hoyos :

> 2017-03-19 10:05 GMT+01:00 Steven Liu :
>
> > +  --disable-xml2   disable XML parsing using the C library
> libxml2 [autodetect]
>
> I believe several developers have argued in the past that they are against
> adding libxml2 as an external dependency to FFmpeg.
> Instead of resending this (or a similar) patch once more, I believe you
> first have to argue why you disagree.
>
> Iirc, it was said that a simple (and very incomplete) xml "parser" would
> also allow to demux dash.
>
> Carl Eugen
>
> PS: I completely agree with autodetection if xml2 should be added.
>
Yes, so this patch is  autodetection xml2, not must use it.

___
> 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] avformat/dashdec: add dash demuxer base version

2017-03-19 Thread Clément Bœsch
On Sun, Mar 19, 2017 at 05:05:55PM +0800, Steven Liu wrote:
> ffmpeg need a dash demuxer for demux the dash formats
> base on 
> https://github.com/samsamsam-iptvplayer/exteplayer3/blob/master/tmp/ffmpeg/patches/3.2.2/01_add_dash_demux.patch
> 
> Signed-off-by: Steven Liu 
> ---
>  configure|4 +
>  libavformat/Makefile |1 +
>  libavformat/allformats.c |2 +-
>  libavformat/dashdec.c| 1845 
> ++
>  4 files changed, 1851 insertions(+), 1 deletion(-)
>  create mode 100644 libavformat/dashdec.c
> 
> diff --git a/configure b/configure
> index 1e2e774..4850cfa 100755
> --- a/configure
> +++ b/configure
> @@ -292,6 +292,7 @@ External library support:
> on OSX if openssl and gnutls are not used 
> [autodetect]
>--enable-x11grab enable X11 grabbing (legacy) [no]
>--disable-xlib   disable xlib [autodetect]

> +  --disable-xml2   disable XML parsing using the C library libxml2 
> [autodetect]

this is not a "system" library, it should not be autodetected but disabled
by default.

[...]

-- 
Clément B.


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


Re: [FFmpeg-devel] [PATCH] avformat/dashdec: add dash demuxer base version

2017-03-19 Thread Steven Liu
2017-03-19 17:48 GMT+08:00 Clément Bœsch :

> On Sun, Mar 19, 2017 at 05:05:55PM +0800, Steven Liu wrote:
> > ffmpeg need a dash demuxer for demux the dash formats
> > base on https://github.com/samsamsam-iptvplayer/exteplayer3/blob/
> master/tmp/ffmpeg/patches/3.2.2/01_add_dash_demux.patch
> >
> > Signed-off-by: Steven Liu 
> > ---
> >  configure|4 +
> >  libavformat/Makefile |1 +
> >  libavformat/allformats.c |2 +-
> >  libavformat/dashdec.c| 1845 ++
> 
> >  4 files changed, 1851 insertions(+), 1 deletion(-)
> >  create mode 100644 libavformat/dashdec.c
> >
> > diff --git a/configure b/configure
> > index 1e2e774..4850cfa 100755
> > --- a/configure
> > +++ b/configure
> > @@ -292,6 +292,7 @@ External library support:
> > on OSX if openssl and gnutls are not used
> [autodetect]
> >--enable-x11grab enable X11 grabbing (legacy) [no]
> >--disable-xlib   disable xlib [autodetect]
>
> > +  --disable-xml2   disable XML parsing using the C library
> libxml2 [autodetect]
>
> this is not a "system" library, it should not be autodetected but disabled
> by default.
>
Now, no xml2, the dash muxer will not be enabled, I think this is better
than disable default.
Because if the system has xml2, it can enable, if no xml2, it disable, just
like ffplay.

>
> [...]
>
> --
> Clément B.
>
> ___
> 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] avformat/dashdec: add dash demuxer base version

2017-03-19 Thread Paul B Mahol
On 3/19/17, Steven Liu  wrote:
> 2017-03-19 17:48 GMT+08:00 Clement Boesch :
>
>> On Sun, Mar 19, 2017 at 05:05:55PM +0800, Steven Liu wrote:
>> > ffmpeg need a dash demuxer for demux the dash formats
>> > base on https://github.com/samsamsam-iptvplayer/exteplayer3/blob/
>> master/tmp/ffmpeg/patches/3.2.2/01_add_dash_demux.patch
>> >
>> > Signed-off-by: Steven Liu 
>> > ---
>> >  configure|4 +
>> >  libavformat/Makefile |1 +
>> >  libavformat/allformats.c |2 +-
>> >  libavformat/dashdec.c| 1845 ++
>> 
>> >  4 files changed, 1851 insertions(+), 1 deletion(-)
>> >  create mode 100644 libavformat/dashdec.c
>> >
>> > diff --git a/configure b/configure
>> > index 1e2e774..4850cfa 100755
>> > --- a/configure
>> > +++ b/configure
>> > @@ -292,6 +292,7 @@ External library support:
>> > on OSX if openssl and gnutls are not used
>> [autodetect]
>> >--enable-x11grab enable X11 grabbing (legacy) [no]
>> >--disable-xlib   disable xlib [autodetect]
>>
>> > +  --disable-xml2   disable XML parsing using the C library
>> libxml2 [autodetect]
>>
>> this is not a "system" library, it should not be autodetected but disabled
>> by default.
>>
> Now, no xml2, the dash muxer will not be enabled, I think this is better
> than disable default.
> Because if the system has xml2, it can enable, if no xml2, it disable, just
> like ffplay.

I do not understand what you are trying to tell.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] avcodec, avformat: deprecate anything related to side data merging

2017-03-19 Thread Nicolas George
L'octidi 28 ventôse, an CCXXV, Michael Niedermayer a écrit :
> People cant always choose what they use, and IMHO a frame work which
> doesnt allow passing side data cleanly may have simply different goals
> or be build around a differnt architecture than what you have in mind
> that doesnt make it bad IMHO

I think it does.

> nor should we IMHO disregard usability with bad frameworks

I think we can and should.

More importantly, I think planning for unknown problems is a waste of
time. Speculating on what bad frameworks people might possibly be using
is also a waste of time.

> I belive if we remove something we should be open to users problems
> as in writing in the release notes that

I am not against a paragraph in the release notes.


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


Re: [FFmpeg-devel] [PATCH] avformat/dashdec: add dash demuxer base version

2017-03-19 Thread Clément Bœsch
On Sun, Mar 19, 2017 at 05:51:15PM +0800, Steven Liu wrote:
> 2017-03-19 17:48 GMT+08:00 Clément Bœsch :
> 
> > On Sun, Mar 19, 2017 at 05:05:55PM +0800, Steven Liu wrote:
> > > ffmpeg need a dash demuxer for demux the dash formats
> > > base on https://github.com/samsamsam-iptvplayer/exteplayer3/blob/
> > master/tmp/ffmpeg/patches/3.2.2/01_add_dash_demux.patch
> > >
> > > Signed-off-by: Steven Liu 
> > > ---
> > >  configure|4 +
> > >  libavformat/Makefile |1 +
> > >  libavformat/allformats.c |2 +-
> > >  libavformat/dashdec.c| 1845 ++
> > 
> > >  4 files changed, 1851 insertions(+), 1 deletion(-)
> > >  create mode 100644 libavformat/dashdec.c
> > >
> > > diff --git a/configure b/configure
> > > index 1e2e774..4850cfa 100755
> > > --- a/configure
> > > +++ b/configure
> > > @@ -292,6 +292,7 @@ External library support:
> > > on OSX if openssl and gnutls are not used
> > [autodetect]
> > >--enable-x11grab enable X11 grabbing (legacy) [no]
> > >--disable-xlib   disable xlib [autodetect]
> >
> > > +  --disable-xml2   disable XML parsing using the C library
> > libxml2 [autodetect]
> >
> > this is not a "system" library, it should not be autodetected but disabled
> > by default.
> >
> Now, no xml2, the dash muxer will not be enabled, I think this is better
> than disable default.

H.264 encoding is disabled unless you --enable-gpl --enable-libx264. But
don't you think H.264 encoding is quite an important feature for a video
framework?

So anyway, the point is that we want to be consistent wrt external
libraries.

If you want to have DASH enabled by default, make sure to have a native
XML parser, or discuss the policy about detecting all the external
libraries within the configure.

-- 
Clément B.


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


Re: [FFmpeg-devel] [PATCH] avformat/dashdec: add dash demuxer base version

2017-03-19 Thread Steven Liu
2017-03-19 17:55 GMT+08:00 Paul B Mahol :

> On 3/19/17, Steven Liu  wrote:
> > 2017-03-19 17:48 GMT+08:00 Clement Boesch :
> >
> >> On Sun, Mar 19, 2017 at 05:05:55PM +0800, Steven Liu wrote:
> >> > ffmpeg need a dash demuxer for demux the dash formats
> >> > base on https://github.com/samsamsam-iptvplayer/exteplayer3/blob/
> >> master/tmp/ffmpeg/patches/3.2.2/01_add_dash_demux.patch
> >> >
> >> > Signed-off-by: Steven Liu 
> >> > ---
> >> >  configure|4 +
> >> >  libavformat/Makefile |1 +
> >> >  libavformat/allformats.c |2 +-
> >> >  libavformat/dashdec.c| 1845 ++
> >> 
> >> >  4 files changed, 1851 insertions(+), 1 deletion(-)
> >> >  create mode 100644 libavformat/dashdec.c
> >> >
> >> > diff --git a/configure b/configure
> >> > index 1e2e774..4850cfa 100755
> >> > --- a/configure
> >> > +++ b/configure
> >> > @@ -292,6 +292,7 @@ External library support:
> >> > on OSX if openssl and gnutls are not used
> >> [autodetect]
> >> >--enable-x11grab enable X11 grabbing (legacy) [no]
> >> >--disable-xlib   disable xlib [autodetect]
> >>
> >> > +  --disable-xml2   disable XML parsing using the C library
> >> libxml2 [autodetect]
> >>
> >> this is not a "system" library, it should not be autodetected but
> disabled
> >> by default.
> >>
> > Now, no xml2, the dash muxer will not be enabled, I think this is better
> > than disable default.
> > Because if the system has xml2, it can enable, if no xml2, it disable,
> just
> > like ffplay.
>
> I do not understand what you are trying to tell.
>

I just want to say :" I think autodetect it better the disabled by default."

> ___
> 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] avformat/concatdec: add concat_seekable operation

2017-03-19 Thread Nicolas George
L'octidi 28 ventôse, an CCXXV, Steven Liu a écrit :
> Can the concat support network stream?

As you can see, the concat demuxer does not contain any code specific to
the protocol, or even to the demuxer. It should therefore work with any
demuxer, and in turn protocol, provided it is reliable enough.

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] avformat/dashdec: add dash demuxer base version

2017-03-19 Thread Nicolas George
Le nonidi 29 ventôse, an CCXXV, Clement Boesch a écrit :
> If you want to have DASH enabled by default, make sure to have a native
> XML parser

For the record, I have started something a few months back. Not very
advanced, because other more pressing matters arose, but reasonably
clean for a start.

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] avformat/dashdec: add dash demuxer base version

2017-03-19 Thread wm4
On Sun, 19 Mar 2017 10:57:21 +0100
Clément Bœsch  wrote:

> 
> If you want to have DASH enabled by default, make sure to have a native
> XML parser, or discuss the policy about detecting all the external
> libraries within the configure.
> 

That's ridiculous. So NIH is encouraged because of a crappy policy
about using external libs? Please...
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] fate/exr : add test for uint32

2017-03-19 Thread Michael Niedermayer
On Sat, Mar 18, 2017 at 01:50:06PM +0100, Martin Vignali wrote:
> Hello,
> 
> In attach patch to add fate test for uint 32 exr
> 
> Sample can be found here :
> https://we.tl/iB6xWicb4X
> 
> and need to be put inside fate-suite/exr/

uploaded

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates


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


Re: [FFmpeg-devel] [PATCH] avformat/dashdec: add dash demuxer base version

2017-03-19 Thread Rodger Combs
A few initial comments inline:

> On Mar 19, 2017, at 04:05, Steven Liu  wrote:
> 
> ffmpeg need a dash demuxer for demux the dash formats
> base on 
> https://github.com/samsamsam-iptvplayer/exteplayer3/blob/master/tmp/ffmpeg/patches/3.2.2/01_add_dash_demux.patch
> 
> Signed-off-by: Steven Liu 
> ---
> configure|4 +
> libavformat/Makefile |1 +
> libavformat/allformats.c |2 +-
> libavformat/dashdec.c| 1845 ++
> 4 files changed, 1851 insertions(+), 1 deletion(-)
> create mode 100644 libavformat/dashdec.c
> 
> diff --git a/configure b/configure
> index 1e2e774..4850cfa 100755
> --- a/configure
> +++ b/configure
> @@ -292,6 +292,7 @@ External library support:
>on OSX if openssl and gnutls are not used 
> [autodetect]
>   --enable-x11grab enable X11 grabbing (legacy) [no]
>   --disable-xlib   disable xlib [autodetect]
> +  --disable-xml2   disable XML parsing using the C library libxml2 
> [autodetect]
>   --disable-zlib   disable zlib [autodetect]
> 
>   The following libraries provide various hardware acceleration features:
> @@ -1508,6 +1509,7 @@ EXTERNAL_AUTODETECT_LIBRARY_LIST="
> sdl2
> securetransport
> xlib
> +xml2
> zlib
> "
> 
> @@ -2902,6 +2904,7 @@ avi_muxer_select="riffenc"
> caf_demuxer_select="iso_media riffdec"
> caf_muxer_select="iso_media"
> dash_muxer_select="mp4_muxer"
> +dash_demuxer_select="xml2"
> dirac_demuxer_select="dirac_parser"
> dts_demuxer_select="dca_parser"
> dtshd_demuxer_select="dca_parser"
> @@ -5710,6 +5713,7 @@ enabled pthreads &&
> disabled  zlib || check_lib   zlib.h  zlibVersion -lz   || disable  zlib
> disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
> disabled  lzma || check_lib2  lzma.h lzma_version_number -llzma || disable 
> lzma
> +disabled  xml2 || { add_cflags -I/usr/include/libxml2 && check_lib 
> libxml/xmlversion.h xmlCheckVersion -lxml2; } || disable xml2
> 
> check_lib math.h sin -lm && LIBM="-lm"
> disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h 
> DtsCrystalHDVersion -lcrystalhd || disable crystalhd
> diff --git a/libavformat/Makefile b/libavformat/Makefile
> index f56ef16..d77ffaa 100644
> --- a/libavformat/Makefile
> +++ b/libavformat/Makefile
> @@ -134,6 +134,7 @@ OBJS-$(CONFIG_CRC_MUXER) += crcenc.o
> OBJS-$(CONFIG_DATA_DEMUXER)  += rawdec.o
> OBJS-$(CONFIG_DATA_MUXER)+= rawenc.o
> OBJS-$(CONFIG_DASH_MUXER)+= dashenc.o
> +OBJS-$(CONFIG_DASH_DEMUXER)  += dashdec.o
> OBJS-$(CONFIG_DAUD_DEMUXER)  += dauddec.o
> OBJS-$(CONFIG_DAUD_MUXER)+= daudenc.o
> OBJS-$(CONFIG_DCSTR_DEMUXER) += dcstr.o
> diff --git a/libavformat/allformats.c b/libavformat/allformats.c
> index 09e62c3..d57314b 100644
> --- a/libavformat/allformats.c
> +++ b/libavformat/allformats.c
> @@ -96,7 +96,7 @@ static void register_all(void)
> REGISTER_DEMUXER (CINE, cine);
> REGISTER_DEMUXER (CONCAT,   concat);
> REGISTER_MUXER   (CRC,  crc);
> -REGISTER_MUXER   (DASH, dash);
> +REGISTER_MUXDEMUX(DASH, dash);
> REGISTER_MUXDEMUX(DATA, data);
> REGISTER_MUXDEMUX(DAUD, daud);
> REGISTER_DEMUXER (DCSTR,dcstr);
> diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
> new file mode 100644
> index 000..4c347f3
> --- /dev/null
> +++ b/libavformat/dashdec.c
> @@ -0,0 +1,1845 @@
> +/*
> + * Dynamic Adaptive Streaming over HTTP demux
> + * Copyright (c) 2017 samsam...@o2.pl based on HLS demux
> + * Copyright (c) 2017 Steven Liu
> + *
> + * 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 "libavutil/avstring.h"
> +#include "libavutil/avassert.h"
> +#include "libavutil/intreadwrite.h"
> +#include "libavutil/mathematics.h"
> +#include "libavutil/opt.h"
> +#include "libavutil/dict.h"
> +#include "libavutil/time.h"
> +#include "avformat.h"
> +#include "internal.h"
> +#include "avio_internal.h"
> +#include "url.h"
> +#include "id3v2.h"
> +
> +#define INITIAL_BUFFER_SIZE 32768
> +
> +#include 
> +#include 
> +

Re: [FFmpeg-devel] [PATCH] avformat/dashdec: add dash demuxer base version

2017-03-19 Thread Nicolas George
Le nonidi 29 ventôse, an CCXXV, Rodger Combs a écrit :
> fragmentTimescale.

fragment_timescale or fragment_time_scale; camelCase is not part of
FFmpeg's coding standards.

> Use time_t or int64_t.

Certainly not time_t.

The rest looks fine at first glance.

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 1/2] fate: add fate-sws-pixdesc-query

2017-03-19 Thread Clément Bœsch
Test the pixel format querying within libswscale.
---
 libswscale/Makefile  |   1 +
 libswscale/tests/.gitignore  |   1 +
 libswscale/tests/pixdesc_query.c |  78 
 tests/Makefile   |   1 +
 tests/fate/libswscale.mak|   7 +
 tests/ref/fate/sws-pixdesc-query | 416 +++
 6 files changed, 504 insertions(+)
 create mode 100644 libswscale/tests/pixdesc_query.c
 create mode 100644 tests/fate/libswscale.mak
 create mode 100644 tests/ref/fate/sws-pixdesc-query

diff --git a/libswscale/Makefile b/libswscale/Makefile
index 0272039a6c..183167cced 100644
--- a/libswscale/Makefile
+++ b/libswscale/Makefile
@@ -26,4 +26,5 @@ OBJS-$(CONFIG_SHARED)+= log2_tab.o
 SLIBOBJS-$(HAVE_GNU_WINDRES) += swscaleres.o
 
 TESTPROGS = colorspace  \
+pixdesc_query   \
 swscale \
diff --git a/libswscale/tests/.gitignore b/libswscale/tests/.gitignore
index 0ac3691ecd..1a26f038c4 100644
--- a/libswscale/tests/.gitignore
+++ b/libswscale/tests/.gitignore
@@ -1,2 +1,3 @@
 /colorspace
+/pixdesc_query
 /swscale
diff --git a/libswscale/tests/pixdesc_query.c b/libswscale/tests/pixdesc_query.c
new file mode 100644
index 00..d1ce1eb4a8
--- /dev/null
+++ b/libswscale/tests/pixdesc_query.c
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2017 Clément Bœsch 
+ *
+ * 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 "libswscale/swscale_internal.h"
+
+/* TODO: drop this wrapper when all the is*() becomes functions */
+#define DECLARE_WRAPPER(macro)   \
+static int macro##_func(enum AVPixelFormat pix_fmt)  \
+{\
+return macro(pix_fmt);   \
+}
+
+DECLARE_WRAPPER(isGray)
+DECLARE_WRAPPER(isRGBinInt)
+DECLARE_WRAPPER(isBGRinInt)
+DECLARE_WRAPPER(isRGBinBytes)
+DECLARE_WRAPPER(isBGRinBytes)
+DECLARE_WRAPPER(isBayer)
+DECLARE_WRAPPER(isAnyRGB)
+DECLARE_WRAPPER(isALPHA)
+DECLARE_WRAPPER(isPacked)
+DECLARE_WRAPPER(isPlanar)
+DECLARE_WRAPPER(isPackedRGB)
+DECLARE_WRAPPER(isPlanarRGB)
+DECLARE_WRAPPER(usePal)
+
+static const struct {
+const char *class;
+int (*cond)(enum AVPixelFormat pix_fmt);
+} query_tab[] = {
+{"Gray",isGray_func},
+{"RGBinInt",isRGBinInt_func},
+{"BGRinInt",isBGRinInt_func},
+{"RGBinBytes",  isRGBinBytes_func},
+{"BGRinBytes",  isBGRinBytes_func},
+{"Bayer",   isBayer_func},
+{"AnyRGB",  isAnyRGB_func},
+{"ALPHA",   isALPHA_func},
+{"Packed",  isPacked_func},
+{"Planar",  isPlanar_func},
+{"PackedRGB",   isPackedRGB_func},
+{"PlanarRGB",   isPlanarRGB_func},
+{"usePal",  usePal_func},
+};
+
+int main(void)
+{
+int i;
+
+for (i = 0; i < FF_ARRAY_ELEMS(query_tab); i++) {
+const AVPixFmtDescriptor *pix_desc = NULL;
+printf("%s:\n", query_tab[i].class);
+while ((pix_desc = av_pix_fmt_desc_next(pix_desc))) {
+enum AVPixelFormat pix_fmt = av_pix_fmt_desc_get_id(pix_desc);
+if (query_tab[i].cond(pix_fmt))
+printf("  %s\n", pix_desc->name);
+}
+printf("\n");
+}
+return 0;
+}
diff --git a/tests/Makefile b/tests/Makefile
index 53d900bdba..66d99106ff 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -145,6 +145,7 @@ include $(SRC_PATH)/tests/fate/libavformat.mak
 include $(SRC_PATH)/tests/fate/libavresample.mak
 include $(SRC_PATH)/tests/fate/libavutil.mak
 include $(SRC_PATH)/tests/fate/libswresample.mak
+include $(SRC_PATH)/tests/fate/libswscale.mak
 include $(SRC_PATH)/tests/fate/lossless-audio.mak
 include $(SRC_PATH)/tests/fate/lossless-video.mak
 include $(SRC_PATH)/tests/fate/matroska.mak
diff --git a/tests/fate/libswscale.mak b/tests/fate/libswscale.mak
new file mode 100644
index 00..e72fe590a8
--- /dev/null
+++ b/tests/fate/libswscale.mak
@@ -0,0 +1,7 @@
+FATE_LIBSWSCALE += fate-sws-pixdesc-query
+fate-sws-pixdesc-query: libswscale/tests/pixdesc_query$(EXESUF)
+fate-sws-pixdesc-query: CMD = run libswscale/tests/pixdesc_query
+
+FATE_LIBSWSCALE += $(FATE_LIBSWSCALE-yes)
+F

[FFmpeg-devel] [PATCH 2/2] swscale: use a function for isGray

2017-03-19 Thread Clément Bœsch
---
 libswscale/swscale_internal.h | 27 ++-
 1 file changed, 10 insertions(+), 17 deletions(-)

diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index af82396b1c..6bcb4640ee 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -687,23 +687,16 @@ static av_always_inline int isRGB(enum AVPixelFormat 
pix_fmt)
 return (desc->flags & AV_PIX_FMT_FLAG_RGB);
 }
 
-#if 0 // FIXME
-#define isGray(x) \
-(!(av_pix_fmt_desc_get(x)->flags & AV_PIX_FMT_FLAG_PAL) && \
- av_pix_fmt_desc_get(x)->nb_components <= 2)
-#else
-#define isGray(x)  \
-((x) == AV_PIX_FMT_GRAY8   ||  \
- (x) == AV_PIX_FMT_YA8 ||  \
- (x) == AV_PIX_FMT_GRAY10BE||  \
- (x) == AV_PIX_FMT_GRAY10LE||  \
- (x) == AV_PIX_FMT_GRAY12BE||  \
- (x) == AV_PIX_FMT_GRAY12LE||  \
- (x) == AV_PIX_FMT_GRAY16BE||  \
- (x) == AV_PIX_FMT_GRAY16LE||  \
- (x) == AV_PIX_FMT_YA16BE  ||  \
- (x) == AV_PIX_FMT_YA16LE)
-#endif
+static av_always_inline int isGray(enum AVPixelFormat pix_fmt)
+{
+const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
+av_assert0(desc);
+return !(desc->flags & AV_PIX_FMT_FLAG_PAL) &&
+   !(desc->flags & AV_PIX_FMT_FLAG_HWACCEL) &&
+   desc->nb_components <= 2 &&
+   pix_fmt != AV_PIX_FMT_MONOBLACK &&
+   pix_fmt != AV_PIX_FMT_MONOWHITE;
+}
 
 #define isRGBinInt(x) \
 (   \
-- 
2.12.0

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


Re: [FFmpeg-devel] [PATCH 1/2] fate: add fate-sws-pixdesc-query

2017-03-19 Thread Clément Bœsch
On Sun, Mar 19, 2017 at 03:00:55PM +0100, Clément Bœsch wrote:
> Test the pixel format querying within libswscale.
> ---
>  libswscale/Makefile  |   1 +
>  libswscale/tests/.gitignore  |   1 +
>  libswscale/tests/pixdesc_query.c |  78 
>  tests/Makefile   |   1 +
>  tests/fate/libswscale.mak|   7 +
>  tests/ref/fate/sws-pixdesc-query | 416 
> +++
>  6 files changed, 504 insertions(+)
>  create mode 100644 libswscale/tests/pixdesc_query.c
>  create mode 100644 tests/fate/libswscale.mak
>  create mode 100644 tests/ref/fate/sws-pixdesc-query
> 

locally added the following forgotten: is16BPS isNBPS isBE isYUV isPlanarYUV 
isRGB

-- 
Clément B.


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


[FFmpeg-devel] Patchset v2 for pixel format querying within swscale

2017-03-19 Thread Clément Bœsch
This is in response to the next Libav commit I'll (partially) noop soon
(aa37d2bf45).

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


[FFmpeg-devel] [PATCH 2/5] swscale: use a function for isGray

2017-03-19 Thread Clément Bœsch
---
 libswscale/swscale_internal.h | 27 ++-
 1 file changed, 10 insertions(+), 17 deletions(-)

diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index af82396b1c..6bcb4640ee 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -687,23 +687,16 @@ static av_always_inline int isRGB(enum AVPixelFormat 
pix_fmt)
 return (desc->flags & AV_PIX_FMT_FLAG_RGB);
 }
 
-#if 0 // FIXME
-#define isGray(x) \
-(!(av_pix_fmt_desc_get(x)->flags & AV_PIX_FMT_FLAG_PAL) && \
- av_pix_fmt_desc_get(x)->nb_components <= 2)
-#else
-#define isGray(x)  \
-((x) == AV_PIX_FMT_GRAY8   ||  \
- (x) == AV_PIX_FMT_YA8 ||  \
- (x) == AV_PIX_FMT_GRAY10BE||  \
- (x) == AV_PIX_FMT_GRAY10LE||  \
- (x) == AV_PIX_FMT_GRAY12BE||  \
- (x) == AV_PIX_FMT_GRAY12LE||  \
- (x) == AV_PIX_FMT_GRAY16BE||  \
- (x) == AV_PIX_FMT_GRAY16LE||  \
- (x) == AV_PIX_FMT_YA16BE  ||  \
- (x) == AV_PIX_FMT_YA16LE)
-#endif
+static av_always_inline int isGray(enum AVPixelFormat pix_fmt)
+{
+const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
+av_assert0(desc);
+return !(desc->flags & AV_PIX_FMT_FLAG_PAL) &&
+   !(desc->flags & AV_PIX_FMT_FLAG_HWACCEL) &&
+   desc->nb_components <= 2 &&
+   pix_fmt != AV_PIX_FMT_MONOBLACK &&
+   pix_fmt != AV_PIX_FMT_MONOWHITE;
+}
 
 #define isRGBinInt(x) \
 (   \
-- 
2.12.0

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


[FFmpeg-devel] [PATCH 3/5] swscale: use a function for isBayer

2017-03-19 Thread Clément Bœsch
---
 libswscale/swscale_internal.h | 20 ++--
 1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index 6bcb4640ee..b3bb1695fb 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -760,20 +760,12 @@ static av_always_inline int isGray(enum AVPixelFormat 
pix_fmt)
 || (x) == AV_PIX_FMT_BGR24   \
 )
 
-#define isBayer(x) ( \
-   (x)==AV_PIX_FMT_BAYER_BGGR8\
-|| (x)==AV_PIX_FMT_BAYER_BGGR16LE \
-|| (x)==AV_PIX_FMT_BAYER_BGGR16BE \
-|| (x)==AV_PIX_FMT_BAYER_RGGB8\
-|| (x)==AV_PIX_FMT_BAYER_RGGB16LE \
-|| (x)==AV_PIX_FMT_BAYER_RGGB16BE \
-|| (x)==AV_PIX_FMT_BAYER_GBRG8\
-|| (x)==AV_PIX_FMT_BAYER_GBRG16LE \
-|| (x)==AV_PIX_FMT_BAYER_GBRG16BE \
-|| (x)==AV_PIX_FMT_BAYER_GRBG8\
-|| (x)==AV_PIX_FMT_BAYER_GRBG16LE \
-|| (x)==AV_PIX_FMT_BAYER_GRBG16BE \
-)
+static av_always_inline int isBayer(enum AVPixelFormat pix_fmt)
+{
+const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
+av_assert0(desc);
+return !strncmp(desc->name, "bayer_", 6);
+}
 
 #define isAnyRGB(x) \
 (   \
-- 
2.12.0

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


[FFmpeg-devel] [PATCH 1/5] fate: add fate-sws-pixdesc-query

2017-03-19 Thread Clément Bœsch
Test the pixel format querying within libswscale.
---
 libswscale/Makefile  |   1 +
 libswscale/tests/.gitignore  |   1 +
 libswscale/tests/pixdesc_query.c |  90 +
 tests/Makefile   |   1 +
 tests/fate/libswscale.mak|   7 +
 tests/ref/fate/sws-pixdesc-query | 806 +++
 6 files changed, 906 insertions(+)
 create mode 100644 libswscale/tests/pixdesc_query.c
 create mode 100644 tests/fate/libswscale.mak
 create mode 100644 tests/ref/fate/sws-pixdesc-query

diff --git a/libswscale/Makefile b/libswscale/Makefile
index 0272039a6c..183167cced 100644
--- a/libswscale/Makefile
+++ b/libswscale/Makefile
@@ -26,4 +26,5 @@ OBJS-$(CONFIG_SHARED)+= log2_tab.o
 SLIBOBJS-$(HAVE_GNU_WINDRES) += swscaleres.o
 
 TESTPROGS = colorspace  \
+pixdesc_query   \
 swscale \
diff --git a/libswscale/tests/.gitignore b/libswscale/tests/.gitignore
index 0ac3691ecd..1a26f038c4 100644
--- a/libswscale/tests/.gitignore
+++ b/libswscale/tests/.gitignore
@@ -1,2 +1,3 @@
 /colorspace
+/pixdesc_query
 /swscale
diff --git a/libswscale/tests/pixdesc_query.c b/libswscale/tests/pixdesc_query.c
new file mode 100644
index 00..bc49809d4b
--- /dev/null
+++ b/libswscale/tests/pixdesc_query.c
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2017 Clément Bœsch 
+ *
+ * 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 "libswscale/swscale_internal.h"
+
+/* TODO: drop this wrapper when all the is*() becomes functions */
+#define DECLARE_WRAPPER(macro)   \
+static int macro##_func(enum AVPixelFormat pix_fmt)  \
+{\
+return macro(pix_fmt);   \
+}
+
+DECLARE_WRAPPER(is16BPS)
+DECLARE_WRAPPER(isNBPS)
+DECLARE_WRAPPER(isBE)
+DECLARE_WRAPPER(isYUV)
+DECLARE_WRAPPER(isPlanarYUV)
+DECLARE_WRAPPER(isRGB)
+DECLARE_WRAPPER(isGray)
+DECLARE_WRAPPER(isRGBinInt)
+DECLARE_WRAPPER(isBGRinInt)
+DECLARE_WRAPPER(isRGBinBytes)
+DECLARE_WRAPPER(isBGRinBytes)
+DECLARE_WRAPPER(isBayer)
+DECLARE_WRAPPER(isAnyRGB)
+DECLARE_WRAPPER(isALPHA)
+DECLARE_WRAPPER(isPacked)
+DECLARE_WRAPPER(isPlanar)
+DECLARE_WRAPPER(isPackedRGB)
+DECLARE_WRAPPER(isPlanarRGB)
+DECLARE_WRAPPER(usePal)
+
+static const struct {
+const char *class;
+int (*cond)(enum AVPixelFormat pix_fmt);
+} query_tab[] = {
+{"is16BPS", is16BPS_func},
+{"isNBPS",  isNBPS_func},
+{"isBE",isBE_func},
+{"isYUV",   isYUV_func},
+{"isPlanarYUV", isPlanarYUV_func},
+{"isRGB",   isRGB_func},
+{"Gray",isGray_func},
+{"RGBinInt",isRGBinInt_func},
+{"BGRinInt",isBGRinInt_func},
+{"RGBinBytes",  isRGBinBytes_func},
+{"BGRinBytes",  isBGRinBytes_func},
+{"Bayer",   isBayer_func},
+{"AnyRGB",  isAnyRGB_func},
+{"ALPHA",   isALPHA_func},
+{"Packed",  isPacked_func},
+{"Planar",  isPlanar_func},
+{"PackedRGB",   isPackedRGB_func},
+{"PlanarRGB",   isPlanarRGB_func},
+{"usePal",  usePal_func},
+};
+
+int main(void)
+{
+int i;
+
+for (i = 0; i < FF_ARRAY_ELEMS(query_tab); i++) {
+const AVPixFmtDescriptor *pix_desc = NULL;
+printf("%s:\n", query_tab[i].class);
+while ((pix_desc = av_pix_fmt_desc_next(pix_desc))) {
+enum AVPixelFormat pix_fmt = av_pix_fmt_desc_get_id(pix_desc);
+if (query_tab[i].cond(pix_fmt))
+printf("  %s\n", pix_desc->name);
+}
+printf("\n");
+}
+return 0;
+}
diff --git a/tests/Makefile b/tests/Makefile
index 53d900bdba..66d99106ff 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -145,6 +145,7 @@ include $(SRC_PATH)/tests/fate/libavformat.mak
 include $(SRC_PATH)/tests/fate/libavresample.mak
 include $(SRC_PATH)/tests/fate/libavutil.mak
 include $(SRC_PATH)/tests/fate/libswresample.mak
+include $(SRC_PATH)/tests/fate/libswscale.mak
 include $(SRC_PATH)/tests/fate/lossless-audio.mak
 include $(SRC_PATH)/tests/fate/lossless-video.mak
 include $(SRC_PATH)/tests/fate/matroska.mak
diff --git a/tests/fate/libswscale.mak 

[FFmpeg-devel] [PATCH 5/5] swscale: use a (more correct) function for isPacked

2017-03-19 Thread Clément Bœsch
---
 libswscale/swscale_internal.h| 21 +++--
 tests/ref/fate/sws-pixdesc-query | 19 +++
 2 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index 9a28d180f1..2c2329ae56 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -784,30 +784,15 @@ static av_always_inline int isALPHA(enum AVPixelFormat 
pix_fmt)
 return desc->flags & AV_PIX_FMT_FLAG_ALPHA;
 }
 
-#if 1
-#define isPacked(x) (   \
-   (x)==AV_PIX_FMT_PAL8\
-|| (x)==AV_PIX_FMT_YUYV422 \
-|| (x)==AV_PIX_FMT_YVYU422 \
-|| (x)==AV_PIX_FMT_UYVY422 \
-|| (x)==AV_PIX_FMT_YA8   \
-|| (x)==AV_PIX_FMT_YA16LE  \
-|| (x)==AV_PIX_FMT_YA16BE  \
-|| (x)==AV_PIX_FMT_AYUV64LE\
-|| (x)==AV_PIX_FMT_AYUV64BE\
-||  isRGBinInt(x)   \
-||  isBGRinInt(x)   \
-)
-#else
 static av_always_inline int isPacked(enum AVPixelFormat pix_fmt)
 {
 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
 av_assert0(desc);
-return ((desc->nb_components >= 2 && !(desc->flags & 
AV_PIX_FMT_FLAG_PLANAR)) ||
-pix_fmt == AV_PIX_FMT_PAL8);
+return (desc->nb_components >= 2 && !(desc->flags & 
AV_PIX_FMT_FLAG_PLANAR)) ||
+pix_fmt == AV_PIX_FMT_PAL8 ||
+pix_fmt == AV_PIX_FMT_MONOBLACK || pix_fmt == AV_PIX_FMT_MONOWHITE;
 }
 
-#endif
 static av_always_inline int isPlanar(enum AVPixelFormat pix_fmt)
 {
 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
diff --git a/tests/ref/fate/sws-pixdesc-query b/tests/ref/fate/sws-pixdesc-query
index 1f0584474b..d23b4f5a11 100644
--- a/tests/ref/fate/sws-pixdesc-query
+++ b/tests/ref/fate/sws-pixdesc-query
@@ -594,6 +594,7 @@ Packed:
   monob
   pal8
   uyvy422
+  uyyvyy411
   bgr8
   bgr4
   bgr4_byte
@@ -621,6 +622,8 @@ Packed:
   ya8
   bgr48be
   bgr48le
+  xyz12le
+  xyz12be
   rgba64be
   rgba64le
   bgra64be
@@ -628,6 +631,22 @@ Packed:
   yvyu422
   ya16be
   ya16le
+  0rgb
+  rgb0
+  0bgr
+  bgr0
+  bayer_bggr8
+  bayer_rggb8
+  bayer_gbrg8
+  bayer_grbg8
+  bayer_bggr16le
+  bayer_bggr16be
+  bayer_rggb16le
+  bayer_rggb16be
+  bayer_gbrg16le
+  bayer_gbrg16be
+  bayer_grbg16le
+  bayer_grbg16be
   ayuv64le
   ayuv64be
 
-- 
2.12.0

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


[FFmpeg-devel] [PATCH 4/5] swscale: use a function for isAnyRGB

2017-03-19 Thread Clément Bœsch
---
 libswscale/swscale_internal.h | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index b3bb1695fb..9a28d180f1 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -767,13 +767,13 @@ static av_always_inline int isBayer(enum AVPixelFormat 
pix_fmt)
 return !strncmp(desc->name, "bayer_", 6);
 }
 
-#define isAnyRGB(x) \
-(   \
-  isBayer(x)  ||\
-  isRGBinInt(x)   ||\
-  isBGRinInt(x)   ||\
-  isRGB(x)  \
-)
+static av_always_inline int isAnyRGB(enum AVPixelFormat pix_fmt)
+{
+const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
+av_assert0(desc);
+return (desc->flags & AV_PIX_FMT_FLAG_RGB) ||
+pix_fmt == AV_PIX_FMT_MONOBLACK || pix_fmt == AV_PIX_FMT_MONOWHITE;
+}
 
 static av_always_inline int isALPHA(enum AVPixelFormat pix_fmt)
 {
-- 
2.12.0

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


Re: [FFmpeg-devel] [PATCH 3/5] swscale: use a function for isBayer

2017-03-19 Thread Michael Niedermayer
On Sun, Mar 19, 2017 at 03:33:41PM +0100, Clément Bœsch wrote:
> ---
>  libswscale/swscale_internal.h | 20 ++--
>  1 file changed, 6 insertions(+), 14 deletions(-)
> 
> diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
> index 6bcb4640ee..b3bb1695fb 100644
> --- a/libswscale/swscale_internal.h
> +++ b/libswscale/swscale_internal.h
> @@ -760,20 +760,12 @@ static av_always_inline int isGray(enum AVPixelFormat 
> pix_fmt)
>  || (x) == AV_PIX_FMT_BGR24   \
>  )
>  
> -#define isBayer(x) ( \
> -   (x)==AV_PIX_FMT_BAYER_BGGR8\
> -|| (x)==AV_PIX_FMT_BAYER_BGGR16LE \
> -|| (x)==AV_PIX_FMT_BAYER_BGGR16BE \
> -|| (x)==AV_PIX_FMT_BAYER_RGGB8\
> -|| (x)==AV_PIX_FMT_BAYER_RGGB16LE \
> -|| (x)==AV_PIX_FMT_BAYER_RGGB16BE \
> -|| (x)==AV_PIX_FMT_BAYER_GBRG8\
> -|| (x)==AV_PIX_FMT_BAYER_GBRG16LE \
> -|| (x)==AV_PIX_FMT_BAYER_GBRG16BE \
> -|| (x)==AV_PIX_FMT_BAYER_GRBG8\
> -|| (x)==AV_PIX_FMT_BAYER_GRBG16LE \
> -|| (x)==AV_PIX_FMT_BAYER_GRBG16BE \
> -)
> +static av_always_inline int isBayer(enum AVPixelFormat pix_fmt)
> +{
> +const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
> +av_assert0(desc);
> +return !strncmp(desc->name, "bayer_", 6);

iam not sure strncmp() is a good idea speed wise

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

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein


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


Re: [FFmpeg-devel] [PATCH 4/5] swscale: use a function for isAnyRGB

2017-03-19 Thread Michael Niedermayer
On Sun, Mar 19, 2017 at 03:33:42PM +0100, Clément Bœsch wrote:
> ---
>  libswscale/swscale_internal.h | 14 +++---
>  1 file changed, 7 insertions(+), 7 deletions(-)

should be ok

thx

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

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus


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


Re: [FFmpeg-devel] [PATCH 5/5] swscale: use a (more correct) function for isPacked

2017-03-19 Thread Michael Niedermayer
On Sun, Mar 19, 2017 at 03:33:43PM +0100, Clément Bœsch wrote:
> ---
>  libswscale/swscale_internal.h| 21 +++--
>  tests/ref/fate/sws-pixdesc-query | 19 +++
>  2 files changed, 22 insertions(+), 18 deletions(-)

should be ok

thx

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

If you fake or manipulate statistics in a paper in physics you will never
get a job again.
If you fake or manipulate statistics in a paper in medicin you will get
a job for life at the pharma industry.


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


Re: [FFmpeg-devel] [PATCH 1/5] fate: add fate-sws-pixdesc-query

2017-03-19 Thread Michael Niedermayer
On Sun, Mar 19, 2017 at 03:33:39PM +0100, Clément Bœsch wrote:
> Test the pixel format querying within libswscale.
> ---
>  libswscale/Makefile  |   1 +
>  libswscale/tests/.gitignore  |   1 +
>  libswscale/tests/pixdesc_query.c |  90 +
>  tests/Makefile   |   1 +
>  tests/fate/libswscale.mak|   7 +
>  tests/ref/fate/sws-pixdesc-query | 806 
> +++
>  6 files changed, 906 insertions(+)
>  create mode 100644 libswscale/tests/pixdesc_query.c
>  create mode 100644 tests/fate/libswscale.mak
>  create mode 100644 tests/ref/fate/sws-pixdesc-query

LGTM

thx

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

What does censorship reveal? It reveals fear. -- Julian Assange


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


Re: [FFmpeg-devel] [PATCH 3/5] swscale: use a function for isBayer

2017-03-19 Thread Clément Bœsch
On Sun, Mar 19, 2017 at 04:35:12PM +0100, Michael Niedermayer wrote:
> On Sun, Mar 19, 2017 at 03:33:41PM +0100, Clément Bœsch wrote:
> > ---
> >  libswscale/swscale_internal.h | 20 ++--
> >  1 file changed, 6 insertions(+), 14 deletions(-)
> > 
> > diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
> > index 6bcb4640ee..b3bb1695fb 100644
> > --- a/libswscale/swscale_internal.h
> > +++ b/libswscale/swscale_internal.h
> > @@ -760,20 +760,12 @@ static av_always_inline int isGray(enum AVPixelFormat 
> > pix_fmt)
> >  || (x) == AV_PIX_FMT_BGR24   \
> >  )
> >  
> > -#define isBayer(x) ( \
> > -   (x)==AV_PIX_FMT_BAYER_BGGR8\
> > -|| (x)==AV_PIX_FMT_BAYER_BGGR16LE \
> > -|| (x)==AV_PIX_FMT_BAYER_BGGR16BE \
> > -|| (x)==AV_PIX_FMT_BAYER_RGGB8\
> > -|| (x)==AV_PIX_FMT_BAYER_RGGB16LE \
> > -|| (x)==AV_PIX_FMT_BAYER_RGGB16BE \
> > -|| (x)==AV_PIX_FMT_BAYER_GBRG8\
> > -|| (x)==AV_PIX_FMT_BAYER_GBRG16LE \
> > -|| (x)==AV_PIX_FMT_BAYER_GBRG16BE \
> > -|| (x)==AV_PIX_FMT_BAYER_GRBG8\
> > -|| (x)==AV_PIX_FMT_BAYER_GRBG16LE \
> > -|| (x)==AV_PIX_FMT_BAYER_GRBG16BE \
> > -)
> > +static av_always_inline int isBayer(enum AVPixelFormat pix_fmt)
> > +{
> > +const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
> > +av_assert0(desc);
> > +return !strncmp(desc->name, "bayer_", 6);
> 
> iam not sure strncmp() is a good idea speed wise
> 

In a non-bayer case, the function will return in the worst case after the
2nd character, I have high doubt about this being a speed issue. We can
introduce a flag for this, but I don't think it's worth.

-- 
Clément B.


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


Re: [FFmpeg-devel] [PATCH v7] - Added Turing codec interface for ffmpeg

2017-03-19 Thread Clément Bœsch
On Tue, Feb 21, 2017 at 05:15:59PM +, Saverio Blasi wrote:
[...]
>  enabled libspeex  && require_pkg_config speex speex/speex.h 
> speex_decoder_init -lspeex
>  enabled libtesseract  && require_pkg_config tesseract tesseract/capi.h 
> TessBaseAPICreate
>  enabled libtheora && require libtheora theora/theoraenc.h 
> th_info_init -ltheoraenc -ltheoradec -logg

> +enabled libturing && require_pkg_config libturing turing.h 
> turing_version

You probably want to specify a minimal version

[...]
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 
> +02110-1301 USA  */
> +

This looks mangled.

> +#include 

Please add a line break after this

> +#include "libavutil/internal.h"
> +#include "libavutil/common.h"
> +#include "libavutil/opt.h"
> +#include "libavutil/pixdesc.h"
> +#include "avcodec.h"
> +#include "internal.h"
> +
> +#define MAX_OPTION_LENGTH 256
> +
> +typedef struct libturingEncodeContext {
> +const AVClass *class;
> +turing_encoder *encoder;
> +const char *options;
> +} libturingEncodeContext;
> +
> +typedef struct optionContext {

> +char** argv;
> +char* options;
> +char* s;

Style here and in other places: * stick to the var

> +int options_buffer_size;
> +int buffer_filled;
> +int options_added;
> +} optionContext;
> +

> +static av_cold int libturing_encode_close(AVCodecContext *avctx) {

Style: here and in other places missing line break before "{" for
functions.

> +libturingEncodeContext *ctx = avctx->priv_data;
> +

> +if (ctx->encoder) {
> +turing_destroy_encoder(ctx->encoder);
> +}

Note: the NULL check should probably be part of the libturing API to
simplify code paths for the users (just like the stdlib free(3)
convention).

> +return 0;
> +}
> +
> +static av_cold int add_option(const char* current_option, 
> +optionContext* option_ctx) {

This function should be replaced with AVBPrint API. It will be much
simpler (that function will basically disappear) and will allow the caller
to check for errors only once.

[...]
> +static av_cold int libturing_encode_init(AVCodecContext *avctx) {
> +libturingEncodeContext *ctx = avctx->priv_data;
> +const int bit_depth = av_pix_fmt_desc_get(avctx->pix_fmt)->comp[0].depth;
> +int error_code = 0;
> +

> +optionContext encoder_options;

use "encoder_options = {0}" so you don't need to fill each and every field
later on, and risk to forget one in the future.

[...]
> +int const illegal_option =
> +!strcmp("input-res", en->key) ||
> +!strcmp("frame-rate", en->key) ||
> +!strcmp("f", en->key) ||
> +!strcmp("frames", en->key) ||
> +!strcmp("sar", en->key) ||
> +!strcmp("bit-depth", en->key) ||
> +!strcmp("internal-bit-depth", en->key);

you could use av_match_name(en->key, "input-res,frame-rate,f,...") here.

> +if (illegal_option) {
> +av_log(avctx, AV_LOG_WARNING, "%s=%s ignored - this 
> parameter is inferred from ffmpeg.\n", en->key, en->value);
> +} else {
> +if (turing_check_binary_option(en->key)) {
> +snprintf(option_string, MAX_OPTION_LENGTH, "--%s", 
> en->key);
> +} else {
> +snprintf(option_string, MAX_OPTION_LENGTH, 
> "--%s=%s", en->key, en->value);
> +}
> +if ((error_code = add_option(option_string, 
> &encoder_options)) > 0) {
> +goto fail;

leaking dict here.

> +}
> +}
> +}
> +av_dict_free(&dict);
> +}
> +}
> +
> +if ((error_code = add_option("dummy-input-filename", &encoder_options)) 
> > 0) {
> +goto fail;
> +}
> +
> +if ((error_code = finalise_options(&encoder_options)) > 0) {
> +goto fail;
> +}
> +
> +settings.argv = (char const**)encoder_options.argv;
> +settings.argc = encoder_options.options_added;
> +

> +for (int i=0; i +av_log(avctx, AV_LOG_VERBOSE, "arg %d: %s\n", i, settings.argv[i]);
> +}
> +
> +ctx->encoder = turing_create_encoder(settings);
> +
> +if (!ctx->encoder) {
> +av_log(avctx, AV_LOG_ERROR, "Failed to create libturing encoder.\n");
> +error_code = AVERROR_INVALIDDATA;
> +goto fail;
> +}
> +
> +if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) {
> +turing_bitstream const *bitstream;
> +bitstream = turing_encode_headers(ctx->encoder);
> +if (bitstream->size <= 0) {
> +av_log(avctx, AV_LOG_ERROR, "Failed to encode headers.\n");
> +turing_destroy_encoder(ctx->encoder);
> +error_code = AVERROR_INVALIDDATA;
> +goto fail;
> +}
> +
> +avctx->extradata_size = bitstream->size;
> +
> +avctx->

Re: [FFmpeg-devel] [PATCH 2/3] ffplay: convert to new decode API

2017-03-19 Thread Philip Langdale
On Fri, 17 Mar 2017 19:42:07 -0700
Philip Langdale  wrote:

> On Sat, 18 Mar 2017 01:51:39 +0100 (CET)
> Marton Balint  wrote:
> 
> > On Sat, 18 Mar 2017, wal...@free.fr wrote:
> >   
> > > The logs:  http://pastebin.com/1duYR0Ui
> > >
> > 
> > Log with video only (run ffplay with -an -sn) might show it more
> > clearly, but even from the logs above it looks like the CrystalHD
> > codec is returning EAGAINs at the same time for both receive_frame
> > and send_packet. If it indeed does work in ffmpeg, then I suspect a
> > lot of busy waiting there. Philip, you mind taking a look? :)  
> 
> My first reply got HTML-ised by my client. Weird.
> 
> Wallak,
> 
> Can I get a sample from you to ensure I can repro. Also: are you using
> a 12 or a 15? I only have a 15 and have never tested the code with a
> 12. Also, it would be great if you can test playback with mpv. As I
> said, that's what I've used for testing.

I did take a brief look, and I confirmed that mpv works fine but ffplay
is hitting this deadlock between send and receive. My hardware is
getting flaky, and my actually be dying, so it's hard for me to do any
kind of systematic testing.

So right now my only useful advice is to look at how mpv is running the
loop and see if there's a significant difference.

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


Re: [FFmpeg-devel] [PATCH 3/5] swscale: use a function for isBayer

2017-03-19 Thread Michael Niedermayer
On Sun, Mar 19, 2017 at 04:50:24PM +0100, Clément Bœsch wrote:
> On Sun, Mar 19, 2017 at 04:35:12PM +0100, Michael Niedermayer wrote:
> > On Sun, Mar 19, 2017 at 03:33:41PM +0100, Clément Bœsch wrote:
> > > ---
> > >  libswscale/swscale_internal.h | 20 ++--
> > >  1 file changed, 6 insertions(+), 14 deletions(-)
> > > 
> > > diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
> > > index 6bcb4640ee..b3bb1695fb 100644
> > > --- a/libswscale/swscale_internal.h
> > > +++ b/libswscale/swscale_internal.h
> > > @@ -760,20 +760,12 @@ static av_always_inline int isGray(enum 
> > > AVPixelFormat pix_fmt)
> > >  || (x) == AV_PIX_FMT_BGR24   \
> > >  )
> > >  
> > > -#define isBayer(x) ( \
> > > -   (x)==AV_PIX_FMT_BAYER_BGGR8\
> > > -|| (x)==AV_PIX_FMT_BAYER_BGGR16LE \
> > > -|| (x)==AV_PIX_FMT_BAYER_BGGR16BE \
> > > -|| (x)==AV_PIX_FMT_BAYER_RGGB8\
> > > -|| (x)==AV_PIX_FMT_BAYER_RGGB16LE \
> > > -|| (x)==AV_PIX_FMT_BAYER_RGGB16BE \
> > > -|| (x)==AV_PIX_FMT_BAYER_GBRG8\
> > > -|| (x)==AV_PIX_FMT_BAYER_GBRG16LE \
> > > -|| (x)==AV_PIX_FMT_BAYER_GBRG16BE \
> > > -|| (x)==AV_PIX_FMT_BAYER_GRBG8\
> > > -|| (x)==AV_PIX_FMT_BAYER_GRBG16LE \
> > > -|| (x)==AV_PIX_FMT_BAYER_GRBG16BE \
> > > -)
> > > +static av_always_inline int isBayer(enum AVPixelFormat pix_fmt)
> > > +{
> > > +const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
> > > +av_assert0(desc);
> > > +return !strncmp(desc->name, "bayer_", 6);
> > 
> > iam not sure strncmp() is a good idea speed wise
> > 
> 
> In a non-bayer case, the function will return in the worst case after the
> 2nd character, I have high doubt about this being a speed issue. We can
> introduce a flag for this, but I don't think it's worth.

i think needing to call libc is a bit ugly here

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway


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


[FFmpeg-devel] [PATCH] avformat/ftp: Solve a crash bug when network occur a exception

2017-03-19 Thread tiejun.peng
This fixes a proble where ffmpeg would cause crash to do a seek when the 
network disconnect.
The log like this:
01-01 10:53:03.441  6580  6580 F DEBUG   : backtrace:
01-01 10:53:03.441  6580  6580 F DEBUG   : #00 pc 0002942e  
/system/lib/libavformat.so (ffurl_write+9)

Signed-off-by: tiejun.peng 
---
 libavformat/ftp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/ftp.c b/libavformat/ftp.c
index 0663b47..3f1bf2e 100644
--- a/libavformat/ftp.c
+++ b/libavformat/ftp.c
@@ -206,6 +206,9 @@ static int ftp_send_command(FTPContext *s, const char 
*command,
 if (response)
 *response = NULL;
 
+if (!s->conn_control)
+return -1;
+
 if ((err = ffurl_write(s->conn_control, command, strlen(command))) < 0)
 return err;
 if (!err)
-- 
2.7.4

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


Re: [FFmpeg-devel] [PATCH] avformat/ftp: Solve a crash bug when network occur a exception

2017-03-19 Thread Nicolas George
Le nonidi 29 ventôse, an CCXXV, tiejun.peng a écrit :
> This fixes a proble where ffmpeg would cause crash to do a seek when the 
> network disconnect.
> The log like this:
> 01-01 10:53:03.441  6580  6580 F DEBUG   : backtrace:
> 01-01 10:53:03.441  6580  6580 F DEBUG   : #00 pc 0002942e  
> /system/lib/libavformat.so (ffurl_write+9)
> 
> Signed-off-by: tiejun.peng 
> ---
>  libavformat/ftp.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/libavformat/ftp.c b/libavformat/ftp.c
> index 0663b47..3f1bf2e 100644
> --- a/libavformat/ftp.c
> +++ b/libavformat/ftp.c
> @@ -206,6 +206,9 @@ static int ftp_send_command(FTPContext *s, const char 
> *command,
>  if (response)
>  *response = NULL;
>  
> +if (!s->conn_control)

> +return -1;

I think -1 is not an acceptable error code here.

> +
>  if ((err = ffurl_write(s->conn_control, command, strlen(command))) < 0)
>  return err;
>  if (!err)

Regards,

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


Re: [FFmpeg-devel] [PATCH 3/5] swscale: use a function for isBayer

2017-03-19 Thread Clément Bœsch
On Sun, Mar 19, 2017 at 10:13:37PM +0100, Michael Niedermayer wrote:
[...]
> > > > +static av_always_inline int isBayer(enum AVPixelFormat pix_fmt)
> > > > +{
> > > > +const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
> > > > +av_assert0(desc);
> > > > +return !strncmp(desc->name, "bayer_", 6);
> > > 
> > > iam not sure strncmp() is a good idea speed wise
> > > 
> > 
> > In a non-bayer case, the function will return in the worst case after the
> > 2nd character, I have high doubt about this being a speed issue. We can
> > introduce a flag for this, but I don't think it's worth.
> 
> i think needing to call libc is a bit ugly here
> 

It's already how we do it in libavutil/pixdesc.c.

But anyway, how about the 2 attached patches?

-- 
Clément B.
From 0a83075486121f1df222c4fe321242567807c9b0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= 
Date: Sun, 19 Mar 2017 22:34:31 +0100
Subject: [PATCH 3/6] lavu: add AV_PIX_FMT_FLAG_BAYER

---
 doc/APIchanges  |  3 +++
 libavutil/pixdesc.c | 26 +-
 libavutil/pixdesc.h |  5 +
 libavutil/version.h |  2 +-
 4 files changed, 22 insertions(+), 14 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index d5cee9b703..cbf6f36979 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2015-08-28
 
 API changes, most recent first:
 
+2017-03-xx - xxx - lavu 55.49.100 - pixdesc.h
+  Add AV_PIX_FMT_FLAG_BAYER pixel format flag.
+
 2017-03-18 - xxx - lavfi 6.77.100 - avfilter.h
   Deprecate AVFilterGraph.resample_lavr_opts
   It's never been used by avfilter nor passed to anything.
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 3b9c45d035..ad068df3c7 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -1915,62 +1915,62 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
 [AV_PIX_FMT_BAYER_BGGR8] = {
 .name = "bayer_bggr8",
 BAYER8_DESC_COMMON
-.flags = AV_PIX_FMT_FLAG_RGB,
+.flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BAYER,
 },
 [AV_PIX_FMT_BAYER_BGGR16LE] = {
 .name = "bayer_bggr16le",
 BAYER16_DESC_COMMON
-.flags = AV_PIX_FMT_FLAG_RGB,
+.flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BAYER,
 },
 [AV_PIX_FMT_BAYER_BGGR16BE] = {
 .name = "bayer_bggr16be",
 BAYER16_DESC_COMMON
-.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
+.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BAYER,
 },
 [AV_PIX_FMT_BAYER_RGGB8] = {
 .name = "bayer_rggb8",
 BAYER8_DESC_COMMON
-.flags = AV_PIX_FMT_FLAG_RGB,
+.flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BAYER,
 },
 [AV_PIX_FMT_BAYER_RGGB16LE] = {
 .name = "bayer_rggb16le",
 BAYER16_DESC_COMMON
-.flags = AV_PIX_FMT_FLAG_RGB,
+.flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BAYER,
 },
 [AV_PIX_FMT_BAYER_RGGB16BE] = {
 .name = "bayer_rggb16be",
 BAYER16_DESC_COMMON
-.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
+.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BAYER,
 },
 [AV_PIX_FMT_BAYER_GBRG8] = {
 .name = "bayer_gbrg8",
 BAYER8_DESC_COMMON
-.flags = AV_PIX_FMT_FLAG_RGB,
+.flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BAYER,
 },
 [AV_PIX_FMT_BAYER_GBRG16LE] = {
 .name = "bayer_gbrg16le",
 BAYER16_DESC_COMMON
-.flags = AV_PIX_FMT_FLAG_RGB,
+.flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BAYER,
 },
 [AV_PIX_FMT_BAYER_GBRG16BE] = {
 .name = "bayer_gbrg16be",
 BAYER16_DESC_COMMON
-.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
+.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BAYER,
 },
 [AV_PIX_FMT_BAYER_GRBG8] = {
 .name = "bayer_grbg8",
 BAYER8_DESC_COMMON
-.flags = AV_PIX_FMT_FLAG_RGB,
+.flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BAYER,
 },
 [AV_PIX_FMT_BAYER_GRBG16LE] = {
 .name = "bayer_grbg16le",
 BAYER16_DESC_COMMON
-.flags = AV_PIX_FMT_FLAG_RGB,
+.flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BAYER,
 },
 [AV_PIX_FMT_BAYER_GRBG16BE] = {
 .name = "bayer_grbg16be",
 BAYER16_DESC_COMMON
-.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
+.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BAYER,
 },
 [AV_PIX_FMT_NV16] = {
 .name = "nv16",
@@ -2415,7 +2415,7 @@ void ff_check_pixfmt_descriptors(void){
 } else {
 av_assert0(8*c->step >= c->depth);
 }
-if (!strncmp(d->name, "bayer_", 6))
+if (d->flags & AV_PIX_FMT_FLAG_BAYER)
 continue;
 av_read_image_line(tmp, (void*)data, linesize, d, 0, 0, j, 2, 0);
 av_assert0(t

Re: [FFmpeg-devel] [PATCH 2/3 v2] decklink: new option 'format_code' to set video format by fourCC

2017-03-19 Thread Matthias Hunstock
Am 18.03.2017 um 02:14 schrieb Marton Balint:
> 
> On Fri, 17 Mar 2017, Matthias Hunstock wrote:
> 
>> Signed-off-by: Matthias Hunstock 
>> ---
>> libavdevice/decklink_common.cpp | 17 +
>> libavdevice/decklink_common_c.h |  1 +
>> libavdevice/decklink_dec.cpp|  5 +++--
>> libavdevice/decklink_dec_c.c|  1 +
>> libavdevice/decklink_enc_c.c|  1 +
>> 5 files changed, 19 insertions(+), 6 deletions(-)
>>
>> diff --git a/libavdevice/decklink_common.cpp
>> b/libavdevice/decklink_common.cpp
>> index 82b3a0c..a75ccc1 100644
>> --- a/libavdevice/decklink_common.cpp
>> +++ b/libavdevice/decklink_common.cpp
>> @@ -33,6 +33,7 @@ extern "C" {
>> #include "libavformat/avformat.h"
>> #include "libavformat/internal.h"
>> #include "libavutil/imgutils.h"
>> +#include "libavutil/intreadwrite.h"
>> #include "libavutil/bswap.h"
>> }
>>
>> @@ -158,8 +159,8 @@ int ff_decklink_set_format(AVFormatContext *avctx,
>> int i = 1;
>> HRESULT res;
>>
>> -av_log(avctx, AV_LOG_DEBUG, "Trying to find mode for frame size
>> %dx%d, frame timing %d/%d, field order %d, direction %d, mode number
>> %d\n",
>> -width, height, tb_num, tb_den, field_order, direction, num);
>> +av_log(avctx, AV_LOG_DEBUG, "Trying to find mode for frame size
>> %dx%d, frame timing %d/%d, field order %d, direction %d, mode number
>> %d, format code %s\n",
>> +width, height, tb_num, tb_den, field_order, direction, num,
>> (cctx->format_code) ? cctx->format_code : "(unset)");
>>
>> if (ctx->duplex_mode) {
>> DECKLINK_BOOL duplex_supported = false;
>> @@ -196,12 +197,18 @@ int ff_decklink_set_format(AVFormatContext *avctx,
>> return AVERROR(EIO);
>> }
>>
>> +BMDDisplayMode target_mode = 0;
>> +char format_buf[] = " ";
>> +if (cctx->format_code)
>> +av_strlcpy(format_buf, cctx->format_code, sizeof(format_buf));
> 
> Are you sure this does what you want it to do? The null terminator
> should noy be copied to format_buf.

Oh, you are right, it doesn't work for 'pal'. I was eager to use some
av* function. Will use memcpy.


>> +target_mode = av_bswap32(AV_RL32(format_buf));
> 
> I think you can do this in one step with AV_RB32 (the big endian pair of
> AV_RL32)

Thanks for the hint. I tried to look up AV_RL32 but got lost in a loop
of #define s.


>> diff --git a/libavdevice/decklink_enc_c.c b/libavdevice/decklink_enc_c.c
>> index 03734f8..76a040c 100644
>> --- a/libavdevice/decklink_enc_c.c
>> +++ b/libavdevice/decklink_enc_c.c
>> @@ -30,6 +30,7 @@
>> static const AVOption options[] = {
>> { "list_devices", "list available devices"  ,
>> OFFSET(list_devices), AV_OPT_TYPE_INT   , { .i64 = 0   }, 0, 1, ENC },
>> { "list_formats", "list supported formats"  ,
>> OFFSET(list_formats), AV_OPT_TYPE_INT   , { .i64 = 0   }, 0, 1, ENC },
>> +{ "format_code",  "force format by fourcc"  ,
>> OFFSET(format_code),  AV_OPT_TYPE_STRING, { .str = NULL}, 3, 4, ENC },
>> { "preroll" , "video preroll in seconds", OFFSET(preroll
>> ), AV_OPT_TYPE_DOUBLE, { .dbl = 0.5 }, 0, 5, ENC },
>> { NULL },
> 
> Please make outdev support a separate patch if you insist on it, I am
> still not convinced that it is a good idea to support this for outdev
> and allowing mismatching width/height/framerate at the same time.


Ok, I'll just drop it.


> On the other hand, you can merge the documentation into this patch.

Ok


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


[FFmpeg-devel] [PATCH 1/2 v3] decklink: add format_code of display mode to list_format output

2017-03-19 Thread Matthias Hunstock
Signed-off-by: Matthias Hunstock 
---
 libavdevice/decklink_common.cpp | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/libavdevice/decklink_common.cpp b/libavdevice/decklink_common.cpp
index 8b499c5..26c0776 100644
--- a/libavdevice/decklink_common.cpp
+++ b/libavdevice/decklink_common.cpp
@@ -33,6 +33,7 @@ extern "C" {
 #include "libavformat/avformat.h"
 #include "libavformat/internal.h"
 #include "libavutil/imgutils.h"
+#include "libavutil/bswap.h"
 }
 
 #include "decklink_common.h"
@@ -276,6 +277,7 @@ int ff_decklink_list_formats(AVFormatContext *avctx, 
decklink_direction_t direct
 struct decklink_ctx *ctx = (struct decklink_ctx *)cctx->ctx;
 IDeckLinkDisplayModeIterator *itermode;
 IDeckLinkDisplayMode *mode;
+uint32_t format_code;
 int i=0;
 HRESULT res;
 
@@ -297,13 +299,14 @@ int ff_decklink_list_formats(AVFormatContext *avctx, 
decklink_direction_t direct
 return AVERROR(EIO);
 }
 
-av_log(avctx, AV_LOG_INFO, "Supported formats for '%s':\n",
+av_log(avctx, AV_LOG_INFO, "Supported formats for 
'%s':\n\tmode\tformat_code\tdescription",
avctx->filename);
 while (itermode->Next(&mode) == S_OK) {
 BMDTimeValue tb_num, tb_den;
 mode->GetFrameRate(&tb_num, &tb_den);
-av_log(avctx, AV_LOG_INFO, "\t%d\t%ldx%ld at %d/%d fps",
-++i,mode->GetWidth(), mode->GetHeight(),
+format_code = av_bswap32(mode->GetDisplayMode());
+av_log(avctx, AV_LOG_INFO, "\n\t%d\t%.4s\t\t%ldx%ld at %d/%d fps",
+++i, (char*) &format_code, mode->GetWidth(), mode->GetHeight(),
 (int) tb_den, (int) tb_num);
 switch (mode->GetFieldDominance()) {
 case bmdLowerFieldFirst:
@@ -311,9 +314,9 @@ int ff_decklink_list_formats(AVFormatContext *avctx, 
decklink_direction_t direct
 case bmdUpperFieldFirst:
 av_log(avctx, AV_LOG_INFO, " (interlaced, upper field first)"); break;
 }
-av_log(avctx, AV_LOG_INFO, "\n");
 mode->Release();
 }
+av_log(avctx, AV_LOG_INFO, "\n");
 
 itermode->Release();
 
-- 
2.1.4

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


[FFmpeg-devel] [PATCH 2/2 v3] decklink: new option 'format_code' to set video format by fourCC

2017-03-19 Thread Matthias Hunstock
Signed-off-by: Matthias Hunstock 
---
 doc/indevs.texi | 14 ++
 libavdevice/decklink_common.cpp | 17 +
 libavdevice/decklink_common_c.h |  1 +
 libavdevice/decklink_dec.cpp|  5 +++--
 libavdevice/decklink_dec_c.c|  1 +
 5 files changed, 28 insertions(+), 10 deletions(-)

diff --git a/doc/indevs.texi b/doc/indevs.texi
index 27cc3d5..a4c99a9 100644
--- a/doc/indevs.texi
+++ b/doc/indevs.texi
@@ -233,6 +233,12 @@ Defaults to @option{false}.
 If set to @option{true}, print a list of supported formats and exit.
 Defaults to @option{false}.
 
+@item format_code 
+This sets the input video format to the format given by the FourCC. To see
+the supported values of your device(s) use @option{list_formats}.
+Note that there is a fourCC @option{'pal '} that can also be used
+as @option{pal} (3 letters).
+
 @item bm_v210
 If set to @samp{1}, video is captured in 10 bit v210 instead
 of uyvy422. Not all Blackmagic devices support this option.
@@ -296,21 +302,21 @@ ffmpeg -f decklink -list_formats 1 -i 'Intensity Pro'
 @end example
 
 @item
-Capture video clip at 1080i50 (format 11):
+Capture video clip at 1080i50:
 @example
-ffmpeg -f decklink -i 'Intensity Pro@@11' -acodec copy -vcodec copy output.avi
+ffmpeg -format_code Hi50 -f decklink -i 'Intensity Pro' -acodec copy -vcodec 
copy output.avi
 @end example
 
 @item
 Capture video clip at 1080i50 10 bit:
 @example
-ffmpeg -bm_v210 1 -f decklink -i 'UltraStudio Mini Recorder@@11' -acodec copy 
-vcodec copy output.avi
+ffmpeg -bm_v210 1 -format_code Hi50 -f decklink -i 'UltraStudio Mini Recorder' 
-acodec copy -vcodec copy output.avi
 @end example
 
 @item
 Capture video clip at 1080i50 with 16 audio channels:
 @example
-ffmpeg -channels 16 -f decklink -i 'UltraStudio Mini Recorder@@11' -acodec 
copy -vcodec copy output.avi
+ffmpeg -channels 16 -format_code Hi50 -f decklink -i 'UltraStudio Mini 
Recorder' -acodec copy -vcodec copy output.avi
 @end example
 
 @end itemize
diff --git a/libavdevice/decklink_common.cpp b/libavdevice/decklink_common.cpp
index 26c0776..9e862ca 100644
--- a/libavdevice/decklink_common.cpp
+++ b/libavdevice/decklink_common.cpp
@@ -33,6 +33,7 @@ extern "C" {
 #include "libavformat/avformat.h"
 #include "libavformat/internal.h"
 #include "libavutil/imgutils.h"
+#include "libavutil/intreadwrite.h"
 #include "libavutil/bswap.h"
 }
 
@@ -158,8 +159,8 @@ int ff_decklink_set_format(AVFormatContext *avctx,
 int i = 1;
 HRESULT res;
 
-av_log(avctx, AV_LOG_DEBUG, "Trying to find mode for frame size %dx%d, 
frame timing %d/%d, field order %d, direction %d, mode number %d\n",
-width, height, tb_num, tb_den, field_order, direction, num);
+av_log(avctx, AV_LOG_DEBUG, "Trying to find mode for frame size %dx%d, 
frame timing %d/%d, field order %d, direction %d, mode number %d, format code 
%s\n",
+width, height, tb_num, tb_den, field_order, direction, num, 
(cctx->format_code) ? cctx->format_code : "(unset)");
 
 if (ctx->duplex_mode) {
 DECKLINK_BOOL duplex_supported = false;
@@ -196,12 +197,18 @@ int ff_decklink_set_format(AVFormatContext *avctx,
 return AVERROR(EIO);
 }
 
+BMDDisplayMode target_mode = 0;
+char format_buf[] = "";
+if (cctx->format_code)
+memcpy(format_buf, cctx->format_code, FFMIN(strlen(cctx->format_code), 
sizeof(format_buf)));
+target_mode = AV_RB32(format_buf);
 AVRational target_tb = av_make_q(tb_num, tb_den);
 ctx->bmd_mode = bmdModeUnknown;
 while ((ctx->bmd_mode == bmdModeUnknown) && itermode->Next(&mode) == S_OK) 
{
 BMDTimeValue bmd_tb_num, bmd_tb_den;
 int bmd_width  = mode->GetWidth();
 int bmd_height = mode->GetHeight();
+BMDDisplayMode bmd_mode = mode->GetDisplayMode();
 BMDFieldDominance bmd_field_dominance = mode->GetFieldDominance();
 
 mode->GetFrameRate(&bmd_tb_num, &bmd_tb_den);
@@ -210,8 +217,10 @@ int ff_decklink_set_format(AVFormatContext *avctx,
 if ((bmd_width == width &&
  bmd_height == height &&
  !av_cmp_q(mode_tb, target_tb) &&
- field_order_eq(field_order, bmd_field_dominance)) || i == num) {
-ctx->bmd_mode   = mode->GetDisplayMode();
+ field_order_eq(field_order, bmd_field_dominance))
+ || i == num
+ || target_mode == bmd_mode) {
+ctx->bmd_mode   = bmd_mode;
 ctx->bmd_width  = bmd_width;
 ctx->bmd_height = bmd_height;
 ctx->bmd_tb_den = bmd_tb_den;
diff --git a/libavdevice/decklink_common_c.h b/libavdevice/decklink_common_c.h
index d565631..72c5f9a 100644
--- a/libavdevice/decklink_common_c.h
+++ b/libavdevice/decklink_common_c.h
@@ -47,6 +47,7 @@ struct decklink_cctx {
 int audio_input;
 int video_input;
 int draw_bars;
+char *format_code;
 };
 
 #endif /* AVDEVICE_DECKLINK_COMMON_C_H */
diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp

Re: [FFmpeg-devel] [PATCH 1/3] lavf: identify MP1 and MP2 as distinct containers from MP3

2017-03-19 Thread Michael Niedermayer
On Sat, Mar 18, 2017 at 04:38:03AM -0500, Rodger Combs wrote:
> This allows us to report the correct codec ID here
> ---
>  libavformat/allformats.c |  3 ++-
>  libavformat/mp3dec.c | 66 
> +++-
>  libavformat/rawenc.c | 13 ++
>  libavformat/utils.c  |  4 +--
>  libavformat/version.h|  4 +--
>  5 files changed, 62 insertions(+), 28 deletions(-)

this seems to change the file from https://trac.ffmpeg.org/ticket/5689
if thats intended please add a mention of the ticket to the commit
message

thx

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

The educated differ from the uneducated as much as the living from the
dead. -- Aristotle 


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


Re: [FFmpeg-devel] [PATCH 3/5] swscale: use a function for isBayer

2017-03-19 Thread Michael Niedermayer
On Sun, Mar 19, 2017 at 10:37:30PM +0100, Clément Bœsch wrote:
> On Sun, Mar 19, 2017 at 10:13:37PM +0100, Michael Niedermayer wrote:
> [...]
> > > > > +static av_always_inline int isBayer(enum AVPixelFormat pix_fmt)
> > > > > +{
> > > > > +const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
> > > > > +av_assert0(desc);
> > > > > +return !strncmp(desc->name, "bayer_", 6);
> > > > 
> > > > iam not sure strncmp() is a good idea speed wise
> > > > 
> > > 
> > > In a non-bayer case, the function will return in the worst case after the
> > > 2nd character, I have high doubt about this being a speed issue. We can
> > > introduce a flag for this, but I don't think it's worth.
> > 
> > i think needing to call libc is a bit ugly here
> > 
> 
> It's already how we do it in libavutil/pixdesc.c.
> 
> But anyway, how about the 2 attached patches?

they look nice

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA


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/3] lavf/utils: add MP2 to the probing list

2017-03-19 Thread Michael Niedermayer
On Sat, Mar 18, 2017 at 04:38:04AM -0500, Rodger Combs wrote:
> ---
>  libavformat/utils.c | 1 +
>  1 file changed, 1 insertion(+)

should be ok

thx

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

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates


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


Re: [FFmpeg-devel] [PATCH 1/2] avcodec/tiff: Check stripsize strippos for overflow

2017-03-19 Thread Michael Niedermayer
On Thu, Mar 16, 2017 at 03:02:49AM +0100, Michael Niedermayer wrote:
> Fixes: 861/clusterfuzz-testcase-5688284384591872
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/tiff.c | 10 ++
>  1 file changed, 10 insertions(+)

applied

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

While the State exists there can be no freedom; when there is freedom there
will be no State. -- 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] avcodec/h264_direct: Fix runtime error: signed integer overflow: -9 - 2147483647 cannot be represented in type 'int'

2017-03-19 Thread Michael Niedermayer
On Thu, Mar 16, 2017 at 06:54:36PM +, Kieran Kunhya wrote:
> On Thu, 16 Mar 2017 at 15:37 Michael Niedermayer 
> wrote:
> 
> > On Thu, Mar 16, 2017 at 11:41:12AM +, Kieran Kunhya wrote:
> > > >
> > > > +
> > > > +if (pocdiff0 != (int)pocdiff0)
> > > > +avpriv_request_sample(sl->h264->avctx, "pocdiff0
> > overflow\n");
> > > > +
> > > >
> > >
> > > Do you think this condition will actually happen in the real world apart
> > > from in glitchy live streams?
> >
> > I dont really know, do you prefer a AV_LOG_DEBUG ?
> >
> 
> IMO yes

changed and applied

thx

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

Dictatorship: All citizens are under surveillance, all their steps and
actions recorded, for the politicians to enforce control.
Democracy: All politicians are under surveillance, all their steps and
actions recorded, for the citizens to enforce control.


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


Re: [FFmpeg-devel] [PATCH] avcodec/vp56: Check avctx->error_concealment before enabling EC

2017-03-19 Thread Michael Niedermayer
On Thu, Mar 16, 2017 at 11:49:04AM +0100, Michael Niedermayer wrote:
> Fixes timeout with 847/clusterfuzz-testcase-5291877358108672
> Fixes timeout with 850/clusterfuzz-testcase-5721296509861888
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/vp56.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

applied


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

The worst form of inequality is to try to make unequal things equal.
-- Aristotle


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


Re: [FFmpeg-devel] [PATCH] avformat/dashdec: add dash demuxer base version

2017-03-19 Thread Alexander Strasser
On 2017-03-19 11:01 +0100, wm4 wrote:
> On Sun, 19 Mar 2017 10:57:21 +0100
> Clément Bœsch  wrote:
> 
> > 
> > If you want to have DASH enabled by default, make sure to have a native
> > XML parser, or discuss the policy about detecting all the external
> > libraries within the configure.
> > 
> 
> That's ridiculous. So NIH is encouraged because of a crappy policy
> about using external libs? Please...

No need to exaggerate...

You even quoted the "or discuss policy" part of the sentence.


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


Re: [FFmpeg-devel] [PATCH] avcodec/vp56: Check avctx->error_concealment before enabling EC

2017-03-19 Thread Ronald S. Bultje
Hi,

On Sun, Mar 19, 2017 at 8:01 PM, Michael Niedermayer  wrote:

> On Thu, Mar 16, 2017 at 11:49:04AM +0100, Michael Niedermayer wrote:
> > Fixes timeout with 847/clusterfuzz-testcase-5291877358108672
> > Fixes timeout with 850/clusterfuzz-testcase-5721296509861888
> >
> > Found-by: continuous fuzzing process https://github.com/google/oss-
> fuzz/tree/master/targets/ffmpeg
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/vp56.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
>
> applied


Sorry about not responding earlier again - patch was OK. I'll try to be
better at explicitly approving patches that are good and that I feel I'm an
appropriate reviewer for...

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


Re: [FFmpeg-devel] [PATCH 1/2] avcodec/mjpegdec: Check quant_matrixes values for being non zero

2017-03-19 Thread Michael Niedermayer
On Fri, Mar 17, 2017 at 03:25:17AM +0100, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/mjpegdec.c | 4 
>  1 file changed, 4 insertions(+)

patchset applied

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

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle


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] avcodec/wavpack: Check shift

2017-03-19 Thread Michael Niedermayer
Fixes: runtime error: shift exponent 255 is too large for 32-bit type 'unsigned 
int'
Fixes: 894/clusterfuzz-testcase-4841537823309824

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavcodec/wavpack.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 3d0b01f257..5086ae442c 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -861,6 +861,12 @@ static int wavpack_decode_block(AVCodecContext *avctx, int 
block_no,
 s->and   = 1;
 s->shift = val[3];
 }
+if (s->shift > 31) {
+av_log(avctx, AV_LOG_ERROR,
+   "Invalid INT32INFO, shift = %d (> 32)\n", s->shift);
+s->and = s->or = s->shift = 0;
+continue;
+}
 /* original WavPack decoder forces 32-bit lossy sound to be treated
  * as 24-bit one in order to have proper clipping */
 if (s->hybrid && bpp == 4 && s->post_shift < 8 && s->shift > 8) {
-- 
2.11.0

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


[FFmpeg-devel] [PATCH 1/2] avcodec/mpegaudiodec_template: Fix 2 runtime error: signed integer overflow

2017-03-19 Thread Michael Niedermayer
Fixes: 873/clusterfuzz-testcase-5714546230558720

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavcodec/mpegaudiodec_template.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/mpegaudiodec_template.c 
b/libavcodec/mpegaudiodec_template.c
index a5ac5817f3..6e94cf75f3 100644
--- a/libavcodec/mpegaudiodec_template.c
+++ b/libavcodec/mpegaudiodec_template.c
@@ -1038,7 +1038,8 @@ static void compute_stereo(MPADecodeContext *s, 
GranuleDef *g0, GranuleDef *g1)
 {
 int i, j, k, l;
 int sf_max, sf, len, non_zero_found;
-INTFLOAT (*is_tab)[16], *tab0, *tab1, tmp0, tmp1, v1, v2;
+INTFLOAT (*is_tab)[16], *tab0, *tab1, v1, v2;
+SUINTFLOAT tmp0, tmp1;
 int non_zero_found_short[3];
 
 /* intensity stereo */
-- 
2.11.0

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


Re: [FFmpeg-devel] [PATCH 2/3] ffplay: convert to new decode API

2017-03-19 Thread wm4
On Sun, 19 Mar 2017 11:51:28 -0700
Philip Langdale  wrote:

> On Fri, 17 Mar 2017 19:42:07 -0700
> Philip Langdale  wrote:
> 
> > On Sat, 18 Mar 2017 01:51:39 +0100 (CET)
> > Marton Balint  wrote:
> >   
> > > On Sat, 18 Mar 2017, wal...@free.fr wrote:
> > > 
> > > > The logs:  http://pastebin.com/1duYR0Ui
> > > >  
> > > 
> > > Log with video only (run ffplay with -an -sn) might show it more
> > > clearly, but even from the logs above it looks like the CrystalHD
> > > codec is returning EAGAINs at the same time for both receive_frame
> > > and send_packet. If it indeed does work in ffmpeg, then I suspect a
> > > lot of busy waiting there. Philip, you mind taking a look? :)
> > 
> > My first reply got HTML-ised by my client. Weird.
> > 
> > Wallak,
> > 
> > Can I get a sample from you to ensure I can repro. Also: are you using
> > a 12 or a 15? I only have a 15 and have never tested the code with a
> > 12. Also, it would be great if you can test playback with mpv. As I
> > said, that's what I've used for testing.  
> 
> I did take a brief look, and I confirmed that mpv works fine but ffplay
> is hitting this deadlock between send and receive. My hardware is
> getting flaky, and my actually be dying, so it's hard for me to do any
> kind of systematic testing.
> 
> So right now my only useful advice is to look at how mpv is running the
> loop and see if there's a significant difference.

Currently, mpv pretty strictly does essentially:

while (1) [
  if (!packet)
packet = read_new_packet();
  if (send_packet(packet) == ok)
packet = NULL;
  receive_frame();
}

which I guess is a bit unusual for API usage.

The API should be able to deal with any of that, though.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


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

2017-03-19 Thread wm4
On Sun, 19 Mar 2017 02:30:11 +0100
Michael Niedermayer  wrote:

> On Sat, Mar 18, 2017 at 09:56:04AM +0100, wm4 wrote:
> > From: Anton Khirnov 
> > 
> > Certain hardware decoding APIs are not guaranteed to be thread-safe, so
> > having the user access decoded hardware surfaces while the decoder is
> > running in another thread can cause failures (this is mainly known to
> > happen with DXVA2).
> > 
> > For such hwaccels, only allow the decoding thread to run while the user
> > is inside a lavc decode call (avcodec_send_packet/receive_frame).
> > 
> > Merges Libav commit d4a91e65.
> > 
> > Signed-off-by: wm4 
> > ---
> >  libavcodec/avcodec.h   |  5 +
> >  libavcodec/hwaccel.h   | 24 +
> >  libavcodec/pthread_frame.c | 52 
> > --
> >  libavcodec/vaapi_h264.c|  2 ++
> >  libavcodec/vaapi_mpeg2.c   |  2 ++
> >  libavcodec/vaapi_mpeg4.c   |  3 +++
> >  libavcodec/vaapi_vc1.c |  3 +++
> >  libavcodec/vdpau_h264.c|  2 ++
> >  libavcodec/vdpau_hevc.c|  2 ++
> >  libavcodec/vdpau_mpeg12.c  |  3 +++
> >  libavcodec/vdpau_mpeg4.c   |  2 ++
> >  libavcodec/vdpau_vc1.c |  3 +++
> >  libavcodec/version.h   |  2 +-
> >  13 files changed, 98 insertions(+), 7 deletions(-)
> >  create mode 100644 libavcodec/hwaccel.h  
> 
> breaks:
> ./ffmpeg -i tickets//4583/ffvp9_corruption.webm -f null -
> https://trac.ffmpeg.org/raw-attachment/ticket/4583/ffvp9_corruption.webm
> 
> ...
> frame=  215 fps=0.0 q=-0.0 Lsize=N/A time=00:00:08.00 bitrate=N/A speed= 165x
> video:104kB audio:1500kB subtitle:0kB other streams:0kB global headers:0kB 
> muxing overhead: unknown
> pthread_mutex_unlock failed with error: Operation not permitted
> Aborted

Fixed with this patch: http://sprunge.us/dNcA

Thanks for the sample link.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] avcodec/wavpack: Check shift

2017-03-19 Thread Clément Bœsch
On Mon, Mar 20, 2017 at 02:21:50AM +0100, Michael Niedermayer wrote:
> Fixes: runtime error: shift exponent 255 is too large for 32-bit type 
> 'unsigned int'
> Fixes: 894/clusterfuzz-testcase-4841537823309824
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/wavpack.c | 6 ++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
> index 3d0b01f257..5086ae442c 100644
> --- a/libavcodec/wavpack.c
> +++ b/libavcodec/wavpack.c
> @@ -861,6 +861,12 @@ static int wavpack_decode_block(AVCodecContext *avctx, 
> int block_no,
>  s->and   = 1;
>  s->shift = val[3];
>  }
> +if (s->shift > 31) {
> +av_log(avctx, AV_LOG_ERROR,
> +   "Invalid INT32INFO, shift = %d (> 32)\n", s->shift);

32 or 31?

-- 
Clément B.


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